#AdirH
1 messages · Page 1 of 1 (latest)
Hi 👋 can you elaborate? What part of your process are you wanting to handle without webhooks?
I'm trying to implement the following flow:
- Create a customer - successfully done.
- Create a product - successfully done.
- Create a payment method - successfully done.
- Create a price - successfully done.
- Actually charge the customer - the current flow I've tried to implement is to create a PaymentIntent on the server side and confirmCardPayment on the client side, it worked good but the down side is that I have to wait to the "charge.succeeded" webhook in order to be sure that the charge actually succeeded.
We currently don't support on web sockets on our app so I can't know if the payment succeeded or not.
The perfect solution (if exists) for me will be to preform the confirmCardPayment method or something similar and get back in the response some property that indicates to me if the charge succeeded or not.
Is it possible?
Does such option exists?
Thank you in advanced
@eternal oak
I see you mentioned using confirmCardPayment. That function either returns the successful Payment Intent if the confirmation succeeds, or it returns an error if not. This is explained in a bit more detail in the Returns section here:
https://stripe.com/docs/js/payment_intents/confirm_card_payment
Is that sufficient for what you're trying to do, or are you looking for something else?
Yes, I saw it,
It returns the successful Payment Intent if the confirmation succeeds,
but this is not the actual charge confirmation right?
I mean is there an option where I'll get the successful Payment Intent but the "charge" webhook that i'll receive will be different from "charge.succeeded"?
If the underlying Charge fails then the Payment Intent will not move to a succeeded state. Since you're working with cards, you will immediately know whether the payment was successful, and the result of the confirmation request will indicate whether it was successful.
Ok, so in other words, in my case the return of the successful Payment intent, indicates that the charge has been successfully done right?
Correct
Ok ,perfect, thank you very much!
Any time!