ShopWT官网-php多用户商城系统-在路上

标题: 通信出错:invalid total_fee和虚拟商品,无法使用微信支付的解决办法 [打印本页]

作者: 2335867854    时间: 2015-7-15 18:15
标题: 通信出错:invalid total_fee和虚拟商品,无法使用微信支付的解决办法
通信出错:invalid total_fee,其实就是你的支付金额不符合微信支付的规定,看了一下支付链接/shop/index.php?act=weixinpay&op=index&body=%E9%A2%84%E5%AD%98%E6%AC%BE%E5%85%85%E5%80%BC&out_trade_no=240490295253338002&total_fee=0&attach=vr_order

total_fee的get值始终为0.......然后就去看代码去了,应该是get过去的值错了
看了看插件里面shop\api\payment\wxpay\wxpay.php 50行左右
$total_fee = ($this->order['order_list']['0']['order_amount'])*100;

然后去打印了一下虚拟商品的shop\control\payment.php 大约82行
var_dump($result);发现这个数组不对,上面$this->order['order_list']['0']['order_amount'] 根本调用不到
只需要在shop\control\payment.php 大约82行$this->_api_pay($result['data'], $payment_info); 之前加上
        $result['data']['order_list']['0']=$result['data']; 这段代码就可以解决啦 ..................解决的有些不好,这个方法比较简单,感觉实体订单的这个数组和虚拟订单的这个数组,结果一样应该好一些,虚拟订单里面掉了一个order['order_list']['0'].


作者: 陈来意    时间: 2015-8-12 16:40
我照这个方法试了,没有解决。




欢迎光临 ShopWT官网-php多用户商城系统-在路上 (https://bbs.shopwt.com/) Powered by Discuz! X3.4