From f0ce106c725c6d15e92a12c63498d910ea7b9776 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Tue, 6 Sep 2022 01:05:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E7=8E=AF=E5=A2=83=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/User/BalanceController.php | 2 +- app/Providers/AppServiceProvider.php | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/User/BalanceController.php b/app/Http/Controllers/User/BalanceController.php index 77b04c0..92ca66e 100644 --- a/app/Http/Controllers/User/BalanceController.php +++ b/app/Http/Controllers/User/BalanceController.php @@ -76,7 +76,7 @@ public function show(Request $request, Balance $balance) } try { - $result = AlipayFactory::payment()->page()->pay("支付", $balance->order_id, $balance->amount, 'http://rcrmqishil.sharedwithexpose.com/api/pay/return'); + $result = AlipayFactory::payment()->page()->pay("支付", $balance->order_id, $balance->amount, route('balances.pay.show', ['balance' => $balance->order_id])); $responseChecker = new ResponseChecker(); diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index f3d6510..a6ef8c0 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -38,14 +38,20 @@ public function boot() }); AlipayFactory::setOptions($this->alipayOptions()); - } private function alipayOptions() { $options = new AlipayConfig(); $options->protocol = 'https'; - $options->gatewayHost = 'openapi.alipaydev.com'; + + // if local + if (app()->environment() == 'local') { + $options->gatewayHost = 'openapi.alipaydev.com'; + } else { + $options->gatewayHost = 'openapi.alipay.com'; + } + $options->signType = 'RSA2'; $options->appId = config('alipay.app_id');