改进 支付网关环境判断
This commit is contained in:
parent
d4c8b0041c
commit
f0ce106c72
@ -76,7 +76,7 @@ public function show(Request $request, Balance $balance)
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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();
|
$responseChecker = new ResponseChecker();
|
||||||
|
|
||||||
|
@ -38,14 +38,20 @@ public function boot()
|
|||||||
});
|
});
|
||||||
|
|
||||||
AlipayFactory::setOptions($this->alipayOptions());
|
AlipayFactory::setOptions($this->alipayOptions());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function alipayOptions()
|
private function alipayOptions()
|
||||||
{
|
{
|
||||||
$options = new AlipayConfig();
|
$options = new AlipayConfig();
|
||||||
$options->protocol = 'https';
|
$options->protocol = 'https';
|
||||||
|
|
||||||
|
// if local
|
||||||
|
if (app()->environment() == 'local') {
|
||||||
$options->gatewayHost = 'openapi.alipaydev.com';
|
$options->gatewayHost = 'openapi.alipaydev.com';
|
||||||
|
} else {
|
||||||
|
$options->gatewayHost = 'openapi.alipay.com';
|
||||||
|
}
|
||||||
|
|
||||||
$options->signType = 'RSA2';
|
$options->signType = 'RSA2';
|
||||||
|
|
||||||
$options->appId = config('alipay.app_id');
|
$options->appId = config('alipay.app_id');
|
||||||
|
Loading…
Reference in New Issue
Block a user