#sayak_docs

1 messages ¡ Page 1 of 1 (latest)

neat mirageBOT
#

👋 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/1383009164799905802

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

fast elm
#

But what if the payment fails. In that case which api of stripe to call to mark the situation as "failed payment"?
When using send_invoice usualy, you need to send the invoice to the customer in order to pay it... but here why you want to explicitly mark the situation as failed ?

#

If the payment intent failed, and the subscription remains unpaid, its status will be updated accordignly.

#

Without any manual action from your side.

midnight perch
#

When using send_invoice usualy, you need to send the invoice to the customer in order to pay it... but here why you want to explicitly mark the situation as failed ?

the merchant receives the invoice.created as webhooks right?

#

If the payment intent failed, and the subscription remains unpaid, its status will be updated accordignly.

is there a way so that stripe can send the merchant webhooks for unpaid installments so that the merchant can manually trigger payment intents apis ?

fast elm
#

the merchant receives the invoice.created as webhooks right?
Yes.

#

is there a way so that stripe can send the merchant webhooks for unpaid installments so that the merchant can manually trigger payment intents apis ?
Yeah there is the webhook event payment_intent.payment_failed that will be triggered and the event invoice.payment_failed will be triggered if you call the pay endpoint

neat mirageBOT
jagged thistle
#

hello! taking over this thread, let me know if you need anything else

midnight perch
#

when does this webhook - invoice.payment_failed get triggered?

jagged thistle
#

any time payment is attempted on a PaymentIntent associated with the invoice, and that payment fails

#

i actually just ran through a quick test just to be sure - even if you do something like

  1. create the invoice
  2. take the invoice => PaymentIntent => client secret
  3. use the Payment Element to attempt payment on the PaymentIntent, but use one of our declined payment test cards
    it looks like we trigger the invoice.payment_failed webhook event
#

i would expect the same if you do something like backend confirmation (although i haven't tested that yet personally)

#

ok, just for fun i did just test backend confirmation and that also resulted in the event

midnight perch
#

Alright

neat mirageBOT