浏览代码

suhctm test query

ayHaru 4 年之前
父节点
当前提交
d4a38938c0
共有 2 个文件被更改,包括 23 次插入2 次删除
  1. 12 1
      helper/refill/suhctm/RefillOil.php
  2. 11 1
      test/TestRefill.php

+ 12 - 1
helper/refill/suhctm/RefillOil.php

@@ -91,7 +91,18 @@ class RefillOil extends refill\IRefillOil
             Log::record($resp,Log::DEBUG);
             $resp = json_decode($resp,true);
             if($resp['state'] == 0) {
-                return [true,$resp['data']];
+                $order_state = '';
+                if ($resp['status'] == 2) {
+                    $order_state = ORDER_STATE_SUCCESS;
+                } elseif ($resp['status'] == 3) {
+                    $order_state = ORDER_STATE_CANCEL;
+                } elseif ($resp['status'] == 0){
+                    $order_state = ORDER_STATE_SEND;
+                }
+                if (empty($order_state)) {
+                    return [false, $resp['data']];
+                }
+                return [true, $order_state];
             }
             else {
                 return [false,$resp['msg']];

+ 11 - 1
test/TestRefill.php

@@ -81,10 +81,20 @@ class TestRefill extends TestCase
             }
         }
     }
+    public function testSuhcQuery(){
+        $providers = new refill\suhctm\RefillOil([]);
+        $refill_info = ['order_sn' => 970663421442637221 , 'ch_trade_no' => 499 , 'card_no' => 	1000111200005252927	];
+        $resp = $providers->query($refill_info);
+    }
+
+    public function testYifaPhone()
+    {
+        $providers = new refill\yifa\RefillPhone([]);
+        $resp = $providers->add(1000111100021211884, 4, 100, ['order_sn' => $this->make_sn()]);
+    }
 
     public function testSaihuOil()
     {
-        global $config;
         $providers = new refill\saihu\RefillOil([]);
         $resp = $providers->add(1000111100021211884, 2, 100, ['order_sn' => $this->make_sn()]);
     }