Mobile SDK 3D
Mobile SDKs 3D for native Android and iOS apps.
Securely collect sensitive cardholder data such as card number and cvv code in your native iOS or Android app with our new mobile SDKs. Completely outsource your tokenisaton processes to our libraries and benefit from a simple, PCI DSS compliant integration and features such as:
    3D Secure / SCA Ready: The SDK takes over the complexity of the 3DS process
    Smart, secure and state of the art UI components
    Card brand identification and input validation
    Card scanner
    Store payment information for later use and fast checkout. Delegate the token selection to the library
    Theme support: Style various items according your CI / Dark mode support
Please note that it's currently not possible to use this API while sending the 3D Acquiring data dynamically. We're expecting to release this feature later this year.

Distribution & Download

Access the latest version of our SDKs by following the links below and link the latest release to your app projects.
OS
Link
Supported version
iOS
Github: Link
iOS SDK Reference: Link
11 +
Android
JFrog Repository: Link
Android SDK Reference: Link
5.0 +

1. Initial Server-to-Server call

To start a 3D mobile SDK tokenisation you have to call our init API from your server. The response returns a mobileToken which is required to initialise the libraries.
post
https://api.sandbox.datatrans.com
/v1/transactions
Init API
Request
Response
1
curl -L -X POST 'https://api.sandbox.datatrans.com/v1/transactions' \
2
-H 'Authorization: Basic MTEwMDAxNzc4OTpNQUd6UUVEbkVxd001d0Vr' \
3
-H 'Content-Type: application/json' \
4
--data-raw '{
5
"amount": 1000,
6
"currency": "EUR",
7
"refno": "SDK 3D_test",
8
"paymentMethods": [
9
"ECA", "VIS"
10
],
11
"card": {
12
"createAliasCVV": true
13
},
14
"option": {
15
"authenticationOnly": true,
16
"createAlias": true,
17
"returnMobileToken": true
18
}
19
}'
Copied!
1
{
2
"mobileToken": "cca3f978017a694e11e92c10d78e71f302eb982819eaa857"
3
}
Copied!

2. Integrate mobile SDK

Now that you have retrieved a mobileToken, you can continue with the initialization of our iOS or Android SDK. Make sure to call the library with your mobile token to start a transaction. Below is an example of the suggested minimum options to start a transaction with iOS (Swift, Objective-C) and Android (Kotlin, Java). Please read our detailed classes description for iOS and Android to discover more initialization options.
Java
Swift
Objective-C
Kotlin
1
Transaction transaction = new Transaction(mobileToken, aliasPaymentMethods);
2
transaction.setListener(this);
3
transaction.getOptions().setAppCallbackScheme("your_scheme");
4
transaction.getOptions().setTesting(true);
5
transaction.getOptions().setUseCertificatePinning(true);
6
TransactionRegistry.INSTANCE.startTransaction(this, transaction);
Copied!
1
let transaction = Transaction(mobileToken: mobile, aliasPaymentMethods: aliasPaymentMethods)
2
transaction.delegate = self
3
transaction.options.appCallbackScheme = "your_scheme"
4
transaction.options.testing = true
5
transaction.options.useCertificatePinning = true
6
transaction.start(presentingController: navigationController)
Copied!
1
DTTransaction* transaction = [[DTTransaction alloc] initWithMobileToken:mobileToken aliasPaymentMethods:aliasPaymentMethods];
2
transaction.delegate = self;
3
transaction.options.appCallbackScheme = @"your_scheme";
4
transaction.options.testing = YES;
5
transaction.options.useCertificatePinning = YES;
6
[transaction startWithPresentingController:self.navigationController];
Copied!
1
val transaction = Transaction(mobileToken, aliasPaymentMethods)
2
transaction.listener = this
3
transaction.options.appCallbackScheme = "your_scheme"
4
transaction.options.isTesting = true
5
transaction.options.useCertificatePinning = true
6
TransactionRegistry.startTransaction(this, transaction)
Copied!
Once the card details have been collected, the 3D process will be started automatically. If required, the cardholder will be redirected to the website or the banking app of the card issuer to complete a challenge.
After the transaction has been completed, you can refer to the class TransactionSuccess that will return the details of the transaction. If the transaction failed, you will have to refer to the class transactionError for further details instead. You may also implement TransactionDelegate (iOS) and TransactionListener (Android) to be notified when a transaction is successfully finalized, encounters an error, or canceled by the user.

Additional requirement for iOS

For the card scanner to work, a usage description for the camera use will be required in your .plist file. If you do not provide a description for the camera use, the app will crash when starting the card scanner.
.plist File
1
Key : Privacy - Camera Usage Description
2
Value : $(PRODUCT_NAME) requires camera access to scan cards.
Copied!

Step 3: Obtain Tokens & 3D parameters

To obtain the tokens as well as the authentication result, you first need to submit the transactionId returned by the SDK to your server.
Subsequently call the GET Status API from your server together with the transactionId to obtain a token for the card number and the cvv code. Additionally, the API returns a 3D object which contains information about the result of the authentication process.
get
https://api.sandbox.datatrans.com
/v1/transactions/{transactionId}
Status API

Examples

Request
Response
1
curl -X GET \
2
https://api.sandbox.datatrans.com/v1/transactions/190906151210861442 \
3
-H 'Authorization: Basic MTEwMDAxNzY3NTpTejdodE5uSjdNM05YQ0lT' \
Copied!
1
{
2
"transactionId": "210609101239797372",
3
"type": "payment",
4
"status": "authenticated",
5
"currency": "EUR",
6
"refno": "SDK 3D_test",
7
"paymentMethod": "ECA",
8
"detail": {
9
"authorize": {
10
"amount": 1000
11
}
12
},
13
"card": {
14
"alias": "AAABee_Un5_ssdexyrAAAXULTeyzAAe1",
15
"fingerprint": "F-c6FruvXTy36oJPosQUsRCf",
16
"masked": "540400xxxxxx0001",
17
"aliasCVV" : "HemcmX8TTB6Lipr_uF5IwG9M",
18
"expiryMonth": "06",
19
"expiryYear": "25",
20
"3D": {
21
"eci": "02",
22
"xid": "MDAyMTA2MDkxMDEyMzk3OTczNzI=",
23
"cavv": "OTkyMTA2MDkxMDEyNDkwOTc0MDY=",
24
"threeDSVersion": "1.0.2",
25
"cavvAlgorithm": "1",
26
"directoryResponse": "Y",
27
"authenticationResponse": "Y"
28
}
29
},
30
"history": [
31
{
32
"action": "authenticate",
33
"amount": 1000,
34
"source": "api",
35
"date": "2021-06-09T08:12:49Z",
36
"success": true,
37
"ip": "178.238.172.18"
38
}
39
]
40
}
Copied!

Styling the Theme

You can style various options in our Mobile SDKs. Refer to the class ThemeConfiguration to adapt various colours to your corporate identity.

Language Support

Our iOS and Android Mobile SDK integrations are currently translated and supported in the following languages:
English enGerman deFrench frItalian it
Please get in touch should you need an additional language to be added for your checkout or if you find a translation error.
Last modified 4d ago