fix(billing): 复用待支付套餐订单

This commit is contained in:
Entropy.Xu
2026-05-28 23:09:36 +08:00
parent ef2953038e
commit 906742e3c4
12 changed files with 636 additions and 1 deletions
+1
View File
@@ -126,6 +126,7 @@ export interface BillingCheckoutResponse {
product?: BillingPlan | null
}
payment_instructions: Record<string, unknown>
reused_pending_order?: boolean
}
export interface UserPlanEntitlement {
+5 -1
View File
@@ -351,7 +351,11 @@ async function checkoutPlan(plan: BillingPlan) {
payment_channel: option.payment_channel,
})
latestCheckout.value = response
success('套餐订单已创建')
success(
response.reused_pending_order
? '已有待支付订单,已打开原支付链接'
: '套餐订单已创建'
)
submitPaymentInstructions(response.payment_instructions)
} catch (err) {
log.error('创建套餐订单失败:', err)