Browse Source

yingdian add api update

xiaoyu 3 years atrás
parent
commit
883bc1852b
1 changed files with 10 additions and 6 deletions
  1. 10 6
      helper/refill/api/xyz/yingdian/RefillOil.php

+ 10 - 6
helper/refill/api/xyz/yingdian/RefillOil.php

@@ -50,24 +50,28 @@ class RefillOil extends refill\IRefillOil
             elseif ($resp['code'] === 0 )
             {
                 $status = $resp['data']['status'];
-                if($status === 'SUBMIT' || $status === 'CREATED' || $status === 'SUCCESS') {
+                if($status === 'SUBMIT' || $status === 'CREATED' || $status === 'SUCCESS' || $status === 'CB_WAITING') {
                     refill\util::inc_card($card_no,$card_info);
                     return [true, $resp['data']['id'], false];
                 }
-                elseif() {
+                elseif($status === 'SUBMIT_FAIL' || $status === 'FAIL') {
+                    return [false, $status, false];
                 }
                 else {
-
+                    //未知status,需人工确认。
+                    $net_errno = "HTTP-997";
+                    return [false, $status, false];
                 }
             }
-            elseif ($resp['code'] == -1){
+            elseif ($resp['code'] === -1){
                 //未知错误,需人工确认。
                 $net_errno = "HTTP-999";
                 return [false, $resp['msg'], false];
             }
             else {
-                $msg = "{$resp['msg']}-{$resp['data']['status']}";
-                return [false, $msg, false];
+                //未知code,需人工确认。
+                $net_errno = "HTTP-998";
+                return [false, $resp['code'], false];
             }
         }
     }