欢迎访问 夜阑小雨 我的学习碎片档案,这里记录了我的学习内容和工作中经验,希望给您带去帮助。

ecshop如何添加网银支付方式

Ecshop 夜阑小雨 1245℃ 0评论

ecshop后台支付方式默认没有西联/westernunion ,既然缺少这个支付方式感觉有点说不过去。西联方式,其实说白了。就是在支付的时候。显示我们卖家的收款信息。好了。以下是我实现的代码
1:在 languages/payment/目录下新增一个文件:westernunion.php,代码如下:

<?php /*    注释省略 */ global $_LANG; $_LANG[‘westernunion’]            = ‘WesternUnion’; $_LANG[‘westernunion_desc’]       = ‘Our account is <font color=”red”><strong>名字, 姓, 省, 国家. The first name is 名字,the last name is 姓.</strong></font>’; $_LANG[‘pay_button’]     = ‘Payment Success’; ?>

2:在 includes/modules/payment 目录下新增一个文件:westernunion.php, 代码如下:
<?php /**      西联汇款模块 */ if (!defined(‘IN_ECS’)) {     die(‘Hacking attempt’); } $payment_lang = ROOT_PATH . ‘languages/’ .$GLOBALS[‘_CFG’][‘lang’]. ‘/payment/westernunion.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’]    = ‘westernunion_desc’;     /* 是否支持货到付款 */     $modules[$i][‘is_cod’]  = ‘0’;     /* 是否支持在线支付 */     $modules[$i][‘is_online’]  = ‘1’;     /* 作者 */     $modules[$i][‘author’]  = ‘CCB’;     /* 网址 */     $modules[$i][‘website’] = ”;     /* 版本号 */     $modules[$i][‘version’] = ‘1.0.1’;     return; } class westernunion {    /**     * 构造函数     *     * @access  public     * @param     *     * @return void     */     function westernunion()     {     }     function __construct()     {         $this->westernunion();     }     /**     * 生成支付代码     * @param   array   $order  订单信息     * @param   array   $payment    支付方式信息     */     function get_code($order, $payment)     { // 此处只是用于显示用户付款成功的提示信息。我并没有做成按钮的形式,可自行修改         $def_url = ‘<br />’. $GLOBALS[‘_LANG’][‘pay_button’] ;         return $def_url;     } } ?>

转载请注明:夜阑小雨 » ecshop如何添加网银支付方式

喜欢 (0)or分享 (0)
发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址