#1TapElite

1 messages · Page 1 of 1 (latest)

solemn berryBOT
hexed barn
#

You can use Stripe CLI to simulate

#

stripe trigger payment_intent.canceled

#

stripe trigger payment_intent.payment_failed

thorn cliff
#

i have done that and i am getting response on these
But my question is how can test on a real scenario like what I am doing right now is creating a checkout session and then closing down the checkout page
so after closing will i get payment_intent.canceled response ?

hexed barn
#

No you won't. Not immediately.

#

If there's a PaymentIntent created for Checkout session (i.e., there's a payment attempt to this checkout session), then the paymentIntent will be cancelled automatically when the checkout session expires in 24 hours.

thorn cliff
#

okay so a checkout session get expries in 24 hours !

#

so, after 24 hours i will get payment_intent.canceled or payment_intent.payment_failed ?

#

on webhook i am listening to both events.

hexed barn
#

when the checkout session expires, you will get a payment_intent.canceled event

thorn cliff
#

so when i will get this evenet -> payment_intent.payment_failed?

hexed barn
#

When the payment was failed, you can use test card 4000 0000 0000 0002 to test out this flow.

thorn cliff
#

basically It will give me response of wrong card details ?

hexed barn
#

The Checkout page will display the error and you'll also get a payment_intent.payment_failed event.

thorn cliff
#

okay. got it
what about US banks how I will test this simulate this scenario ?

hexed barn
thorn cliff
#

thank you

#

I just tested bank testing using this account

000222222227 pm_usBankAccount_insufficientFunds 110000000 The payment fails due to insufficient funds.

but it does not show any kind of insufficient funds error and payment got successful also !

hexed barn
#

Do you have the checkout session ID?

thorn cliff
#

cs_test_a1x4nQGJrSY1rZD7HEoZ7fkAH2Hlukjj7o7jH3auNBlfwSHTL9ou4VHGs7

hexed barn
thorn cliff
#

okay let me try again with new amount

#

cs_test_a1cNLlSgfm65gOVZbWTRMfsEU1V2elaY9SbhC4HuUuaV5lYgYgn5asLGKz
can you please test this

hexed barn
#

This Payment was not completed and its latest status is requies_action

thorn cliff
#

so which event i should listen to get these scenrio for my webhook

#

?

hexed barn
#

It depends on what you are interested in. If you want to get notified when a paymentIntent is in requires_action status, you can listen to payment_intent.requires_action

thorn cliff
#

on the bank side, I want that if there is any problem with the payment
and payment is not successful then I should get response on webhook
so for this which event i should listen.