|
@@ -561,6 +561,50 @@ class RefillBase
|
|
|
return ($api_pay_amount == ncPriceFormat(0.0000));
|
|
|
}
|
|
|
|
|
|
+ private function risksn_check($refill_info,$order_info)
|
|
|
+ {
|
|
|
+ $start_with = function ($haystack, $needle) {
|
|
|
+ $length = strlen($needle);
|
|
|
+ return (substr($haystack, 0, $length) === $needle);
|
|
|
+ };
|
|
|
+
|
|
|
+ $spcheker = function ($refill_info) use($start_with)
|
|
|
+ {
|
|
|
+ $official_sn = $refill_info['official_sn'];
|
|
|
+ $card_type = intval($refill_info['card_type']);
|
|
|
+
|
|
|
+ if(empty($official_sn)) return false;
|
|
|
+
|
|
|
+ if($card_type === mtopcard\ChinaMobileCard) {
|
|
|
+ if($start_with($official_sn,'0095')) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ elseif($card_type === mtopcard\ChinaUnicomCard) {
|
|
|
+ if($start_with($official_sn,'SP')) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ elseif($start_with($official_sn,'J98')) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ elseif($card_type === mtopcard\ChinaTelecomCard) {
|
|
|
+ if($start_with($official_sn,'SP')) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ elseif($start_with($official_sn,'WX')) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+
|
|
|
+ if($spcheker($refill_info)) {
|
|
|
+ QueueClient::async_push("OnRiskSN", ['store_id' => $order_info['store_id'],'channel_name' => $refill_info['channel_name']], 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function notify_merchant($order_id,$manual)
|
|
|
{
|
|
|
if ($order_id <= 0) {
|
|
@@ -593,6 +637,12 @@ class RefillBase
|
|
|
if ($order_state !== ORDER_STATE_CANCEL && $order_state !== ORDER_STATE_SUCCESS) {
|
|
|
return [false, "错误的订单状态,不能通知."];
|
|
|
}
|
|
|
+
|
|
|
+ //流水号风险检测
|
|
|
+ if ($order_state === ORDER_STATE_SUCCESS && $refill_info['mch_notify_times'] < 1) {
|
|
|
+ $this->risksn_check($refill_info, $order_info);
|
|
|
+ }
|
|
|
+
|
|
|
$resp = $this->mPolicy->notify($order_info,$refill_info);
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
if ($resp) {
|