标签:
公众号支付 --> H5调起支付API
1 function onBridgeReady(){
2 WeixinJSBridge.invoke(
3 ‘getBrandWCPayRequest‘, {
4 "appId" : "wx2421b1c4370ec43b", //公众号名称,由商户传入
5 "timeStamp":" 1395712654", //时间戳,自1970年以来的秒数
6 "nonceStr" : "e61463f8efa94090b1f366cccfbbb444", //随机串
7 "package" : "prepay_id=u802345jgfjsdfgsdg888",
8 "signType" : "MD5", //微信签名方式:
9 "paySign" : "70EA570631E4BB79628FBCA90534C63FF7FADD89" //微信签名
10 },
11 function(res){
12 if(res.err_msg == "get_brand_wcpay_request:ok" ) {} // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回 ok,但并不保证它绝对可靠。
13 }
14 );
15 }
16 if (typeof WeixinJSBridge == "undefined"){
17 if( document.addEventListener ){
18 document.addEventListener(‘WeixinJSBridgeReady‘, onBridgeReady, false);
19 }else if (document.attachEvent){
20 document.attachEvent(‘WeixinJSBridgeReady‘, onBridgeReady);
21 document.attachEvent(‘onWeixinJSBridgeReady‘, onBridgeReady);
22 }
23 }else{
24 onBridgeReady();
25 }
SHOPKEE 微信支付,订单状态显示未支付
微信支付支付成功后,返回到mobile/wx_native_callback.php
之前代码
1 define(‘IN_ECS‘, true);
2 require(dirname(__FILE__) . ‘/include/init.php‘);
3 require(ROOT_PATH . ‘include/lib_payment.php‘);
4 require_once(ROOT_PATH .‘include/modules/payment/wx_new_jspay.php‘);
5 $payment = new wx_new_qrcode();
6 $payment->respond();
7 exit;
修改后:
1 <?php
2 define(‘IN_ECTOUCH‘, true);
3 define(‘IN_ECS‘, true);
4
5 require(dirname(__FILE__) . ‘/include/init.php‘);
6
7 require(ROOT_PATH . ‘include/lib_payment.php‘);
8 require_once(ROOT_PATH .‘include/modules/payment/wx_new_jspay.php‘);
9 $payment = new wx_new_jspay();
10 $payment->respond();
11 exit;
还有mobile/include/modules/payment/wx_new_jspay.php
修复
1 // $root_url = str_replace(‘mobile/‘, ‘‘, $GLOBALS[‘ecs‘]->url());
2
3 $root_url=$GLOBALS[‘ecs‘]->url();
让他返回到mobile/wx_native_callback.php
标签:
原文地址:http://www.cnblogs.com/itwo/p/5066499.html