diff --git a/apps/web/app/(dashboard)/home/(user)/billing/server-actions.ts b/apps/web/app/(dashboard)/home/(user)/billing/server-actions.ts index 3d552fb0d..96443a083 100644 --- a/apps/web/app/(dashboard)/home/(user)/billing/server-actions.ts +++ b/apps/web/app/(dashboard)/home/(user)/billing/server-actions.ts @@ -4,7 +4,7 @@ import { redirect } from 'next/navigation'; import { z } from 'zod'; -import { getLineItemsFromPlanId } from '@kit/billing'; +import { getProductPlanPair } from '@kit/billing'; import { getBillingGatewayProvider } from '@kit/billing-gateway'; import { Logger } from '@kit/shared/logger'; import { requireUser } from '@kit/supabase/require-user'; @@ -65,17 +65,15 @@ export async function createPersonalAccountCheckoutSession(params: { throw new Error('Product not found'); } - const { lineItems, trialDays } = getLineItemsFromPlanId(product, planId); + const { plan } = getProductPlanPair(billingConfig, planId); // call the payment gateway to create the checkout session const { checkoutToken } = await service.createCheckoutSession({ - lineItems, returnUrl, accountId, - trialDays, - paymentType: product.paymentType, customerEmail: user.email, customerId, + plan, }); Logger.info( diff --git a/packages/billing-gateway/src/components/current-plan-card.tsx b/packages/billing-gateway/src/components/current-plan-card.tsx index a1384f3b6..a76560430 100644 --- a/packages/billing-gateway/src/components/current-plan-card.tsx +++ b/packages/billing-gateway/src/components/current-plan-card.tsx @@ -67,7 +67,7 @@ export function CurrentPlanCard({ i18nKey="billing:planRenewal" values={{ interval: subscription.interval, - price: formatCurrency(product.currency, baseLineItem.price), + price: formatCurrency(product.currency, baseLineItem.cost), }} />