0.使用模拟数据进行充值和提现
1.优化提现接口/api/finance/withdrawCreate 2.优化充值接口/api/finance/depositCreate
This commit is contained in:
@@ -4,13 +4,14 @@ declare(strict_types=1);
|
||||
|
||||
namespace app\common\library\game;
|
||||
|
||||
use app\common\library\finance\MockPay;
|
||||
use InvalidArgumentException;
|
||||
use support\think\Db;
|
||||
|
||||
/**
|
||||
* 充值支付渠道:优先读取 game_config.finance_cashier.channels;无此键时回退 game_config.deposit_channel(迁移期镜像)
|
||||
*
|
||||
* 每项:code(须在代码/环境注册表内)、sort、status(0/1)。**代码注册表当前仅内置 `ddpay`**(DDPay 网关)。
|
||||
* 每项:code(须在代码/环境注册表内)、sort、status(0/1)。内置 `ddpay`(DDPay)、`mock`(模拟支付,见 FINANCE_MOCK_PAY_ENABLED)。
|
||||
*
|
||||
* 渠道展示名以代码注册表为准;运营只配置开关、排序与支持币种,默认兼容全部充值档位。
|
||||
*/
|
||||
@@ -23,9 +24,9 @@ final class DepositChannel
|
||||
*/
|
||||
public static function codeRegistry(): array
|
||||
{
|
||||
// 仅保留 DDPay:充值/回调只走网关文档约定,不再提供模拟或其它渠道码
|
||||
$base = [
|
||||
'ddpay' => ['name' => 'DDPay', 'name_en' => 'DDPay', 'sort' => 10],
|
||||
'mock' => ['name' => '模拟支付', 'name_en' => 'Mock Pay', 'sort' => 5],
|
||||
];
|
||||
$extra = self::registryFromEnv();
|
||||
foreach ($extra as $code => $meta) {
|
||||
@@ -287,6 +288,9 @@ final class DepositChannel
|
||||
if (!isset($registry[$code])) {
|
||||
continue;
|
||||
}
|
||||
if ($code === MockPay::CHANNEL_CODE && !MockPay::isEnabled()) {
|
||||
continue;
|
||||
}
|
||||
if ($fiatCurrencyCode !== '' && !self::isCurrencyAllowedForRow($row, $fiatCurrencyCode)) {
|
||||
continue;
|
||||
}
|
||||
@@ -409,7 +413,12 @@ final class DepositChannel
|
||||
*/
|
||||
public static function withdrawPayoutChannelCodes(): array
|
||||
{
|
||||
return ['ddpay'];
|
||||
$codes = ['ddpay'];
|
||||
if (MockPay::isEnabled()) {
|
||||
$codes[] = MockPay::CHANNEL_CODE;
|
||||
}
|
||||
|
||||
return $codes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user