Update user billing flow and improve error handling
Updated the user billing process to add a return to home function and redirect users to their specific account page after payment. Enhanced error handling in the billing event handler to handle scenarios where no account id is found in the subscription. Removed unused billing page object from the stripe page object.
This commit is contained in:
@@ -68,6 +68,15 @@ 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