Browse Source

开启充值金额验证

15954078560 2 years ago
parent
commit
af4bd79571
2 changed files with 8 additions and 8 deletions
  1. 6 6
      application/api/controller/Notify.php
  2. 2 2
      application/api/controller/User.php

+ 6 - 6
application/api/controller/Notify.php

@@ -33,12 +33,12 @@ class Notify extends Api
                 $PayResult = Db::name('rechar_order');
                 $where['order_no'] = $order_sn;
                 $order_info = $PayResult->where($where)->find();
-//                if ($order_info['money'] != $total_fee) {
-//                    $r_arr['return_code'] = 'FAIL';
-//                    $r_arr['return_msg'] = '回调失败';
-//                    echo $wxPay->arrayToXml($r_arr);
-//                    die;
-//                }
+                if ($order_info['money'] != $total_fee) {
+                    $r_arr['return_code'] = 'FAIL';
+                    $r_arr['return_msg'] = '回调失败';
+                    echo $wxPay->arrayToXml($r_arr);
+                    die;
+                }
                 if ($order_info['status'] == 1) {
                     $r_arr['return_code'] = 'SUCCESS';
                     $r_arr['return_msg'] = '回调成功';

+ 2 - 2
application/api/controller/User.php

@@ -1594,8 +1594,8 @@ class User extends Api
         //构建支付链接数据
         $wxData['body'] = '充值';
         $wxData['out_trade_no'] = $rechar_order['order_no'];
-//        $wxData['total_fee'] = $info['price'];
-        $wxData['total_fee'] = 0.01;
+        $wxData['total_fee'] = $info['price'];
+//        $wxData['total_fee'] = 0.01;
         $wxData['openid'] = $this->auth->openid;
 
 //            require_once($_SERVER['DOCUMENT_ROOT'] . '/Plugins/Weixin/WxPay/WxPay.php');