#tonytangplanity

1 messages · Page 1 of 1 (latest)

coral charmBOT
toxic jungle
#

Hi there!

#

As you can see, it returned an error.

#

So there may be an issue in your integration where you don't handle errors correctly

midnight matrix
opal slate
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

#

Our app considered the payment successful
Could you please elaborate on this? What does it mean? Do you have logs the confirm this?

midnight matrix
#

In our database, the payment is marked as successful. As if there was no error during the payment process. I will look for the logs.

opal slate
midnight matrix
#

I don't believe we're using the webhook. I'm waiting for confirmation from my colleague. I looked at the logs and apparently no error was thrown from Stripe. We're using the stripe library from npm.
The creation of the payment intent did not throw any error and then our app considered the payment as successful

opal slate
#

This is wrong, as you should never rely on anything other than the webhook notifications to tell your business logic that a payment was successful or not. Please go through the guide I shared above an let me know if you run into any issues.

midnight matrix
#

So yes, I confirm we're not using the webhook. We're using capturePaymentIntent from the stripe library. Should we still use the webhook ?

opal slate
#

These are 2 different things. With capturePaymentIntent you perform an action, and send a request to Stripe. After we process the payment you will get a webhook event notification payment_intent.succeeded (or payment_intent.payment_failed). This is the recommended flow of information.

midnight matrix
#

Alright. And just so I understand correctly, capturePaymentIntent does throw an error sometimes right ? But we cannot trust it to throw en error every single time ? That's why we must use the webhook ?

opal slate
#

Rather the oposite, it might look like the request was successful but the payment failed. That's why you should look out for those payment_intent.payment_failed webhook events. But also, only fulfill your orders when you receive the payment_intent.succeeded event.

midnight matrix
#

Alright, that's clear to me now. Thank you !

opal slate
#

Happy to help!

coral charmBOT