Lae/config/pay.php

97 lines
3.8 KiB
PHP
Raw Normal View History

2022-11-06 11:28:22 +00:00
<?php
declare(strict_types=1);
use Yansongda\Pay\Pay;
return [
'alipay' => [
'default' => [
// 必填-支付宝分配的 app_id
'app_id' => env('ALIPAY_APP_ID'),
// 必填-应用私钥 字符串或路径
'app_secret_cert' => trim(file_get_contents(env('ALIPAY_APP_SECERT_CERT_PATH'))),
// 必填-应用公钥证书 路径
'app_public_cert_path' => env('ALIPAY_APP_PUBLIC_CERT_PATH'),
// 必填-支付宝公钥证书 路径
'alipay_public_cert_path' => env('ALIPAY_PUBLIC_CERT_PATH'),
// 必填-支付宝根证书 路径
'alipay_root_cert_path' => env('ALIPAY_ROOT_CERT_PATH'),
'return_url' => env('ALIPAY_CALLBACK_RETURN_URL'),
'notify_url' => env('ALIPAY_CALLBACK_NOTIFY_URL'),
// 选填-服务商模式下的服务商 id当 mode 为 Pay::MODE_SERVICE 时使用该参数
'service_provider_id' => '',
// 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SANDBOX, MODE_SERVICE
2022-11-06 13:31:35 +00:00
// 如果应用程序环境为 local自动切换为沙箱模式
'mode' => env('APP_ENV') == 'local' ? Pay::MODE_SANDBOX : Pay::MODE_NORMAL,
2022-11-06 11:28:22 +00:00
],
],
'wechat' => [
'default' => [
// 必填-商户号,服务商模式下为服务商商户号
2022-11-06 13:31:35 +00:00
'mch_id' => env('WECHAT_MENCENT_ID'),
2022-11-06 11:28:22 +00:00
// 必填-商户秘钥
'mch_secret_key' => '',
// 必填-商户私钥 字符串或路径
'mch_secret_cert' => '',
// 必填-商户公钥证书路径
'mch_public_cert_path' => '',
// 必填
'notify_url' => '',
// 选填-公众号 的 app_id
'mp_app_id' => '',
// 选填-小程序 的 app_id
'mini_app_id' => '',
// 选填-app 的 app_id
'app_id' => '',
// 选填-合单 app_id
'combine_app_id' => '',
// 选填-合单商户号
'combine_mch_id' => '',
// 选填-服务商模式下,子公众号 的 app_id
'sub_mp_app_id' => '',
// 选填-服务商模式下,子 app 的 app_id
'sub_app_id' => '',
// 选填-服务商模式下,子小程序 的 app_id
'sub_mini_app_id' => '',
// 选填-服务商模式下子商户id
'sub_mch_id' => '',
// 选填-微信公钥证书路径, optional强烈建议 php-fpm 模式下配置此参数
'wechat_public_cert_path' => [
'45F59D4DABF31918AFCEC556D5D2C6E376675D57' => __DIR__ . '/Cert/wechatPublicKey.crt',
],
// 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE
'mode' => Pay::MODE_NORMAL,
],
],
'unipay' => [
'default' => [
// 必填-商户号
'mch_id' => '',
// 必填-商户公私钥
'mch_cert_path' => '',
// 必填-商户公私钥密码
'mch_cert_password' => '000000',
// 必填-银联公钥证书路径
'unipay_public_cert_path' => '',
// 必填
'return_url' => '',
// 必填
'notify_url' => '',
],
],
'http' => [ // optional
'timeout' => 5.0,
'connect_timeout' => 5.0,
// 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html)
],
// optional默认 warning日志路径为sys_get_temp_dir().'/logs/yansongda.balances.log'
2022-11-06 11:28:22 +00:00
'logger' => [
'enable' => false,
'file' => null,
'level' => 'debug',
'type' => 'single', // optional, 可选 daily.
'max_file' => 30,
],
];