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');