fix: harden GoPay and 5sim PR paths

This commit is contained in:
QLHazyCoder
2026-05-03 15:14:31 +08:00
parent 29093e08db
commit 61e9b40d85
8 changed files with 134 additions and 35 deletions
+4 -3
View File
@@ -84,6 +84,7 @@ const PLUS_GOPAY_STEP_IDS = PLUS_GOPAY_STEP_DEFINITIONS
.map((definition) => Number(definition?.id))
.filter(Number.isFinite)
.sort((left, right) => left - right);
const PLUS_STEP_IDS = PLUS_PAYPAL_STEP_IDS;
const LAST_STEP_ID = Math.max(
NORMAL_STEP_IDS[NORMAL_STEP_IDS.length - 1] || 10,
PLUS_PAYPAL_STEP_IDS[PLUS_PAYPAL_STEP_IDS.length - 1] || 10,
@@ -445,7 +446,7 @@ function getStepDefinitionsForState(state = {}) {
if (!isPlusModeState(state)) {
return NORMAL_STEP_DEFINITIONS;
}
return normalizePlusPaymentMethod(state?.plusPaymentMethod) === 'gopay'
return normalizePlusPaymentMethod(state?.plusPaymentMethod) === PLUS_PAYMENT_METHOD_GOPAY
? PLUS_GOPAY_STEP_DEFINITIONS
: PLUS_PAYPAL_STEP_DEFINITIONS;
}
@@ -454,7 +455,7 @@ function getStepIdsForState(state = {}) {
if (!isPlusModeState(state)) {
return NORMAL_STEP_IDS;
}
return normalizePlusPaymentMethod(state?.plusPaymentMethod) === 'gopay'
return normalizePlusPaymentMethod(state?.plusPaymentMethod) === PLUS_PAYMENT_METHOD_GOPAY
? PLUS_GOPAY_STEP_IDS
: PLUS_PAYPAL_STEP_IDS;
}
@@ -10054,7 +10055,7 @@ function getStepRegistryForState(state = {}) {
if (!isPlusModeState(state)) {
return normalStepRegistry;
}
return normalizePlusPaymentMethod(state?.plusPaymentMethod) === 'gopay'
return normalizePlusPaymentMethod(state?.plusPaymentMethod) === PLUS_PAYMENT_METHOD_GOPAY
? plusGoPayStepRegistry
: plusPayPalStepRegistry;
}