#BRData

1 messages · Page 1 of 1 (latest)

sand sparrowBOT
wise locust
#

Hello!

#

Ill explain more in this thread:

lost ivy
#

Hey there, you've had a few questions recently about webhook integrations. Can you please provided a very clear summary of exactly what you're trying to achieve now and what isn't doing what you expect it to do?

wise locust
#

Right now I have a webhook that checks if the status = =requires_capture(payment was successful) - if it does then it stores a row in my database with all the information - if it doesnt then it doesnt store anything

#

On my frontend to show the user if the payment was successful or not I am running a loop to check my database for the row that is supposed to be inserted after the webhook call - if it is there a message is displayed saying the payment was successful (it checks the database every 250 miliseconds for 15 seconds)

#

Now here is where my problem is - if the 15 seconds is hit - it is still possible that stripe has not proccecced the payment and my idea is I check the status of the payment on my frontend doing this:

#

var service = new PaymentIntentService();
var options = new PaymentIntentGetOptions { Expand = new List<string> { "payment_method" } };
var result = service.Get(paymentIntent, options, requestOptions);

#

then getting result.Status and grabbing the status for example it could say "Payment Failed" or whatever stripe returns

#

But stripe could also return "Proccessing" if it is still proccessing I will continue to scan my database until the webhook stores something

#

What are the possible status's that it could show that I would need to check for

#

Basically I am looking for a If statement that will cover all possible stripe status if(result.Status == "Payment Failed" || result.Status == "Fraud" etc...){return "Payment Failed"} else if(result.Status == "Proccessing") { continue to scan DB for webhook storage}

lost ivy
#

I should point out that not all payments will go through a requires_capture status step -- many payment method types do not support this auth & capture flow

#

Are you using only cards?

wise locust
#

As of right now I am only using cards but I am planning on using apple pay and google pay in the future but that is it.

#

And I am ONLY using payment holds

lost ivy
#

Ok, sure -- those two also behave like cards

wise locust
#

Awesome - so the main ones I should be checking for in my case are "proccessing" and "canceled" - can it ever be "requires_action"?

#

Along with that question ^ if a payment failed due to a card issue will the status be canceled?

lost ivy
#

Depend on how you process payments, but generally yes requires_action is possible to handle 3DS flows at the banks discretion

#

If you're confirming the payment intent as off_session then its expected that payments requiring 3DS would be declined with authentication_required as the code

wise locust
#

authentication required doesnt seem to be a status that is possible in the doc you sent me

lost ivy
#

No that's a decline code, the the payment intent would be requires_payment_method in that case

wise locust
#

Gotcha - so for payment failure I should be checking "canceled" and "requires_payment_method"

#

does that sound right?

lost ivy
wise locust
#

how do I get that from this: var result = service.Get(paymentIntent, options, requestOptions);

lost ivy
#

You don't