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

Merge branch 'rtest' of 39.97.239.116:gyfl/xyzshop into rtest

stanley-king 3 éve
szülő
commit
4707dc38cf
2 módosított fájl, 21 hozzáadás és 8 törlés
  1. 14 1
      helper/refill/api/xyz/menggu/RefillOil.php
  2. 7 7
      test/TestRefill.php

+ 14 - 1
helper/refill/api/xyz/menggu/RefillOil.php

@@ -83,7 +83,10 @@ class RefillOil extends refill\IRefillOil
                 $status = intval($resp['orderStatus']);
 
                 if ($status === 2) {
-                    $updata['official_sn'] = $resp['ext1'];
+                    Log::record("mengu query sms:{$resp['ext1']}",Log::DEBUG);
+                    Model('')->table('refill_ext')->insert(['order_id' => $refill_info['order_id'], 'sms' => $resp['ext1']]);
+                    $official_sn = $this->substr_content($resp['ext1']);
+                    $updata['official_sn'] = $official_sn;
                     Model('refill_order')->edit($refill_info['order_id'], $updata);
                     $order_state = ORDER_STATE_SUCCESS;
                 } elseif ($status === 3) {
@@ -150,4 +153,14 @@ class RefillOil extends refill\IRefillOil
         $content = rtrim($content, '&');
         return md5($content);
     }
+
+    private function substr_content($content)
+    {
+        $data = explode(':',$content);
+        if(count($data) > 1) {
+            return $data[1];
+        } else {
+            return '';
+        }
+    }
 }

+ 7 - 7
test/TestRefill.php

@@ -1043,15 +1043,15 @@ class TestRefill extends TestCase
 
     public function testMenggu()
     {
-//        $providers = $this->getProvider('menggu','RefillOil');
+        $providers = $this->getProvider('menggu','RefillOil');
 //        $resp = $providers->add(1000111100021211884, 2, 500, ['order_sn' => $this->make_sn()]);
-//        $resp = $providers->query(['order_sn' => '63021632301956855605']);
+        $resp = $providers->query(['order_sn' => '63021632301956855605']);
 
-        $body = '{"orderId":"210922171242123506","appId":"1hqLCRUja7","outOrderId":"63021632301956855605","sign":"f3f0b48657bb4e3b993aa284159c6565","orderStatus":"2","completeTime":"20210922171306","orderDesc":"\u8ba2\u5355\u6210\u529f","ext1":"\u3010\u4e2d\u56fd\u77f3\u5316\u3011\u60a8\u5c3e\u53f7\u4e3a211884\u7684\u52a0\u6cb9\u5361\u4e8e09\u670822\u65e5 17\u65f612\u5206\u5145\u503c\u6210\u529f,\u91d1\u989d500\u5143,\u8ba2\u5355\u53f7:2521092217126714"}';
-        $params = json_decode($body, true);
-        $providers = $this->getProvider('menggu','RefillCallBack');
-        $ret = $providers->verify($params);
-        $resp = $providers->notify($params);
+//        $body = '{"orderId":"210922171242123506","appId":"1hqLCRUja7","outOrderId":"63021632301956855605","sign":"f3f0b48657bb4e3b993aa284159c6565","orderStatus":"2","completeTime":"20210922171306","orderDesc":"\u8ba2\u5355\u6210\u529f","ext1":"\u3010\u4e2d\u56fd\u77f3\u5316\u3011\u60a8\u5c3e\u53f7\u4e3a211884\u7684\u52a0\u6cb9\u5361\u4e8e09\u670822\u65e5 17\u65f612\u5206\u5145\u503c\u6210\u529f,\u91d1\u989d500\u5143,\u8ba2\u5355\u53f7:2521092217126714"}';
+//        $params = json_decode($body, true);
+//        $providers = $this->getProvider('menggu','RefillCallBack');
+//        $ret = $providers->verify($params);
+//        $resp = $providers->notify($params);
     }
 
     public function testMenggu_hf()