fix(payment): card/link are Stripe sub-methods, not top-level providers

- Remove card/link from global allPaymentTypes (they belong inside Stripe provider)
- Resolve i18n labels for Stripe sub-methods in provider dialog and card
This commit is contained in:
erio
2026-04-07 00:46:11 +08:00
parent f906b5f1f3
commit 8648950f44
4 changed files with 14 additions and 6 deletions
+1 -1
View File
@@ -1 +1 @@
0.1.108.38
0.1.108.39
@@ -263,9 +263,15 @@ const stripeWebhookUrl = computed(() =>
const callbackPaths = computed(() => PROVIDER_CALLBACK_PATHS[form.provider_key] || null)
const availableTypes = computed(() =>
getAvailableTypes(form.provider_key, props.allPaymentTypes, props.redirectLabel),
)
const availableTypes = computed(() => {
const base = getAvailableTypes(form.provider_key, props.allPaymentTypes, props.redirectLabel)
// Resolve i18n labels for types not in allPaymentTypes (e.g. card, link inside stripe)
return base.map(opt =>
opt.label === opt.value
? { ...opt, label: t(`payment.methods.${opt.value}`, opt.value) }
: opt,
)
})
const resolvedFields = computed(() => {
const fields = PROVIDER_CONFIG_FIELDS[form.provider_key] || []
@@ -114,5 +114,9 @@ function isEnabled(providerKey: string): boolean {
function getTypes(providerKey: string): TypeOption[] {
return getAvailableTypes(providerKey, props.allPaymentTypes, props.redirectLabel)
.map(opt => opt.label === opt.value
? { ...opt, label: t(`payment.methods.${opt.value}`, opt.value) }
: opt,
)
}
</script>
@@ -2841,8 +2841,6 @@ const allPaymentTypes = computed(() => [
{ value: 'easypay', label: t('payment.methods.easypay') },
{ value: 'alipay', label: t('payment.methods.alipay') },
{ value: 'wxpay', label: t('payment.methods.wxpay') },
{ value: 'card', label: t('payment.methods.card') },
{ value: 'link', label: t('payment.methods.link') },
{ value: 'stripe', label: t('payment.methods.stripe') },
])