#yathartha_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1287643930460033077
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
https://docs.stripe.com/api/invoices/object#invoice_object-attempt_count
only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
dont we see attempted_count as 1 when taking subscription for the first time other than that manual payment count can be ignored
No, the attempt_count is from the perspective of the payment retry schedule.
okay
is there any fields on the invoice object which i can use to determine if the invoice is attempted to payment but the payment is failed
so that i can use it to make retry logic at our end
You should listen to invoice.payment_failed event
I have listed to payment_intent.payment_failed event
do i need to strictly listen to the event you mentioned
payment_intent.payment_failed will occur for all payment failures, but invoice.payment_failed wil only occur for invoice payment failures
yeah thats a good point to listen to that event. But l just went through the code and have managed with the metadata
with respect to subscription, we need to listen for invoice.* events for the best approach although, payment_intent.* gave us relevant detail
https://docs.stripe.com/billing/subscriptions/webhooks this page gives you a list of billing webhook events that you should listen
and here we are always getting status as open? "invoice.payment_failed"
I don't quite understand your question
in the webhook event response for invoice.payment_failed event, is the status: "open"
If I understand you correctly, you want to get notified when an invoice becomes "open"? if so, listen to invoice.finalized
currently I have used payment_intent.payment_failed event and looks like its wrong event i have listened to
so few failed webhook are missed and the status of the subscription is either pending or paid which is before the failed case
so for now before changing the event from payment_intent.payment_failed to invoice.payment_failed, I wanted to check the invoice listing of subscription and check how may invoices have payment attempted and are failed so that I can show the retry button
So inorder to get this scenario; i thought of using attempt_count but it is not updating so, can I look for the attempted boolean key check if the payment was tried and its failed which i can find by utilizing the key paid boolen key