Browse Source

modify retry times

stanley-king 4 years ago
parent
commit
9ddf35c697
2 changed files with 17 additions and 9 deletions
  1. 14 6
      helper/rbridge/wsd/Bridge.php
  2. 3 3
      helper/refill/policy/xyz/policy.php

+ 14 - 6
helper/rbridge/wsd/Bridge.php

@@ -6,7 +6,7 @@ require_once(BASE_HELPER_PATH . '/refill/RefillFactory.php');
 
 use rbridge\IBridge;
 use rbridge\wsd\config;
-use refill\RefillFactory;
+use refill;
 use refill_proxy;
 use Log;
 use member_info;
@@ -39,13 +39,21 @@ class Bridge implements IBridge
         $mchinfo = Model('merchant')->getMerchantInfo(['mchid' => $mchid]);
         $userid = intval($mchinfo['admin_id']);
 
-        $idcard = '';
-        $card_name = '';
+        $input = [ 'mchid' => $mchid,
+            'buyer_id' => $userid,
+            'amount' => $params['chargeCash'],
+            'card_no' => $params['chargeAcct'],
+            'mch_order' => $params['chargeId'],
+            'notify_url' => config::MCH_NOTIFY_URL];
 
-        [$code, $msg] = RefillFactory::instance()->add($mchid, $userid, $params['chargeCash'], $params['chargeAcct'], $params['chargeId'],
-            $idcard, $card_name,config::MCH_NOTIFY_URL,1,time(),0);
+        $code = refill\util::push_add($input);
+        if($code) {
+            $ret = $this->retbody($code, '提交成功', $params);
+        }
+        else {
+            $ret = $this->retbody($code, '提交失败', $params);
+        }
 
-        $ret = $this->retbody($code, $msg, $params);
         return json_encode($ret,JSON_UNESCAPED_UNICODE);
     }
 

+ 3 - 3
helper/refill/policy/xyz/policy.php

@@ -9,13 +9,13 @@ use StatesHelper;
 
 class policy extends ProviderManager implements IPolicy
 {
-    const normal_times = 15;
-    const normal_time_out = 900;
+    const normal_times = 3;
+    const normal_time_out = 600;
     const normal_req_secs = 60;
 
     const high_times = 3;
     const high_time_out = 60;
-    
+
     protected $mChannelControl;
     protected $mMchctl;
     public function __construct()