#maze260
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Typically, developers rely on webhooks to receive information about the status of the Payment
https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-post-payment
Okay, thank you Hanzo. I guess a webhook is what I now need instead. Would there be an example of how a webhook is coded in JS please?
Additionally, confirmCardPayment returns with a result object
https://stripe.com/docs/js/payment_intents/confirm_card_payment#:~:text=stripe.confirmCardPayment will return,the successful PaymentIntent
which should have the PaymentIntent object as a parameter and you should be able to check the status there too
Oh, well in that case I'm on a good track.
๐
One last thing please ... Is there some info on the possible result statuses of the confirmCardPayment's result object please?
Yes, we have docs on failed payments and errors here
https://stripe.com/docs/declines
https://stripe.com/docs/api/errors#errors-payment_intent
If the payment succeeds then the status would be succeeded otherwise, if it fails then it goes back to requires_payment_method
You can read more about the statuses here too
https://stripe.com/docs/payments/paymentintents/lifecycle#intent-statuses
Cool, thank you Hanzo ๐
NP! ๐ Good luck