修复 支付

This commit is contained in:
iVampireSP.com 2022-11-06 23:05:40 +08:00
parent 5dc942ea1c
commit 8cd9cce185
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132
4 changed files with 18 additions and 57 deletions

View File

@ -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;
}
/**

View File

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>支付结果</title>
</head>
<body>
<p>无法完成支付,请联系我们。</p>
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>支付进度</title>
</head>
<body>
<p>非常感谢。我们正在处理您的支付,稍后您就可以在交易记录中看到了。</p>
</body>
</html>

View File

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>支付结果</title>
</head>
<body>
<p>非常感谢。您现在可以关闭页面并继续刚才的操作了。</p>
</body>
</html>