爱数据专家
标题: 微信支付官方配置方法及修复支付功能BUG专用帖(不断增加中) [打印本页]
作者: admin 时间: 2017-1-2 16:10
标题: 微信支付官方配置方法及修复支付功能BUG专用帖(不断增加中)
1、BUG文件目录:weimicms\Lib\ORG\Weixinnewpay\WxPayPubHelper.class.php
使用文本编辑器,打开
- public function getParameters()
- {
- $jsApiObj["appId"] = $this->appid;
- $timeS**p = time();
- $jsApiObj["timeS**p"] = "$timeS**p";
- $jsApiObj["nonceStr"] = $this->createNoncestr();
- $jsApiObj["package"] = "prepay_id=".$this->prepay_id[prepay_id];
- $jsApiObj["signType"] = "MD5";
- $jsApiObj["paySign"] = $this->getSign($jsApiObj);
- $this->parameters = json_encode($jsApiObj);
- return $this->parameters;
- }
- }
复制代码$jsApiObj["package"] = "prepay_id=".$this->prepay_id[prepay_id];
蓝色的对应你的程序进行修改 这个是官方用变量名称和对象名不严谨造成的!完美修复!prepay_id是数组的变量名,也是键值名,this->prepay_id就返回了一个数组,得不到预支付ID所以会出错!提示为缺少key0参数
2、BUG文件目录:weimicms\Lib\ORG\Weixinnewpay\WxPayPubHelper.class.php
错误:点击支付按钮后,调用JSAPI没反应;提示:调用支付jsapi缺少参数 total_fee
分析:total_fee错误不正确,header重定向参数丢失,无法获取订单号和金额
解决:
找到以下代码
- {
- public $code;
- public $openid;
- public $parameters;
- public $prepay_id;
- public $curl_timeout;
- public function createOauthUrlForCode($redirectUrl)
- {
- $urlObj['appid'] = $this->appid;
- $urlObj["redirect_uri"] = $redirectUrl;
- $urlObj['response_type'] = 'code';
- $urlObj['scope'] = 'snsapi_base';
- $urlObj['state'] = 'STATE' . '#wechat_redirect';
- $bizString = $this->formatBizQueryParaMap($urlObj, false);
- return 'https://open.weixin.qq.com/connect/oauth2/authorize?' . $bizString;
- }
复制代码修改为
- {
- public $code;
- public $openid;
- public $parameters;
- public $prepay_id;
- public $curl_timeout;
- public function createOauthUrlForCode($redirectUrl)
- {
- $urlObj['appid'] = $this->appid;
- $urlObj["redirect_uri"] = urlencode($redirectUrl);
- $urlObj['response_type'] = 'code';
- $urlObj['scope'] = 'snsapi_base';
- $urlObj['state'] = 'STATE' . '#wechat_redirect';
- $bizString = $this->formatBizQueryParaMap($urlObj, false);
- return 'https://open.weixin.qq.com/connect/oauth2/authorize?' . $bizString;
- }
复制代码修改urlencode($redirectUrl);这部分
3、
欢迎光临 爱数据专家 (https://icnzz.cn/) |
Powered by Discuz! X3.2 |