From e6406477097637b8947f5241f79c5c1c007619ce Mon Sep 17 00:00:00 2001 From: xuanchen <122383162@qq.com> Date: Fri, 13 Aug 2021 13:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Action/Sign.php | 1 - src/WoUnicom.php | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Action/Sign.php b/src/Action/Sign.php index 79f3333..6e34f8e 100644 --- a/src/Action/Sign.php +++ b/src/Action/Sign.php @@ -17,7 +17,6 @@ class Sign extends Init // $signMsg = str_replace('\\', '', $signMsg); $signMsg = str_replace(' ', '+', $signMsg); $this->sign = $signMsg; - info($this->sign); return $this->checkSign(); diff --git a/src/WoUnicom.php b/src/WoUnicom.php index 6a144c5..7dfbf38 100644 --- a/src/WoUnicom.php +++ b/src/WoUnicom.php @@ -2,6 +2,7 @@ namespace XuanChen\WoUnicom; +use App\Models\ActivitySchoolOrder; use App\Models\Payment; use App\Models\Welfare; use App\Models\WelfareOrder; @@ -117,6 +118,21 @@ class WoUnicom $order->paid(); } + } elseif (Str::is('AS*', $data['orderid'])) { + $order = ActivitySchoolOrder::where('orderid', $data['orderid'])->first(); + if ($order && $order->state == 'UNPAY') { + $payment = \App\Models\Payment::where('orderable_type', get_class($order)) + ->where('orderable_id', $order->id) + ->latest() + ->first(); + + $payment->state = 'SUCCESS'; + $payment->out_trade_no = $data['payfloodid']; + $payment->type = 'UNICOM'; + $payment->paid_at = Carbon::now(); + $payment->save(); + $order->paid(); + } } else { $order = \App\Models\Order::where('orderid', $data['orderid'])->first();