--- template/app/src/payment/stripe/webhook.ts +++ opensaas-sh/app/src/payment/stripe/webhook.ts @@ -106,7 +106,7 @@ case PaymentPlanId.Credits10: await updateUserCredits( { - paymentProcessorUserId: customerId, + stripeId: customerId, datePaid: invoicePaidAtDate, numOfCreditsPurchased: paymentPlans[paymentPlanId].effect.amount, }, @@ -117,7 +117,7 @@ case PaymentPlanId.Hobby: await updateUserSubscription( { - paymentProcessorUserId: customerId, + stripeId: customerId, datePaid: invoicePaidAtDate, paymentPlanId, subscriptionStatus: SubscriptionStatus.Active, @@ -164,7 +164,7 @@ ); const user = await updateUserSubscription( - { paymentProcessorUserId: customerId, paymentPlanId, subscriptionStatus }, + { stripeId: customerId, paymentPlanId, subscriptionStatus }, prismaUserDelegate, ); @@ -232,7 +232,7 @@ await updateUserSubscription( { - paymentProcessorUserId: customerId, + stripeId: customerId, subscriptionStatus: SubscriptionStatus.Deleted, }, prismaUserDelegate,