改回 支付宝支付
This commit is contained in:
parent
5c2ecffd81
commit
86d3a2d361
@ -15,8 +15,6 @@
|
|||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
use SimpleSoftwareIO\QrCode\Facades\QrCode;
|
||||||
use Yansongda\LaravelPay\Facades\Pay;
|
use Yansongda\LaravelPay\Facades\Pay;
|
||||||
use Yansongda\Pay\Exception\ContainerException;
|
|
||||||
use Yansongda\Pay\Exception\InvalidParamsException;
|
|
||||||
|
|
||||||
class BalanceController extends Controller
|
class BalanceController extends Controller
|
||||||
{
|
{
|
||||||
@ -220,16 +218,7 @@ public function notify(Request $request, $payment): View|JsonResponse
|
|||||||
|
|
||||||
|
|
||||||
// 处理验证
|
// 处理验证
|
||||||
if ($payment === 'alipay') {
|
if ($payment === 'wechat') {
|
||||||
try {
|
|
||||||
$pay = Pay::alipay()->callback();
|
|
||||||
|
|
||||||
} catch (ContainerException|InvalidParamsException $e) {
|
|
||||||
abort(500, $e->getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
$is_paid = true;
|
|
||||||
} else if ($payment === 'wechat') {
|
|
||||||
if (!($request->filled('hash') || $request->filled('trade_order_id'))) {
|
if (!($request->filled('hash') || $request->filled('trade_order_id'))) {
|
||||||
return $this->error('参数错误。');
|
return $this->error('参数错误。');
|
||||||
}
|
}
|
||||||
@ -246,9 +235,6 @@ public function notify(Request $request, $payment): View|JsonResponse
|
|||||||
if ($request->input('status') === 'OD') {
|
if ($request->input('status') === 'OD') {
|
||||||
$is_paid = true;
|
$is_paid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
abort(400, '支付方式错误。');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($is_paid) {
|
if ($is_paid) {
|
||||||
@ -280,8 +266,10 @@ public function notify(Request $request, $payment): View|JsonResponse
|
|||||||
*
|
*
|
||||||
* @return View
|
* @return View
|
||||||
*/
|
*/
|
||||||
public function transactions(Request $request): View
|
public
|
||||||
{
|
function transactions(
|
||||||
|
Request $request
|
||||||
|
): View {
|
||||||
|
|
||||||
$modules = Module::all();
|
$modules = Module::all();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user