The Simplified Interface

Overview

The simplified interface is to give the application developer a single method to perform the complete 3DS flow behind the scenes so she does not care about getting auth parameters, pass them to the backend, parse ARes to find out whether a challenge flow is requested and so on and so forth.

The simplified interface gives a single authenticatemethod that performs the whole 3DS transaction and notifies the application in the end.

Actors & flow diagram

When the simplified interface is used, the mobile uSDKs expect the requestor backend to expose two endpoints. The uSDKs call the endpoints at different moments of a 3DS transaction lifecycle. The two endpoints are:

  • Supported Versions

  • Authenticate

The application needs to pass the two URLs for the endpoints above along with other transaction data in authenticate method as described further in this document.

The endpoints are then called by uSDK in sequence. It first calls the “Supported Versions” endpoint to get one or more Directory Servers for given account number. Then, when a Directory Server is known, it calls “Authenticate” which essentially performs a 3DS transaction.

uSDK will prompt the user to pick a Directory Server if there were more than one returned from the “Supported Versions” endpoint.

Initialization

The initialization is very similar to the one that the pure 3DS interface leverages. The only difference is that there’s an InitSpec argument that incapsulates all the normal parameters.

Android

The complete initialization routine would look like this:

ThreeDS2Service threeDS2Service = new UsdkThreeDS2ServiceImpl(); InitSpec initSpec = new InitSpec(); initSpec.setLicenseKey("<license key"); initSpec.setApplicationContext(context); initSpec.setUiCustomization(); // if UICustomization is necessary InitCallback initCallback = new new InitCallback() { @Override public void onSuccess() { // initialization succeeded } @Override public void onError(Exception exception) { // initialization failed } } threeDS2Service.initialize(initSpec, initCallback);

The example above also shows how the license key is passed to the uSDK

The complete structure of InitSpecis this:

public class InitSpec { // The license key issued by the MSignia administrator private String licenseKey; // An instance of Android application context private Context applicationContext; // Sets a string that represents the locale for the app's user interface. // For example, the value of locale can be "en_US" in Java. // If this parameter is not provided, then the default device locale is used. private String locale; // Returns an UI configuration information that is used to specify // the UI layout and theme. For example, font style and font size. private UiCustomization uiCustomization; // A configuration information that shall be used during initialization. // For example ConfigParameters can be used for passing custom DirectoryServers. private ConfigParameters configParameters; }

iOS

A complete initialization example is this:

let initSpec = UInitSpec( licenseKey: "<license key>", uiCustomization: UUiCustomization(), configParameters: UConfigParameters() ) UThreeDS2ServiceImpl.shared().initialize(spec: initSpec) { (error) in if let error = error { // can flip the logic and use guard let if preferred // handle error return } // no error

The example above also shows how the license key is passed to the uSDK

The structure of InitSpec is this:

Authenticating

When the user makes a purchase, the authenticate method is called.

Android

The method is called like this:

The authSpec argument encloses the parameters the uSDK needs in order to perform a transaction and the authCallback object is what the uSDK calls back when a 3DS transaction completes.

The AuthSpec parameter

The parameter encapsulates all the data the app passes to the uSDK in authenticate method:

The authCallbacks parameter

This is an interface used by the uSDK to call the Android application back when transaction finishes, gets canceled by the user, or gets erred:

The complete example

iOS

The method is called like this:

The authSpec argument encloses the parameters the uSDK needs in order to perform a transaction and the delegate object is what the uSDK calls back when a 3DS transaction completes. The currentViewController parameter is a view controller that will be used to display the SDK’s view controllers (all SDK view controllers are presented modally).

The authSpec parameter

The parameter encapsulates all the data the app passes to the uSDK in authenticate method:

The UAuthenticationDelegate parameter

This is a delegate used by the uSDK to call the iOS application back when transaction finishes, gets canceled by the user, or gets erred:

The complete example

How uSDK calls back from authenticate?

The following diagram explains how the uSDK calls the app back and when. It applies to both Android and iOS platforms.