From d97b1542dc82e93994b4a48a75591f20503a891c Mon Sep 17 00:00:00 2001 From: Jason Date: Thu, 15 Sep 2022 16:57:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=BB=93=E6=9E=9C=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/Wechat.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controller/Wechat.php b/app/controller/Wechat.php index b2519ea..c58e033 100644 --- a/app/controller/Wechat.php +++ b/app/controller/Wechat.php @@ -144,9 +144,10 @@ class Wechat */ public function paid() { - $this->initWechat(); + $config = Config::get('wechat.payment'); + $payment = Factory::payment($config); - return $this->app->handlePaidNotify(function ($message, $fail) { + return $payment->handlePaidNotify(function ($message, $fail) { $order = Payment::where('trade_no', $message['out_trade_no'])->find(); if (! $order || $order->paid_at) { @@ -163,10 +164,9 @@ class Wechat $zhuLi = env("ZHULI_VALUE") ?? 150; Db::name("student")->inc("hot", $zhuLi)->where("id", $order_detail->id)->update(); Db::name("student")->inc("hot_count", 1)->where("id", $order_detail->id)->update(); - - } else { - $fail('Order not exists.'); + return true; } + return $fail('Order not exists.'); }); }