--- template/app/src/payment/stripe/paymentProcessor.ts +++ opensaas-sh/app/src/payment/stripe/paymentProcessor.ts @@ -8,8 +8,8 @@ } from "../paymentProcessor"; import type { PaymentPlanEffect } from "../plans"; import { - fetchUserPaymentProcessorUserId, - updateUserPaymentProcessorUserId, + fetchUserStripeId, + updateUserStripeId } from "../user"; import { createStripeCheckoutSession, @@ -28,8 +28,8 @@ }: CreateCheckoutSessionArgs) => { const customer = await ensureStripeCustomer(userEmail); - await updateUserPaymentProcessorUserId( - { userId, paymentProcessorUserId: customer.id }, + await updateUserStripeId( + { userId, stripeId: customer.id }, prismaUserDelegate, ); @@ -56,18 +56,18 @@ prismaUserDelegate, userId, }: FetchCustomerPortalUrlArgs) => { - const paymentProcessorUserId = await fetchUserPaymentProcessorUserId( + const stripeId = await fetchUserStripeId( userId, prismaUserDelegate, ); - if (!paymentProcessorUserId) { + if (!stripeId) { return null; } const billingPortalSession = await stripeClient.billingPortal.sessions.create({ - customer: paymentProcessorUserId, + customer: stripeId, return_url: `${config.frontendUrl}/account`, });