|
@@ -19,7 +19,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
$params['appId'] = config::APP_ID;
|
|
|
$params['version'] = '1.0';
|
|
|
$params['merchantOrderNo'] = $order_sn;
|
|
|
- $params['productId'] = config::ProductIdS[$card_type][$amount];
|
|
|
+ $params['productId'] = 1;
|
|
|
$params['account'] = "{$phone}";
|
|
|
$params['amt'] = $amount * 100;
|
|
|
$params['callbackUrl'] = config::NOTIFY_URL;
|
|
@@ -30,18 +30,19 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
return $params;
|
|
|
}
|
|
|
|
|
|
- public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
|
+ public function add($card_no, $card_type, $amount, $params, &$net_errno = 0)
|
|
|
{
|
|
|
$regin_no = $params['regin_no'] ?? -1;
|
|
|
- if($regin_no <= 0) {
|
|
|
+ if ($regin_no <= 0) {
|
|
|
return [false, '省份获取错误', false];
|
|
|
}
|
|
|
+
|
|
|
$params = $this->req_params($card_no, $amount, $card_type, $params['order_sn'], $regin_no);
|
|
|
$sign = config::sign($params);
|
|
|
$params['sign'] = $sign;
|
|
|
|
|
|
$params = json_encode($params);
|
|
|
- $resp = http_post_data(config::ORDER_URL, $params , config::ExtHeaders, $net_errno);
|
|
|
+ $resp = http_post_data(config::ORDER_URL, $params, config::ExtHeaders, $net_errno);
|
|
|
|
|
|
if (empty($resp)) {
|
|
|
return [false, '系统错误', true];
|
|
@@ -92,6 +93,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
} else {
|
|
|
return [false, $status];
|
|
|
}
|
|
|
+
|
|
|
return [true, $order_state];
|
|
|
}
|
|
|
else {
|
|
@@ -111,15 +113,13 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
if (empty($resp)) {
|
|
|
return [false, '系统错误'];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
+ } else {
|
|
|
Log::record($resp, Log::DEBUG);
|
|
|
$resp = json_decode($resp, true);
|
|
|
if (empty($resp)) {
|
|
|
return [false, '系统错误'];
|
|
|
} elseif ($resp['code'] === 1000) {
|
|
|
- return [true, $resp['data']['balance']*100];
|
|
|
+ return [true, $resp['data']['balance'] * 100];
|
|
|
} else {
|
|
|
return [false, $resp['msg']];
|
|
|
}
|