mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-23 01:23:35 +00:00
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:
@@ -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') },
|
||||
])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user