Files
webman-buildadmin/config/app.php
zhenhui 1b8d947f97 0.使用模拟数据进行充值和提现
1.优化提现接口/api/finance/withdrawCreate
2.优化充值接口/api/finance/depositCreate
2026-05-20 15:57:19 +08:00

80 lines
3.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\Request;
return [
/**
* DDPayPayment Gateway全量配置来自环境变量见仓库根目录 `.env-example` 中 DDPAY_* 说明。
*
* - DDPAY_PUBLIC_BASE_URL站点对外的 HTTPS 根地址(无尾斜杠),用于拼接入金/出金 callback_url不配置则从请求头推导本地可能为 http生产务必配置
* - DDPAY_CLIENT_ID / DDPAY_IDENTIFIER / DDPAY_API_SECRET商户标识与签名密钥文档 Authentication
* - DDPAY_DEPOSIT_INIT_URL / DDPAY_DEPOSIT_STATUS_URL入金发起、入金状态查询文档 §3.1 / §3.3)。
* - DDPAY_PAYOUT_INIT_URL / DDPAY_PAYOUT_STATUS_URL出金发起、出金状态查询文档 §3.2 / §3.4)。
*/
'ddpay_public_base_url' => is_string(getenv('DDPAY_PUBLIC_BASE_URL')) ? trim(getenv('DDPAY_PUBLIC_BASE_URL')) : '',
'ddpay_client_id' => is_string(getenv('DDPAY_CLIENT_ID')) ? trim(getenv('DDPAY_CLIENT_ID')) : '',
'ddpay_identifier' => is_string(getenv('DDPAY_IDENTIFIER')) ? trim(getenv('DDPAY_IDENTIFIER')) : '',
'ddpay_api_secret' => is_string(getenv('DDPAY_API_SECRET')) ? trim(getenv('DDPAY_API_SECRET')) : '',
'ddpay_deposit_init_url' => is_string(getenv('DDPAY_DEPOSIT_INIT_URL')) ? trim(getenv('DDPAY_DEPOSIT_INIT_URL')) : '',
'ddpay_deposit_status_url' => is_string(getenv('DDPAY_DEPOSIT_STATUS_URL')) ? trim(getenv('DDPAY_DEPOSIT_STATUS_URL')) : '',
'ddpay_payout_init_url' => is_string(getenv('DDPAY_PAYOUT_INIT_URL')) ? trim(getenv('DDPAY_PAYOUT_INIT_URL')) : '',
'ddpay_payout_status_url' => is_string(getenv('DDPAY_PAYOUT_STATUS_URL')) ? trim(getenv('DDPAY_PAYOUT_STATUS_URL')) : '',
// 模拟支付channel_code=mock未接入 DDPay 时用于联调FINANCE_MOCK_PAY_ENABLED=0 可关闭
'finance_mock_pay_enabled' => (static function (): bool {
$raw = getenv('FINANCE_MOCK_PAY_ENABLED');
if (is_string($raw) && $raw !== '') {
$norm = strtolower(trim($raw));
if (in_array($norm, ['0', 'false', 'no', 'off'], true)) {
return false;
}
if (in_array($norm, ['1', 'true', 'yes', 'on'], true)) {
return true;
}
}
$debugRaw = getenv('APP_DEBUG');
if ($debugRaw === false || $debugRaw === '') {
return true;
}
return in_array(strtolower(trim((string) $debugRaw)), ['1', 'true', 'yes', 'on'], true);
})(),
/** 充值待支付订单有效秒数(超时未支付自动失败;支付链接倒计时与此一致) */
'deposit_pending_expire_seconds' => (static function (): int {
$raw = getenv('DEPOSIT_PENDING_EXPIRE_SECONDS');
if (is_string($raw) && trim($raw) !== '') {
$v = filter_var(trim($raw), FILTER_VALIDATE_INT);
if ($v !== false && $v > 0) {
return $v;
}
}
return 60;
})(),
'debug' => true,
'error_reporting' => E_ALL,
'default_timezone' => 'Asia/Shanghai',
'request_class' => Request::class,
'public_path' => base_path() . DIRECTORY_SEPARATOR . 'public',
'runtime_path' => base_path(false) . DIRECTORY_SEPARATOR . 'runtime',
'controller_suffix' => 'Controller',
'controller_reuse' => false,
];