test: cover ENABLED_PAYMENT_TYPES fallback paths

Co-authored-by: gopkg-dev <58848833+gopkg-dev@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-14 13:52:02 +00:00
parent 1f2d0499ed
commit 9af7133d93
2 changed files with 11 additions and 2 deletions

View File

@@ -55,12 +55,12 @@ export async function GET(request: NextRequest) {
const env = getEnv();
initPaymentProviders();
const supportedTypes = paymentRegistry.getSupportedTypes();
const [user, configuredEnabledTypes, balanceDisabledVal] = await Promise.all([
const [user, configuredPaymentTypesRaw, balanceDisabledVal] = await Promise.all([
getUser(userId),
getSystemConfig('ENABLED_PAYMENT_TYPES'),
getSystemConfig('BALANCE_PAYMENT_DISABLED'),
]);
const enabledTypes = resolveEnabledPaymentTypes(supportedTypes, configuredEnabledTypes);
const enabledTypes = resolveEnabledPaymentTypes(supportedTypes, configuredPaymentTypesRaw);
const methodLimits = await queryMethodLimits(enabledTypes);
const balanceDisabled = balanceDisabledVal === 'true';