#yathartha_webhooks

1 messages ¡ Page 1 of 1 (latest)

nocturne ridgeBOT
#

👋 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.

pastel relic
outer tapir
#

dont we see attempted_count as 1 when taking subscription for the first time other than that manual payment count can be ignored

pastel relic
#

No, the attempt_count is from the perspective of the payment retry schedule.

outer tapir
#

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

pastel relic
#

You should listen to invoice.payment_failed event

outer tapir
#

I have listed to payment_intent.payment_failed event

#

do i need to strictly listen to the event you mentioned

pastel relic
#

payment_intent.payment_failed will occur for all payment failures, but invoice.payment_failed wil only occur for invoice payment failures

outer tapir
#

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

pastel relic
outer tapir
#

and here we are always getting status as open? "invoice.payment_failed"

pastel relic
#

I don't quite understand your question

outer tapir
#

in the webhook event response for invoice.payment_failed event, is the status: "open"

pastel relic
#

If I understand you correctly, you want to get notified when an invoice becomes "open"? if so, listen to invoice.finalized

outer tapir
#

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