#jonah11
1 messages · Page 1 of 1 (latest)
It depends on which changes will be made via the user action on web. If it's to confirm the PaymentIntent, then you can simulate by calling Confirm backend too, if that is acceptable for your test
The problem I am trying to solve is confirming the 3ds screen. Eg, I am using one of the test cards that will fail 3ds. But my understanding is that I still have to simulate the 3ds screen, can closing it, or similar. Is there a way to simulate that user interaction entirely via the API, without a headless browser or anything like that? If so, I would much prefer that approach.
I see what you mean, but it's kind of out-of-scope when all those interactions is implemented and tested by stripe.js already. You can just simulate a card has been confirmed correctly, including as if it is 3DS requested, by a simple Confirm via ServerSide
I am not sure I understand you. Here are the docs on confirm:
Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action.
In the case I am testing, won't there be a next_action required for 3ds? I need to "complete" that somehow. That is the crux of my question.
To be clear, I am not trying to test what stripe has tested already. I simply need to complete this step in order to test my own post payment logic on my own backend.
Yes, so you can call https://stripe.com/docs/api/payment_intents/confirm on serverside, pass in for example pm_card_visa for payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
For example in Ruby:
Stripe::PaymentIntent.confirm(
'pi_xxx',
{payment_method: 'pm_card_visa'},
)
pm_card_visa won't require any 3DS
For this test, I need to test a card where 3ds is required, and then I need to fail to pass the challenge.
You mean you want to simulate the failing and passing the 3DS modal?