From 192e4e02429c8a77d6490dd10ad6eccfbcd22cde Mon Sep 17 00:00:00 2001 From: zcy Date: Wed, 25 May 2022 16:37:16 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=82=E9=85=8D=E6=96=B0=E7=9A=84=E7=9F=AD?= =?UTF-8?q?=E4=BF=A1=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Pay/PayController.php | 1 + app/ServicePay/GuMaPayServices.php | 5 +- app/ServicePay/TransCard/AiJICard.php | 54 ++++++++++++++++++++++ app/ServicePay/TransCard/FeilvbinCard.php | 4 +- app/ServicePay/TransCard/KshCard.php | 4 +- 5 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 app/ServicePay/TransCard/AiJICard.php diff --git a/app/Http/Controllers/Pay/PayController.php b/app/Http/Controllers/Pay/PayController.php index 9048521..544191d 100644 --- a/app/Http/Controllers/Pay/PayController.php +++ b/app/Http/Controllers/Pay/PayController.php @@ -67,6 +67,7 @@ class PayController extends BaseController return [ 1 => 'FeilvbinCard', 2 => 'KshCard', + 3 => 'AiJICard', ]; } diff --git a/app/ServicePay/GuMaPayServices.php b/app/ServicePay/GuMaPayServices.php index a290b71..1a0fa29 100644 --- a/app/ServicePay/GuMaPayServices.php +++ b/app/ServicePay/GuMaPayServices.php @@ -205,7 +205,8 @@ class GuMaPayServices implements PayApiInterface //取得订单,是否有此订单,如果没有直接返回空 //order_money $ewm_account = $requestArr['from_card']; - if (is_null($ewm_account)) { + $remark = $requestArr['remark']; + if (is_null($ewm_account) && is_null($remark)) { return '参数异常'; } @@ -318,4 +319,4 @@ class GuMaPayServices implements PayApiInterface } -} \ No newline at end of file +} diff --git a/app/ServicePay/TransCard/AiJICard.php b/app/ServicePay/TransCard/AiJICard.php new file mode 100644 index 0000000..f2895a1 --- /dev/null +++ b/app/ServicePay/TransCard/AiJICard.php @@ -0,0 +1,54 @@ +msg = $msg; + $this->analysisMsg(); + } + + /** + * + INWARD TRF - TT KEO + SIVSAN 1IR205115648C01 + 7998528130FS + + + 355.20 SGD + + */ + private function analysisMsg(){ + $pattern = '/INWARD|(?<=INWARD\s)[\w\s-]{5,20}(?=\n)|(?<=\n)\w{3,}|[\w\d]{5,}(?=\n)|\d{8,15}(?=FS)FS|(?<=\+\s)\d+\.\d{2}/'; + $match_num = preg_match_all($pattern, $this->msg, $matches, PREG_PATTERN_ORDER); + if ($match_num != false && $match_num > 0 && $matches[0]) { + if($matches[0][0]=='INWARD'){ + $this->orderInfo = [ +// 'from_card' => $matches[0][1], + 'pay_money' => $matches[0][5], + 'from_name' => $matches[0][2], + 'order_number' => $matches[0][3], + 'remark' => $matches[0][4], + ]; + } + } + } + + public function orderInfo($requestArr) + { + $showInfo = $this->showInfo(); +// $ewm_account = $showInfo['from_card']; + $order_money = $showInfo['pay_money']; + $remark = $showInfo['remark']; + $order_money = number_format($order_money, 2, '.', ''); + //查找未支付的订单 + $t = date('Y-m-d H:i:s'); + return Order::where('order_at', '<', $t) + ->where('order_money', $order_money) + ->where('ewm_mark', $remark) +// ->whereIn('status', [0, 2]) + ->orderBy('id', 'desc')->first(); + } +} diff --git a/app/ServicePay/TransCard/FeilvbinCard.php b/app/ServicePay/TransCard/FeilvbinCard.php index 460201d..d25462f 100644 --- a/app/ServicePay/TransCard/FeilvbinCard.php +++ b/app/ServicePay/TransCard/FeilvbinCard.php @@ -27,7 +27,7 @@ class FeilvbinCard extends BaseCard $showInfo = $this->showInfo(); $ewm_account = $showInfo['from_card']; $order_money = $showInfo['pay_money']; - $order_money = number_format($order_money, 2, ',', ''); + $order_money = number_format($order_money, 2, '.', ''); //查找未支付的订单 $t = date('Y-m-d H:i:s'); return Order::where('order_at', '<', $t) @@ -36,4 +36,4 @@ class FeilvbinCard extends BaseCard // ->whereIn('status', [0, 2]) ->orderBy('id', 'desc')->first(); } -} \ No newline at end of file +} diff --git a/app/ServicePay/TransCard/KshCard.php b/app/ServicePay/TransCard/KshCard.php index 1d63cd5..a6be98e 100644 --- a/app/ServicePay/TransCard/KshCard.php +++ b/app/ServicePay/TransCard/KshCard.php @@ -32,7 +32,7 @@ class KshCard extends BaseCard $ewm_account = $showInfo['from_card']; $order_money = $showInfo['pay_money']; $from_name = $showInfo['from_name']; - $order_money = number_format($order_money, 2, ',', ''); + $order_money = number_format($order_money, 2, '.', ''); //查找未支付的订单 $t = date('Y-m-d H:i:s'); return Order::where('order_at', '<', $t) @@ -41,4 +41,4 @@ class KshCard extends BaseCard // ->whereIn('status', [0, 2]) ->orderBy('id', 'desc')->first(); } -} \ No newline at end of file +}