|
@@ -92,7 +92,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
if (empty($resp)) {
|
|
|
return [false, '网络错误', true];
|
|
|
} elseif ($resp['respCode'] == 00) {
|
|
|
- $notify_data = $this->notify_data_format($resp);
|
|
|
+ $notify_data = $this->notify_data_format($resp,true);
|
|
|
//可替换延迟回调
|
|
|
refill\util::push_notify('suning',$notify_data);
|
|
|
return [true, $resp['orderNo'], false];
|
|
@@ -113,7 +113,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
$params = $this->req_params($order_sn,$product_code,$quantity);
|
|
|
$params['bizType'] = '01';
|
|
|
$sign = $this->sign($params);
|
|
|
- $params['Sign'] = $sign;
|
|
|
+ $params['sign'] = $sign;
|
|
|
|
|
|
$resp = http_request(config::ORDER_URL, $params);
|
|
|
if (empty($resp)) {
|
|
@@ -126,7 +126,7 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
if (empty($resp)) {
|
|
|
return [false, '网络错误', true];
|
|
|
} elseif ($resp['respCode'] == 00) {
|
|
|
- $notify_data = $this->notify_data_format($resp);
|
|
|
+ $notify_data = $this->notify_data_format($resp,false);
|
|
|
//可替换延迟回调
|
|
|
refill\util::push_notify('suning',$notify_data);
|
|
|
return [true, $resp['orderNo'], false];
|
|
@@ -156,13 +156,21 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
$i++;
|
|
|
}
|
|
|
return hash_hmac("sha1", $body, config::APP_KEY);
|
|
|
-// return bin2hex(hash_hmac("sha1", $body, config::APP_KEY, true));
|
|
|
}
|
|
|
|
|
|
- private function notify_data_format($params): array
|
|
|
+ private function notify_data_format($params,$fdirect): array
|
|
|
{
|
|
|
$data['order_sn'] = $params['partnerOrderNo'];
|
|
|
- $data['cardList'] = $params['cardList'];
|
|
|
+ $data['orderNo'] = $params['orderNo'];
|
|
|
+
|
|
|
+ $card_list = $params['cardList'];
|
|
|
+ if(count($card_list) == 1) {
|
|
|
+ $data['card_info'] = $params['cardList'][0];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $data['card_info'] = [];
|
|
|
+ }
|
|
|
+ $data['isDirect'] = $fdirect;
|
|
|
|
|
|
return $data;
|
|
|
}
|