Add cancellation alert and refactor subscription handling
Added a 'Subscription Cancelled' alert in the billing component to improve visibility of subscription status. Also, removed an unnecessary check for target_account_id in billing-event-handler service as it lead to early exits. Fixed a typo in stripe-webhook-handler service for better consistency in naming conventions.
This commit is contained in:
@@ -68,15 +68,6 @@ export class BillingEventHandlerService {
|
||||
|
||||
logger.info(ctx, 'Processing subscription updated event ...');
|
||||
|
||||
if (!subscription.target_account_id) {
|
||||
logger.info(
|
||||
`No account id found in subscription. This event may have arrived before we created a subscription. Exiting...`,
|
||||
subscription,
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle the subscription updated event
|
||||
// here we update the subscription in the database
|
||||
const { error } = await client.rpc('upsert_subscription', subscription);
|
||||
|
||||
Reference in New Issue
Block a user