#cnguyen-payment-successful
1 messages · Page 1 of 1 (latest)
Yes, if you get either, the payment is successful
It is common to listen for both and to fullfil the order on whichever you get first
At the very least, listen to the webhook. If the user loses connection at the wrong time it is possible for them to be charged but for the client to not be able to reach out back to your server to notify you of a successful payment
So the best way is to handle it on the first success. So on the front part with the .confirm is successuful
And check again when I received the webhook of payment success.
Right?
@steep lake
Correct. Fulfill when you receive either, but make sure to check that you have not already fulfilled this order
ok thank you
So we are sure à 100% that the payment is good with the confirm on front. I thought that there is edge cas where wa can have that but after it's failed ^^
you're 100% confirmed of a payment on the webhook event
and on the confirmCardPayment ?
can you explain, I don't understand
you said ti me that 100% confirmed of a payment on the webhook
And I would like to know if it's all 100% sure when I received a success event from the confirmCardPayment
And I would like to know if it's all 100% sure when I received a success event from the confirmCardPayment
no you cannot treat confirmCardPayment() as 100%, because your customer might pay but close the page before that Promise resolves
so your webpage won't hear about confirmCardPayment()'s result but the payment still goes through
ok but if the customer don't leave, it's 100% sure that the payment is successfull when I receive the event ?
even if customer leaves, you can only depend on the webhook event
yes it's just to have a double check. That's why I would like to know if it's sure that the payment is successfull when I receive the OK from the confirmCardPayment ?
But ofc, I will double check with the webhook.
It'es just to pass my order from pending to processing if I receive also the confirmCardPayment successfull But I want to be sure that, if I receive this event, it's 100% sure that the payment is good
yes if confirmCardPayment resolves with status: succeeded you can treat that as a successful payment