How to write an integration spec for Stripe Strong Customer Authentication

103 views Asked by At

We're updating our applications integration of Stripe to use strong customer authentication. I want to test that our integration triggers the appropriate Javascript when the customer confirms using 3d secure.

The problem that I'm running into is that I'm using the same client secret in multiple tests and the modal will only appear the first time the client secret is used. This is an issue because I don't want to have to complete a full transaction by interacting with the frontend for every test just to test the SCA portion of the integration.

Does anyone know of a workaround for this?

1

There are 1 answers

0
wsw On

@keoghpe, the successfully completed payment_intent client secret could not be reused. However, if you are using testing card such as (4000008260003178) https://stripe.com/docs/payments/cards/testing#regulatory-cards This card number is Stripe testing card which simulates a payment failure. In this case, payment_intent's state machine will be kicked back to be requires_payment_method state which you could reuse the client secret again.