* @version: v1.0
* ---------------------------------------------
*/
if (!defined('IN_ECS'))
{
die('Hacking attempt');
}
$payment_lang = ROOT_PATH . 'languages/' .$GLOBALS['_CFG']['lang']. '/payment/express.php';
if (file_exists($payment_lang))
{
global $_LANG;
include_once($payment_lang);
}
/* 模块的基本信息 */
if (isset($set_modules) && $set_modules == TRUE)
{
$i = isset($modules) ? count($modules) : 0;
/* 代码 */
$modules[$i]['code'] = basename(__FILE__, '.php');
/* 描述对应的语言项 */
$modules[$i]['desc'] = 'express_desc';
/* 是否支持货到付款 */
$modules[$i]['is_cod'] = '0';
/* 是否支持在线支付 */
$modules[$i]['is_online'] = '1';
/* 作者 */
$modules[$i]['author'] = 'ECSHOP TEAM';
/* 网址 */
$modules[$i]['website'] = 'http://express.ips.com.cn/';
/* 版本号 */
$modules[$i]['version'] = '1.0.0';
/* 配置信息 */
$modules[$i]['config'] = array(
array('name' => 'ips_account', 'type' => 'text', 'value' => ''),
array('name' => 'ips_key', 'type' => 'text', 'value' => '')
);
return;
}
class express
{
/**
* 构造函数
*
* @access public
* @param
*
* @return void
*/
function express()
{
}
function __construct()
{
$this->express();
}
/**
* 生成支付代码
* @param array $order 订单信息
* @param array $payment 支付方式信息
*/
function get_code($order, $payment)
{
$mer_code = $payment['ips_account'];
$billno = $order['log_id'];
$amount = sprintf("%0.02f", $order['order_amount']);
$strcert = $payment['ips_key'];
$remark = '';
$signmd5 = MD5($mer_code . $billno . $amount . $remark . $strcert);
$def_url = '