|
@@ -57,44 +57,8 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
|
{
|
|
|
- $order_sn = $params['order_sn'];
|
|
|
- $regin_no = $params['regin_no'] ?? -1;
|
|
|
-
|
|
|
- if($regin_no <= 0) {
|
|
|
- return [false, '省份获取错误', false];
|
|
|
- }
|
|
|
-
|
|
|
- $params = $this->req_params($card_no, $amount, $card_type, $order_sn);
|
|
|
- $params['provId'] = config::ProvinceMap[$regin_no];
|
|
|
- if(empty($params['provId'])) {
|
|
|
- return [false, '省份获取错误', false];
|
|
|
- }
|
|
|
-
|
|
|
- $resp = $this->url_request($params,'order.phone.charge');
|
|
|
- if (empty($resp)) {
|
|
|
- return [false, '系统错误', true];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- Log::record($resp, Log::DEBUG);
|
|
|
-
|
|
|
- $resp = json_decode($resp ,true);
|
|
|
- $code = $resp['code'];
|
|
|
- if (empty($resp)) {
|
|
|
- return [false, '系统错误', true];
|
|
|
- } elseif ($code == 'SUCCESS') {
|
|
|
- return [true, $resp['id'], false];
|
|
|
- } elseif (in_array($code, config::ORDER_ERR_CODE)) {
|
|
|
- return [false, $code, false];
|
|
|
- } elseif (in_array($code, ['SYSTEM_ERROR', 'ORDER_ID_EXIST'])) {
|
|
|
- $net_errno = "HTTP-{$code}";
|
|
|
- return [false, $code, false];
|
|
|
- } else {
|
|
|
- $err = 998;
|
|
|
- $net_errno = "HTTP-{$err}";
|
|
|
- return [false, $code, false];
|
|
|
- }
|
|
|
- }
|
|
|
+ sleep(3);
|
|
|
+ return [true , '',false];
|
|
|
}
|
|
|
|
|
|
public function query($refill_info)
|