feat(subscription): support Stripe payment element

This commit is contained in:
2026-06-18 18:03:36 +08:00
parent 8cca42238e
commit 5bf98e9452
16 changed files with 402 additions and 76 deletions
+2 -3
View File
@@ -60,14 +60,13 @@ function planCaption(plan: PaymentPlan): string {
return `${currencySymbol(plan.currency)}${perDay.toFixed(2)}/day`;
}
function toPlanView(plan: PaymentPlan, index: number): SubscriptionPlanView {
function toPlanView(plan: PaymentPlan): SubscriptionPlanView {
return {
id: plan.planId,
name: plan.planName,
price: formatAmount(plan.amountCents),
originalPrice: null,
perDay: planCaption(plan),
highlight: plan.planId === "vip_monthly" || index === 0,
currencySymbol: currencySymbol(plan.currency),
};
}
@@ -96,7 +95,7 @@ export function SubscriptionScreen() {
() =>
payment.plans
.filter(isVipPlan)
.map((plan, index) => toPlanView(plan, index)),
.map((plan) => toPlanView(plan)),
[payment.plans],
);