Forráskód Böngészése

fix RefillFactory changeOrderStateCancel err and modify retry time limit

stanley-king 4 éve
szülő
commit
42b21d2ff3
2 módosított fájl, 9 hozzáadás és 2 törlés
  1. 7 0
      helper/refill/RefillFactory.php
  2. 2 2
      test/TestRefill.php

+ 7 - 0
helper/refill/RefillFactory.php

@@ -255,10 +255,17 @@ class RefillFactory
             if ($state !== ORDER_STATE_SEND) {
                 return false;
             }
+
             $times = intval($refill['commit_times']);
             if ($times > 5) {
                 return false;
             }
+
+            $period = time() - $refill['order_time'];
+            if($period >= 600) {
+                return false;
+            }
+
             return true;
         };
 

+ 2 - 2
test/TestRefill.php

@@ -68,8 +68,8 @@ class TestRefill extends TestCase
     public function testSuhxVerify()
     {
         $data = 'onlystr=920661883198026632&sign=533151e3f0dff5f507786aabc37b18f7&amt=100&notifyurl=https%3A%2F%2Fwww.xyzshops.cn%2Fmobile%2Frefill_suhc.php&jdno&cardtype=Sinoepc&batchid=26106&cardno=1000111100020654226&orgid=1590993600&status=3';
-        //$url = "https://www.xyzshops.cn/mobile/refill_suhc.php?" . $data;
-        $url = "http://192.168.1.220/mobile/refill_suhc.php?" . $data;
+        $url = "https://www.xyzshops.cn/mobile/refill_suhc.php?" . $data;
+//        $url = "http://192.168.1.220/mobile/refill_suhc.php?" . $data;
 
         $resp = http_request($url);
     }