|
@@ -60,7 +60,7 @@ class RefillBase
|
|
|
elseif ($caller->verify($input))
|
|
|
{
|
|
|
$values = $caller->notify($input);
|
|
|
- if(count($values) == 4) {
|
|
|
+ if(count($values) == 4) { //老的接口返回四个参数
|
|
|
[$order_id, $success, $can_try, $need_handle] = $values;
|
|
|
$official_sn = false;
|
|
|
} else {
|
|
@@ -85,7 +85,7 @@ class RefillBase
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
- private function risksn_check($refill_info)
|
|
|
+ private function risksn_check($refill_info,$org_official_sn)
|
|
|
{
|
|
|
$card_type = intval($refill_info['card_type']);
|
|
|
$chk_types = [mtopcard\ChinaMobileCard , mtopcard\ChinaUnicomCard , mtopcard\ChinaTelecomCard];
|
|
@@ -94,6 +94,10 @@ class RefillBase
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ if ($org_official_sn !== false and count($org_official_sn) > 48) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
$quality = intval($refill_info['quality']);
|
|
|
$official_sn = $refill_info['official_sn'];
|
|
|
|
|
@@ -170,11 +174,7 @@ class RefillBase
|
|
|
$mch_order = $refill_info['mch_order'];
|
|
|
$order_time = intval($refill_info['order_time']);
|
|
|
|
|
|
- if($official_sn != false and count($official_sn) > 48) {
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if($success && $this->risksn_check($refill_info)) {
|
|
|
+ if ($success && $this->risksn_check($refill_info, $official_sn)) {
|
|
|
$tran->commit();
|
|
|
$params = ['store_id' => $order_info['store_id'],
|
|
|
'channel_name' => $refill_info['channel_name'],
|
|
@@ -730,18 +730,22 @@ class RefillBase
|
|
|
$provider = $this->mPolicy->provider($chname);
|
|
|
if(empty($provider)) return false;
|
|
|
|
|
|
- [$state, $order_state] = $provider->query($refill_info);
|
|
|
- if(!$state) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- elseif($order_state == ORDER_STATE_SUCCESS) {
|
|
|
- $this->proc_notify($order_id,true,false,$chname);
|
|
|
- }
|
|
|
- elseif($order_state == ORDER_STATE_CANCEL) {
|
|
|
- $this->proc_notify($order_id,false,true,$chname);
|
|
|
+ $values = $provider->query($refill_info);
|
|
|
+ if (count($values) == 2) {
|
|
|
+ [$state, $order_state] = $values;
|
|
|
+ $official_sn = false;
|
|
|
+ } else {
|
|
|
+ [$state, $order_state, $official_sn] = $values;
|
|
|
}
|
|
|
- else {
|
|
|
- Log::record("RefillBase::query order_state={$order_state}",Log::DEBUG);
|
|
|
+
|
|
|
+ if (!$state) {
|
|
|
+ return false;
|
|
|
+ } elseif ($order_state == ORDER_STATE_SUCCESS) {
|
|
|
+ $this->proc_notify($order_id, true, false, $chname, $official_sn);
|
|
|
+ } elseif ($order_state == ORDER_STATE_CANCEL) {
|
|
|
+ $this->proc_notify($order_id, false, true, $chname, $official_sn);
|
|
|
+ } else {
|
|
|
+ Log::record("RefillBase::query order_state={$order_state}", Log::DEBUG);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -806,7 +810,13 @@ class RefillBase
|
|
|
$provider = $this->mPolicy->provider($chname);
|
|
|
if(empty($provider)) return false;
|
|
|
|
|
|
- [$state, $order_state] = $provider->query($refill_info);
|
|
|
+ $values = $provider->query($refill_info);
|
|
|
+ if (count($values) == 2) {
|
|
|
+ [$state, $order_state] = $values;
|
|
|
+ $official_sn = false;
|
|
|
+ } else {
|
|
|
+ [$state, $order_state, $official_sn] = $values;
|
|
|
+ }
|
|
|
|
|
|
try {
|
|
|
$can_try = false;
|
|
@@ -827,7 +837,7 @@ class RefillBase
|
|
|
if($can_try)
|
|
|
{
|
|
|
if($trans_succ) {
|
|
|
- $this->proc_notify($order_id, false, true, $chname);
|
|
|
+ $this->proc_notify($order_id, false, true, $chname, $official_sn);
|
|
|
} else {
|
|
|
QueueClient::async_push("QueryOrderNeterr",['order_id' => $order_id],30);
|
|
|
}
|