日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ECSHOP 大商创 对接易支付接口

發(fā)布時(shí)間:2023/12/10 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ECSHOP 大商创 对接易支付接口 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

ECSHOP 大商創(chuàng) 對接易支付接口
1.languages/zh_cn/payment 新建ezhifu.php

<?php global $_LANG; $_LANG['ezhifu'] = '易支付'; $_LANG['ezhifu_desc'] = '易支付接口模塊'; $_LANG['ezhifu_APPID'] = 'APPID'; $_LANG['ezhifu_APPKEY'] = 'APPKEY'; $_LANG['pay_button'] = '立即支付'; $_LANG['ezhifu_pay_method'] = '選擇接口類型'; $_LANG['ezhifu_pay_method_desc'] = '控制支付接口類型'; $_LANG['ezhifu_pay_method_range'][0] = '微信+支付寶'; $_LANG['ezhifu_pay_method_range'][1] = '僅微信'; $_LANG['ezhifu_pay_method_range'][2] = '僅支付寶'; ?>

2.includes/modules/payment 新建ezhifu.php

<?phpif (!defined('IN_ECS')) {exit('Hacking attempt'); }$payment_lang = ROOT_PATH . 'languages/' .$GLOBALS['_CFG']['lang']. '/payment/ezhifu.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'] = 'ezhifu_desc';$modules[$i]['is_cod'] = '0';$modules[$i]['is_online'] = '1';$modules[$i]['author'] = '易支付';$modules[$i]['website'] = '';$modules[$i]['version'] = '1.0.0';$modules[$i]['config'] = array(array('name' => 'ezhifu_APPID', 'type' => 'text', 'value' => ''),array('name' => 'ezhifu_APPKEY', 'type' => 'text', 'value' => ''),array('name' => 'ezhifu_pay_method', 'type' => 'select', 'value' => ''));return; } class ezhifu {function __construct(){}function get_code($order, $payment){}function respond(){} } ?>

3.app/Plugins/payment 新建eyizhifu.php

<?php class ezhifu {function __construct(){$this->ezhifu();}function ezhifu(){}function get_code($order, $payment){if (!defined('EC_CHARSET')){$charset = 'utf-8';}else{$charset = EC_CHARSET;}include_once BASE_PATH . 'Helpers/payment_helper.php';$returnurl = return_url(basename(__FILE__, '.php'));$notifyurl = notify_url(basename(__FILE__, '.php'));$returnurl = urlencode($returnurl);$notifyurl = urlencode($notifyurl);$url = "?appid={$payment['ezhifu_APPID']}&money={$order['order_amount']}&subject={$order['order_sn']}&logid={$order['log_id']}&returnurl=".$returnurl."&notifyurl=".$notifyurl;$real_method = $payment['ezhifu_pay_method'];if(empty($real_method))$real_method = 0;$html = "";$gopayweb = "http://****自行替換提交頁面地址*****/epayapi.php";switch ($real_method){case '0':$html = '<a class="btn-reset box-flex" href="'.$gopayweb.$url.'&type=1" target="_blank">微信支付</a><a class="btn-reset box-flex" href="'.$gopayweb.$url.'&type=2" target="_blank">支付寶</a>';break;case '1':$html = '<a class="btn-reset box-flex" href="'.$gopayweb.$url.'&type=1" target="_blank">微信支付</a>';break;case '2':$html = '<a class="btn-reset box-flex" href="'.$gopayweb.$url.'&type=2" target="_blank">支付寶付款</a>';break;}return $html;}function respond(){$this->write_log(json_encode($_GET),"paynotify_respond");unset($_GET['code']);include_once BASE_PATH . 'Helpers/payment_helper.php';$payment = get_payment(basename(__FILE__, '.php'));$sign = $_GET['sign'];unset($_GET['sign']);unset($_GET['sign_type']);ksort($_GET);if(md5(http_build_query($_GET).$payment['ezhifu_APPKEY'])!=$sign){return false;}$out_trade_no = $_GET['out_trade_no'];$trade_no = $_GET['trade_no'];$trade_status = $_GET['trade_status'];if ($_GET['trade_status'] == 'TRADE_SUCCESS') {if(stristr($out_trade_no,"_")!==false){$logid = explode("_",$out_trade_no);$logid = $logid[0];echo $logid;order_paid($logid);return true;}else{return false;}}else{return false;}}function callback(){unset($_GET['code']);include_once BASE_PATH . 'Helpers/payment_helper.php';$payment = get_payment(basename(__FILE__, '.php'));$sign = $_GET['sign'];unset($_GET['sign']);unset($_GET['sign_type']);ksort($_GET);if(md5(http_build_query($_GET).$payment['ezhifu_APPKEY'])!=$sign){return false;}$out_trade_no = $_GET['out_trade_no'];$trade_no = $_GET['trade_no'];$trade_status = $_GET['trade_status'];if ($_GET['trade_status'] == 'TRADE_SUCCESS') {if(stristr($out_trade_no,"_")!==false){$logid = explode("_",$out_trade_no);$logid = $logid[0];order_paid($logid);return true;}else{return false;}}else{return false;}}function notify($data){include_once BASE_PATH . 'Helpers/payment_helper.php';$payment = get_payment(basename(__FILE__, '.php'));unset($_GET['code']);$sign = $_GET['sign'];unset($_GET['sign']);unset($_GET['sign_type']);ksort($_GET);if(md5(http_build_query($_GET).$payment['ezhifu_APPKEY'])!=$sign){return false;}$out_trade_no = $_GET['out_trade_no'];$trade_no = $_GET['trade_no'];$trade_status = $_GET['trade_status'];if ($_GET['trade_status'] == 'TRADE_SUCCESS') {if(stristr($out_trade_no,"_")!==false){$logid = explode("_",$out_trade_no);$logid = $logid[0];order_paid($logid);return true;}else{return false;}}else{return false;}}} ?>

4 回調(diào)地址和返回地址分別是
mobile/public/notify/ezhifu.php
mobile/respond.php?code=ezhifu
回調(diào)地址文件mobile/public/notify/ezhifu.php內(nèi)容

<?php define('BIND_MODULE', 'Respond'); define('BIND_CONTROLLER', 'Index'); define('BIND_ACTION', 'notify'); $_GET['code'] = basename(__FILE__, '.php'); require __DIR__ . '/../../index.php';

總結(jié)

以上是生活随笔為你收集整理的ECSHOP 大商创 对接易支付接口的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。