This commit is contained in:
2023-03-08 09:16:04 +08:00
commit e78454540f
1318 changed files with 210569 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
<?php
namespace Modules\Payment\Models\Traits;
use Modules\Payment\Models\Setting;
trait WithConfig
{
/**
* Notes: 获取配置文件
* @Author: 玄尘
* @Date : 2021/11/2 15:27
* @param string $driver
* @return array
* @throws \Exception
*/
public function getPayConfig(string $driver, $gateway = '')
{
$defaule_config = Setting::getDefaultConfig($driver);
if (config('payment.version', 2) == 3) {
$config = [
$driver => [
'default' => $defaule_config,
],
'logger' => array_merge($defaule_config['logger'], [
'enable' => config('payment.logger', true),
]),
];
}
return $config;
}
}