From 7ce6403ce4934fa455eb4cfba1062a72bf378650 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 6 Jun 2024 15:34:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=8C=E6=AC=A1=E6=94=AF?= =?UTF-8?q?=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/PayController.php | 11 ++++++----- app/api/controller/order/OrderController.php | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index eebfb3214..ec8863c73 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -33,18 +33,19 @@ class PayController extends BaseApiController Cache::set('logE1'.time(),$result['event_type']??''); if ($result && $result->event_type == 'TRANSACTION.SUCCESS') { $ciphertext = $result->resource['ciphertext']; - Cache::set('logc'.time(),json_decode($result->resource['ciphertext'],true)); + Cache::set('logc'.time(),json_encode($result->resource['ciphertext'],true)); if ($ciphertext['trade_state'] === 'SUCCESS') { $attach = $ciphertext['attach']; switch ($attach) { - case 'wechat_common': - PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext); - $app->wechat->success(); - break; case 'recharge': PayNotifyLogic::handle('recharge', $ciphertext['out_trade_no'], $ciphertext); $app->wechat->success(); break; + case 'wechat_common': + default: + PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext); + $app->wechat->success(); + break; } } } diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index e48ff902d..ef4f7a801 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -304,7 +304,7 @@ class OrderController extends BaseApiController StoreOrder::where(['id' => $order_id, 'uid' => Request()->userId])->update($_order); } } - $result = PaymentLogic::pay($pay_type, 'StoreOrder', $order, $this->userInfo['terminal'], $redirectUrl); + $result = PaymentLogic::pay($pay_type, 'wechat_common', $order, $this->userInfo['terminal'], $redirectUrl); if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError()); }