Complete Checkout with 3DS Challenge - React
Get User Session Details
3DS requires you to pass details about the user’s session, which will be used to analyze likelihood of fraud.
Create a function that gets the required session data.
Initiate Card Checkout using 3DS Params
Make a POST request to the card checkout endpoint and pass the 3ds session parameters.
If the end-user needs to go through a frictioned challenge, this will return a 412, and you will need to retrieve transactionId, creq, and url from the response.
For saved card checkout, change request url to: https://api-sandbox.coinflow.cash/api/checkout/token/YOUR_MERCHANT_ID
If challenge is frictionless, this request will return a paymentId and displaying a challenge is not required
Display the 3DS Challenge Modal
Display a challenge modal to the end-user and pass url creq transactionId and a callback function to handle when the challenge gets completed.
While testing, you may use any random key to complete the challenge.
Make a Subsequent Request to Card Checkout
After the challenge is complete, send a subsequent POST request to Card Checkout, and pass in the transactionId. Challenges that are successful will return a paymentId.
For saved card checkout, change request url to: https://api-sandbox.coinflow.cash/api/checkout/token/YOUR_MERCHANT_ID
Complete the 3DS Challenge and Finalize Checkout
Now it’s time to put everything together!
Initiate a card checkout and watch for any 3DS challenges. If a challenge is required, display it in a modal, and when the challenge is completed, finalize the checkout by making a follow-up call using the transaction ID associated with the challenge.

