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 the 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.

Todo Java Script

Requirements

  • MSDK 2.62.0 or higher

Import libraries

ipworks3ds_sdk.xcframework // certified 3DS SDK
OPPWAMobile_ThreeDS.xcframework // wrapper SDK to simplify the integration
There are two versions of the ipworks3ds_sdk.xcframework included: one to be used for development and one for production. The production version includes more strict security measures that would not allow for common development processes to occur, including running with attached debuggers or using simulators/emulators. The deployment version includes _deploy in the filename.
  1. Drap and drop ipworks3ds_sdk.xcframework & OPPWAMobile_ThreeDS.xcframework to the “Frameworks” folder of your project.Make sure “Copy items if needed” is checked.
  2. Embed the frameworks
    • Go to the app target’s General configuration page.
    • Add the frameworks target to the Frameworks, Libraries, and Embedded Content section by clicking the Add icon.
  3. Review your Build Phases:
    • ipworks3ds_sdk.xcframework & OPPWAMobile_ThreeDS.xcframework are added to the “Link Binary With Libraries”.
You can now import frameworks with:
@import OPPWAMobile_ThreeDS;
@import ipworks3ds_sdk;

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 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.

Getting authRequestParams 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 OPPCardPaymentParams class with collected card details (or OPPTokenPaymentParams 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 OPPTransaction 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 OppThreeDSChallengeCallback 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!

Note: Android

Requirements

  • MSDK 2.62.0 or higher

Import libraries

ipworks3ds_sdk.aar // certified 3DS SDK
oppwa.mobile.threeds.aar // wrapper SDK to simplify the integration
There are two versions of the ipworks3ds_sdk.aar included: one to be used for development and one for production. The production version includes more strict security measures that would not allow for common development processes to occur, including running with attached debuggers or using simulators/emulators. The deployment version includes _deploy in the filename.
2. Add the module and required dependencies to the build.gradle:
// this name must match the library name defined with an include: in your settings.gradle file
implementation project(":ipworks3ds_sdk")
implementation project(":oppwa.mobile.threeds")

implementation "androidx.constraintlayout:constraintlayout:x.x.x"

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.

Getting authRequestParams 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!