Search…
Mobile SDKs
Securely collect sensitive cardholder data such as the card number and the 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 the credit card number and cvv code tokenizations 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 or via Cocoapods with pod 'Datatrans'
For Android projects, you can link the repo and dependencies as demonstrated here:
Android implementation
1
repositories {
2
...
3
maven { url 'https://datatrans.jfrog.io/artifactory/mobile-sdk/' }
4
}
5
6
dependencies {
7
...
8
implementation 'ch.datatrans:android-sdk:1.5.1'
9
}
Copied!
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 tokenization has been completed, TokenizationRequestDelegate will contain the tokenizationId and also tell you if a tokenization process was successful, cancelled, 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 the tokens 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.
post
https://api.sandbox.datatrans.com
/v1/tokenizations/{tokenizationId}
GET Token

Examples

Request
Response
1
curl -L -X POST '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 colors in our Mobile SDKs to match your corporate identity. Check the graphic below to see what color properties can be defined. On iOS, you can define your preferred colors within the class ThemeConfiguration. On Android you can set theming options in your project’s color XML resource file, typically colors.xml. Use the color key names as defined in the table below.
Property
Description
Android
iOS
Background Color¹
Background color of the navigation bars. If this is not specified, the navigation bars will be transparent.
barBackgroundColor
dtpl_bar_background_color
Bar Link Color²
Color of the buttons in the navigation bars. If this is not specified, the color will be the color set in Link Color.
barLinkColor
dtpl_bar_link_color
Bar Title Color³
Color of the title within the navigation bars. If this is not specified, the color will be the text color. The text color is either white or black and cannot be customized.
barTitleColor
dtpl_bar_title_color
Button Color
Background color of large buttons, such as the Pay button. If this is not specified, the color will be the color set in Link Color.
buttonColor
dtpl_button_color
Button Text Color
Text color of large buttons, such as the Pay button. If this is not specified, the color will be set to white.
buttonTextColor
dtpl_button_text_color
Link Color
Color of text-only buttons or links and the text cursor. If this is not specified, the link color will be in a blue tone.
linkColor
dtpl_link_color

Language Support

Our iOS and Android Mobile SDK integrations are currently translated and supported in the following languages:
  • English en
  • German de
  • French fr
  • Italian it
Please get in touch should you need an additional language to be added for your checkout or if you find a translation error.