Mobile SDK
Mobile SDKs 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 tokenisation processes to our libraries and benefit from a simple, fully PCI DSS compliant integration and features such as:
    Smart, secure and state of the art UI components
    Card brand identification and input validation
    Card scanner
    Theme support: Style various items according to your CI
    Dark mode support
This section covers credit card number and cvv code tokenization only. If you need to process 3D-Secure authentication within your SDKs please refer to our SDK 3D integration.

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

2. Integration

As a next step, continue with the initialization of our iOS or Android SDK.
For iOS, you can add the SDK to your project by adding a new package dependency in Xcode. For Android, you can link the dependency with implementation 'ch.datatrans:android-sdk:x.x.x' and the repository with maven { url "repositoryUrl" }.
Create a tokenization object with your merchantId and paymentMethodTypes to start a tokenisation. Below is an example of the suggested minimum options to start a tokenisation with iOS (Swift) and Android (Kotlin, Java). Please read our detailed classes description for iOS and Android to discover more initialization options.
Swift
Kotlin
Java
1
let tokenizationRequest = TokenizationRequest(merchantId: merchantId, paymentMethodTypes: [.Visa, .MasterCard])
2
tokenizationRequest.delegate = self
3
tokenizationRequest.start(presentingController: navigationController)
Copied!
1
val tokenizationRequest = TokenizationRequest(merchantId, [VISA, MASTER_CARD])
2
tokenizationRequest.listener = this
3
TransactionRegistry.startTokenizationRequest(this, tokenizationRequest)
Copied!
1
TokenizationRequest tokenizationRequest = new TokenizationRequest(merchantId, [VISA, MASTER_CARD]);
2
tokenizationRequest.setListener(this);
3
TransactionRegistry.INSTANCE.startTokenizationRequest(this, tokenizationRequest);
Copied!
After the tokenisation has been completed, TokenizationRequestDelegate will contain the tokenizationId and also tell you if a tokenization process was successful, canceled or resulted in an error.

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!

3. Obtain tokens

To obtain the tokenized values, you first need to submit the tokenizationId returned by the SDK to your server.
Subsequently call the GET Token API from your server together with the tokenizationId to obtain a token for the card number and the cvv code. Additionally, the API returns the expiry dates, the fingerprint of the card number as well as the cardInfo object.
get
https://api.sandbox.datatrans.com
/v1/tokenizations/{tokenizationId}
GET Token

Examples

Request
Response
1
curl -L -X GET 'https://api.sandbox.datatrans.com/v1/tokenizations/210329160815401747' \
2
-H 'Authorization: Basic MTEwMDAxNzc4OTpNQUd6UUVEbkVxd001d0Vr' \
3
-H 'Content-Type: application/json'
Copied!
1
{
2
"alias": "AAABeO_NX9LssdexyrAAAQCsDugEAKc5",
3
"fingerprint": "F-dV5V8dE0SZLoTurWbq2HZp",
4
"maskedCard": "424242xxxxxx4242",
5
"aliasCVV": "MnzXPMHJQYebRpmz-WZycWHG",
6
"expiryYear": "21",
7
"expiryMonth": "09",
8
"cardInfo": {
9
"brand": "VISA CREDIT",
10
"type": "credit",
11
"usage": "consumer",
12
"country": "GB",
13
"issuer": "DATATRANS"
14
}
15
}
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