#venkateshjsoft
1 messages · Page 1 of 1 (latest)
We are having some internal logic to collect renewal payment from the customer.
During this process, if payment failed for any reason (insufficient fund, invalid payment method) we want to retry the payemnt again after certain interval from our system.
I want to know if payment failed during create payment intent what is the status we get it from Stripe
will it give the status immediately or we need to check this through our webhook
Hi! Let me help you with this.
It's best to rely on webhooks. However if you initiate an off-session payment you will also get an immediate error. Depends on your integration.
im initiating off-session payment
what is the status I get it if payment failed
requires_payment_method
requires_confirmation,
requires_action
processing
requires_capture
canceled
succeeded
i dont see any status for failed
You will get an error. If it's an off-session payment it needs to go to succeeded immediately or the request will fail and the PaymentIntent will not be even created.
Yes, depending on what SDK you're using.
because in the offsession mode, we will not pass any payment data (like card number or anything), in that case how can I test this scenario
What are you planning to charge then? You need to pass the Payment Method object to an off-session PaymentIntent for it to succeed
yes we will pass payment method object
when I do first time payment method, I pass the card details
but when I collect next time, I pass only payment method Id with off_session
second time, I cant pass the card details
so I want to know how can I test failure case during the renewal
is it clear?
I am not sure what's your challenge here.
first time i m creating payment intent with valid card number,
with the saved payment method I wan to retry second payment
Correct
but during second payment if the card is invalid or in sufficient fund, how can I test
if card is expired
because im using saved payment method id, i cant change original card details right
If the request fails, you will need to ask your customer to provide another card.
I understand this part
i want to test this scenario before we endup production
is it possible or not?
i want to simulat this behaviour
You want to simulate a failure, you mean?
If so, there's a range of test card numbers that you can use: https://stripe.com/docs/testing#declined-payments
yes but during the second time
first time I can test this value invalid card
when payment is success first time but the card is expired before the second paymwent
how can I test this?
or user doesnt have enough balance
i want to test this specific case
I understand. For this you can use the 3DS enabled test cards: https://stripe.com/docs/testing#regulatory-cards
If you use the "Always authenticate" card, it will fail in the 2nd step, because you can't handle 3DS in off-session payments.
Thanks
sorry to bother you again. is it possible for the user to choose 3DS card or is it something we can control on our end
because for the renewal we cant ask the user to provide card details
3DS prompt is triggered by the issuing bank. Normally, if the card is set up correctly, it's not required for subsequent payments. However, for the sake of testing we provided one test card that will always require 3DS and fail the off-session payments.
can you please share the 3ds card which fail the off-session payment?
The one I mentioned above, the "Always authenticate" one ☝️