Skip to content

Commit 540f47f

Browse files
committed
完成unionpay通过数据库数据配置网关
1 parent 339cb25 commit 540f47f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/App/Models/Config.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,24 @@ public function gatewayRegister()
3434
{
3535
$this->where('status', true)->get()->map(function ($item) {
3636
$upload = new Upload();
37-
$private_key = storage_path($upload->getUploadWhereFirst($item->private_key)->path);
38-
$public_key = storage_path($upload->getUploadWhereFirst($item->public_key)->path);
37+
$private_key = storage_path('app/'.$upload->getUploadWhereFirst($item->private_key)->path);
38+
$public_key = storage_path('app/'.$upload->getUploadWhereFirst($item->public_key)->path);
3939
switch ($item->gateway) {
4040
case 'unionpay':
4141
config(['laravel-omnipay.gateways.'.$item->gateway.'.driver' => $item->driver]);
4242
config(['laravel-omnipay.gateways.'.$item->gateway.'.options' => [
4343
'merId' => $item->app_id,
4444
'certPath' => $private_key,
4545
'certPassword' => $item->other,
46-
'certDir'=> $public_key,
46+
'certDir'=> storage_path('app/certificates/unionpay'),
47+
'certDir'=> substr($public_key,0,strripos($public_key,'/')), //这里需要目录
4748
'returnUrl' => $item->return_url,
4849
'notifyUrl' => $item->notify_url
4950
]]);
5051
break;
5152
}
5253
});
53-
dd(config('laravel-omnipay.gateways'));
54+
// dd(config('laravel-omnipay.gateways'));
5455
/**
5556
* [加载云磁盘配置]
5657
* @var [type]

0 commit comments

Comments
 (0)