panda 1 year ago
parent
commit
3b7932ccf4
2 changed files with 3 additions and 5 deletions
  1. 0 2
      application/api/controller/Passport.php
  2. 3 3
      application/utils/PayUtil.php

+ 0 - 2
application/api/controller/Passport.php

@@ -116,7 +116,6 @@ class Passport extends Api
         $order_no = !empty($order_no) ? $order_no : time() . rand(1, 200);
         $order_no = !empty($order_no) ? $order_no : time() . rand(1, 200);
 
 
         $pay = new PayUtil();
         $pay = new PayUtil();
-        $pay->jsPay($openid, "D0{$order_no}", '0.01', '开通会员');
         if (!$pay->jsPay($openid, "D0{$order_no}", '0.01', '开通会员')){
         if (!$pay->jsPay($openid, "D0{$order_no}", '0.01', '开通会员')){
             $this->error($pay->getMessage());
             $this->error($pay->getMessage());
         }
         }
@@ -124,7 +123,6 @@ class Passport extends Api
         $res = $pay->getData();
         $res = $pay->getData();
         if (empty($res['data']['pay_info']) || !$pay_info = json_decode($res['data']['pay_info'],true)){
         if (empty($res['data']['pay_info']) || !$pay_info = json_decode($res['data']['pay_info'],true)){
             $this->error('支付信息有误');
             $this->error('支付信息有误');
-            return;
         }
         }
 
 
         $this->success('success', [
         $this->success('success', [

+ 3 - 3
application/utils/PayUtil.php

@@ -47,11 +47,11 @@ class PayUtil
         ];
         ];
 
 
         $res = CurlUtil::postJson($url, $data);
         $res = CurlUtil::postJson($url, $data);
-        if (empty($res['data']) || $res['data']['bank_code'] != 'SUCCESS') {
-            return $this->error($res['data']['bank_message'] ?? '下单失败', $res);
+        if (empty($res['data']['resp_code']) || $res['data']['resp_code'] != '00000100') {
+            return $this->error($res['data']['resp_desc'] ?? '下单失败', $res);
         }
         }
 
 
-        return $this->success($res['data']['bank_message'] ?? '下单成功!', $res);
+        return $this->success($res['data']['resp_desc'] ?? '下单成功!', $res);
     }
     }
 
 
     private function getSign($post_data)
     private function getSign($post_data)