|
@@ -16,13 +16,13 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
private function req_params(int $phone, int $amount, $card_type, string $order_sn): array
|
|
|
{
|
|
|
- $params['batch_no'] = $order_sn;
|
|
|
- $params['agent_id'] = config::USER_ID;
|
|
|
$productid = config::ProductIdS[$card_type][$amount] ?? false;
|
|
|
if ($productid === false){
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
+ $params['batch_no'] = $order_sn;
|
|
|
+ $params['agent_id'] = config::USER_ID;
|
|
|
$params['productNo'] = $productid;
|
|
|
$params['account'] = $phone;
|
|
|
$params['notify_url'] = config::NOTIFY_URL;
|
|
@@ -41,7 +41,6 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
$sign = $this->sign($params);
|
|
|
$params['sign'] = $sign;
|
|
|
-
|
|
|
$resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
|
|
|
|
|
|
if (empty($resp)) {
|
|
@@ -78,8 +77,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
{
|
|
|
Log::record($resp, Log::DEBUG);
|
|
|
$resp = json_decode($resp, true);
|
|
|
- if (empty($resp))
|
|
|
- {
|
|
|
+ if (empty($resp)) {
|
|
|
return [false, '系统错误'];
|
|
|
}
|
|
|
elseif ($resp['code'] === 200 && !empty($resp['result']))
|
|
@@ -99,8 +97,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
return [true, $order_state];
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ else {
|
|
|
return [false, $resp['message']];
|
|
|
}
|
|
|
}
|