feat(subscription): support Stripe payment element
This commit is contained in:
@@ -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],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user