#cajcek_webhooks
1 messages ยท Page 1 of 1 (latest)
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.
- cajcek_webhooks, 5 hours ago, 17 messages
- cajcek_webhooks, 8 hours ago, 19 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1255229799694340248
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hello! What's your question?
Will this webhook be the best for listening to subscriptions when the payment is rejected after several attempts and the subscription is canceled?
there will be no conflict with invoice.payment_failed ?
It might be best or it might not be, it depends on your specific situation. Are you using Subscription Schedules? What conflict are you worried about, exactly?
If the payment fails (I have a subscription cancellation in my API in the subscription database) in such a case. Then, during these few attempts, it may trigger me? (invoice.payment_failed). If so, how can I check how many payment attempts there are left?
Sorry, I don't understand. You're canceling Subscriptions but leaving outstanding Invoices open to still collect payments, and you want to know when those payments fail? Or something else? What's your goal?
- I create subscriptions for a customer with a 7-day trial mode
- After 7 days I want to collect the payment and it fails
- Is the subscription canceled or does it try to collect the payment several times?
next case
- I am creating a subscription for a customer
- Successfully pays for half a year of subscription
- the 7th time there is an error
- When an attempt is made to collect the amount from the customer's card, a webhook is triggered every time the "invoice.payment_failed" error occurs?
- If the attempt to collect the amount fails, is the "subscription_schedule.aborted" webhook triggered?
It depends on your retry and cancelation setting in the Dashboard here: https://dashboard.stripe.com/settings/billing/automatic
When an attempt is made to collect the amount from the customer's card, a webhook is triggered every time the "invoice.payment_failed" error occurs?
Yes.
Can I get some data from this webhook that there will be, for example, 1 more attempt to collect the amount?
If the attempt to collect the amount fails, is the "subscription_schedule.aborted" webhook triggered?
Maybe? It depends on if you're using Subscription Schedules and if the underlying Subscription is canceled because of failed payments: https://docs.stripe.com/api/events/types?event_types-invoice.payment_succeeded=#event_types-subscription_schedule.aborted
no, without Subscription Schedules
You can look at next_payment_attempt on the Invoice to see if there's going to be another attempt or not: https://docs.stripe.com/api/invoices/object#invoice_object-next_payment_attempt
If you don't use Subscription Schedules then no subscription_schedule.* Events will fire.
You probably want customer.subscription.deleted for when a Subscription is canceled: https://docs.stripe.com/api/events/types#event_types-customer.subscription.deleted
hmm sounds good. How can I test, for example, 3 payment attempts if they fail and the subscription is finally canceled?
You can use Test Clocks to advance time in test mode so you don't have to wait for things like payment retries: https://docs.stripe.com/billing/testing/test-clocks
ok last question
in this webhook:
invoice.payment_failed
How can I check how many payment attempts are left?
You can't, you can only see how many there have been and if another one will happen or not.
Ok, and which field corresponds to "will there be 1 more attempt" or "when"?
There's no way to know how many are left because sometimes we encounter certain types of failures that indicate retrying wouldn't do any good.
The property I explained above:
You can look at
next_payment_attempton the Invoice to see if there's going to be another attempt or not: https://docs.stripe.com/api/invoices/object#invoice_object-next_payment_attempt