|
@@ -57,36 +57,37 @@ class RefillPhone extends refill\IRefillPhone
|
|
|
|
|
|
public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
public function add($card_no, $card_type, $amount, $params,&$net_errno = 0)
|
|
{
|
|
{
|
|
- $params = $this->req_params($card_no, $params['order_sn']);
|
|
|
|
- $goods_id = intval($params['goods_id']);
|
|
|
|
- $channel_code = $this->getProductCode($goods_id, $params['product_code']);
|
|
|
|
- if(empty($channel_code)) {
|
|
|
|
- return [false, '产品有误', false];
|
|
|
|
- }
|
|
|
|
- $params['ProductNumber'] = $channel_code;
|
|
|
|
- $sign = $this->sign($params);
|
|
|
|
- $params['Sign'] = $sign;
|
|
|
|
-
|
|
|
|
- $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
|
|
|
|
-
|
|
|
|
- if (empty($resp)) {
|
|
|
|
- return [false, '系统错误', true];
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- {
|
|
|
|
- Log::record($resp, Log::DEBUG);
|
|
|
|
- $resp = json_decode($resp, true);
|
|
|
|
- if (empty($resp)) {
|
|
|
|
- return [false, '系统错误', true];
|
|
|
|
- } elseif ($resp['Code'] === 0) {
|
|
|
|
- return [true, $resp['OutOrderID'], false];
|
|
|
|
- } elseif ($resp['Code'] === -170 || $resp['Code'] === -180){
|
|
|
|
- $net_errno = "HTTP-{$resp['Code']}";
|
|
|
|
- return [false, $net_errno, true];
|
|
|
|
- } else {
|
|
|
|
- return [false, $resp['Msg'], false];
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ return [true, '', false];
|
|
|
|
+// $params = $this->req_params($card_no, $params['order_sn']);
|
|
|
|
+// $goods_id = intval($params['goods_id']);
|
|
|
|
+// $channel_code = $this->getProductCode($goods_id, $params['product_code']);
|
|
|
|
+// if(empty($channel_code)) {
|
|
|
|
+// return [false, '产品有误', false];
|
|
|
|
+// }
|
|
|
|
+// $params['ProductNumber'] = $channel_code;
|
|
|
|
+// $sign = $this->sign($params);
|
|
|
|
+// $params['Sign'] = $sign;
|
|
|
|
+//
|
|
|
|
+// $resp = http_request(config::ORDER_URL, $params, 'POST', false, config::ExtHeaders, $net_errno);
|
|
|
|
+//
|
|
|
|
+// if (empty($resp)) {
|
|
|
|
+// return [false, '系统错误', true];
|
|
|
|
+// }
|
|
|
|
+// else
|
|
|
|
+// {
|
|
|
|
+// Log::record($resp, Log::DEBUG);
|
|
|
|
+// $resp = json_decode($resp, true);
|
|
|
|
+// if (empty($resp)) {
|
|
|
|
+// return [false, '系统错误', true];
|
|
|
|
+// } elseif ($resp['Code'] === 0) {
|
|
|
|
+// return [true, $resp['OutOrderID'], false];
|
|
|
|
+// } elseif ($resp['Code'] === -170 || $resp['Code'] === -180){
|
|
|
|
+// $net_errno = "HTTP-{$resp['Code']}";
|
|
|
|
+// return [false, $net_errno, true];
|
|
|
|
+// } else {
|
|
|
|
+// return [false, $resp['Msg'], false];
|
|
|
|
+// }
|
|
|
|
+// }
|
|
}
|
|
}
|
|
|
|
|
|
public function query($refill_info)
|
|
public function query($refill_info)
|
|
@@ -177,4 +178,4 @@ class RefillPhone extends refill\IRefillPhone
|
|
$cur = intval($cur * 1000);
|
|
$cur = intval($cur * 1000);
|
|
return $cur;
|
|
return $cur;
|
|
}
|
|
}
|
|
-}
|
|
|
|
|
|
+}
|