Refactor billing event handler and fix minor bugs

Refactored the billing-event-handler.service.ts by introducing new types `UpsertSubscriptionParams` and `UpsertOrderParams` to simplify method parameters. Fixed minor bugs including the correction of an error message in lemon-squeezy-webhook-handler.service.ts and adjusting the handling of attribute types. Also updated comment in billing-webhook-handler.service.ts for better clarity.
This commit is contained in:
giancarlo
2024-04-16 12:32:15 +08:00
parent ebb8fc08fe
commit 8fde758671
3 changed files with 34 additions and 15 deletions

View File

@@ -36,7 +36,7 @@ export abstract class BillingWebhookHandlerService {
// one-time payments
onPaymentSucceeded: (sessionId: string) => Promise<unknown>;
// this method is called when an invoice is paid. This is used for
// this method is called when an invoice is paid. This is used for recurring payments
onInvoicePaid: (data: UpsertSubscriptionParams) => Promise<unknown>;
// this method is called when a payment is failed. This is used for