#mangle8582
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- mangle8582, 21 hours ago, 10 messages
- mangle8582, 1 day ago, 41 messages
Subscriptions don't cancel/delete on failed payment
You can configure it to cancel under certain circumstances in your dashboard settings though: https://dashboard.stripe.com/settings/billing/automatic
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
What's the best way to handle this?
Can i atleast have a status of not paid for that subscription? To show it on frontend
And after all retires to cancel the subscription?
You can but you'd manage the status in your databse
If payment fails, update the record in your db to not paid
Then you can use the above settings I linked to cancel sub automatically if all retries fail
Yeah the live settings work in test mode
But you need to be aware that changing those settings will affect your live subs
aa ok, thanks, can you suggest a webhook event on which to change status to not paid?
invoice.payment_failed or charge.failed or payment.intent.canceled
Up to you
Not the payment intent one
That's not a failed payment event
invoice.payment_failed works fine
thanks!
Also, how can i trigger a retry payment directly from frontend?
if the status is unpaid?
which method should i call from stripe after i do a http request to backend API
Just confirm the payment again
It's the same way
I use stripe elements to confirm the payment, but on failed payments i'm not sure which method to trigger from API stripe
And from backend side?
I'm confused why you want to do that
Aren't you relying on automatic retries already?
And cancelling automatically after x amount of them?
I've added 1 day retry, after 1 day it will retry and it it fails it will cancel subscription, and it works good
But I need to add a button to the user on frontend, so it can call API and call Stripe to retry
Why
User's subscription will be unpaid, and he cannot use the functionality of the app, so he needs a retry button to trigger the payment so it can be active again
He can't just wait 1 day of the automatic retry
You probably don't want a button that the user can spam as much as possible to call the stripe api and retry payment
Like you'd probably want them to be able to enter new card details
Yeah, but entering new card details just triggers payment_method_attached only
I can just cancel the subscription on first payment_failed and he just adds his card again and create a new subscription and that's it
I thought i can add a retry button but you're probably right, it's not the best solution
Why not use the automations from your dashboard settings?
Like we provide functionality to email customer to fix their payment method
And handle all retries automatically
I'm in an Electron app, i believe it's harder to redirect them to a URL.
And retries from dashboard settings i see they are per day.
If they could trigger the retry when changing payment method in the app it would be nice
You can code that yourself
Yea, i can catch it on payment_method_attached but not sure which API method to call from Stripe to trigger the retry
It's the same
You just collect payment details and call confirm with the client secret from the invoice's payment intent
No need to listen for payment method attached
Aaa call it from frontend with stripe elements right?
yes
Thank you!