3DS SDK makes it easy to implement native 3D Secure 2 authentication in a mobile application.
NOTE: This guide is specific for the cases when Open Payment Platform (OPP) is not going to be used for some reason. Otherwise, refer to one of the integration types with MSDK.
3DS SDK provides the following features:
Collecting and encrypting user's device data
Performing security checks
Performing challenge process (including presenting UI and communication with ACS)
Features that are NOT included into the scope of SDK:
Performing authentication request to the 3DS Server
iOSAndroid
Requirements
Xcode 11 and iOS 13 SDK
iOS 10.0+ deployment target
SDK min version 19
Import libraries
Import the following frameworks to the project:
ipworks3ds_sdk.xcframework // certified 3DS SDK
OPPWAMobile_ThreeDS.xcframework // wrapper SDK to simplify the integration
Drap and drop ipworks3ds_sdk.xcframework & OPPWAMobile_ThreeDS.xcframework to the "Frameworks" folder of your project. Make sure "Copy items if needed" is checked.
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.
Review your Build Phases:
ipworks3ds_sdk.xcframework & OPPWAMobile_ThreeDS.xcframework are added to the "Link Binary With Libraries".
Import the following two libraries in your project in addition to the base Mobile SDK (File > New > New Module > Import .JAR/.AAR Package).
Then, reference them from your application (File > Project Structure > Dependencies > Add Module Dependency).
ipworks3ds_sdk.aar // certified 3DS SDK
oppwa.mobile.threeds.aar // wrapper SDK to simplify the integration
Also add one extra dependency to the build.gradle if it's not here yet:
Initialization phase includes fetching actual config data from 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.
val paymentBrands = listOf("AMEX", "VISA")
OppThreeDSService.getInstance().initialize(
applicationContext,
TransactionMode.LIVE,
paymentBrands)
We also recommend to look through the Customization guide to check advanced features of the 3DS SDK.
Create 3DS transaction
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.
val transaction: OppThreeDSTransaction = OppThreeDSService.getInstance().createTransaction("AMEX")
Send authentication parameters
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 sent to the Server.
E.g. Platform expects it as threeDSecure.deviceInfo parameter in the payment submission request.
let progressView = try transaction.getProgressView()
progressView.show()
// Later, to hide/close:
progressView.close()
ProgressDialog progressDialog = transaction.getProgressView(activity);
progressDialog.show();
// Later, to hide/dismiss:
progressDialog.dismiss();
val progressDialog: ProgressDialog = transaction.getProgressView(activity)
progressDialog.show()
// Later, to hide/dismiss:
progressDialog.dismiss()
Handle authentication response
If card is enrolled for the 3D Secure 2, Server will return 3DS authentication status and client authentication response which is required for the challenge flow.
Depending on status, start challenge or finish the checkout process:
if ([transactionStatus isEqualToString:@"C"]) {
// start the challenge process to complete user authentication
} else {
// authentication is complete
// request payment status
}
if (transactionStatus == "C") {
// start the challenge process to complete user authentication
} else {
// authentication is complete
// request payment status
}
if (transactionStatus.equals("C")) {
// start the challenge process to complete user authentication
} else {
// authentication is complete
// request payment status
}
if (transactionStatus == "C") {
// start the challenge process to complete user authentication
} else {
// authentication is complete
// request payment status
}
Frictionless flow
Frictionless flow means that authentication is done. The payment will be completed or rejected depending on authentication result and system configuration. Request payment status to get the result of the transaction.
Challenge flow
For the challenge flow you will need to pass clientAuthResponse received from the Server 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.