#DramaLlama-invoice-events
1 messages ยท Page 1 of 1 (latest)
alternatively I could not listen to invoice.payment_action_required I suppose and just check the flag in payment_failed to see what kind of email to send to the customer
I am curious to why payment_failed event is sent. Strictly speaking the payment hasn't failed right?
It just isn't done processing and needs a manual step
Hey ๐ apologies for the delay, please bear with me a moment while I read through this.
While I do, could you provide a link to the documentation you're referring to, just to make sure we're on the same page (pun intended).
Absolutely!
direct link to the section
Thank you for that, let me double check if there is any other reason a PaymentIntent would go into a requires_action state, other than requiring authentication.
what is the flow you would recomment?
listen to payment_failed, and send action email to customer if requires_action = true
or, ignore payment_failed when requires_action = true and instead also listen to requires_action webhook?
In my opinion, it depends on whether or not you're planning to receive payment_failed for any other reason.
If so, I'd listen to those events and then check the requires_action value inside of the block processing the event.
If you don't plan on doing anything else with payment_failed events, then I'd subscribe to the payment_action_required events instead.
I do use payment_failed to send out an unpaid invoice normally.
Which in truth is what I will do now aswell with action_required. With the one difference that I will have a link in the email
So makes sense that I just listen for payment_failed
Can I just double check my flow with you.
- Recieve payment_failed with requires_action.
- Send email to my customer to link them to a page, and send with the invocie id (that I took from step 1).
- When customer loads page, take invoice id, look up invoice.payment_intent (is that always set?)
- Get payment_intent and get intent.client_secret.
- Now in the view I serve the user I use stripe.js and run stripe.confirmCardPayment(clientSecret)
And that takes care of everything?
Is that a correct flow?
Running through a test scenario to confirm.
Fantastic, thanks!
Thanks for your patience! Those steps looked right, but I just wanted to double check and my test flow using them worked as expected.
awesome, really appreciate the help there!
Then I should be able to finish this rather quick
Is it best practise or at least fine to have
So is it fine to have your invoice id (in_654897789) in the url I email customer
That's fine, it's just an identifier. It's not a sensitive value like the client_secret.
Fantastic!
Then this should be done in a flash, thanks!
Glad to hear! If there is ever anything else we can help with, we'll be here ๐