* @version: v1.0
* ---------------------------------------------
*/
if (!defined('IN_ECS'))
{
die('Hacking attempt');
}
$payment_lang = ROOT_PATH . 'languages/' .$GLOBALS['_CFG']['lang']. '/payment/ips.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'] = 'ips_desc';
/* 是否支持货到付款 */
$modules[$i]['is_cod'] = '0';
/* 是否支持在线支付 */
$modules[$i]['is_online'] = '1';
/* 作者 */
$modules[$i]['author'] = 'ECSHOP TEAM';
/* 网址 */
$modules[$i]['website'] = 'http://www.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' => ''),
array('name' => 'ips_currency', 'type' => 'select', 'value' => '01'),
array('name' => 'ips_lang', 'type' => 'select', 'value' => 'GB')
);
return;
}
class ips
{
/**
* 构造函数
*
* @access public
* @param
*
* @return void
*/
function ips()
{
}
function __construct()
{
$this->ips();
}
/**
* 生成支付代码
* @param array $order 订单信息
* @param array $payment 支付方式信息
*/
function get_code($order, $payment)
{
$billstr = date('His', time());
$datestr = date('Ymd', time());
$mer_code = $payment['ips_account'];
$billno = str_pad($order['log_id'], 10, '0', STR_PAD_LEFT) . $billstr;
$amount = sprintf("%0.02f", $order['order_amount']);
$strcert = $payment['ips_key'];
$strcontent = $billno . $amount . $datestr . 'RMB' . $strcert; // 签名验证串 //
$signmd5 = MD5($strcontent);
$def_url = '