mirror of
https://github.com/wasp-lang/open-saas.git
synced 2025-11-20 00:46:37 +01:00
47 lines
1.3 KiB
Diff
47 lines
1.3 KiB
Diff
--- 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`,
|
|
});
|
|
|