* @version: v2.1
* ---------------------------------------------
*/
if (!defined('IN_ECS'))
{
die('Hacking attempt');
}
$payment_lang = ROOT_PATH . 'languages/' .$GLOBALS['_CFG']['lang']. '/payment/xpay.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'] = 'xpay_desc';
/* 是否支持货到付款 */
$modules[$i]['is_cod'] = '0';
/* 是否支持在线支付 */
$modules[$i]['is_online'] = '1';
/* 作者 */
$modules[$i]['author'] = 'ECSHOP TEAM';
/* 网址 */
$modules[$i]['website'] = 'http://www.xpay.cn';
/* 版本号 */
$modules[$i]['version'] = '2.0.0';
/* 配置信息 */
$modules[$i]['config'] = array(
array('name' => 'xpay_tid', 'type' => 'text', 'value' => ''),
array('name' => 'xpay_key', 'type' => 'text', 'value' => ''),
);
return;
}
/**
* 类
*/
class xpay
{
/**
* 构造函数
*
* @access public
* @param
*
* @return void
*/
function xpay()
{
}
function __construct()
{
$this->xpay();
}
/**
* 生成支付代码
* @param array $order 订单信息
* @param array $payment 支付方式信息
*/
function get_code($order, $payment)
{
$data_order_id = $order['log_id'];
$data_amount = $order['order_amount'];
$data_return_url = return_url('xpay');;
$data_tid = $payment['xpay_tid'];
$data_key = md5("$payment[xpay_key]:$data_amount,$data_order_id,$data_tid,bank,,sell,,2.0");
$def_url = '