feat: insufficant funds

This commit is contained in:
Nevo David 2024-12-18 00:26:18 +07:00
parent 72c8a4475c
commit f5164624e0
1 changed files with 4 additions and 0 deletions

View File

@ -101,6 +101,10 @@ export class StripeService {
await stripe.paymentIntents.cancel(paymentIntent.id as string);
return true;
} catch (err) {
try {
await stripe.paymentMethods.detach(paymentMethods.data[0].id);
await stripe.subscriptions.cancel(event.data.object.id as string);
} catch (err) {/*dont do anything*/}
return false;
}
}