3DS SDK + MSDK + Your Custom UI

3DS SDK + MSDK + Your Custom UI

This guide describes how to use 3DS SDK in combination with the Mobile SDK (MSDK) and your custom UI. We assume that you already went through base MSDK integration guide and can submit payments. If yes, proceed with the following instructions to enhance payments with the 3D Secure 2 verification.

NOTE: First of all, proper configuration in the Administration Portal should be done to enable 3DS 2 for the specific card brands.



Requirements

  • MSDK 2.62.0 or higher

Import libraries

Initialize the 3DS service

Initialization phase includes pulling actual config data form the Server, collecting device data and performing security checks. All these actions are done in background thread, so start it whenever you want, it won't affect UI thread. It’s recommended to run initialization on checkout process start or even on application start.

We also recommend to look through the Customization guide to check advanced features of the 3DS SDK.

Send authentication params to the Server

After shopper entered card details and clicked Pay, use 3DS service to create 3DS transaction for the specific payment brand. Store a reference to the transaction, it will be needed later to initiate challenge process.

Calling getAuthRequestParams() will encrypt shopper device data and other important information needed for the 3DS Server to authenticate a transaction. It will return JSON string which should be added to the CardPaymentParams class with collected card details (or TokenPaymentParams class if you pay with the stored card). Then proceed with the Submit Transaction step of MSDK integration guide.

Display processing view

It’s also required to show appropriate processing view while communicating with the Server. You can use processing view provided by the SDK.

Handle authentication response

If shopper's card is enrolled for the 3D Secure 2, Server will return 3DS specific information in the threeDS2Info property of the Transaction object. Here you should check if challenge is required or authentication is already done (frictionless flow).

Challenge flow

For the challenge flow you will need to pass authentication response to the 3SD SDK and start the challenge.
The SDK will take care of all communication with the ACS while performing the challenge, as well as prompting the shopper as needed for the required input. When the challenge process is complete, control returns to the app in the one of the ChallengeCallback events. See how it can be implemented in the sample code below.

At last, request payment status to finalize the checkout process, and you're done!