xiaoyu пре 3 година
родитељ
комит
37c0e2405d

+ 7 - 9
helper/refill/api/xyz/duojing/RefillCallBack.php

@@ -48,22 +48,20 @@ class RefillCallBack implements refill\IRefillCallBack
 
     public function notify($params)
     {
-        $status = $params['status'];
         $order_sn = $params['orderId'];
         $order_info = Model('vr_order')->getOrderInfo(['order_sn' => $order_sn]);
         if (empty($order_info)) {
             return [false, false, false,false];
         }
-        $order_id = $order_info['order_id'];
 
+        $order_id = $order_info['order_id'];
+        $status = $params['status'];
         if ($status === 'SUCCESS') {
-            return [$order_id, true, false,true];
-        }
-        elseif ($status === 'FAIL') {
-            return [$order_id, false, true,true];
-        }
-        else {
-            return [$order_id, false, false,false];
+            return [$order_id, true, false, true];
+        } elseif ($status === 'FAIL') {
+            return [$order_id, false, true, true];
+        } else {
+            return [$order_id, false, false, false];
         }
     }
 }

+ 1 - 1
helper/refill/api/xyz/duojing/RefillPhone.php

@@ -86,7 +86,7 @@ class RefillPhone extends refill\IRefillPhone
                 }
                 return [true, $order_state];
             }
-            elseif($resp['code'] === '11009') {
+            elseif($resp['return_code'] === 11009 && (time() - $refill_info['commit_time'] > 600)) {
                 return [true, ORDER_STATE_NOEXIST];
             }
             else {

+ 5 - 4
helper/refill/api/xyz/duojing/config.php

@@ -3,12 +3,13 @@ namespace refill\duojing;
 
 class config
 {
-    const ORDER_URL = 'http://81.69.6.74:9099/v1/mobile/express';
-    const QUERY_URL= 'http://81.69.6.74:9099/v1/mobile/query';
-    const BALANCE_URL= 'http://81.69.6.74:9099/v1/account/query';
+    const ORDER_URL = 'https://api.36duojing.com/v1/mobile/order';
+    const QUERY_URL= 'https://api.36duojing.com/v1/mobile/query';
+    const BALANCE_URL= 'https://api.36duojing.com/v1/account/query';
 
     const appKey= '30000419';
     const KEY = 'YpSWT1qwMnKTWAD0pLhF_Ev9BBUs2INV';
-    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_duojing.php";
+//    const NOTIFY_URL = BASE_SITE_URL . "/mobile/callback/refill_duojing.php";
+    const NOTIFY_URL = "https://www.xyzshops.cn/mobile/signature.php";
     const ExtHeaders = ['Content-Type: application/x-www-form-urlencoded'];
 }

BIN
helper/refill/api/xyz/duojing/话费快充接口文档.pdf


BIN
helper/refill/api/xyz/duojing/话费特快充接口文档.pdf


+ 8 - 8
test/TestRefill.php

@@ -1059,16 +1059,16 @@ class TestRefill extends TestCase
 
     public function testDuojing()
     {
-//        $provider = $this->getProvider('duojing');
+        $provider = $this->getProvider('duojing');
 //        $resp = $provider->balance();
-//        $resp = $provider->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
-//        $resp = $provider->query(['order_sn' => '24731632377651122245']);
+        $resp = $provider->add(18500608333, 5, 50, ['order_sn' => $this->make_sn()]);
+//        $resp = $provider->query(['order_sn' => '80511642657640305990']);
 
-        $body = '{"appKey":"30000419","number":"56521092314142544365","orderId":"24731632377651122245","mobile":"18500608333","reason":"","amount":"50.00","actualAmount":"49.85","createdAt":"2021-09-23 14:14:25","status":"SUCCESS","sign":"8D7A526CF3F6C1279BD1819028B7683A"}';
-        $params = json_decode($body, true);
-        $provider = $this->getProvider('duojing','RefillCallBack');
-        $ret = $provider->verify($params);
-        $resp = $provider->notify($params);
+//        $body = '{"appKey":"30000419","number":"56521092314142544365","orderId":"24731632377651122245","mobile":"18500608333","reason":"","amount":"50.00","actualAmount":"49.85","createdAt":"2021-09-23 14:14:25","status":"SUCCESS","sign":"8D7A526CF3F6C1279BD1819028B7683A"}';
+//        $params = json_decode($body, true);
+//        $provider = $this->getProvider('duojing','RefillCallBack');
+//        $ret = $provider->verify($params);
+//        $resp = $provider->notify($params);
     }
 
     public function testMenggu()