#dafrancofl-payment
1 messages · Page 1 of 1 (latest)
if we must process every payment intent asynchronously, even when using confirmCardPayment function on client side
Can you tell me more about what you mean by this? Not sure if this is what you are getting at but we do recommend listening to webhooks for every payment. It is possible for the payment to go through but then for the client to have issues communicating with your server. You can listen for client signals too but it is best to have webooks as a backup.
I don't think we have an SLA for it but it is sent out as soon as the payment succeeds so the delay would be more based on your network.
I mean it may take us seconds to send it out but it should generally be received soon after.
Thanks @vast oriole ! I think you already answer it. Yes, we essentially want to know if payments should be marked as successful only based on payment_intent.succeeded event and avoid relying on js confirmCardPayment function result
Regarding SLA, can we ensure that the webhook event will be triggered by the time confirmCardPayment promise at js library is resolved?
Unfortunately not. It will kind of be a race between the client signal and the webhook
So the typical advice if you are listening to both is to do your fulfillment logic on the first signal you receive and then no-op on the second one
Got it, so confirmCardPayment response is as valid as webhook event, right? I mean, if I get a successful status on js side, then we can ensure the payment succeeded and 'order can be fulfiled', right?
It is, though if the client tells you the payment succeeded you will probably want to retrieve the payment intent just to be sure. Otherwise a bad actor may send a fake success message to try to get free stuff
Got it. Ok that's great. Thanks a lot!!