feat: add subscription update and cancel logics

This commit is contained in:
Ali BARIN
2023-04-06 13:08:49 +00:00
parent 3e268bf66b
commit 7d47793afb
15 changed files with 170 additions and 54 deletions

View File

@@ -12,6 +12,10 @@ export default async (request: IRequest, response: Response) => {
if (request.body.alert_name === 'subscription_created') {
await Billing.webhooks.handleSubscriptionCreated(request);
} else if (request.body.alert_name === 'subscription_updated') {
await Billing.webhooks.handleSubscriptionUpdated(request);
} else if (request.body.alert_name === 'subscription_cancelled') {
await Billing.webhooks.handleSubscriptionCancelled(request);
} else if (request.body.alert_name === 'subscription_payment_succeeded') {
await Billing.webhooks.handleSubscriptionPaymentSucceeded(request);
}