Update and refactor billing services and types
Several updates and refactorings have been made to the billing services and types. The "onInvoicePaid" method and some types related to line items have been removed. The comments and arguments for the "verifyWebhookSignature" and "handleWebhookEvent" methods in service classes have been updated for clarity. The "onEvent" method's arguments have also been adjusted in multiple places to improve consistency.
This commit is contained in:
@@ -97,8 +97,7 @@ export class LemonSqueezyWebhookHandlerService
|
||||
onSubscriptionDeleted: (subscriptionId: string) => Promise<unknown>;
|
||||
onPaymentSucceeded: (sessionId: string) => Promise<unknown>;
|
||||
onPaymentFailed: (sessionId: string) => Promise<unknown>;
|
||||
onInvoicePaid: (data: UpsertSubscriptionParams) => Promise<unknown>;
|
||||
onEvent?: (event: string) => Promise<unknown>;
|
||||
onEvent?: (event: OrderWebhook | SubscriptionWebhook) => Promise<unknown>;
|
||||
},
|
||||
) {
|
||||
const eventName = event.meta.event_name;
|
||||
@@ -133,6 +132,10 @@ export class LemonSqueezyWebhookHandlerService
|
||||
}
|
||||
|
||||
default: {
|
||||
if (params.onEvent) {
|
||||
return params.onEvent(event);
|
||||
}
|
||||
|
||||
const logger = await getLogger();
|
||||
|
||||
logger.info(
|
||||
|
||||
Reference in New Issue
Block a user