diff --git a/packages/billing/stripe/src/services/stripe-webhook-handler.service.ts b/packages/billing/stripe/src/services/stripe-webhook-handler.service.ts index 816740e7f..c90568e97 100644 --- a/packages/billing/stripe/src/services/stripe-webhook-handler.service.ts +++ b/packages/billing/stripe/src/services/stripe-webhook-handler.service.ts @@ -100,10 +100,6 @@ export class StripeWebhookHandlerService return this.handleAsyncPaymentFailed(event, params.onPaymentFailed); } - case 'invoice.paid': { - return this.handleInvoicePaid(event, params.onInvoicePaid); - } - case 'checkout.session.async_payment_succeeded': { return this.handleAsyncPaymentSucceeded( event, @@ -320,34 +316,6 @@ export class StripeWebhookHandlerService }; } - private async handleInvoicePaid( - event: Stripe.InvoicePaidEvent, - onInvoicePaid: (params: UpsertSubscriptionParams) => Promise, - ) { - const stripe = await this.loadStripe(); - - const subscriptionId = event.data.object.subscription as string; - const subscription = await stripe.subscriptions.retrieve(subscriptionId); - - const accountId = subscription.metadata.accountId as string; - - const payload = this.buildSubscriptionPayload({ - customerId: subscription.customer as string, - id: subscriptionId, - accountId, - lineItems: subscription.items.data, - status: subscription.status, - currency: subscription.currency, - periodStartsAt: subscription.current_period_start, - periodEndsAt: subscription.current_period_end, - cancelAtPeriodEnd: subscription.cancel_at_period_end, - trialStartsAt: subscription.trial_start, - trialEndsAt: subscription.trial_end, - }); - - return onInvoicePaid(payload); - } - private async loadStripe() { if (!this.stripe) { this.stripe = await createStripeClient();