Browse Source

update return data 0000 to string

ayHaru 4 years ago
parent
commit
038db26a7b
1 changed files with 17 additions and 10 deletions
  1. 17 10
      test/TestRefill.php

+ 17 - 10
test/TestRefill.php

@@ -394,16 +394,23 @@ class TestRefill extends TestCase
     {
     {
         $providers = new refill\xunyin\RefillPhone([]);
         $providers = new refill\xunyin\RefillPhone([]);
 //        $resp = $providers->add(17703711950, 6, 30, ['order_sn' => $this->make_sn()]);
 //        $resp = $providers->add(17703711950, 6, 30, ['order_sn' => $this->make_sn()]);
-//        $resp = $providers->query(['order_sn' => '76831617176125893158']);
-        $params['ext'] = '';
-        $params['code'] = '8888';
-        $params['sign'] = '428ac223cf3a1f6f3d382aac754e8e17';
-        $params['statemes'] = '成功';
-        $params['id'] = '76831617176125893158';
-        $params['userid'] = '8417';
-        $params['operatorid'] = '1000000083421033115583773201';
-        $params['status'] = 'SUCCESS';
-        refill\RefillFactory::instance()->notify('xunyin',$params);
+        $resp = $providers->query(['order_sn' => '76831617176125893158']);
+        $xml = '<Order><cpid>8417</cpid><orderid>40591617173295524057</orderid><order_no>14784226</order_no><msg>充值中</msg><Code>0000</Code><Cards/></Order>';
+        $resp = $providers->xmlToArray($xml);
+        if ($resp['Code'] === '0000') {
+            return [true, $resp['order_no'], false];
+        } else {
+            return [false, $resp['msg'], false];
+        }
+//        $params['ext'] = '';
+//        $params['code'] = '8888';
+//        $params['sign'] = '428ac223cf3a1f6f3d382aac754e8e17';
+//        $params['statemes'] = '成功';
+//        $params['id'] = '76831617176125893158';
+//        $params['userid'] = '8417';
+//        $params['operatorid'] = '1000000083421033115583773201';
+//        $params['status'] = 'SUCCESS';
+//        refill\RefillFactory::instance()->notify('xunyin',$params);
     }
     }