From 8cd9cce1850f130d82c44fe335d16b14fe3f9521 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Sun, 6 Nov 2022 23:05:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/BalanceController.php | 36 +++---------------- resources/views/pay_error.blade.php | 13 ------- resources/views/pay_process.blade.php | 13 +++++++ resources/views/pay_success.blade.php | 13 ------- 4 files changed, 18 insertions(+), 57 deletions(-) delete mode 100644 resources/views/pay_error.blade.php create mode 100644 resources/views/pay_process.blade.php delete mode 100644 resources/views/pay_success.blade.php diff --git a/app/Http/Controllers/Api/BalanceController.php b/app/Http/Controllers/Api/BalanceController.php index 1c630c3..7549ed6 100644 --- a/app/Http/Controllers/Api/BalanceController.php +++ b/app/Http/Controllers/Api/BalanceController.php @@ -88,30 +88,6 @@ public function show(Balance $balance) ]); return $pay; - - - // $result = false; - // try { - // $result = $this->checkAndCharge($balance, true); - // // if ($responseChecker->success($result)) { - // // $html = $result->body; - // // return view('pay', compact('html')); - // // } - // } catch (Exception $e) { - // Log::error($e); - // return $this->error($e->getMessage()); - // } - - // if ($result) { - - - // return response($pay); - // } else { - // return $this->error('支付失败'); - // } - - - // return $this->success($balance); } public function notify(Request $request) @@ -129,7 +105,7 @@ public function notify(Request $request) // 检测订单是否已支付 if ($balance->paid_at !== null) { // return $this->success('订单已支付'); - return view('pay_success'); + return view('pay_process'); } $data = Pay::alipay()->callback(); @@ -148,11 +124,9 @@ public function notify(Request $request) throw new ChargeException('商户不匹配'); } - if ($this->checkAndCharge($balance)) { - return $this->success(); - } else { - return $this->error(); - } + $this->checkAndCharge($balance); + + return view('pay_process'); } public function checkAndCharge(Balance $balance, $check = false) @@ -176,7 +150,7 @@ public function checkAndCharge(Balance $balance, $check = false) return $this->error('无法验证支付结果'); } - return view('pay_success'); + return true; } /** diff --git a/resources/views/pay_error.blade.php b/resources/views/pay_error.blade.php deleted file mode 100644 index 885b7df..0000000 --- a/resources/views/pay_error.blade.php +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 支付结果 - - - -

无法完成支付,请联系我们。

- - - diff --git a/resources/views/pay_process.blade.php b/resources/views/pay_process.blade.php new file mode 100644 index 0000000..f7d9458 --- /dev/null +++ b/resources/views/pay_process.blade.php @@ -0,0 +1,13 @@ + + + + + + 支付进度 + + + +

非常感谢。我们正在处理您的支付,稍后您就可以在交易记录中看到了。

+ + + diff --git a/resources/views/pay_success.blade.php b/resources/views/pay_success.blade.php deleted file mode 100644 index 6ed1953..0000000 --- a/resources/views/pay_success.blade.php +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - 支付结果 - - - -

非常感谢。您现在可以关闭页面并继续刚才的操作了。

- - -