|
@@ -29,9 +29,13 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
{
|
|
|
$order_sn = $params['order_sn'];
|
|
|
$params = $this->req_params($card_no, $amount, $order_sn);
|
|
|
- if(empty($params['code'] || empty($params['product']))) {
|
|
|
- Log::record("Xiao Chuang provider code product empty err,code:{$params['code']},product:{$params['product']}", Log::DEBUG);
|
|
|
- return [false, 'code或产品编码有误', false];
|
|
|
+ if(empty($params['code'])) {
|
|
|
+ Log::record("Xiao Chuang provider code empty err,amount:{$amount}", Log::DEBUG);
|
|
|
+ return [false, 'code有误', false];
|
|
|
+ }
|
|
|
+ if(empty($params['product'])) {
|
|
|
+ Log::record("Xiao Chuang provider product empty err,amount:{$amount}", Log::DEBUG);
|
|
|
+ return [false, '产品编码有误', false];
|
|
|
}
|
|
|
$sign = $this->sign($params);
|
|
|
$params['sign'] = $sign;
|
|
@@ -49,7 +53,8 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
return [false, '网络错误', true];
|
|
|
}
|
|
|
$error = intval($resp['error']);
|
|
|
- if ($error === 0) {
|
|
|
+ $code = intval($resp['code']);
|
|
|
+ if ($error === 0 && $code === 0) {
|
|
|
return [true, $resp['p_order_sn'], false];
|
|
|
} else {
|
|
|
return [false, $resp['msg'], false];
|
|
@@ -80,8 +85,9 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
else
|
|
|
{
|
|
|
$error = intval($resp['error']);
|
|
|
- if($error === 0) {
|
|
|
- $status = $resp['status'];
|
|
|
+ $code = intval($resp['code']);
|
|
|
+ if ($error === 0 && $code === 0) {
|
|
|
+ $status = $resp['order_status'];
|
|
|
if ($status === 3) {
|
|
|
$order_state = ORDER_STATE_SUCCESS;
|
|
|
} elseif (in_array($status, [4,5])) {
|