# Technical documentation MDC SDK

## Introduction

### Basic abbreviations and definitions

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-description-fc"><tbody><tr><th class="confluenceTh mceSelected">**Field**</th><th class="confluenceTh mceSelected">**Description**</th></tr><tr><td class="confluenceTd mceSelected">FCM</td><td class="confluenceTd mceSelected">Firebase Cloud Messaging

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">DC</td><td class="confluenceTd mceSelected" colspan="1">Data Core</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">MDC</td><td class="confluenceTd mceSelected" colspan="1">Mobile <span class="inline-comment-marker" data-ref="41e1cb0e-23bd-4434-b47c-5305160244e6">DC</span> module

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">MPA</td><td class="confluenceTd mceSelected" colspan="1">Mobile Payment Application

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">UCP</td><td class="confluenceTd mceSelected" colspan="1">Verestro Cloud Payments</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">IBAN</td><td class="confluenceTd mceSelected" colspan="1">Back Account Number</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">JWT</td><td class="confluenceTd mceSelected" colspan="1">Json Web Token</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">JWE</td><td class="confluenceTd mceSelected" colspan="1">Json Web Encryption</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">OTP</td><td class="confluenceTd mceSelected" colspan="1">One-time password</td></tr></tbody></table>

### What is Mobile DC SDK?

The Mobile DC SDK is a core module dedicated to the management of users, devices, and cards in the Verestro system.

Usage of other Verestro modules (f.e. UCP - Verestro Claud Payment) always depends on this SDK and Mobile DC must be always used.

### Versioning and backward compatibility

SDK version contains three numbers. For example: 1.0.0.

- <span class="inline-comment-marker" data-ref="46f6c1d4-dfa6-4eef-9534-5d67a64f05e4">First version digit tracks compatibility-breaking changes in SDK public APIs. It is mandatory to update the application code and to use SDK when this is incremented.</span>
- Second version digit tracks new, not compatibility-breaking changes in the public API of SDK. It is optional to update the application code when this digit is incremented.
- The third version digit tracks internal changes in SDK. No updates in the application code are necessary to update to the version, which has this number incremented.

Changes not breaking compatibility:

- Adding a new optional interface to SDK setup.
- Adding a new method to any domain.
- Adding new ENUM value to input or output.<span class="inline-comment-marker" data-ref="72e32c34-1e2c-42be-bfae-d5ee3d3181e9">  
    </span>
- <span class="inline-comment-marker" data-ref="72e32c34-1e2c-42be-bfae-d5ee3d3181e9">Adding a new field in the input or output model.</span>

## <span class="inline-comment-marker" data-ref="72e32c34-1e2c-42be-bfae-d5ee3d3181e9">Technical overview</span>

<span class="inline-comment-marker" data-ref="72e32c34-1e2c-42be-bfae-d5ee3d3181e9">This section describes basic information about Mobile DC SDK, SDK setup, and available methods.</span>

### <span class="inline-comment-marker" data-ref="72e32c34-1e2c-42be-bfae-d5ee3d3181e9">Basic configuration</span>

**Artifactory**

SDK is available on the Verestro maven repository and can be configured in a project using the Gradle build system.

**The username and password are provided by Verestro.**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="4d87e775-bd2f-4fa9-a47a-a4d754e863ce" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-repositories%7B-maven-"><tbody><tr><td class="wysiwyg-macro-body">```
repositories{
	maven {
		credentials {
			username "<enter_username_here>"
			password "<enter_password_here>"
		}
	url "https://artifactory.upaid.pl/artifactory/libs-release-local/"
}
```

</td></tr></tbody></table>

**Versions**

<span class="inline-comment-marker" data-ref="2f78929c-873f-45c6-8a92-0c5a8e815328">Mobile DC SDK is available in two versions: debug and release</span>.

The difference between versions is debugged version allows to use of an application with a debugger connected.

Debug version is ended with appendix "-debug" in version name. Samples below:

<span class="inline-comment-marker" data-ref="3b381b18-7363-4c81-8740-e75f51f1e219">For release version, used on production environment in application uploaded to Google Play:</span>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="08424b55-6596-4ffc-8619-f4611df66259" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-dependencies%7B-implem"><tbody><tr><td class="wysiwyg-macro-body">```
dependencies{
	implementation 'pl.upaid.module:mobiledc:{version}'
} 
```

</td></tr></tbody></table>

<span class="inline-comment-marker" data-ref="c491e291-f133-4f1f-b644-c593573b36e9">Debug version - could be used for application development:</span>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="5a1ab960-8df9-47db-a46b-a7f7166c6101" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-dependencies%7B-implem-0"><tbody><tr><td class="wysiwyg-macro-body">```
dependencies{
	implementation 'pl.upaid.module:mobiledc:{version}-debug'
}
```

</td></tr></tbody></table>

**Min SDK Version**

The minSdkVersion must be at least 23 (Android 6.0). In case of using SDK on lower Android API version declare in the application manifest.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8772f259-4b73-431d-a965-a0dc5cc3b0eb" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%3Cuses-sdk-tools%3Aover"><tbody><tr><td class="wysiwyg-macro-body">```
  <uses-sdk tools:overrideLibrary= "pl.upaid.module.ucp, 
    pl.upaid.module.mobiledc, pl.upaid.module.mcbp,
    pl.upaid.module.security, com.mastercard.mpsdk, pl.upaid.nativesecurity" />
```

</td></tr></tbody></table>

SDK cannot be initialized on a lower Android API version, and none of the SDK methods should be used on it.

**Android APIs 31+**

Android Worker uses PendingIntent which causes some problems with the newest Android APIs. To resolve this problem application Gradle dependency configuration must override this dependency.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="60bc9361-5af9-4961-86bb-f4a29db8f7bf" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-dependencies%7B-implem-1"><tbody><tr><td class="wysiwyg-macro-body">```
dependencies{
	implementation 'androidx.work:work-runtime-ktx:2.7.1'
} 
```

</td></tr></tbody></table>

Native libs extraction in AndroidManifest and Gradle.

Native libs should be packaged in application in uncompressed form due to security reasons.

This solution is also recommended by Google due to the smaller app install and download size.

Note: Starting from Android Gradle Plugin 4.2 an attribute is replaced with parameter `<span class="pln">android.packagingOptions.jniLibs.useLegacyOptions</span>`.

  
If you need to package native libraries in the compressed form please contact Verestro.

Recommended solution when using Verestro SDK below:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="5a9fd133-e48b-4fc8-922e-baf18a81edbd" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fandroidmanifest.xm"><tbody><tr><td class="wysiwyg-macro-body">```
//AndroidManifest.xml

<application
    android:extractNativeLibs="false"
    ... >
</application>
```

</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="9d30133f-7177-4af6-9d24-d599d94f2931" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fbuild.gradle-andro"><tbody><tr><td class="wysiwyg-macro-body">```
//build.gradle

android {
    packagingOptions {
        jniLibs {
            useLegacyPackaging false
        }
    }
}
```

</td></tr></tbody></table>

```


```

**Source code obfuscation and optimization**

As SDK is written in Kotlin the language we recommend adding following code to Gradle configuration:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="cd915575-cc6d-4123-9c81-6f58583354ed" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-android-%7B-...-kotlin"><tbody><tr><td class="wysiwyg-macro-body">```
android {
	...	 
	kotlinOptions {
    	freeCompilerArgs = [
        	    '-Xno-param-assertions',
        	    '-Xno-call-assertions',
        	    '-Xno-receiver-assertions'
    	]
	}

	packagingOptions {
    	exclude '/kotlin_metadata/**'
	}
	...
}
```

</td></tr></tbody></table>

And use the newest tools for code shrinking, optimization, and obfuscation from Google by enabling R8 instead Proguard in the *gradle.properties* file:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="af2de44e-2280-4dd2-8ef5-c8b15964baac" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-android.enabler8%3Dtru"><tbody><tr><td class="wysiwyg-macro-body">```
android.enableR8=true
```

</td></tr></tbody></table>

**Android permissions**

**QUERY\_ALL\_PACKAGES**

Module declares the usage of permission QUERY\_ALL\_PACKAGES, which is required since Android API 30 to list packages available on the device.  
Permission is used for security tasks.

On 20.07.2022 Google Play introduced restrictions on high-risk permissions and the application sender could be obliged to send more information about this permission usage.

The application which uses this permission is usually a bank or financial institution - in such case permission may be granted to usage.  
Read more [https://support.google.com/googleplay/android-developer/answer/10158779?hl=en](https://support.google.com/googleplay/android-developer/answer/10158779?hl=en)

In case of lack of agreement from Google Play permission could be removed on the application side AndroidManifest.xml file.  
When removed application should declare package visibility to search known root packages.

<u>In case of removing this permission please contact Verestro representative.</u>

<u>  
</u>

Sample code to remove QUERY\_ALL\_PACKAGES permission in the AndroidManigest.xml file and package visibility declaration:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="95dca755-c865-43dd-8f4c-bb0491ce689f" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%3Cmanifest-package%3D%22c"><tbody><tr><td class="wysiwyg-macro-body">```
<manifest package="com.sampleapp">
	
	<!-- remove permission from manifest -->
	<uses-permission
    	android:name="android.permission.QUERY_ALL_PACKAGES"
    	tools:ignore="QueryAllPackagesPermission"
    	tools:node="remove" />

	<!-- declare application visibility -->
	<queries>
        <package android:name="com.noshufou.android.su" />
        <package android:name="com.noshufou.android.su.elite" />
        <package android:name="eu.chainfire.supersu" />
        <package android:name="com.koushikdutta.superuser" />
        <package android:name="com.thirdparty.superuser" />
        <package android:name="com.yellowes.su" />
        <package android:name="stericson.busybox" />
        <package android:name="com.topjohnwu.magisk" />
        <package android:name="com.koushikdutta.rommanager" />
        <package android:name="com.koushikdutta.rommanager.license" />
        <package android:name="com.dimonvideo.luckypatcher" />
        <package android:name="com.chelpus.lackypatch" />
        <package android:name="com.ramdroid.appquarantine" />
        <package android:name="com.ramdroid.appquarantinepro" />
        <package android:name="com.android.vending.billing.InAppBillingService.COIN" />
        <package android:name="com.chelpus.luckypatcher" />
        <package android:name="com.devadvance.rootcloak" />
        <package android:name="com.devadvance.rootcloakplus" />
        <package android:name="de.robv.android.xposed.installer" />
        <package android:name="com.saurik.substrate" />
        <package android:name="com.zachspong.temprootremovejb" />
        <package android:name="com.amphoras.hidemyroot" />
        <package android:name="com.amphoras.hidemyrootadfree" />
        <package android:name="com.formyhm.hiderootPremium" />
        <package android:name="com.formyhm.hideroot" />
        <package android:name="org.projectvoodoo.otarootkeeper" />
    </queries>
```

</td></tr></tbody></table>

### MDC SDK Size

The size of SDK is dependent on the apk distribution system.

The table below shows the size of the module for apk and bundle file.

<table class="wrapped relative-table confluenceTable" id="bkmrk-format-size-notes-ap"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Format**</th><th class="confluenceTh">**Size**</th><th class="confluenceTh" colspan="1">**Notes**</th></tr><tr><td class="confluenceTd">APK</td><td class="confluenceTd">~15,1 MB</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">Bundle</td><td class="confluenceTd" colspan="1">~2,5 MB - ~3,6 MB</td><td class="confluenceTd" colspan="1">Ranged size depends on the ABI of the device.

SDK contains native libraries used by different ABI. By using a bundle only the necessary version of the native library will be downloaded to a device.

</td></tr></tbody></table>

<span class="inline-comment-marker" data-ref="71f32ad2-2cb9-4467-b639-71582fb7508d">Additional information</span>

- size from the table above is referred to release version;
- size depends on configured proguard (module provides consumer progurd rules);

### MDC SDK usage

This chapter describes the structure and basic usage of Mobile DC SDK.

#### Domains

Every described facade is divided into domains with different responsibilities.

Available domains:

- Cards.
- User.
- Device.
- CloudMessaging.
- TransactionsHistory.

Every domain contains domain-related methods.

#### Facade

The facade is an entry point to communication with Mobile DC SDK.

Contains an SDK initialization method and domains which allows to manage Verestro account.

#### Multiple facade types

Mobile DC SDK provides three public APIs with the same functionalities, the APIs are:

- MobileDcApiJava for projects which use Java programming language.
- MobileDcApiKotlin for projects which use Kotlin programming language.

The difference between the APIs is a way of providing data to SDK methods and getting the results from them.

Input and output as information data are always the same.

This documentation presents I/O types in a Kotlin way as it’s easier to mark nullable fields (as a question mark).

#### Method structure

Every method described in documentation has same structure.

**Execution type:**

- Asynchronous - Operation could take more time and method is called on thread different than main. The result of execution is provided in callback (described below).
- Synchronous - Result of operation is provided as method return type.

**Method type:**

- Online - Operation requires internet connection.
- Offline - Operation can be called without internet access.

**Input**

Input parameters with name, description and validation rules. For some methods input is result of different uPaid method.

**Output**

If present is delivered in success callback with data described below.

**Callbacks**

- Success callback - Depends on used programming language and facade type <span class="toc-item-body">[Multiple facade types.](https://wiki.verestro.com/pages/viewpage.action?pageId=67340674)</span> <span class="inline-comment-marker" data-ref="4b21e998-1763-4a1f-98f3-ace7533c14f0">s</span> onSuccess or success callback inform about operation success.
- Success callback with data - Callback with additional result object.
- Failure callback - Informs about failure. Contains information about exception ([Error handling.](https://wiki.verestro.com/pages/viewpage.action?pageId=67340690)). Exception can contains additional details.

**Sample usage:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="34e8edd0-f624-46c0-832e-0e3f50232cb6" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fjava-sample-cardss"><tbody><tr><td class="wysiwyg-macro-body">```
//java sample

cardsService.getAll(
        new SuccessDataCallback<List<Card>>() {
            @Override
            public void onSuccess(List<Card> cards) {
                //show cards on UI
            }
        }, new FailureCallback() {
            @Override
            public void onFailure(@NotNull Throwable throwable) {
                //show error
            }
        });

SuccessDataCallback and FailureCallback could be replaced by lambda like in kotlin sample below

//kotlin sample

cardsService.getAll({ cards ->
    //show cards on UI
}, {
    //show error
})
```

</td></tr></tbody></table>

#### Error handling

SDK returns errors by exceptions, which could be caught by the application and shown on UI with a detailed message.

**Note:** Exception message is only information for a developer and shouldn't be shown on the application UI to the user. Use reason code to add a suitable message on the application layer.

 The table below describes exceptions types.

<table class="relative-table wrapped confluenceTable" id="bkmrk-exception-type-excep" style="width: 100%;"><colgroup><col style="width: 10%;"></col><col style="width: 20%;"></col><col style="width: 69.876543%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Exception type**</th><th class="confluenceTh">**Exception class**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">SDK Validation</td><td class="confluenceTd">ValidationException</td><td class="confluenceTd">Every parameter provided in method is validated locally by SDK. For example, card number is validated with Luhn algorithm

Exception object contains field reason with detailed error code

</td></tr><tr><td class="confluenceTd">Backend</td><td class="confluenceTd">BackendException</td><td class="confluenceTd">Provides additional validation or error on backend side

Exception object contains field *reasonCode* and *message*

Application should get reason code and show suitable message or made action

Message should be never shown to user. Could be logged for error reporting and for developers

List of available raeson in table below

</td></tr><tr><td class="confluenceTd" colspan="1">Internal Sdk</td><td class="confluenceTd" colspan="1">CoreSdkException</td><td class="confluenceTd" colspan="1">Provides additional information about error in SDK

Exception object contains field reason and message

Application should get reason code and show suitable message or made action

Message should be never shown to user. Could be logged for error reporting and for developers

List of available raeson in table below

</td></tr><tr><td class="confluenceTd">Process related</td><td class="confluenceTd">-</td><td class="confluenceTd">As every process is different some methods could throw specified exception. Types of exception is described in method description

</td></tr><tr><td class="confluenceTd" colspan="1">Network</td><td class="confluenceTd" colspan="1">NetworkConnectionException</td><td class="confluenceTd" colspan="1">Provide information about network connection error. Check table with possible reasons below</td></tr><tr><td class="confluenceTd" colspan="1">Internal</td><td class="confluenceTd" colspan="1">UnknownException</td><td class="confluenceTd" colspan="1">For unknown errors in SDK process</td></tr></tbody></table>

**BackendException error codes**

<table id="bkmrk-reason-code-descript" width="100%"><tbody><tr><td>**Reason code**

</td><td>**Description**

</td></tr><tr><td width="24%">INTERNAL\_ERROR

</td><td width="75%">Error occurred on server

</td></tr><tr><td width="24%">CRYPTOGRAPHY\_ERROR

</td><td width="75%">Error occurred during cryptography operation

</td></tr><tr><td width="24%">VALIDATION\_ERROR

</td><td width="75%">Client sent invalid data

</td></tr><tr><td width="24%">CARD\_NO\_OUTSIDE\_RANGE\_BINS

</td><td width="75%">Card number is outside of preconfigured range

</td></tr><tr><td width="24%">CARD\_KIND\_LIMIT\_REACHED

</td><td width="75%">Card kind limit reached

</td></tr><tr><td width="24%">CARD\_DELETED

</td><td width="75%">Card was deleted and operation cannot be proceed

</td></tr><tr><td width="24%">FAIL\_3DS\_VERIFICATION

</td><td width="75%">3ds verification failed

</td></tr><tr><td width="24%">FAIL\_AUTHORIZATION

</td><td width="75%">Fail authorization - error from card verification

</td></tr><tr><td width="24%">TRANSACTION\_DENIED

</td><td width="75%">Transaction denied - error from card verification

</td></tr><tr><td width="24%">FAIL\_AUTHENTICATION

</td><td width="75%">Invalid username or password

</td></tr><tr><td width="24%">CARD\_EXPIRED

</td><td width="75%">Card expired

</td></tr><tr><td width="24%">LIMITS\_EXCEEDED

</td><td width="75%">Limit of transactions has been exceeded

</td></tr><tr><td width="24%">REJECTED\_BY\_BANK

</td><td width="75%">Current transaction has been rejected by bank - error from card verification

</td></tr><tr><td width="24%">INSUFFICIENT\_FOUNDS

</td><td width="75%">There is no enough founds on card to complete this transaction

</td></tr><tr><td width="24%">INVALID\_JWS\_TOKEN

</td><td width="75%">Specified JWS token is invalid

</td></tr><tr><td width="24%">INVALID\_FCM\_TOKEN

</td><td width="75%">Given FCM token is invalid

</td></tr><tr><td width="24%">OPERATION\_NOT\_SUPPORTED

</td><td width="75%">Method is not allowed

</td></tr><tr><td width="24%">CANT\_FIND\_USER

</td><td width="75%">Cannot find user by requested identifier

</td></tr><tr><td width="24%">CANT\_FIND\_CARD

</td><td width="75%">Cannot find card by requested identifier

</td></tr><tr><td width="24%">CANT\_FIND\_DEVICE

</td><td width="75%">Cannot find device by requested identifier

</td></tr><tr><td width="24%">CANT\_FIND\_WPIN

</td><td width="75%">Cannot find wallet pin

</td></tr><tr><td width="24%">CANT\_FIND\_ADDRESS

</td><td width="75%">Cannot find requested address

</td></tr><tr><td width="24%">CANT\_FIND\_INVITATION

</td><td width="75%">Cannot find invitation for the requested resource

</td></tr><tr><td width="24%">RESOURCE\_NOT\_FOUND

</td><td width="75%">Cannot find requested resource

</td></tr><tr><td width="24%">USER\_IS\_LOCKED

</td><td width="75%">Requested user is locked

</td></tr><tr><td width="24%">CARD\_IS\_LOCKED

</td><td width="75%">Requested card is locked

</td></tr><tr><td width="24%">DEVICE\_PERMANENTLY\_LOCKED

</td><td width="75%">Requested device is locked

</td></tr><tr><td width="24%">DEVICE\_TEMPORARILY\_LOCKED

</td><td width="75%">Requested device is temporary locked

</td></tr><tr><td width="24%">BAD\_LOGIN\_LIMIT\_REACHED

</td><td width="75%">Number of incorrect login attempts is reached

</td></tr><tr><td width="24%">BAD\_WPIN\_LIMIT\_REACHED

</td><td width="75%">Requested user is temporary locked

</td></tr><tr><td width="24%">SMS\_FAILCOUNT\_REACHED

</td><td width="75%">Sms fail count limit reached

</td></tr><tr><td width="24%">TOO\_MANY\_REQUESTS

</td><td width="75%">Too Many Requests

</td></tr><tr><td width="24%">CARD\_IS\_ALREADY\_VERIFIED

</td><td width="75%">Requested card has been verified

</td></tr><tr><td width="24%">USER\_IS\_NOT\_VERIFIED

</td><td width="75%">User is not verified. E.g. User had registered already however did not finish the verification step and is trying to pair/login

</td></tr><tr><td width="24%">PAYMENT\_ALREADY\_SUCCESS

</td><td width="75%">Requested payment has been already finished

</td></tr><tr><td width="24%">INVALID\_CARD

</td><td width="75%">Card is invalid for this payment

</td></tr><tr><td width="24%">USER\_HAS\_NOT\_SET\_A\_PASSWORD

</td><td width="75%">Requested user has not set password

</td></tr><tr><td width="24%">DEVICE\_LIMIT\_REACHED

</td><td width="75%">Number of device is reached

</td></tr><tr><td width="24%">BAD\_WPIN

</td><td width="75%">The wallet pin does not match the requested user

</td></tr><tr><td width="24%">SMS\_LIMIT\_EXCEEDED

</td><td width="75%">Number of sent messages has reached the limit. Please try again later

</td></tr><tr><td width="24%">FAIL\_COUNT\_LIMIT\_REACHED

</td><td width="75%">Attempt limit has exceeded

</td></tr><tr><td width="24%">INITIALIZE\_PROCESS\_REQUIRED

</td><td width="75%">Fail count limit has been reached and new process has not been initialized

</td></tr><tr><td width="24%">INVALID\_AUTHORIZATION\_AMOUNT

</td><td width="75%">Authorization amount is incorrect

</td></tr><tr><td width="24%">CLIENT\_UNAUTHORIZED

</td><td width="75%">Client of the api is unauthorized(invalid/expired *X-Client-Auth* token)

</td></tr><tr><td width="24%">USER\_UNAUTHORIZED

</td><td width="75%">User is unauthorized

</td></tr><tr><td width="24%">VERIFICATION\_FAILED

</td><td width="75%">Requested card could not be verified

</td></tr><tr><td width="24%">CARD\_NOT\_ENROLLED

</td><td width="75%">Card does not participate in 3ds v2, please use 3ds v1

</td></tr><tr><td width="24%">INVALID\_AUTHENTICATION\_ID

</td><td width="75%">Authentication process id does not match card id

</td></tr></tbody></table>

**BackendException - additional error codes** **related to TransactionsHistoryService**

<table id="bkmrk-reason-code-descript-0"><tbody><tr><td>**Reason code**

</td><td>**Description**

</td></tr><tr><td>TRANSACTION\_ATTACHMENT\_STATUS\_APPROVED

</td><td>Cannot update transaction or store new attachment. Attachment status in transaction is APPROVED

</td></tr><tr><td>MAX\_ATTACHMENTS\_COUNT

</td><td>Maximum number of attachments for given transaction

</td></tr><tr><td>MAX\_ATTACHMENT\_SIZE\_EXCEEDED

</td><td>Maximum attachment size exceeded

</td></tr><tr><td>EMPTY\_ATTACHMENT

</td><td>Empty attachment file

</td></tr><tr><td>EMPTY\_ATTACHMENT\_NAME

</td><td>Empty attachment file name

</td></tr><tr><td>NOT\_SUPPORTED\_ATTACHMENT\_FILE\_TYPE

</td><td>Attachment file type is not supported

</td></tr><tr><td>CANT\_FIND\_TRANSACTION\_ATTACHMENT

</td><td>Cannot find transaction attachment

</td></tr></tbody></table>

**CoreSdkException error codes INTERNAL\_ERROR**

<table class="relative-table wrapped confluenceTable" id="bkmrk-reason-code-descript-1"><colgroup><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Reason code</th><th class="confluenceTh">Description</th></tr><tr><td class="confluenceTd">DEVICE\_NOT\_PAIRED</td><td class="confluenceTd">Device is not paired or trying to call the method without device pairing</td></tr><tr><td class="confluenceTd">SAFETYNET\_ERROR</td><td class="confluenceTd">An error during device authentication in Google SafetyNet service</td></tr><tr><td class="confluenceTd">PUSH\_INVALID\_SOURCE</td><td class="confluenceTd">Relates to push processing process. Push message should be consumed in another module

</td></tr><tr><td class="confluenceTd">PUSH\_INVALID\_PUSH\_CONTENT</td><td class="confluenceTd">Cannot process push message. The message is invalid or some process failed

</td></tr><tr><td class="confluenceTd" colspan="1">BIOMETRIC\_AUTHENTICATION\_NOT\_ENABLED</td><td class="confluenceTd" colspan="1">Biometric public key is invalid</td></tr><tr><td class="confluenceTd" colspan="1">BIOMETRIC\_AUTHENTICATION\_ABORTED</td><td class="confluenceTd" colspan="1">Cannot authenticate biometric signature</td></tr><tr><td class="confluenceTd" colspan="1">KEYSTORE\_IS\_NOT\_SECURE</td><td class="confluenceTd" colspan="1">Keystore is not secure. The device is not secured with PIN, pattern or password</td></tr><tr><td class="confluenceTd" colspan="1">CANNOT\_GET\_PUBLIC\_KEY</td><td class="confluenceTd" colspan="1">Internal error during SDK processing</td></tr><tr><td class="confluenceTd" colspan="1">SECURITY\_EVENT\_OCCURRED</td><td class="confluenceTd" colspan="1">Security event occurred during application usage. Data is cleared and the method can't be used.

Application is always informed about a security issue with onSecurityIssueAppeared callback initialized in setup() method

</td></tr><tr><td class="confluenceTd" colspan="1">PIN\_AUTHENTICATION\_FAILURE

</td><td class="confluenceTd" colspan="1">Provided PIN is invalid</td></tr><tr><td class="confluenceTd" colspan="1">PIN\_AUTHENTICATION\_FAILURE\_LIMIT\_EXCEEDED

</td><td class="confluenceTd" colspan="1">PIN fail count is reached, every next try PIN authentication will finish with this status</td></tr><tr><td class="confluenceTd" colspan="1">PIN\_AUTHENTICATION\_NOT\_POSSIBLE

</td><td class="confluenceTd" colspan="1">PIN authentication is not possible until the user is at least once logged online with PIN</td></tr><tr><td class="confluenceTd" colspan="1">PIN\_AUTHENTICATION\_INTERNAL\_ERROR

</td><td class="confluenceTd" colspan="1">Something went wrong</td></tr><tr><td class="confluenceTd" colspan="1">PAIRING\_IS\_ALREADY\_IN\_PROGRESS</td><td class="confluenceTd" colspan="1">Another pairing is now processed</td></tr><tr><td class="confluenceTd" colspan="1">PAYMENT\_INSTRUMENT\_DEFAULT\_NOT\_FOUND</td><td class="confluenceTd" colspan="1">No default payment instrument for contactless payment found</td></tr><tr><td class="confluenceTd" colspan="1">PAYMENT\_INSTRUMENT\_NOT\_FOUND</td><td class="confluenceTd" colspan="1">Payment instrument with this id cannot be found in SDK</td></tr><tr><td class="confluenceTd" colspan="1">APPLICATION\_PROCESS\_NOT\_KILLED</td><td class="confluenceTd" colspan="1">Application process is not killed after SDK reset</td></tr><tr><td class="confluenceTd" colspan="1">TOKEN\_NOT\_ACTIVE</td><td class="confluenceTd" colspan="1">Required token status is ACTIVE</td></tr><tr><td class="confluenceTd" colspan="1">PAYMENT\_INSTRUMENT\_NOT\_FOUND</td><td class="confluenceTd" colspan="1">Token with that id was not found in SDK</td></tr><tr><td class="confluenceTd" colspan="1">API\_SERVICE\_NOT\_INITIALIZED</td><td class="confluenceTd" colspan="1">API service was not initialized</td></tr><tr><td class="confluenceTd" colspan="1">DIGITIZATION\_NOT\_STARTED</td><td class="confluenceTd" colspan="1">Digitization of that payment instrument was not started</td></tr></tbody></table>

**NetworkConnectionException error codes**

<table class="relative-table wrapped confluenceTable" id="bkmrk-reason-code-descript-2"><colgroup><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Reason code**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">UNKNOWN\_HOST</td><td class="confluenceTd">Host is unreachable, check network connection and try again later

</td></tr><tr><td class="confluenceTd">SOCKET\_TIMEOUT</td><td class="confluenceTd">Connection timeout, check network connection and try again later</td></tr><tr><td class="confluenceTd" colspan="1">UNKNOWN\_HTTP\_ERROR</td><td class="confluenceTd" colspan="1">An unknown HTTP error</td></tr></tbody></table>

###   


### Firebase Cloud Messaging configuration 

**Dependency**

Add Firebase Cloud Messaging dependency entry to build.gradle.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="db5f2755-0880-497f-9476-19a1d5b50f56" data-macro-name="code" data-macro-parameters="language=groovy" data-macro-schema-version="1" id="bkmrk-...-implementation%28%27"><tbody><tr><td class="wysiwyg-macro-body">```
...

implementation('com.google.firebase:firebase-messaging:22.0.0')

...
```

</td></tr></tbody></table>

**Initializing**

All parameter required to initialize FCM can get from firebase console.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a889a0e2-4935-47f6-a995-60019e513f28" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-val-firebaseoptions-"><tbody><tr><td class="wysiwyg-macro-body">```
val firebaseOptions =
            FirebaseOptions
                .Builder()
                .setApplicationId(applicationId)
                .setGcmSenderId(senderId)
                .setProjectId(projectId)
                .setApiKey(apiKey)
                .build()
FirebaseApp.initializeApp(this, firebaseOptions)
```

</td></tr></tbody></table>

To initialize two FCM projects should add name parameter for second one.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="4a727d1a-1274-488b-89cf-1d51e3d51422" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-%2F%2Finit-default-proje"><tbody><tr><td class="wysiwyg-macro-body">```
//init default project
FirebaseApp.initializeApp(this, firebaseOptions)
 
//init additional project
FirebaseApp.initializeApp(this, firebaseOptionsOther, otherProjectName)
```

</td></tr></tbody></table>

**Getting FCM registration token**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="cafa42ff-f701-4850-ba04-e10dac60da34" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-%2F%2Fgetting-token-for-"><tbody><tr><td class="wysiwyg-macro-body">```
//getting token for default project
FirebaseMessaging.getInstance().token
    .addOnCompleteListener {
        //handle token
    }
  
  
//getting token for additional project
val messaging = FirebaseApp.getInstance("other").get(FirebaseMessaging::class.java)
messaging.token.addOnCompleteListener {
    //handle token
}
```

</td></tr></tbody></table>

### Security processes overview

This document contains short information about security mechanisms used by SDK. Only high-level functions are described, without technical specifications.

Security processes were designed to protect its assets, and ensure that the application using our product is installed on a safe environment.

SDK security mechanism starts just after initialisation of library. Because of process optimalization part of checks are made only once, other are called periodically.

**Process check**

Implementation of checking application process is one of many methods that SDK uses to protect itself from hooking tools.

It is based on validating app\_process file, checking if it was not manipulated, or corrupted. Many popular hooking tools used nowadays uses that method to upload its hooks, modules, or cloaks over adding root access. Validating that file helps in analysis potential threats from hazardous software, and even checking root acces.

**Root check**

Checking root access is one of SDK most important security processes. SDK is analysing application enviromnent in following ways:

- Searching for harmful binaries:  
    SDK analyses device in search for commonly known binaries indicating that device is rooted. Additionally in this step there are checked some binaries connected to hooking tools.

- Checking system partitions permissions:  
    SDK validates if some paths(commonly connected with root access), along with some common system directories are writtable on specific partition.
- Validating installed packages :  
    SDK analyses installed application on device in search for apps known to be connected with root access, apps requiring root, and root cloak apps.  
    Android 11 introduced some changes reducing visibility of other packages installed on device. To keep checking harmful application there is added additional android permission: <span class="devsite-heading">QUERY\_ALL\_PACKAGES</span>
- Checking rom settings:  
    Analyses device rom properties, to search for flags set on rooted devices.
- Checking su existance:  
    Checks is *su* directory accessible in some common paths.

**Emulator check**

SDK validates application installment device by analyzing its properties and searching for evidences indicating that device is emulator.

**Other packages check**

Searches for well known applications connected with harmful hooking tools.

Especially aimed into finding evidences of *magisk*.

**Debug check**

<span class="inline-comment-marker" data-ref="312b2529-54f3-44c1-bd06-49f6cdf0684b">Simple check is debugger connected, based on OS properties. Used only in *release* version.  
</span>

**SafetyNet Api - deprecated from version 2.3.17**

API tool used for protecting application from tampering, harmful applications, and validating device OS. It availability depends on project configuration.

Usage of this process is configured od server side. If end application already performs this process it could be disabled during project configuration.

**Play Integrity API**

Due to Safetynet Attestation API planned deprecation it's replaced by Play Integrity API in Mobile DC version 2.13.7.

API tool used for protecting application from tampering, harmful applications, and validating device OS. It availability depends on project configuration.

Usage of this process is configured od server side. If end application already performs this process it could be disabled during project configuration.

When used, Play Integrity API must be enabled Google Play Developer Console - [https://developer.android.com/google/play/integrity/setup#enable-responses](https://developer.android.com/google/play/integrity/setup#enable-responses).

**<span class="inline-comment-marker" data-ref="52d8f089-a5c6-48fb-b7c6-303e6c3866fb">Error codes handling in application</span>**

<span class="inline-comment-marker" data-ref="52d8f089-a5c6-48fb-b7c6-303e6c3866fb">Table describes error codes which could be handled on application side with message to user about possible problem.</span>

<span class="inline-comment-marker" data-ref="52d8f089-a5c6-48fb-b7c6-303e6c3866fb">Other error codes cannot be handled on application side.  
</span>

<table class="relative-table wrapped confluenceTable" id="bkmrk-code-meaning-80a1-de"><colgroup><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Code**</th><th class="confluenceTh">**Meaning**</th></tr><tr><td class="confluenceTd">80a1</td><td class="confluenceTd">Device is rooted</td></tr><tr><td class="confluenceTd">80b1</td><td class="confluenceTd">SDK cannot be used on emulator</td></tr><tr><td class="confluenceTd" colspan="1">811a</td><td class="confluenceTd" colspan="1">User has installed some harmful application on device</td></tr><tr><td class="confluenceTd" colspan="1">8a9b</td><td class="confluenceTd" colspan="1">User has attached debugger during SDK usage</td></tr></tbody></table>

### Application Isolated Process

**Overview**

Starting from Mobile DC SDK version 2.4.3 SDK provides additional security checks which could be enabled in [setup.](https://wiki.verestro.com/pages/viewpage.action?pageId=67340696) method using "withOptionalDeveloperOptions" and enableAdditionalSecurityChecks parameter.

For some security processes SDK need to start services marked as *isolatedProcess* to ensure more security by splitting application from a security layer.  
It may cause problems with initialize Application as this service will run under a special process that is isolated from the rest of the system and has no permissions of its own.

To avoid problems, check if application start from isolated process and do not invoke any additional action in your Application::onCreate.

**Sample implementation**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e9e5b08c-8900-4344-8a6e-8214aefafb3c" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-%2F%2Fmobile-dc-setup-co"><tbody><tr><td class="wysiwyg-macro-body">```
//Mobile DC setup configuration for enableAdditionalSecurityChecks 

val developerOptions = DeveloperOptions()
developerOptions.enableAdditionalSecurityChecks = true

MobileDcApiConfigurationBuilder()
 	// other require configuration
    .withOptionalDeveloperOptions(developerOptions)


//Sample Application declaration for handing isolated process

class SampleApplication : Application {

    override fun onCreate() {
        super.onCreate()

        if (isIsolatedProcess()) {
            return
        }
		
		//sample methods called in application
        startKoin()
        initializeMobileDcModule()
        initUcpModule()
        initFirebase()
		//other methods..
    }


	private fun isIsolatedProcess(): Boolean {
    	return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
        	android.os.Process.isIsolated()
    	} else {
        	try {
            	val activityManager = getSystemService(ACTIVITY_SERVICE) as ActivityManager
            	activityManager.runningAppProcesses
            	false
        	} catch (securityException: SecurityException) {
            	securityException.message?.contains("isolated", true) ?: false
        	} catch (exception: Exception) {
            	false
        	}
    	}
	}
}
```

</td></tr></tbody></table>

This functionality is introduced to protect against magisk tool.

Magisk gives root access using daemon, which starts with system booting, with unrestricted SELinux context. When specific application needs access to /su it connects to daemon unix socket, process of granting access access is managed with Magisk Manager application.

Magisk Hide function hides /sbin paths for specific process, what obscures magisk presence in /proc/pid/mounts. This problems is solved with isolated processes introduced in android 4.1. They are started with new, fresh SELinux context without any permissions, what keeps magisk from removing it paths with /sbin. From this process view there is possibility to check mounted paths and find evidences of magisk presence.

### Data signing and encryption

#### Configuration

**Signing Data Configuration**

Signature will be verified using public key certificate which was signed by preconfigured Root CA. DN from the certificate will be also validated. Root CA and DN will be set during onboarding. Client has two options:

- provide Root CA and DN of the public key certificate for the private key which already has and use this private key for signing data.
    
    <table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b03719a2-8b60-4892-91ee-092f9d72f551" data-macro-name="info" data-macro-schema-version="1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">DN cannot change during certificate renewals and all intermediate certificates should be placed in JWT</p>
    
    </td></tr></tbody></table>
- generate csr where `CN=Signature-${uniqueClientName}`. Csr will be signed by uPaid. Client needs to use private key for signing from key pair used to generate csr.

**Encryption Data Configuration**

If the client decide to encrypt data, public key certificate from RSA 2048 should be set during onboarding. Public key certificate can be self-signed.

**Signed Data Verification**

<span class="inline-comment-marker" data-ref="a72b8cd0-8cb4-482a-b4ef-d9f6070660c8">Some methods requires signed data verification on client side. Public key certificate from RSA 2048 will be provided during onboarding and should be used for signature validation.</span>

#### Data Encryption

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b871d406-e912-44c5-8233-d9ebef041cb4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-some-data-like-token"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Some data like Token Verification Code can be encrypted using JWE per RFC 7516.</p>

</td></tr></tbody></table>

Configured(see *Encrypting Data Configuration* *in Confoguration chapter*) public key certificate will be used to encrypt CEK(Content Encryption Key).

**Algorithm used for encryption:**

<table class="wrapped confluenceTable" id="bkmrk-jwe-header-name-desc"><colgroup><col></col><col></col><col></col></colgroup><thead><tr><th class="confluenceTh">**JWE header**</th><th class="confluenceTh">**Name**</th><th class="confluenceTh">**Description**</th></tr></thead><tbody><tr><td class="confluenceTd">alg

</td><td class="confluenceTd">RSA-OAEP-256

</td><td class="confluenceTd">Cryptographic algorithm used to encrypt CEK

</td></tr><tr><td class="confluenceTd">enc

</td><td class="confluenceTd">A256GCM

</td><td class="confluenceTd">Identifies the content encryption algorithm used to perform authenticated encryption

</td></tr></tbody></table>

Payload of the JWE will be json formatted object.

Client needs to perform decryption with private key using standard JWE library.

**Sample code which shows how to decrypt JWE for given encryptedData and privateKey**:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="31629ebf-8702-4275-87e4-4c27fa4f8550" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-rsajwedecrypte"><tbody><tr><td class="wysiwyg-macro-body">```
class RsaJweDecrypter {

    @Throws(Exception::class)
    fun decrypt(encryptedData: String, privateKey: PrivateKey): ByteArray {
        val parse = JWEObject.parse(encryptedData)
        parse.decrypt(RSADecrypter(privateKey))
        return parse.payload.toBytes()
    }
}
```

</td></tr></tbody></table>

#### Data Signing

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0f9af74f-2b85-42ef-bf64-6e86cad825bc" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-some-fields-are-sign"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Some fields are signed using JWT per RFC 7519.</p>

<p class="callout info">Data signing should be done on **server side**.</p>

</td></tr></tbody></table>

JWTs are composed of three sections: a header, a payload (containing a claim set), and a signature.

The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding.

The JWT’s header, payload, and signature are concatenated with periods (.). As a result, a JWT typically takes the following form:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="9a464607-d8e1-44cc-b7bc-1a8281fb4b28" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%7Bbase64url-encoded-h"><tbody><tr><td class="wysiwyg-macro-body">```
{Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature}
```

</td></tr></tbody></table>

Object fields should be placed as claims in the token. Moreover there are some additional required claims that are needed to protect against replay attack:

<table class="relative-table wrapped confluenceTable" id="bkmrk-name-description-iat"><colgroup><col></col><col></col></colgroup><thead><tr><th class="confluenceTh">**Name**</th><th class="confluenceTh">**Description**</th></tr></thead><tbody><tr><td class="confluenceTd">iat

</td><td class="confluenceTd">The time at which the JWT was issued. UNIX Epoch timestamp, in seconds

</td></tr><tr><td class="confluenceTd">jti

</td><td class="confluenceTd">JWT ID - unique identifier for the JWT

</td></tr></tbody></table>

JWT tokens have TTL which is validated against "issued at" time from claims (iat). TTL is 10 minutes.

JWT tokens should be signed using private key from the RSA 2048 key pair (see *Signing Data Configuration in Configuration chapter*).

**JWT tokens must have additional header:**

<table class="wrapped relative-table confluenceTable" id="bkmrk-name-description-x5c"><colgroup><col></col><col></col></colgroup><thead><tr><th class="confluenceTh">**Name**</th><th class="confluenceTh">**Description**</th></tr></thead><tbody><tr><td class="confluenceTd">x5c

</td><td class="confluenceTd">Parameter contains the X.509 certificates chain ([RFC7515#section-4.1.6](https://tools.ietf.org/html/rfc7515#section-4.1.6))

</td></tr></tbody></table>

This chain will be validated against preconfigured Root CA. DN from the public key certificate(from key pair which private key was used for signing) will be also validated (See *Signing Data Configuration in Configuration chapter*).

**Sample code which shows how to build JWT for given claims, certificates and <span class="inline-comment-marker" data-ref="ecf63aeb-038d-46ac-9817-5d6c3953661b">private key</span>:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6900e1a9-b7cf-44a9-bc57-fa69c825c59e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-jwtgenerator-%7B"><tbody><tr><td class="wysiwyg-macro-body">```
class JwtGenerator {
    
    fun generate(
        jwtClaimsSet: JWTClaimsSet,
        certificates: List<X509Certificate>,
        privateKey: PrivateKey
    ): String {

        val claims = buildFinalClaims(jwtClaimsSet)

        val certChains = certificates
            .map { it.encoded }
            .map { Base64.encode(it) }

        val jwsHeader = JWSHeader.Builder(JWSAlgorithm.RS256)
            .x509CertChain(certChains)
            .build()

        val signer = RSASSASigner(privateKey)

        val jwsObject = JWSObject(
            jwsHeader,
            Payload(claims.toJSONObject())
        )

        jwsObject.sign(signer)

        return jwsObject.serialize()
    }


    private fun buildFinalClaims(jwtClaimsSet: JWTClaimsSet): JWTClaimsSet {

        val epochSeconds = Instant.now().epochSecond

        return JWTClaimsSet
            .Builder(jwtClaimsSet)
            .claim("iat", epochSeconds)
            .jwtID(UUID.randomUUID().toString())
            .build()
    }
}
```

</td></tr></tbody></table>

####   


#### Signed data verification

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0f9af74f-2b85-42ef-bf64-6e86cad825bc" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-some-fields-are-sign-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Some fields are signed on Wallet Server using JWT per RFC 7519.</p>

</td></tr></tbody></table>

Wallet Server signs some data in response and signature has to be verified before this data are used. Data are signed using JWT per RFC 7519. JWTs are composed of three sections: a header, a payload (containing a claim s<span class="inline-comment-marker" data-ref="4d70d56f-9aec-4f85-b8ea-be05fedf4ff9">et) and a</span> signature.

The header and payload are JSON objects, which are serialized to UTF-8 bytes, then encoded using base64url encoding.

The JWT's header, payload, and signature are concatenated with period<span class="inline-comment-marker" data-ref="dc5c8de3-d76b-47f4-9208-8eb6009774b5">s (.).</span>  
As a result, a JWT typically takes the following form:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="9a464607-d8e1-44cc-b7bc-1a8281fb4b28" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%7Bbase64url-encoded-h-0"><tbody><tr><td class="wysiwyg-macro-body">```
{Base64url encoded header}.{Base64url encoded payload}.{Base64url encoded signature}
```

</td></tr></tbody></table>

Specific object fields are placed as claims in the JWT token.  
Moreover there are some additional claims that are added to the JWT token to protect against replay attack:

<table class="relative-table wrapped confluenceTable" id="bkmrk-name-description-iat-0"><colgroup><col></col><col></col></colgroup><thead><tr><th class="confluenceTh">**Name**</th><th class="confluenceTh">**Description**</th></tr></thead><tbody><tr><td class="confluenceTd">iat

</td><td class="confluenceTd">The time at which the JWT was issued. UNIX Epoch timestamp, in seconds

</td></tr><tr><td class="confluenceTd">jti

</td><td class="confluenceTd">JWT ID - unique identifier for the JWT

</td></tr></tbody></table>

JWT tokens are signed using private key from the RSA 2048 key pair. <span class="inline-comment-marker" data-ref="9308531d-9232-4579-89aa-f28262b12909">Public key certificate will be shared as part of configuration</span> of given project and public key should be used for signature validation.

JWT tokens have additional header:

<table class="relative-table wrapped confluenceTable" id="bkmrk-name-description-kid"><colgroup><col></col><col></col></colgroup><thead><tr><th class="confluenceTh">**Name**</th><th class="confluenceTh">**Description**</th></tr></thead><tbody><tr><td class="confluenceTd">kid

</td><td class="confluenceTd">fingerprint of public key which's corresponding private key was used to sign data calculated as sha1Hex(publicKeyBytes)

</td></tr></tbody></table>

**Sample code which shows how to verify signed JWT:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6900e1a9-b7cf-44a9-bc57-fa69c825c59e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-jwtverifier-%7B-"><tbody><tr><td class="wysiwyg-macro-body">```
class JWTVerifier {

        fun verify(
            signedData: String,
            rsaPublicKey: RSAPublicKey,
            iatToleranceSeconds: Long
        ): JWTClaimsSet {
            
            val signedJWT = SignedJWT.parse(signedData)
            val signatureResult = signedJWT.verify(RSASSAVerifier(rsaPublicKey))
            if (!signatureResult) {
                throw ValidationException("Invalid signature")
            }
            
            val jwtClaimsSet = signedJWT.getJWTClaimsSet()
            
            //optionally check iat with tolerance
            val isIatInAllowedTimeRange = jwtClaimsSet
                .getIssueTime()
                .toInstant()
                .plusSeconds(iatToleranceSeconds)
                .isAfter(Instant.now())
            
            if (!isIatInAllowedTimeRange) {
                throw ValidationException("Signed JWT expired")
            }
            
            return jwtClaimsSet
        }
    }
```

</td></tr></tbody></table>

### APK Certificate

#### <span class="inline-comment-marker" data-ref="5f483f08-8d5d-4eb7-8ca2-b0cd05969c24">About APK certificate</span>

Verestro provides mechanism which ensures that authorized entities using Verestro SDKs.

To achieve that apk certificate needs to configured during onboarding.

Apk Certificate is binded to given client id, if customer uses many applications then many apk certificates digest should be provided and for each client id will be given by Verestro.

#### <span class="inline-comment-marker" data-ref="a90e9d05-e6d2-455d-a804-09a18d422df9">Calculate APK certificate digest</span>

You can sign your application using self managed key, or let Google Play sign using Google Play managed keys:

- APK or Bundle <span class="inline-comment-marker" data-ref="fecb3c49-8400-44c3-b34c-cd68ae083da6">signing</span> key (aka "upload key").
- Google Play signing key (optional, may be enabled and configured in Google Play Console).

If you update key, you must follow steps below again and provide key to representative uPaid person.

Please check your installation package and follow the outlined steps.

#### <span class="inline-comment-marker" data-ref="3c2c1300-d689-42c2-9c4d-992750885ecc">Using own APK Signing Key</span>

<span class="inline-comment-marker" data-ref="8475f843-6276-4896-98b0-7bf420f058b5">When</span> signing apk in android studio only, please follow the steps below:

1\. Convert java keystore (eg. cert.jks) used to sign APK to p12 format using following command:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="ec4fd0e9-d9a1-4dae-b9c3-c096b6e79868" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-keytool--importkeyst"><tbody><tr><td class="wysiwyg-macro-body">```
keytool -importkeystore -srckeystore cert.jks -destkeystore cert.p12 -srcstoretype jks -deststoretype pkcs12
```

</td></tr></tbody></table>

2\. Convert obtained p12 file (eg. cert.p12) to pem format using following command:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="88fe1b0b-8bd3-4467-ab7b-af4248e2a0d6" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-openssl-pkcs12--noke"><tbody><tr><td class="wysiwyg-macro-body">```
openssl pkcs12 -nokeys -in cert.p12 -out cert.pem
```

</td></tr></tbody></table>

#### <span class="inline-comment-marker" data-ref="e11ef677-15eb-49d4-ab5d-1cf0cc9913ea">Using Google Play Signing Key</span>

When signing application in Google Play console(whenever you uploaded own key, or used one that was automatically generated by Google), please follow steps below:

1. Add .apk or .aab file in google play console.
2. Select "Let Google create and manage my app signing key (recommended)" and press Continue.  
    [![google app sign key.png](https://developer.verestro.com/uploads/images/gallery/2022-11/scaled-1680-/google-app-sign-key.png)](https://developer.verestro.com/uploads/images/gallery/2022-11/google-app-sign-key.png)
3. In the application panel in the menu look for release management option.
4. Select app signing section.  
      
    [![app_signing.png](https://developer.verestro.com/uploads/images/gallery/2022-11/scaled-1680-/app-signing.png)](https://developer.verestro.com/uploads/images/gallery/2022-11/app-signing.png)
5. Download the certificate from App signing certificate section.  
      
    [![app sing cert.png](https://developer.verestro.com/uploads/images/gallery/2022-11/scaled-1680-/app-sing-cert.png)](https://developer.verestro.com/uploads/images/gallery/2022-11/app-sing-cert.png)
6. Convert downloaded certificate from der to pem format using following command:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a944e1de-9b6a-4e37-878a-e75e62facb50" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-openssl-x509--inform"><tbody><tr><td class="wysiwyg-macro-body">```
openssl x509 -inform der -in deployment_cert.der -out certificate.pem
```

</td></tr></tbody></table>

### Recommended MPA data protection mechanisms

- <span class="inline-comment-marker" data-ref="81d37bf4-4aea-4518-9b6e-bb272c4a58a6">Code obfuscation:</span>  
    Code obfuscation is basic, and one of the most efficient application protection mechanism. Obfuscating code saves your app from static code analysis, exploring your code in search of vulnerabilities, that can be used by hooking software. There are many tools used for obfuscation nowadays, the most popular are proguard and its successor - R8. If you are using Kotlin in your project, R8 is a better option for you. It is also important to keep app architecture supporting obfuscation, using obfuscation tools is as simple as your architecture is adjusted to it.
- Disable logs &amp; turning off debugging:  
    It is very important to remember turning off logging data and disable debugging in your production application. Data printed in logs in development process should never be available in release application. It is recommended to manage printing it from one place, to not 'forget' removing every single of them.
- Input data validation:  
    Input data should be validated on every level of app structure, it reduces risk of processing some unwanted, or even harmful data. It is recommended to clean sensitive data that is no longer useful, we advise to not use string to keep it. String is immutable, data stored in it can later be accessed by dumping application memory. We recommend using **char\[\]**, and overwriting it when it is no longer useful.
- Prevent taking screenshot:  
    We recommend adding a mechanism that prevents taking screenshots, and recording your application. It protects you from harmful applications getting users inputted data.
- Prevent copy/paste :  
    Input taking sensitive data such as user password should not have the ability to copying and pasting in it. Storing it in clipboard expose it for copying, or modifying by harmful applications, even if it was initially encrypted it is plaintext when the user copies it.
- Prevent screen overlay:  
    It is recommended to protect MPA from applications that have the possibility to overlay it. Not securing it may result with recording user data.
- Checking the installer:  
    MPA should implement a mechanism that will check installer of application. It should check if the application is downloaded from Google Play, preventing it from possibility of tampering installation binary.
- Checksum mechanism:  
    Implementing checking checksum mechanism is a very efficient way to check if your application was not tampered. It should compare checksum of your application, prepared after generating app with data send by your app after installing it on device. It bases on the fact that every generated application have different checksum, comparing it can ensure you that your server is communicating with the app released by you.
- Removal redundant permissions:  
    It is important to keep in your app only used permissions. You should not give your application access to components, that it not requires.
- Network security configuration:  
    MPA should use network security configuration application customize their network security settings(for example protection application from usage of cleartext traffic) in declarative configuration file without modifying app code.

### Models

#### LimitedResourceInfo

<table class="confluenceTable" id="bkmrk-parameter-type-descr"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">xRateLimitLimit</td><td class="confluenceTd">Int</td><td class="confluenceTd">Limit of requests until resource will be locked</td></tr><tr><td class="confluenceTd" colspan="1">xRateLimitRemaining</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Remaining amount of requests</td></tr><tr><td class="confluenceTd" colspan="1">retryAfter</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Seconds until lock expires</td></tr><tr><td class="confluenceTd" colspan="1">xRateLimitReset</td><td class="confluenceTd" colspan="1">Long</td><td class="confluenceTd" colspan="1">Lock expiration timestamp - epoch in seconds</td></tr></tbody></table>

### External libraries

The SDK uses several external Apache 2.0 libraries:

- com.nimbusds:nimbus-jose-jwt
- commons-codec:commons-codec
- com.fasterxml.jackson.core:jackson-core
- com.fasterxml.jackson.core:jackson-annotations
- com.fasterxml.jackson.core:jackson-databind
- com.fasterxml.jackson.module:jackson-module-kotlin
- io.insert-koin:koin-android
- io.reactivex.rxjava2:rxjava
- io.reactivex.rxjava2:rxandroid
- com.squareup.retrofit2:adapter-rxjava2
- com.squareup.retrofit2:retrofit
- com.squareup.retrofit2:converter
- com.squareup.okhttp3:logging
- com.squareup.okhttp3:okhttp

## MDC SDK Setup

### Setup

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="03d404e5-9701-4720-b451-d3766b4aa2ff" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline. Mobile DC initialization method. Contains all necessary data to configure SDK.</p>

<p class="callout info">Should be called at very beginning of application lifecycle. For example in Android Application::onCreate method.</p>

<p class="callout info">**Note:** Please be aware to use this method before usage of any MobileDC methods or another Verestro product.</p>

</td></tr></tbody></table>

#### Input

Mobile DC different configuration options depending on SKD usage.

Configuration is provided by builder in facade method named *setup*.

All builder methods without *optional* keyword in method name are required.

**<span class="inline-comment-marker" data-ref="00efe6b4-e058-46e7-adab-5d29955fa882">Available configurations methods</span>:**

- setup(MobileDcCoreConfiguration)
- setup(MobileDcApiConfiguration)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b1c7c216-5aa8-46a8-b76d-eed73ef0ad94" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-sdk-event-listeners-"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">**SDK Event Listeners - errors catching**</p>

<p class="callout info">The application should prevent throwing exceptions in MDC SDK Event Listeners described below as it could cause breaking process in SDK.</p>

<p class="callout info">In case of error in application event listener implementation SDK runs this code in try-catch block.</p>

</td></tr></tbody></table>

**MobileDcCoreConfiguration**

Used when usage of uPaid product doesn't require Verestro backend system (f.e. UCP with External Wallet Server).

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-parameter-des" style="width: 100%;"><colgroup><col style="width: 27.901235%;"></col><col style="width: 24.814815%;"></col><col style="width: 28.395062%;"></col><col style="width: 18.765432%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Method**</th><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">withApplicationContext</td><td class="confluenceTd">Context</td><td class="confluenceTd">Application context</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">withWalletSecurityEventListener</td><td class="confluenceTd">WalletSecurityEventListener

</td><td class="confluenceTd">Global listener for security events

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">withOptionalLogger</td><td class="confluenceTd">EventsLogger</td><td class="confluenceTd">Handler for secure logging of sdk events</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">withOptionalDeveloperOptions</td><td class="confluenceTd">DeveloperOptions

</td><td class="confluenceTd">Additional options for developers</td><td class="confluenceTd">  
</td></tr></tbody></table>

**MobileDcApiConfiguration**

Used when applicaton use Mobile DC API for user data management.

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-parameter-des-0" style="width: 100%;"><colgroup><col style="width: 20.864198%;"></col><col style="width: 18.888889%;"></col><col style="width: 45.925926%;"></col><col style="width: 14.320988%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Method**</th><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">withApplicationContext</td><td class="confluenceTd">Context</td><td class="confluenceTd">Application context</td><td class="confluenceTd">Not null</td></tr><tr><td class="confluenceTd">withMobileDcConnection  
Configuration

</td><td class="confluenceTd">MobileDcConnection  
Configuration

</td><td class="confluenceTd">Mobile DC API connection configuration delivered by uPaid

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">withWalletSecurityEventListener</td><td class="confluenceTd">WalletSecurityEventListener

</td><td class="confluenceTd">Global listener for security events

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">withOptionalWalletPin  
Configuration</td><td class="confluenceTd">MobileDcWalletPin  
Configuration</td><td class="confluenceTd">Wallet Pin configuration in SDK</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">withOptionalLogger</td><td class="confluenceTd">EventsLogger</td><td class="confluenceTd">Handler for secure logging of sdk events</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">withOptionalDeveloperOptions</td><td class="confluenceTd">DeveloperOptions</td><td class="confluenceTd">Additional options for developers</td><td class="confluenceTd">  
</td></tr><tr><td>withOptionalCloudMessaging  
Configuration  
</td><td>MobileDcCloudMessaging  
Configuration

</td><td>Interface for providing cloud messaging configuration like actual registration token  
</td><td>  
</td></tr></tbody></table>

**MobileDcConnectionConfiguration**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-0"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">url</td><td class="confluenceTd">String</td><td class="confluenceTd">Url for mobile DC environment in which SDK connect.  
Depending on the deployment model the Wallet Server can be deployed on the Customer infrastructure or provided by uPaid.  
Different for development and production environment.  
For more details please contact uPaid representative.

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">pinningCertificates</td><td class="confluenceTd">List&lt;String&gt;</td><td class="confluenceTd">List of public key certificate in PEM associated with host server.  
Certificate is used for certificate pinning during connection to Wallet Server.  
Certificate is associated with the Wallet Server and like the url its value depends on the deployment model.

  
When used services hosted on uPaid side please contact uPaid representative.

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">clientId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Each customer has a unique client id it's different for development and production environment.

ClientId should be provided by uPaid representative.

</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**MobileDcWalletPinConfiguration**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-1"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">pinFailCount</td><td class="confluenceTd">Int</td><td class="confluenceTd">Number of possible fails in offline pin verification

</td><td class="confluenceTd">Greater then 0</td></tr></tbody></table>

**WalletSecurityEventListener**

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-name-paramete"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Method** </th><th class="confluenceTh">**Parameters**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">onSecurityIssueAppeared</td><td class="confluenceTd">EventSecurityIssueAppeared  
(tag: Int, code: Int, message:String)

</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="cd5144a0-5bb7-4d9b-924c-0091f7ebae32">Information about security issue. Due to security requirements this message isn’t readable for user</span>

<span class="inline-comment-marker" data-ref="cd5144a0-5bb7-4d9b-924c-0091f7ebae32">When using setup(MobileDcApiConfiguration) SDK reports event instantly to server (when internet is available). Could be also catched on application side and reported by client.</span>

<span class="inline-comment-marker" data-ref="cd5144a0-5bb7-4d9b-924c-0091f7ebae32">Some error codes could be properly handled in application [Security processes overview](https://wiki.verestro.com/display/UCP/Security+processes+overview)  
</span>

</td></tr></tbody></table>

**EventsLogger**

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-name-paramete-0" style="width: 100%;"><colgroup><col style="width: 11.851852%;"></col><col style="width: 15.679012%;"></col><col style="width: 72.345679%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Method** </th><th class="confluenceTh">**Parameters**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">onEvent</td><td class="confluenceTd">onEvent(eventId:Int)</td><td class="confluenceTd">Callback to trace list of events that occured in SDK (those are secure aliases - event as Integer). You can collect 'em in ordered list and store to be accesible in case of errors/exceptions.

</td></tr></tbody></table>

**DeveloperOptions**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-2" style="width: 100%;"><colgroup><col style="width: 20.617284%;"></col><col style="width: 10%;"></col><col style="width: 69.259259%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">allowDebug</td><td class="confluenceTd">Boolean

</td><td class="confluenceTd">Determine AndroidManifest *android:debuggable* state in *&lt;application&gt;*scope.

When configured as true SDK verifies combination of SDK production(without -debug) version and *android:debuggable*=true.

</td></tr><tr><td class="confluenceTd" colspan="1">enableAdditionalSecurityChecks</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Enables additional security checks in application required during EMV Security Evaluation.

Enabling requires additional action on application side, refer to [Application Isolated Process](https://wiki.verestro.com/display/UCP/Application+Isolated+Process) to get more details.  
  
Added in version 2.4.3.

</td></tr><tr><td class="confluenceTd" colspan="1">enableCodeObfuscationCheck</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Enable additional check if application obfuscates SDK facade classes.

Default value is false.

</td></tr></tbody></table>

**MobileDcCloudMessagingConfiguration**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-3"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter** </th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">cloudMessagingRegistrationToken</td><td class="confluenceTd">CloudMessagingRegistrationProvider</td><td class="confluenceTd">Provides information abour Cloud Messaging registrationtoken like FCM  
</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-parameters-de" style="width: 100%;"><colgroup><col style="width: 16.296296%;"></col><col style="width: 12.222222%;"></col><col style="width: 71.358025%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Method** </th><th class="confluenceTh">**Parameters**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">getRegistrationToken</td><td class="confluenceTd">-</td><td class="confluenceTd">Gets actual FCM registration token from application. Used to device registration in RNS and SSE service.

</td></tr></tbody></table>

**CloudMessagingRegistrationToken**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-4"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">type</td><td class="confluenceTd">CloudMessagingType

</td><td class="confluenceTd">Mandatory. One of: \[FCM\].

FCM - Firebase Cloud Messaging

</td></tr><tr><td class="confluenceTd">token</td><td class="confluenceTd">String</td><td class="confluenceTd">Registaration token for push notifications  
</td></tr></tbody></table>

**Sample**

Initialization for MobileDcCoreConfiguration (without Wallet Server).

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="93697b07-c9eb-4286-a455-3e55a1b53d87" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-var-eventstrace-%3D-ar"><tbody><tr><td class="wysiwyg-macro-body">```
var eventsTrace = arrayListOf<Int>()//make use of this in case of error/failure/unexpected behaviour to retrace sdk internal processes


val mobileDcCoreConfiguration = MobileDcCoreConfiguration.create(
    MobileDcCoreConfigurationBuilder()
        .withApplicationContext(this)
        .withWalletSecurityEventListener(object : WalletSecurityEventListener {
            override fun onSecurityIssueAppeared(event: EventSecurityIssueAppeared) {
                //eg. show security screen or toast with details from event object
                //all data collected by SDK will be removed
                //Clearing application data in context of SDK is recommended
            }

        })
        .withOptionalLogger(object : EventsLogger {
            override fun onEvent(eventId: Int) {
                eventsTrace.add(eventId)
            }
        })
        .withOptionalDeveloperOptions(DeveloperOptions().apply {
            allowDebug = false
            enableAdditionalSecurityChecks = true
            enableCodeObfuscationCheck = true
        })
)

MobileDcApiKotlin.setup(mobileDcCoreConfiguration)
```

</td></tr></tbody></table>

Initialization for MobileDcApiConfiguration.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="b6fa2348-b956-497c-b0fa-b9678c614f90" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-myappmobiledcc"><tbody><tr><td class="wysiwyg-macro-body">```
class MyAppMobileDcConnectionConfig : MobileDcConnectionConfiguration {
    override val clientId: String = "clientId"
    override val url: String = "https://subdomain.domain.com/endpoint"
    override val pinningCertificates: List<String> = listOf(certificatePublicKeyInPemFormat)
}

class MyAppMobileDcWalletPinConfig : MobileDcWalletPinConfiguration {
    override val pinFailCount: Int = 3
}

var eventsTrace = arrayListOf<Int>()//make use of this in case of error/failure/unexpected behaviuour to retrace sdk internal processes

val mobileDcApiConfiguration = MobileDcApiConfiguration.create(
    MobileDcApiConfigurationBuilder()
        .withApplicationContext(this)
        .withMobileDcConnectionConfiguration(MyAppMobileDcConnectionConfig())
        .withOptionalWalletPinConfiguration(MyAppMobileDcWalletPinConfig())
        .withWalletSecurityEventListener(object : WalletSecurityEventListener {
            override fun onSecurityIssueAppeared(event: EventSecurityIssueAppeared) {
                //eg. show security screen or toast with details from event object
                //all data collected by SDK will be removed
                //Clearing application data in context of SDK is recommended
            }
        })
        .withOptionalLogger(object : EventsLogger {
            override fun onEvent(eventId: Int) {
                eventsTrace.add(eventId)
            }
        })
        .withOptionalDeveloperOptions(DeveloperOptions().apply {
            allowDebug = false
			enableAdditionalSecurityChecks = true
			enableCodeObfuscationCheck = true
        })
        .withOptionalCloudMessagingConfiguration(
            object : MobileDcCloudMessagingConfiguration {
                override val cloudMessagingRegistrationTokenProvider =
                      object : MobileDcCloudMessagingInfoProvider {
                          override fun getRegistrationToken(): CloudMessagingRegistrationToken? {
                              return CloudMessagingRegistrationToken(
									CloudMessagingType.FCM, 
									getFCMToken() //implement blocking get FCM token 
						  )
        	          }
            }
        })
)

MobileDcApiKotlin.setup(mobileDcApiConfiguration)
```

</td></tr></tbody></table>

Additional isolated process check, read more: **Application Isolated Process**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a8501b77-c50e-49e2-b70e-9da0a93e51c0" data-macro-name="code" data-macro-parameters="language=java|theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-app-%3A-applicat"><tbody><tr><td class="wysiwyg-macro-body">```
class App : Application() {

    override fun onCreate() {
        super.onCreate()
        if (isIsolatedProcess()) {
			return
        }

		//call all required methods
    }

}
```

</td></tr></tbody></table>

## Address domain

### addAddress

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Adds new address with given parameters.</p>

</td></tr></tbody></table>

**Input**

**AddAddress**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-5"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th><th class="confluenceTh">Validation conditions</th></tr><tr><td class="confluenceTd">street</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Street

</td><td class="confluenceTd">-</td></tr><tr><td class="confluenceTd">number</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Number

</td><td class="confluenceTd">-</td></tr><tr><td class="confluenceTd">apartment</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Apartment

</td><td class="confluenceTd">-</td></tr><tr><td class="confluenceTd">city</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">City

</td><td class="confluenceTd">-</td></tr><tr><td class="confluenceTd" colspan="1">isBilling</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Is invoice address

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">isShipping</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Is Shipping address

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">zipCode</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Zip code

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">countryId</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Country identifier

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">vatNo</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Vat number

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">companyName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Company name

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">firstName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">First name

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">lastName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Last name

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">province</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Province

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">district</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">District

</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">additional</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">(Optional) Additional field

</td><td class="confluenceTd" colspan="1">-</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-with-long-va"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success with Long value as addressId / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-addadress%28addadd"><tbody><tr><td class="wysiwyg-macro-body">```
fun addAdress(addAddress: AddAddress) {
    mobileDcApi
        .addressesService
        .addAddress(addAddress, { addressId ->
            // Address added
        }, {
            // Something went wrong
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### getAll

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Gets all addresses for the current user.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6ba37464-67ba-4870-b2e6-d83a4be5450e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback with list of user <span class="inline-comment-marker" data-ref="7a827c0d-6b12-468f-a778-c7806b702992">addresses.</span></p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-6"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd"><span class="inline-comment-marker" data-ref="63f38489-2dc2-437a-8a17-0c5d92fdb57a">addresses</span></td><td class="confluenceTd">List &lt;Address&gt;</td><td class="confluenceTd">List of user addresses

</td></tr></tbody></table>

**Address**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-7" style="width: 42.839506%;"><colgroup><col style="width: 35.446686%;"></col><col style="width: 25.648415%;"></col><col style="width: 38.904899%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">id</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Id of the address</td></tr><tr><td class="confluenceTd">street</td><td class="confluenceTd">CharArray</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="9820a2e5-c80f-4ca1-bd1c-340f846ade76">Street</span>

</td></tr><tr><td class="confluenceTd">number</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Number

</td></tr><tr><td class="confluenceTd">apartment</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Apartment

</td></tr><tr><td class="confluenceTd">city</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">City

</td></tr><tr><td class="confluenceTd" colspan="1">isBilling</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Is invoice address

</td></tr><tr><td class="confluenceTd" colspan="1">isShipping</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Is Shipping address

</td></tr><tr><td class="confluenceTd" colspan="1">zipCode</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Zip code

</td></tr><tr><td class="confluenceTd" colspan="1">country</td><td class="confluenceTd" colspan="1">Country</td><td class="confluenceTd" colspan="1">Country

</td></tr><tr><td class="confluenceTd" colspan="1">vatNo</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Vat number

</td></tr><tr><td class="confluenceTd" colspan="1">companyName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Company name

</td></tr><tr><td class="confluenceTd" colspan="1">firstName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">First name

</td></tr><tr><td class="confluenceTd" colspan="1">lastName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Last name

</td></tr><tr><td class="confluenceTd" colspan="1">province</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Province

</td></tr><tr><td class="confluenceTd" colspan="1">district</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">District

</td></tr><tr><td class="confluenceTd" colspan="1">additional</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Additional field

</td></tr></tbody></table>

**Country**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-8"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**

</th><th class="confluenceTh">**Type**

</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd" colspan="1">id

</td><td class="confluenceTd" colspan="1">Int

</td><td class="confluenceTd" colspan="1">Id of the country

</td></tr><tr><td class="confluenceTd">code

</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">Country code

</td></tr><tr><td class="confluenceTd">currency

</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">Currency code

</td></tr><tr><td class="confluenceTd">currencyNumeric

</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">Numeric currency code

</td></tr><tr><td class="confluenceTd">prefix

</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">Prefix telephone number for a given country

</td></tr><tr><td class="confluenceTd" colspan="1">regexp

</td><td class="confluenceTd" colspan="1">CharArray

</td><td class="confluenceTd" colspan="1">The phone number validation rule for a given country

</td></tr><tr><td class="confluenceTd" colspan="1">name

</td><td class="confluenceTd" colspan="1">CharArray

</td><td class="confluenceTd" colspan="1">The currency's name

</td></tr><tr><td class="confluenceTd" colspan="1">currencyName

</td><td class="confluenceTd" colspan="1">CharArray

</td><td class="confluenceTd" colspan="1">Country

</td></tr><tr><td class="confluenceTd" colspan="1">language

</td><td class="confluenceTd" colspan="1">CharArray

</td><td class="confluenceTd" colspan="1">Official language

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getall%28%29-%7B-mobil"><tbody><tr><td class="wysiwyg-macro-body">```
fun getAll() {
    mobileDcApi
        .addressesService
        .getAll({
            // List of addresses
        }, { throwable ->
            // Something went wrong
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### updateAddress

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Update address for the current id.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-9"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">updateAddress</td><td class="confluenceTd">UpdateAddress</td><td class="confluenceTd">An object containing address data to update

</td></tr></tbody></table>

**UpdateAddress**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-10" style="width: 42.592593%; height: 519px;"><colgroup><col style="width: 34.202899%;"></col><col style="width: 24.637681%;"></col><col style="width: 41.15942%;"></col></colgroup><tbody><tr style="height: 29px;"><th class="confluenceTh" style="height: 29px;">**Parameter**</th><th class="confluenceTh" style="height: 29px;">**Type**</th><th class="confluenceTh" style="height: 29px;">**Description**</th></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">addressId</td><td class="confluenceTd" colspan="1" style="height: 29px;">Long</td><td class="confluenceTd" colspan="1" style="height: 29px;">Id of the address</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">street</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Street</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">number</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Number</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">apartment</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Apartment</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">city</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">City</td></tr><tr style="height: 34px;"><td class="confluenceTd" colspan="1" style="height: 34px;">isBilling

</td><td class="confluenceTd" colspan="1" style="height: 34px;">Boolean</td><td class="confluenceTd" colspan="1" style="height: 34px;">Is invoice address</td></tr><tr style="height: 45px;"><td class="confluenceTd" colspan="1" style="height: 45px;">isShipping</td><td class="confluenceTd" colspan="1" style="height: 45px;">Boolean</td><td class="confluenceTd" colspan="1" style="height: 45px;">Is shipping address</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">zipCode</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Zip code</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">countryId</td><td class="confluenceTd" colspan="1" style="height: 29px;">Int</td><td class="confluenceTd" colspan="1" style="height: 29px;">Country identifier</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">vatNo</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Vat number</td></tr><tr style="height: 31px;"><td class="confluenceTd" colspan="1" style="height: 31px;">companyName</td><td class="confluenceTd" colspan="1" style="height: 31px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 31px;">Company Name</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">firstName</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">First name</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">lastName</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Last name</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">province</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">Province</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">district</td><td class="confluenceTd" colspan="1" style="height: 29px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 29px;">District</td></tr><tr style="height: 32px;"><td class="confluenceTd" colspan="1" style="height: 32px;">additionalField</td><td class="confluenceTd" colspan="1" style="height: 32px;">CharArray</td><td class="confluenceTd" colspan="1" style="height: 32px;">Additional filed</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="66fa869c-ab3b-43ac-8c7e-aaa02ec5f4a2" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-private-fun-updatead"><tbody><tr><td class="wysiwyg-macro-body">```
private fun updateAddress(updateAddress: UpdateAddress) {

    mobileDcApi
        .addressesService
        .updateAddress(updateAddress, {
            //address updated successfully
        }, { throwable ->
            // Something went wrong, maybe user data was incorrect
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### deleteAddress

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="fd52d643-70ee-4169-8ab1-22b3911b5e3f" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-method-for-delete-us"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Method for delete user address with given address id.</p>

</td></tr></tbody></table>

**Input**

<table class="confluenceTable" id="bkmrk-parameter-type-descr-11"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">addressId</td><td class="confluenceTd">Long</td><td class="confluenceTd">(Required) Unique address id</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9a536f26-f2a1-4978-80b7-1f794147d74d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2F-fa"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback/ Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6a77dcad-cb03-473a-a6b9-e3925d1b458f" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-deleteaddress%28ad"><tbody><tr><td class="wysiwyg-macro-body">```
fun deleteAddress(addressId: Long) {
    mobileDcApi
        .addressesService
        .deleteAddress(addressId, {
            //Success, address deleted
        }, {
            //Something went wrong
            //Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

###   


## User domain

### addUser

<p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Creates new user wallet account with given parameters.</p>

**Input**

NewUser model is required, but most of it's fields are optional. Fields requirement depends on product integration process.

<div class="table-wrap" id="bkmrk-parameter-type-descr-12"><table class="wrapped confluenceTable tablesorter tablesorter-default stickyTableHeaders" role="grid"><colgroup><col></col><col></col><col></col><col></col></colgroup><thead class="tableFloatingHeaderOriginal"><tr class="tablesorter-headerRow" role="row"><th aria-disabled="false" aria-label="Parameter: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="0" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Parameter**</div></th><th aria-disabled="false" aria-label="Type: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="1" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Type**</div></th><th aria-disabled="false" aria-label="Description: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="2" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Description**</div></th><th aria-disabled="false" aria-label="Validation coditions: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="3" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Validation coditions**</div></th></tr></thead><tbody aria-live="polite" aria-relevant="all"><tr role="row"><td class="confluenceTd">newUser</td><td class="confluenceTd">NewUser</td><td class="confluenceTd"><span class="tlid-translation translation" lang="en">An object containing user data</span></td><td class="confluenceTd">(Required)</td></tr></tbody></table>

</div>NewUser object contains following fields:

<div class="table-wrap" id="bkmrk-parameter-type-descr-13"><table class="relative-table confluenceTable tablesorter tablesorter-default stickyTableHeaders" role="grid" style="width: 100%;"><colgroup><col style="width: 11.604938%;"></col><col style="width: 12.962963%;"></col><col style="width: 20.123457%;"></col><col style="width: 55.185185%;"></col></colgroup><thead class="tableFloatingHeaderOriginal"><tr class="tablesorter-headerRow" role="row"><th aria-disabled="false" aria-label="Parameter: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="0" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Parameter**</div></th><th aria-disabled="false" aria-label="Type: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="1" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Type**</div></th><th aria-disabled="false" aria-label="Description: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="2" role="columnheader" scope="col" tabindex="0"><div class="tablesorter-header-inner">**Description**</div></th><th aria-disabled="false" aria-label="Validation conditions: No sort applied, activate to apply an ascending sort" aria-sort="none" class="confluenceTh tablesorter-header sortableHeader tablesorter-headerUnSorted" data-column="3" role="columnheader" scope="col" tabindex="0">**Validation conditions**

</th></tr></thead><thead class="tableFloatingHeader"></thead><tbody aria-live="polite" aria-relevant="all"><tr role="row"><td class="confluenceTd">phone</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's phone number

</td><td class="confluenceTd">Phone with country prefix. For pl: 48500500500</td></tr><tr role="row"><td class="confluenceTd">email</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's email address</td><td class="confluenceTd">Email format if any value passed</td></tr><tr role="row"><td class="confluenceTd">firstName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's first name</td><td class="confluenceTd">  
</td></tr><tr role="row"><td class="confluenceTd">lastName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's last name</td><td class="confluenceTd">  
</td></tr><tr role="row"><td class="confluenceTd">walletPin</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's wallet pin</td><td class="confluenceTd">4 to 8 digits if passed  
</td></tr><tr role="row"><td class="confluenceTd">password</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's password</td><td class="confluenceTd">Password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr><tr role="row"><td class="confluenceTd">acceptedMarketing</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">True if user accepted marketing agreement, false otherwise</td><td class="confluenceTd">-

</td></tr><tr role="row"><td class="confluenceTd">invitationCode</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Invitation code <span class="tlid-translation translation" lang="en">used in a specific server configuration</span></td><td class="confluenceTd">(Conditional/Optional) - depends on specific server configuration</td></tr><tr role="row"><td class="confluenceTd">nip</td><td class="confluenceTd">String</td><td class="confluenceTd">Taxpayer identification number</td><td class="confluenceTd">Not empty if passed</td></tr></tbody></table>

</div>**Output**

<p class="callout info">Success / failure callback.</p>

**Sample**

<div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" id="bkmrk-fun-adduser%28newuser%3A"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl"><div class="syntaxhighlighter sh-eclipse nogutter  java" id="bkmrk-fun-adduser%28newuser%3A-0"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td class="code"><div class="container" title="Hint: double-click to select code"><div class="line number1 index0 alt2">`fun addUser(newUser: NewUser) {`</div><div class="line number2 index1 alt1">`    ``mobileDcApi`</div><div class="line number3 index2 alt2">`        ``.userService`</div><div class="line number4 index3 alt1">`        ``.addUser(newUser, {`</div><div class="line number5 index4 alt2">`            ``//new user is added successfully`</div><div class="line number6 index5 alt1">`        ``}, { throwable ->`</div><div class="line number7 index6 alt2">`            ``// Something went wrong, maybe user data was incorrect`</div><div class="line number8 index7 alt1">`            ``// Check exceptions described in Error handling chapter`</div><div class="line number9 index8 alt2">`        ``})`</div><div class="line number10 index9 alt1">`}`</div></div></td></tr></tbody></table>

</div></div></div></div>### addUser (deprecated)

<div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" id="bkmrk-asynchronous.-online-3"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl"><table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Creates new user wallet account with given parameters.</p>

</td></tr></tbody></table>

</div></div></div>**Input**

Most of fields are optional. Fields requirement depends on product integration process.

<div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" id="bkmrk-parameter-type-descr-14"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl"><table class="relative-table wrapped confluenceTable" style="width: 100%;"><colgroup><col style="width: 11.481481%;"></col><col style="width: 11.604938%;"></col><col style="width: 19.753086%;"></col><col style="width: 57.037037%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">phone</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User's phone number

</td><td class="confluenceTd">Phone with country prefix. For pl: 48500500500</td></tr><tr><td class="confluenceTd" colspan="1">email</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's email address</td><td class="confluenceTd" colspan="1">Email format if any value passed</td></tr><tr><td class="confluenceTd" colspan="1">firstName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's first name</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">lastName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's last name</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">walletPin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's wallet pin</td><td class="confluenceTd" colspan="1">4 to 8 digits if passed  
</td></tr><tr><td class="confluenceTd" colspan="1">password</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's password</td><td class="confluenceTd" colspan="1">Password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr><tr><td class="confluenceTd" colspan="1">acceptedMarketing</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">True if user accepted marketing agreement, false otherwise</td><td class="confluenceTd" colspan="1">-

</td></tr></tbody></table>

</div></div></div>**Output**

<div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code" id="bkmrk-success-%2F-failure-ca-1"><div class="code panel pdl conf-macro output-block" data-hasbody="true" data-macro-name="code"><div class="codeContent panelContent pdl"><table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

</div></div></div>### addUserWithIban

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="2844aba3-955a-4a44-a160-08ab8c140435" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Creates new user wallet account if not exist with IBAN in Mobile DC backend.</p>

<p class="callout info">When user already exist calling this method will be also finished with success.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-15" style="width: 100%;"><colgroup><col style="width: 14.444444%;"></col><col style="width: 8.024691%;"></col><col style="width: 60.493827%;"></col><col style="width: 16.91358%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">signedAccountInfo</td><td class="confluenceTd">String</td><td class="confluenceTd">Signed AccountInfo per RFC 7519 generated on Client server side

Instruction how to sign data with JWT can be found in *<span class="inline-comment-marker" data-ref="fcc560bb-e660-475f-b79d-b14d39dfd6a5">[Data signing and encryption](https://wiki.verestro.com/display/UCP/Data+signing+and+encryption)</span>* chapter

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**AccountInfo**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-16"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">userId</td><td class="confluenceTd">String</td><td class="confluenceTd">External user id given by the client

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">iban</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Bank Account Number</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">countryCode</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The country of the financial account

Expressed as a 3-letter (alpha-3 country code as defined in ISO 3166-1

</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback.-ca"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback. Called when new user is created or already exist with passed input data.</p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-17"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">ibanId</td><td class="confluenceTd">String</td><td class="confluenceTd">Hash (sha256) of provided IBAN

</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6165e6d0-8a81-4de4-b672-2f622b7c6282" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="1a4477e8-d027-48c9-a04b-c58b22986fec">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="7ac25542-1b63-4862-8c18-36b532d0bff9" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-class-signedaccounti"><tbody><tr><td class="wysiwyg-macro-body">```
class SignedAccountInfo {
    fun generate() {
        val claims = JWTClaimsSet.Builder()
            .claim("userId", "externalUserId")
            .claim("iban", "IN15HIND23467433866365")
            .claim("countryCode", "IND")
            .build()

        val signedAccountInfo = JwtGenerator.generate(claims, certificates, privateKey)
        // ...
    }
}
```

</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="bcc44fb5-ac88-483f-bc03-7a4c8159f59d" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-private-fun-adduserw"><tbody><tr><td class="wysiwyg-macro-body">```
private fun addUserWithIban() {

    val signedAccountInfo: String = getSignedAccountInfo()

    mobileDcApi
        .userService
        .addUserWithIban(signedAccountInfo, { ibanId ->
            //user already exist or was added with selected iban
        }, {
            //failure, check exceptions, maybe signedAccountInfo is wrong?
        })
}
```

</td></tr></tbody></table>

### updateUser

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Update user wallet account with given parameters.</p>

<p class="callout info">Most of it's fields are optional. Fields requirement depends on product integration process.  
</p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-18"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation coditions**</th></tr><tr><td class="confluenceTd">updateUser</td><td class="confluenceTd">UpdateUser</td><td class="confluenceTd"><span class="tlid-translation translation" lang="en">An object containing user data to update</span></td><td class="confluenceTd">(Required)</td></tr></tbody></table>

**UpdateUser**

<table class="relative-table confluenceTable wrapped" id="bkmrk-parameter-type-descr-19"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">firstName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's first name</td></tr><tr><td class="confluenceTd" colspan="1">lastName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User's last name</td></tr><tr><td class="confluenceTd" colspan="1">acceptedMarketing</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">True if user accepted marketing agreement, false otherwise</td></tr><tr><td class="confluenceTd" colspan="1">acceptedRegulations</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Accepted regulations agreement</td></tr><tr><td class="confluenceTd" colspan="1">acceptedMarketingReceiving</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Accepted marketing consent</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-updateuser%28updat"><tbody><tr><td class="wysiwyg-macro-body">```
fun updateUser(updateUser: UpdateUser) {
    mobileDcApi
        .userService
        .updateUser(updateUser, {
            //user updated successfully
        }, { throwable ->
            // Something went wrong, maybe user data was incorrect
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### getUser

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="62ccd748-1dd8-490f-825e-9fb87ed4cb5f" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Get data of current user.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6ba37464-67ba-4870-b2e6-d83a4be5450e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info"><span class="inline-comment-marker" data-ref="676ca14c-1f64-49ef-b7ef-e07a9bd6931a">Success callback with User model.</span></p>

</td></tr></tbody></table>

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-20"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">user</td><td class="confluenceTd">User</td><td class="confluenceTd">User data

</td></tr></tbody></table>

User contains following fields:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-21" style="width: 100%;"><colgroup><col style="width: 20.864198%;"></col><col style="width: 12.716049%;"></col><col style="width: 66.296296%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd"><span class="inline-comment-marker" data-ref="c258fa37-23ef-46a1-a19f-018bfdc3cf36">userId</span></td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of registered user

</td></tr><tr><td class="confluenceTd">firstName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">First name of the user (required depending on server configuration)</td></tr><tr><td class="confluenceTd" colspan="1">lastName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Last name of the user (required depending on server configuration)</td></tr><tr><td class="confluenceTd" colspan="1">phone</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Phone with country prefix. For pl: 48500500500 (required depending on server configuration)</td></tr><tr><td class="confluenceTd" colspan="1">email</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Email of the user (required depending on server configuration)

</td></tr><tr><td class="confluenceTd">birthDate</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Birth date in format yyyy-MM-dd

</td></tr><tr><td class="confluenceTd" colspan="1">gender</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Gender: \[M, F\]</td></tr><tr><td class="confluenceTd" colspan="1">acceptTos</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Date when user accepted regulations in format yyyy-MM-dd hh:mm:ss</td></tr><tr><td class="confluenceTd" colspan="1">acceptMarketing</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Date when user accepted marketing info in format yyyy-MM-dd hh:mm:ss</td></tr><tr><td class="confluenceTd" colspan="1">isLocked</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">True if user is locked, false otherwise</td></tr><tr><td class="confluenceTd" colspan="1">deactivated</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">True if user is deactivated, false otherwise</td></tr><tr><td class="confluenceTd" colspan="1">status</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User status: \[ACTIVE, LOCKED, DEACTIVATED\]</td></tr><tr><td class="confluenceTd" colspan="1">verified</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">True if user is verified, false otherwise</td></tr><tr><td class="confluenceTd" colspan="1">kyc</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User’s KYC verification status, one of: \[SUCCESS, REJECTED, IN\_PROGRESS\]</td></tr><tr><td class="confluenceTd" colspan="1">created</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Date of creation user in DB</td></tr><tr><td class="confluenceTd" colspan="1">failCount</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Number of failed authentication attempts</td></tr><tr><td class="confluenceTd" colspan="1">hasSetPassword</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">True if user has password set, false otherwise</td></tr><tr><td class="confluenceTd" colspan="1">lastPasswordChange</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Last password change in format yyyy-MM-dd</td></tr><tr><td class="confluenceTd" colspan="1">lockTo</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Time for which user is locked in format Y-m-d H:i:s</td></tr><tr><td class="confluenceTd" colspan="1">lastActivity</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Data of user last activity in format yyyy-MM-dd hh:mm:ss</td></tr><tr><td class="confluenceTd" colspan="1">country</td><td class="confluenceTd" colspan="1">Country</td><td class="confluenceTd" colspan="1">Country object</td></tr><tr><td class="confluenceTd" colspan="1">acceptMarketingReceiving</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Date when user accepted marketing consent in format yyyy-MM-dd hh:mm:ss</td></tr></tbody></table>

Country contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">id</td><td class="confluenceTd">Long</td><td class="confluenceTd">Country identifier

</td></tr><tr><td class="confluenceTd" colspan="1">code</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Country code in accordance with the ISO 3166-2 standard</td></tr><tr><td class="confluenceTd" colspan="1">prefix</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Prefix telephone number for a given country</td></tr><tr><td class="confluenceTd" colspan="1">name</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="85e7b956-dc5d-49e5-abd1-b6f435d85a71">Country name</span>

</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0d22d5a0-2696-456f-9197-316a059eb4c3" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="834a2333-be7d-42a3-a162-f5991680f7db">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="624723bc-c8d5-40cb-b571-7983b758cc02" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getuser%28%29-%7B-mobi"><tbody><tr><td class="wysiwyg-macro-body">```
fun getUser() {
    mobileDcApi.userService
        .getUser({ user ->
            // Getting user went successfully
			showUser(user)
        }, { throwable ->
            // Something went wrong
            // Check exceptions described in error handling chapter
        })
}
```

</td></tr></tbody></table>

### finalizeUserRegistration

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-7"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Activate user account by finalizing registration process with SMS code sent to the phone number provided during new user wallet account creation.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-22" style="width: 100%;"><colgroup><col style="width: 11.851852%;"></col><col style="width: 10.987654%;"></col><col style="width: 60%;"></col><col style="width: 17.037037%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd" colspan="1">otp</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">One time password (sent via SMS as a result of successful new user wallet account creation)</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-finalizeuserregi"><tbody><tr><td class="wysiwyg-macro-body">```
fun finalizeUserRegistration(otp: CharArray) {
    mobileDcApi
        .userService
        .finalizeUserRegistration(otp, { 
           // User wallet account was successfully activated
        }, { throwable ->
            // Something went wrong. 
            // Check exceptions described in error handling chapter
        })
}
```

</td></tr></tbody></table>

### authenticateByPin

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Authenticates user locally after providing correct pin.</p>

<p class="callout info">Provide method to verify user without connection into Mobile DC.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-23" style="width: 100%;"><colgroup><col style="width: 8.395062%;"></col><col style="width: 11.358025%;"></col><col style="width: 64.814815%;"></col><col style="width: 15.308642%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd"><span class="inline-comment-marker" data-ref="ae79c10f-7e9c-4c28-9710-811b89553266">pin</span></td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Wallet Pin created during user registration process associated with user account. (see: [addUser (deprecated)](https://wiki.verestro.com/pages/viewpage.action?pageId=67340747))

</td><td class="confluenceTd">Not empty.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="5cdf5835-d768-4d5d-ab72-66ad22ecf864" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="74a94987-8a53-4a43-a21c-8ec9b131a77e">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-authenticatebypi"><tbody><tr><td class="wysiwyg-macro-body">```
fun authenticateByPin(mobileDcApi: MobileDcApiKotlin, pin: CharArray) {
    //Wallet Pin created during user registration process associated with user account
    mobileDcApi
        .userService
        .authenticateByPin(pin, {
            //user is verified
        }, { throwable ->
            // Something went wrong, maybe pin is incorrect? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### isBiometricAuthenticationEnabled

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="3a308729-1dd5-4a2e-8aca-75664529673a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Method that check if biometric authentication is enabled.</p>

<p class="callout info">**Note:** Authentication could be disabled by system when Android Keystore state changed (eg. User disabled screen lock or add new authentication method).</p>

<p class="callout info">State of biometrics should be checked before every biometrics authentication usage.</p>

</td></tr></tbody></table>

**Input**

No input parameters

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="8273ee62-8345-488e-afa0-24b8c55ae11f" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with status of authentication or failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="5c25e7cd-70b8-4aab-9ead-d5c7642a8e95">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="1fd5ed54-717c-43d7-823f-64029be325d3" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-fun-isbiometricauthe"><tbody><tr><td class="wysiwyg-macro-body">```
fun isBiometricAuthenticationEnabled() {
    mobileDcApi
            .userService
            .isBiometricAuthenticationEnabled({ isBiometricEnabled ->
                if (isBiometricEnabled) {
                    // Biometric authentication is enabled, process startBiometricAuthentication method
                } else {
                    // Biometric authentication is disabled, use enableBiometricAuthentication
                }
            }, { throwable ->
                // Something went wrong
                // Check exceptions
            })
}
```

</td></tr></tbody></table>

### enableBiometricAuthentication

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="36fa2435-c943-49d1-be5e-e1a7091861a4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-8"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Method for enabling device level authentication and updating biometric public key.</p>

<p class="callout info">To perform this method device must have set PIN, pattern or password. To check these use KeyguardManager.</p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-24"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh" colspan="1">**Description**</th><th class="confluenceTh" colspan="1">**Validation conditions**</th></tr><tr><td class="confluenceTd">userName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd" colspan="1">Current username</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd">password</td><td class="confluenceTd">CharArray</td><td class="confluenceTd" colspan="1">Current password</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">biometricAuthType</td><td class="confluenceTd" colspan="1">BiometricAuthType (BIOMETRIC\_ONLY, BIOMETRIC\_WITH\_ALTERNATIVE)</td><td class="confluenceTd" colspan="1">Type of biometrics to enable during device pairing process.</td><td class="confluenceTd" colspan="1">Not null</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c625c53-6d1f-4bad-b332-b76ee3d08318" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

```
//KeyguardManager example
keyguardManager = context.getSystemService(KEYGUARD_SERVICE)

fun isDeviceSecure(): Boolean {
    return keyguardManager.isKeyguardSecure
}
//if isDeviceSecure return true device is safe and enableBiometricAuthentication method can be performed

fun enableBiometricAuthentication(userName: CharArray, password: CharArray, biometricAuthType : BiometricAuthType) {
    mobileDcApi.userService
        		.enableBiometricAuthentication(userName, password, biometricAuthType,
					{
            			// Biometric authentication is enabled. Read startBiometricAuthentication description to authenticate user.
        			},
 					{ throwable ->
            			// Something went wrong
            			// Check exceptions described in Error handling chapter
        			}
				)
}
```

### disableBiometricAuthentication

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Disable possibility to use biometric authentication.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6ba37464-67ba-4870-b2e6-d83a4be5450e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-2"><tbody><tr><td class="wysiwyg-macro-body">No input parameters.

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-6"><tbody><tr><td class="wysiwyg-macro-body">Success / failure callback.

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-disablebiometric"><tbody><tr><td class="wysiwyg-macro-body">```
fun disableBiometricAuthentication() {
    mobileDcApi
        .userService
        .disableBiometricAuthentication({
            //Biometric authentication cannot be no longer used. Use enableBiometricAuthentication to enable it again
        }, {
            //Something went wrong
            //Check exceptions described in Error handling chapter            
        })
}
```

</td></tr></tbody></table>

### enableBiometricAuthenticationWithWalletPin

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="36fa2435-c943-49d1-be5e-e1a7091861a4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-9"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Method for enabling device level authentication and updating biometric public key with Wallet Pin.</p>

<p class="callout info">To perform this method device must have set PIN, pattern or password. To check these use KeyguardManager.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable wrapped" id="bkmrk-parameter-type-descr-25"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh" colspan="1">**Description**</th><th class="confluenceTh" colspan="1">**Validation conditions**</th></tr><tr><td class="confluenceTd">walletPin</td><td class="confluenceTd">CharArray</td><td class="confluenceTd" colspan="1">Current walletPin</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">biometricAuthType</td><td class="confluenceTd" colspan="1">BiometricAuthType (BIOMETRIC\_ONLY, BIOMETRIC\_WITH\_ALTERNATIVE)</td><td class="confluenceTd" colspan="1">Type of biometrics to enable during device pairing process.</td><td class="confluenceTd" colspan="1">Not null</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c625c53-6d1f-4bad-b332-b76ee3d08318" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-7"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="418fa22f-892f-4370-88ac-4510cb8fd22b" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-%2F%2Fkeyguardmanager-ex-0"><tbody><tr><td class="wysiwyg-macro-body">```
//KeyguardManager example
keyguardManager = context.getSystemService(KEYGUARD_SERVICE)

fun isDeviceSecure(): Boolean {
    return keyguardManager.isKeyguardSecure
}
//if isDeviceSecure return true device is safe and enableBiometricAuthenticationWithWalletPin method can be performed

fun enableBiometricAuthenticationWithWalletPin(walletPin: CharArray, biometricAuthType : BiometricAuthType) {
    mobileDcApi.userService
        		.enableBiometricAuthenticationWithWalletPin(walletPin, biometricAuthType,
					{
            			// Biometric authentication is enabled. Read startBiometricAuthentication description to authenticate user.
        			},
 					{ throwable ->
            			// Something went wrong
            			// Check exceptions described in Error handling chapter
        			}
				)
}
```

</td></tr></tbody></table>

### startBiometricAuthentication

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e6f53b54-8abb-4a1d-b90f-eadd82dc4836" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Create CryptoObject for biometric authentication.</p>

<p class="callout info">Depends on usage of androidx/android support library an different CryptoObject can be provided by Android SDK.</p>

</td></tr></tbody></table>

**Input**

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-26" style="width: 100%;"><colgroup><col style="width: 12.839506%;"></col><col style="width: 13.333333%;"></col><col style="width: 60.987654%;"></col><col style="width: 12.716049%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cryptoObjectType</td><td class="confluenceTd">CryptoObjectType</td><td class="confluenceTd">Enum that defines different types of CryptoObject

BIOMETRIC\_PROMPT\_ANDROIDX - androidx/biometric/BiometricPrompt/CryptoObject,

FINGERPRINT\_MANAGER\_COMPAT\_ANDROIDX - androidx/core/hardware/fingerprint/FingerprintManagerCompat/CryptoObject,

FINGERPRINT\_MANAGER - android/hardware/fingerprint/FingerprintManager/CryptoObject,

BIOMETRIC\_PROMPT - android/hardware/biometrics/BiometricPrompt/CryptoObject

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="84f21610-8bb6-4ffd-9609-ea0ef2b54549" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback.</p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-27"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">result</td><td class="confluenceTd">BiometricAuthenticationData

</td><td class="confluenceTd">Object containing CryptoObject kept as Object. </td></tr></tbody></table>

BiometricAuthenticationData contains following field:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-28"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">cryptoObject</td><td class="confluenceTd">Object</td><td class="confluenceTd">Wrapper class for crypto objects supported biometric authentication.</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b9e08504-b114-488f-905f-022b53b8571b" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout warning">Failure callback.</p>

</td></tr></tbody></table>

**Sample**

startBiometricAuthentication sample:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="fa26fc15-0037-4bc0-beb9-dbd408619a45" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-mobiledcapi-.userser"><tbody><tr><td class="wysiwyg-macro-body">```
  mobileDcApi
            .userService
            .startBiometricAuthentication(CryptoObjectType.BIOMETRIC_PROMPT_ANDROIDX)
            {
             	// Creating Object for biometric authentication is done
            }, {
				// Something went wrong maybe: private key is not created or not authenticated
				// Check exceptions 
            }
```

</td></tr></tbody></table>

BiometricAuthenticationData should be used as parameter in [authenticateWithBiometric](https://wiki.verestro.com/display/UCP/authenticateWithBiometric) but application must cast cryptoObject parameter to CryptoObject.

Cast to CryptoObject sample :

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="47cac0d9-b60f-44f9-aa74-872a37e9d28d" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-wraptobiometrica"><tbody><tr><td class="wysiwyg-macro-body">```
fun wrapToBiometricAuthenticationResult(biometricAuthenticationData: BiometricAuthenticationData): BiometricAuthenticationResult {
   
	val cryptoObject = biometricAuthenticationData.cryptoObject as CryptoObject //Casting to androidx/support version of CryptoObject

    return BiometricAuthenticationResult(
        cryptoObject.signature,
        cryptoObject.cipher,
		cryptoObject.mac
	)
}
```

</td></tr></tbody></table>

Complete flow of authentication with biometric methods:

Create your own custom view, which require to authenticate with biometric.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="941e68e7-e349-4b62-b091-a039662f36c4" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-customviewforbiometr"><tbody><tr><td class="wysiwyg-macro-body">```
customViewForBiometricAuthentication = BiometricPrompt


fun startAuthentication(){
	mobileDcApi
            .userService
            .startBiometricAuthentication(CryptoObjectType.BIOMETRIC_PROMPT_ANDROIDX)
            { biometricAuthenticationData ->
             	verifyAuthentication(wrapToBiometricAuthenticationResult(biometricAuthenticationData))
            }, {
				// Something went wrong maybe: private key is not created or not authenticated
				// Check exceptions 
            }
}

fun verifyAuthentication(biometricAuthenticationResult:BiometricAuthenticationResult){
	 mobileDcApi
            .userService
            .authenticateWithBiometric(biometricAuthenticationResult)
        {
            // success authentication is done
        },
        { throwable ->
            // Something went wrong maybe private key is not authenticated?
            // Check exceptions
             
        }
    )
}


 val biometricPrompt: BiometricPrompt = BiometricPrompt(activityFragment, executor,
    object : BiometricPrompt.AuthenticationCallback() {
        override fun onAuthenticationError(
            errorCode: Int,
            errString: CharSequence
        ) {
            super.onAuthenticationError(errorCode, errString)
            Toast.makeText(context,"Authentication error", Toast.LENGTH_SHORT).show()
        }

        override fun onAuthenticationSucceeded(
            result: BiometricPrompt.AuthenticationResult
        ) {
            super.onAuthenticationSucceeded(result)
            Toast.makeText(
                context,
                "Authentication succeeded!", Toast.LENGTH_SHORT).show()

            startAuthentication()
        }


        override fun onAuthenticationFailed() {
            super.onAuthenticationFailed()
            Toast.makeText(
                context, "Authentication failed", Toast.LENGTH_SHORT).show()
        }
    })
```

</td></tr></tbody></table>

### authenticateWithBiometric

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e6f53b54-8abb-4a1d-b90f-eadd82dc4836" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Starts system biometric authentication.</p>

<p class="callout info">After invoke system waits for a biometric authentication.</p>

</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b81b967a-f154-43e4-b72d-e67037af6b16" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-method-can-throw-bio"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout warning">Method can throw BiometricVerificationException.</p>

</td></tr></tbody></table>

**Input**

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-29"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">biometricAuthenticationResult</td><td class="confluenceTd">BiometricAuthenticationResult</td><td class="confluenceTd">Class wrapper for biometric authentication result (Signature, Cipher, Mac) created in startBiometricAuthentication

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="1f81ae82-9572-48b4-97f6-cb34a8724351" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback.</p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-30"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">result</td><td class="confluenceTd">AuthorizationResult</td><td class="confluenceTd">Object containing verification details. </td></tr></tbody></table>

AuthorizationResult contains following fields:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-31" style="width: 51.975309%; height: 117px;"><colgroup><col style="width: 31.353919%;"></col><col style="width: 20.665083%;"></col><col style="width: 47.505938%;"></col></colgroup><tbody><tr style="height: 29px;"><th class="confluenceTh" style="height: 29px;">Parameter</th><th class="confluenceTh" style="height: 29px;">Type</th><th class="confluenceTh" style="height: 29px;">Description</th></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">timestamp</td><td class="confluenceTd" style="height: 29px;">Long</td><td class="confluenceTd" style="height: 29px;">Internal information for SDK.</td></tr><tr style="height: 30px;"><td class="confluenceTd" style="height: 30px;">signedTimestamp</td><td class="confluenceTd" style="height: 30px;">ByteArray</td><td class="confluenceTd" style="height: 30px;">Internal information for SDK</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">errorMessage</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">Internal information for SDK</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="cab0dcf7-a1fc-4f49-b110-625130adb69a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback."><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.  
</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="fa26fc15-0037-4bc0-beb9-dbd408619a45" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-authenticatewith"><tbody><tr><td class="wysiwyg-macro-body">```
fun authenticateWithBiometrics(biometricAuthenticationResult: BiometricAuthenticationResult) {
    mobileDcApi
        .userService
        .authenticateWithBiometric(biometricAuthenticationResult, { authorizationResult ->
            // authentication with biometric is finished with success, use authorizationResult to loginBySignature
        }, { throwable ->
            // Something went wrong, was authentication passed?
            // Check exceptions
        })
}
```

</td></tr></tbody></table>

### loginByTrustedIdentity

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-10"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Authenticates user in Mobile DC backend after providing trusted identity.</p>

<p class="callout info">Creates / refreshes user session.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-32"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th><th class="confluenceTh">Validation conditions

</th></tr><tr><td class="confluenceTd">trustedIdentity</td><td class="confluenceTd">String</td><td class="confluenceTd">Trusted identity generated by client

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**TrustedIdentity**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-33"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh" colspan="1">Parameter</th><th class="confluenceTh" colspan="1">Type</th><th class="confluenceTh" colspan="1">Description</th><th class="confluenceTh" colspan="1">Validation conditions

</th></tr><tr><td class="confluenceTd">userId</td><td class="confluenceTd">String</td><td class="confluenceTd">External user id given by the client

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="5cdf5835-d768-4d5d-ab72-66ad22ecf864" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-8"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="74a94987-8a53-4a43-a21c-8ec9b131a77e">Sample</span>**

<span class="inline-comment-marker" data-ref="74a94987-8a53-4a43-a21c-8ec9b131a77e">Sample code for *trustedIdentity* generation (see also *Data signing and encryption* chapter):</span>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-trustedidentit"><tbody><tr><td class="wysiwyg-macro-body">```
class TrustedIdentity {
    fun generate() {
        val claims = JWTClaimsSet.Builder()
            .claim("userId", "externalUserId")
            .build();

        val trustedIdentity = JwtGenerator.generate(claims, certificates, privateKey);
        // ...
    }
}
```

</td></tr></tbody></table>

<span class="inline-comment-marker" data-ref="74a94987-8a53-4a43-a21c-8ec9b131a77e">Usage of trustedIdentity in application:</span>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e7cf8263-8c60-44e0-a8c1-8921372f7cfc" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-loginbytrustedid"><tbody><tr><td class="wysiwyg-macro-body">```
fun loginByTrustedIdentity(mobileDcApi: MobileDcApiKotlin, trustedIdentity: String) {
    //where trustedIdentity should be generated by server and passed to mobile application
    mobileDcApi
        .userService
        .loginByTrustedIdentity(trustedIdentity, {
            //user is logged
        }, { throwable ->
            // Something went wrong, maybe trustedIdentity is wrong? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### loginByPin

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-11"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Authenticates user in Mobile DC backend after providing correct pin.</p>

<p class="callout info">Creates / refreshes user session.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-34" style="width: 100%;"><colgroup><col style="width: 9.135802%;"></col><col style="width: 10.123457%;"></col><col style="width: 63.950617%;"></col><col style="width: 16.666667%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd"><span class="inline-comment-marker" data-ref="2d0c88d6-1037-41b9-b59d-d159223c6eb9">pin</span></td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Wallet Pin created during user registration process associated with user account. (see: [addUser](https://wiki.upaid.pl/display/UCP/addUser))

</td><td class="confluenceTd">Not empty.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="5cdf5835-d768-4d5d-ab72-66ad22ecf864" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-9"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="74a94987-8a53-4a43-a21c-8ec9b131a77e">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-loginbypin%28mobil"><tbody><tr><td class="wysiwyg-macro-body">```
fun loginByPin(mobileDcApi: MobileDcApiKotlin, pin: CharArray) {
    //Wallet Pin created during user registration process associated with user account
    mobileDcApi
        .userService
        .loginByPin(pin, {
            //user is logged
        }, { throwable ->
            // Something went wrong, maybe pin is incorrect? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### loginBySignature

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="044d24ab-6cbb-41db-b624-c8856b7fb6f9" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-12"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Authenticates user in Mobile DC backend after local biometric authentication (startBiometricAuthentication and authenticateWithBiometric methods).</p>

<p class="callout info">Creates / refreshes user session.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0bb800ad-adb2-4280-9c77-efbb8101ae98" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-authorizationresult--0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">**AuthorizationResult** provided in success callback from authenticateWithBiometric method.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="db497e45-0229-45bc-b073-a4cb0941b276" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-10"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8e6ff1e0-73c7-4ba1-aac4-2d3f0b1f9511" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-fun-loginbysignature"><tbody><tr><td class="wysiwyg-macro-body">```
fun loginBySignature(authorizationResult: AuthorizationResult) {
    mobileDcApi
            .userService
            .loginBySignature(authorizationResult, {
                // User is authenticated
            }, { throwable ->
                // Something went wrong
                // Check exceptions
            })
}
```

</td></tr></tbody></table>

### changeWalletPin

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="cf6d5185-0632-4dff-9ffe-11cb909aa71d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-13"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Changes user's wallet PIN with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-35"><colgroup><col></col><col></col><col></col><col></col></colgroup><thead><tr><th class="confluenceTh">**Parameter**

</th><th class="confluenceTh">**Type**

</th><th class="confluenceTh">**Description**

</th><th class="confluenceTh">**Validation conditions**

</th></tr></thead><tbody><tr><td class="confluenceTd">walletPin</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Current wallet PIN.

</td><td class="confluenceTd">Has 4 or 8 digits.</td></tr><tr><td class="confluenceTd" colspan="1">newWalletPin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">New wallet PIN.</td><td class="confluenceTd" colspan="1">Has 4 or 8 digits.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="562c1282-1c79-4861-9368-60a3b0a8c487" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-11"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-changewalletpin%28"><tbody><tr><td class="wysiwyg-macro-body">```
fun changeWalletPin(walletPin:CharArray, newWalletPin:CharArray) {
    mobileDcApi
        .userService
        .changeWalletPin(walletPin, newWalletPin, {
            //user's Wallet PIN is changed
        }, { throwable ->
            // Something went wrong, maybe current PIN is wrong? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### resetWalletPin

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-14"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Resets wallet pin with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-36" style="width: 100%;"><colgroup><col style="width: 15.061728%;"></col><col style="width: 10.617284%;"></col><col style="width: 12.469136%;"></col><col style="width: 61.728395%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd" colspan="1">userLoginType

</td><td class="confluenceTd" colspan="1">UserType</td><td class="confluenceTd" colspan="1">User identifier type. One of: \[PHONE, EMAIL\]

</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">userLogin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User identifier. Depends on user identifier type (EMAIL or PHONE)</td><td class="confluenceTd" colspan="1">Depends on user identifier type. For a phone number it's phone number with country prefix. For pl: 48500500500. For email it's a valid email</td></tr><tr><td class="confluenceTd" colspan="1">newWalletPin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">New user wallet pin</td><td class="confluenceTd" colspan="1">Only numbers with 4 to 8 digits</td></tr><tr><td class="confluenceTd">password</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Current user password

</td><td class="confluenceTd">The password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-12"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-resetwalletpin%28u"><tbody><tr><td class="wysiwyg-macro-body">```
fun resetWalletPin(userLogin: CharArray, loginType: UserType, newPin: CharArray, password: CharArray) {
    mobileDcApi
        .userService
        .resetWalletPin(userLogin, loginType, newPin, password, {
            //user's pin is changed
        }, { throwable ->
            // Something went wrong, maybe password is wrong? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### changePassword

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-15"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Changes user's password with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-37" style="width: 100%;"><colgroup><col style="width: 13.580247%;"></col><col style="width: 10.246914%;"></col><col style="width: 14.567901%;"></col><col style="width: 61.481481%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">password</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Current user password

</td><td class="confluenceTd">The password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit  
</td></tr><tr><td class="confluenceTd" colspan="1">newPassword</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">New user password</td><td class="confluenceTd" colspan="1">The password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-13"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-changepassword%28p"><tbody><tr><td class="wysiwyg-macro-body">```
fun changePassword(password:CharArray, newPassword:CharArray) {
    mobileDcApi
        .userService
        .changePassword(password, newPassword, {
            //user's password is changed
        }, { throwable ->
            // Something went wrong, maybe current password is wrong? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### initializeResetUserPassword (deprecated)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-16"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Reset user's password with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-38"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">userLoginType</td><td class="confluenceTd">UserType</td><td class="confluenceTd"> User identifier type. One of: \[PHONE, EMAIL, INTERNAL\_ID, EXTERNAL\_ID\]

</td><td class="confluenceTd"> Not empty</td></tr><tr><td class="confluenceTd" colspan="1">userLogin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User identifier. Depends on user identifier type</td><td class="confluenceTd" colspan="1">Not empty, valid email address or phone with country prefix. For pl: 48500500500</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with key and optionally with LimitedResourceInfo.  
</p>

</td></tr></tbody></table>

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-39"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">key</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">(Required) Initialization key that will be required for finalize reser user password process</td></tr><tr><td class="confluenceTd" colspan="1" width="">limitedResourceInfo</td><td class="confluenceTd" colspan="1" width="">LimitedRedourceInfo?</td><td class="confluenceTd" colspan="1" width="">Additional paremeter which shows information about rate of APIs limits.</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bde8e26d-767a-4d6d-8051-64ec62259124" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-initializeresetu"><tbody><tr><td class="wysiwyg-macro-body">```
fun initializeResetUserPassword(userLoginType: UserType, userLogin: CharArray) {
    mobileDcApi
        .userService
        .initializeResetUserPassword(userLoginType, userLogin, { response ->
            val key = response // key is necessary to call the finalizeResetUserPassword method. 
        }, { throwable ->
            // Something went wrong. 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### initializeResetUserPassword

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-17"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Reset user's password with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-40"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">initializeResetUserPassword</td><td class="confluenceTd">InitializeResetUserPassword</td><td class="confluenceTd">An object containing user login type and user login</td><td class="confluenceTd"> Not empty

</td></tr></tbody></table>

**InitializeResetUserPassword** model:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-41"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th></tr><tr><td class="confluenceTd">userLoginType</td><td class="confluenceTd">UserType</td><td class="confluenceTd">User identifier type. One of: \[PHONE, EMAIL, INTERNAL\_ID, EXTERNAL\_ID\]

</td></tr><tr><td class="confluenceTd">userLogin</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User identifier. Depends on user identifier type</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with key.</p>

</td></tr></tbody></table>

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-42" style="width: 100%;"><colgroup><col style="width: 19.135802%;"></col><col style="width: 20.123457%;"></col><col style="width: 60.617284%;"></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th></tr><tr><td class="confluenceTd">key</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">(Required) Initialization key that will be required for finalize reser user password process</td></tr><tr><td class="confluenceTd" colspan="1">limitedResourceInfo</td><td class="confluenceTd" colspan="1">LimitedResourceInfo</td><td class="confluenceTd" colspan="1">Additional paremeter which shows information about rate limited APIs.</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bde8e26d-767a-4d6d-8051-64ec62259124" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-initializeresetu-0"><tbody><tr><td class="wysiwyg-macro-body">```
fun initializeResetUserPassword(initializeResetUserPassword: InitializeResetUserPassword) {
    mobileDcApi
        .userService
        .initializeResetUserPassword(initializeResetUserPassword, { response ->
            val key = response.key // key is necessary to call the finalizeResetUserPassword method. 
			val limitedResourceInfo = response.limitedResourceInfo // limitedResourceInfo contains information about 
            // rate limited APIs, all parameters are nullable
        }, { throwable ->
            // Something went wrong. 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### finalizeResetUserPassword

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-18"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Set new user password with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-43" style="width: 100%;"><colgroup><col style="width: 14.938272%;"></col><col style="width: 15.432099%;"></col><col style="width: 22.345679%;"></col><col style="width: 47.160494%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">userLoginType</td><td class="confluenceTd">UserType</td><td class="confluenceTd"> User identifier type. One of: \[PHONE, EMAIL, INTERNAL\_ID, EXTERNAL\_ID\]

</td><td class="confluenceTd"> Not empty</td></tr><tr><td class="confluenceTd" colspan="1">userLogin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User identifier. Depends on user identifier type</td><td class="confluenceTd" colspan="1">Not empty, valid email address or phone with country prefix. For pl: 48500500500</td></tr><tr><td class="confluenceTd" colspan="1">key</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Key from initialize reset user password method</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">otp</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">One time password (sent via email during initialize password reset process)</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">newPassword</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">New user password</td><td class="confluenceTd" colspan="1">The password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-14"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-finalizeresetuse"><tbody><tr><td class="wysiwyg-macro-body">```
fun finalizeResetUserPassword(userLoginType: UserType, userLogin: CharArray, 
	key: CharArray, otp: CharArray, newPassword: CharArray) {
    mobileDcApi
        .userService
        .finalizeResetUserPassword(userLoginType, userLogin, key, otp, newPassword, { 
           // The OTP has been sent
        }, { throwable ->
            // Something went wrong. 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### initializeEmailUpdate

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-19"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="be455b11-a2af-4ecd-b6fd-d757a5f09930">Change the user's email address to a new one.   
After confirming the change of the email, the one-time password ( OTP) will be sent to this address.  
</span></p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-44"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd" colspan="1">email</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">New email (an OTP will be sent to that address)

</td><td class="confluenceTd" colspan="1">Email format</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback with key.</p>

</td></tr></tbody></table>

<table class="confluenceTable" id="bkmrk-parameter-type-descr-45"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">key</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Initialization key that will be required for finalize reset user password process</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6d7f9b22-b90d-4a28-9b8d-5d9dffea2bd0" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-initializeemailu"><tbody><tr><td class="wysiwyg-macro-body">```
fun initializeEmailUpdate(email: CharArray) {
    mobileDcApi
        .userService
        .initializeEmailUpdate(email, { response ->
            val key = response // key is necessary to call the finalizeChangeEmail method.
        }, { throwable ->
            // Something went wrong.
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### finalizeEmailUpdate

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-20"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Set new user email.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-46" style="width: 100%;"><colgroup><col style="width: 11.728395%;"></col><col style="width: 10.246914%;"></col><col style="width: 58.271605%;"></col><col style="width: 19.62963%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd" colspan="1">key</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Key from initialize change email method</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">otp</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">One time password (sent via email during initialize change email process)</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-15"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-finalizeemailupd"><tbody><tr><td class="wysiwyg-macro-body">```
fun finalizeEmailUpdate(key: CharArray, otp: CharArray) {
    mobileDcApi
        .userService
        .finalizeEmailUpdate( key, otp, { 
           // The user's email has been changed
        }, { throwable ->
            // Something went wrong. 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### resendOtp

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-21"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Method for resend OTP.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-47" style="width: 100%;"><colgroup><col style="width: 14.567901%;"></col><col style="width: 15.925926%;"></col><col style="width: 38.765432%;"></col><col style="width: 30.740741%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd" colspan="1">userLoginType</td><td class="confluenceTd" colspan="1">UserType</td><td class="confluenceTd" colspan="1">User identifier type. One of: \[PHONE, EMAIL, INTERNAL\_ID, EXTERNAL\_ID\]</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">userLogin</td><td class="confluenceTd" colspan="1">User identifier. Depends on user identifier type</td><td class="confluenceTd" colspan="1">User identifier. Depends on user identifier type</td><td class="confluenceTd" colspan="1">Not empty, valid email address or phone with country prefix. For pl: 48500500500</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-16"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-resendotp%28userlo"><tbody><tr><td class="wysiwyg-macro-body">```
fun resendOtp(userLoginType: UserType, userLogin: CharArray) {
    mobileDcApi
        .userService
        .resendOtp( userLoginType, userLogin, { 
           // OTP has been sent
        }, { throwable ->
            // Something went wrong. 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### logout

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e6f53b54-8abb-4a1d-b90f-eadd82dc4836" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Cancels user session.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6ba37464-67ba-4870-b2e6-d83a4be5450e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-17"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-logout%28%29-%7B-mobil"><tbody><tr><td class="wysiwyg-macro-body">```
fun logout() {
    mobileDcApi
        .userService
        .logout({
            //User session has been canceled. Refresh user session to restore it.
        }, {
            //Something went wrong
            //Check exceptions described in Error handling chapter            
        })
}
```

</td></tr></tbody></table>

### deleteUser

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-22"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Delete data of current user and reset SDK state when success. The user can be hard or soft deleted depending on project’s configuration.  
Hard - method used to delete user with deleting data connected to the user (eg. card).  
Soft - method used to delete user without deleting data connected to the user (eg. card)</p>

<p class="callout info"><u>Usage of this method causes clearing all data related to selected user.</u>  
</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6ba37464-67ba-4870-b2e6-d83a4be5450e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success%2Ffailure-call"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success/failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="cefc550c-5147-4e3f-a684-9694049b9071" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-deleteuser%28%29-%7B-m"><tbody><tr><td class="wysiwyg-macro-body">```
fun deleteUser() {
    mobileDcApi
        .userService
        .deleteUser({
            //user is deleted, all data related to user, device cards etc is cleared. SDK is restarted.
        }, { throwable ->
            // Something went wrong
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

## Cards domain

### addCard

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-23"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Adds new payment card with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-48"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">addCard</td><td class="confluenceTd">AddCard</td><td class="confluenceTd">Card information data.</td></tr></tbody></table>

**AddCard**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-49" style="width: 100%;"><colgroup><col style="width: 11.234568%;"></col><col style="width: 11.975309%;"></col><col style="width: 15.802469%;"></col><col style="width: 60.864198%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cardNumber</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card number

</td><td class="confluenceTd">Field cannot be empty, it must contain only digits, a length of exactly 16 digits and the checksum of the digits must be valid</td></tr><tr><td class="confluenceTd">expirationDate</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card expiration date</td><td class="confluenceTd">Field may not be empty and must have a format MM/YY</td></tr><tr><td class="confluenceTd">description</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card description

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">cardHolder</td><td class="confluenceTd">CardHolder

</td><td class="confluenceTd">Card holder data</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">isDefault</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Is default card for user</td><td class="confluenceTd">-</td></tr><tr><td class="confluenceTd" colspan="1">currency</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Currency of card (ISO 4217, three letter code)</td><td class="confluenceTd" colspan="1">-</td></tr><tr><td class="confluenceTd" colspan="1">visualId</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Visual identifier</td><td class="confluenceTd" colspan="1">-</td></tr></tbody></table>

**CardHolder**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-50"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">firstName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">First name of card holder

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">lastName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Last name of card holder</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with cardId.</p>

</td></tr></tbody></table>

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-51"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of added card</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-addcard%28addcard%3A"><tbody><tr><td class="wysiwyg-macro-body">```
fun addCard(addCard: AddCard){
    mobileDcApi
        .cardsService
        .addCard(addCard, { cardId ->
            // Card added
        }, { throwable ->
            // Something went wrong, maybe any field is wrong? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### addCard (deprecated)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-24"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Adds new payment card with given parameters.</p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-52" style="width: 100%;"><colgroup><col style="width: 13.950617%;"></col><col style="width: 10.123457%;"></col><col style="width: 13.703704%;"></col><col style="width: 62.098765%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cardNumber</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card number</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="2a8b387b-a22d-43f1-8131-57ff337b7c6f">Field</span> cannot be empty, it must contain only digits, a length of exactly 16 digits and the checksum of the digits must be valid</td></tr><tr><td class="confluenceTd">expirationDate</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card expiration date</td><td class="confluenceTd">Field may not be empty and must have a format MM/YY</td></tr><tr><td class="confluenceTd">description</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card description

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">firstName</td><td class="confluenceTd">CharArray

</td><td class="confluenceTd">Card holder first name</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">lastName</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Card holder last name</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="cff68a64-a34e-4db0-b395-608e079f86eb">Output</span>**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with cardId.</p>

</td></tr></tbody></table>

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-53"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of added card</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="01dddc41-787c-48f2-b9a3-7e16de321244">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-addcard%28cardnumb"><tbody><tr><td class="wysiwyg-macro-body">```
fun addCard(cardNumber:CharArray, expirationDate:CharArray, description:CharArray, 
	firstName:CharArray, lastName:CharArray){
    	mobileDcApi
        	.cardsService
        	.addCard(cardNumber, expirationDate, description, firstName, lastName, { cardId ->
           	 // Card added
        	}, { throwable ->
          	  // Something went wrong, maybe any field is wrong? 
           	 // Check exceptions described in Error handling chapter
       	 })
}
```

</td></tr></tbody></table>

### getAll

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="62ccd748-1dd8-490f-825e-9fb87ed4cb5f" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-25"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Provides user cards from Mobile DC backend.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="6ba37464-67ba-4870-b2e6-d83a4be5450e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-7"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with list of user cards.</p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-54"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">cards</td><td class="confluenceTd">List &lt;Card&gt;</td><td class="confluenceTd">List of user cards

</td></tr></tbody></table>

**Card**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-0" style="width: 100%; height: 485px;"><colgroup><col style="width: 15.925926%;"></col><col style="width: 34.567901%;"></col><col style="width: 49.382716%;"></col></colgroup><tbody><tr style="height: 29px;"><th class="confluenceTh" style="height: 29px;">**Field**</th><th class="confluenceTh" style="height: 29px;">**Type**</th><th class="confluenceTh" style="height: 29px;">**Description**</th></tr><tr style="height: 57px;"><td class="confluenceTd" style="height: 57px;">cardId</td><td class="confluenceTd" style="height: 57px;">Long</td><td class="confluenceTd" style="height: 57px;">Card main identifier. Also used as paymentInstrumentId

</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">lastFourDigits</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Last four digits of user card</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">expirationDate</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Card expiration date</td></tr><tr style="height: 35px;"><td class="confluenceTd" colspan="1" style="height: 35px;">isVerified</td><td class="confluenceTd" colspan="1" style="height: 35px;">Boolean</td><td class="confluenceTd" colspan="1" style="height: 35px;">Flag informing about card verification

</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">cardHolder</td><td class="confluenceTd" colspan="1" style="height: 29px;">CardHolder</td><td class="confluenceTd" colspan="1" style="height: 29px;">Card holder details</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">visualPath</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Path to visual of card</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">description</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Card description</td></tr><tr style="height: 45px;"><td class="confluenceTd" colspan="1" style="height: 45px;">cardType</td><td class="confluenceTd" colspan="1" style="height: 45px;">CardType (MASTERCARD, VISA, OTHER, UNKNOWN)</td><td class="confluenceTd" colspan="1" style="height: 45px;">Type of card</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">isDefault</td><td class="confluenceTd" colspan="1" style="height: 29px;">Boolean</td><td class="confluenceTd" colspan="1" style="height: 29px;">Indicates if card is default user’s card</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">source</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">From which source card has been added</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">currency</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Currency code (ISO 4217, three letter code)</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">visualId</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Visual id</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">externalId</td><td class="confluenceTd" colspan="1" style="height: 29px;">String</td><td class="confluenceTd" colspan="1" style="height: 29px;">Card external id</td></tr><tr style="height: 29px;"><td class="confluenceTd" colspan="1" style="height: 29px;">isLocked</td><td class="confluenceTd" colspan="1" style="height: 29px;">Boolean</td><td class="confluenceTd" colspan="1" style="height: 29px;">Flag which informs if card is locked</td></tr></tbody></table>

**CardHolder**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-1"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh" colspan="1">**Description**</th></tr><tr><td class="confluenceTd">firstName</td><td class="confluenceTd">String</td><td class="confluenceTd" colspan="1">Card holder first name</td></tr><tr><td class="confluenceTd">lastName</td><td class="confluenceTd">String</td><td class="confluenceTd" colspan="1">Card holder last name</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0d22d5a0-2696-456f-9197-316a059eb4c3" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="624723bc-c8d5-40cb-b571-7983b758cc02" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getcards%28%29-%7B-mob"><tbody><tr><td class="wysiwyg-macro-body">```
fun getCards() {
    mobileDcApi
        .cardsService
        .getAll({ cards ->
            showCardList(cards)
        }, {
            // Something went wrong
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### deleteCard

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-26"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Delete card with given card id.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-55"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of deleting card</td><td class="confluenceTd">Field cannot be empty.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-18"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-deletecard%28cardi"><tbody><tr><td class="wysiwyg-macro-body">```
fun deleteCard(cardId: Long) {
    mobileDcApi
        .cardsService
        .deleteCard(cardId, {
            //Success
        }, {
            //Something went wrong
            //Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### initialize3ds

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-27"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Card verification- initialize 3D Secure. Provides the data needed for the 3D Secure verification process.</p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-56"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th><th class="confluenceTh">Validation conditions</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of added card</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-8"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with Initialize3dsResult.</p>

</td></tr></tbody></table>

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-57"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">initialize3dsResult</td><td class="confluenceTd">Initialize3dsResult</td><td class="confluenceTd">Contains necessary data for 3DS verification</td></tr></tbody></table>

**Initialize3dsResult**

<table class="wrapped relative-table confluenceTable" id="bkmrk-field-type-descripti-2"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">paymentId</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Internal transaction id</td></tr><tr><td class="confluenceTd">pageContent</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Content of webpage to be shown in browser created in application</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-initialize3ds%28mo"><tbody><tr><td class="wysiwyg-macro-body">```
fun initialize3ds(mobileDcApi: MobileDcApiKotlin, cardId: Long) {
        mobileDcApi
                .cardsService
                .initialize3ds(cardId, { result ->
                    val paymentId = result.paymentId
                    val pageContent = result.pageContent

                    // Check is pageContent not null
                    if (pageContent != null) {
                        // Necessary convert from CharArray to ByteArray
                        val pageContentToByteArray = pageContent.toByteArray()
                        openWebView(paymentId, pageContentToByteArray)
                    } else {
                        // Card verification error
                    }
                }, { throwable ->
                    // Something went wrong, maybe cardId is invalid?
                    // Check exceptions described in Error handling chapter
                })

    }

    fun openWebView(paymentId: CharArray, pageContent: ByteArray) {
        //Bind your webView
        val myWebView = findViewById<WebView>(R.id.myWebView)

        //JavaScript is disabled in a WebView by default. You can enable it through the WebSettings
        //attached to your WebView. You can retrieve WebSettings with getSettings(), then enable JavaScript 
        //with setJavaScriptEnabled().
        val webSettings: WebSettings = myWebView.getSettings()
        webSettings.javaScriptEnabled = true

        //Necessary bind this class to the JavaScript that runs in your WebView with addJavascriptInterface() 
        //and name the interface Android.
        myWebView.addJavascriptInterface(WebAppInterface(), "Android")

        // Decode pageContent from initialize3ds response
        val viewPageContent = String(Base64.decode(pageContent, Base64.DEFAULT))
        // Load page in vebWiew
        myWebView.loadData(viewPageContent, "text/html; charset=UTF-8", "utf-8")
    }

//To bind a new interface between your JavaScript and Android code, call addJavascriptInterface(),
//passing it a class instance to bind to your JavaScript and an interface name that your JavaScript 
//can call to access the class, like below example

    class WebAppInterface {
        // Get the pares parameter from the web page
        @JavascriptInterface
       	fun setData(pares: String?) {
            // onPares interface method provides the pares parameter after interaction with webView. 
            //Parameter pares is needed to perform finalize3ds
            // Necessary convert from String to CharArray
            val paresToCharArray = pares?.toCharArray()
            // close webView
            // Then you need to properly handle the parameter pares to be able to call finalize3ds
            //with the parameter pares and paymentId.
        }
    }

```

</td></tr></tbody></table>

### finalize3ds

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-28"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Card verification - finalize 3D Secure. Verifies the payment card by the 3D Secure.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-58" style="width: 100%;"><colgroup><col style="width: 11.604938%;"></col><col style="width: 10.37037%;"></col><col style="width: 28.271605%;"></col><col style="width: 49.62963%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of added card</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">cvc</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Card verification code </td><td class="confluenceTd" colspan="1">Field cannot be empty, it must contain only digits, a length of exactly 3 digits</td></tr><tr><td class="confluenceTd" colspan="1">pares</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="14d8c3e1-9ee3-4664-9aed-dec3d13d2c86">Received after successful interaction with webView  
</span></td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">paymentId</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="424ee91e-3788-4cf8-8ed6-bfd594e0455f">Received after a valid query to Initialize3ds  
</span></td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-9"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with Finalize3dsResult.</p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-59"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">finalize3dsResult</td><td class="confluenceTd">Finalize3dsResult</td><td class="confluenceTd">Contains data on the needed to carry out the amount verification and the verification value of the cardholder authentication</td></tr></tbody></table>

**Finalize3dsResult**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-3"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">amountValidation</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Inform if random quotation should be used to complete card verification</td></tr><tr><td class="confluenceTd">cavv</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Cardholder authentication verification value</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="c9cfe99d-66da-444d-a0c1-97fa75b87968">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-finalize3ds%28mobi"><tbody><tr><td class="wysiwyg-macro-body">```
fun finalize3ds(mobileDcApi: MobileDcApiKotlin, cardId: Long, cvc: CharArray, pares: CharArray, 
	paymentId: CharArray) {
    	mobileDcApi
        	    .cardsService
            	.finalize3ds(cardId, cvc, pares, paymentId, { result ->
                	val amountValidation = result.amountValidation
                	val cavv = result.cavv
           		 }, { throwable ->
            	    // Something went wrong, maybe any field is invalid?
                	// Check exceptions described in Error handling chapter
            })
}
```

</td></tr></tbody></table>

### initialize3DSv2

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-29"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Card verification - initialize 3D Secure. Provides the data needed for the 3D Secure verification process.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-60"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">initialize3DSv2</td><td class="confluenceTd">Initialize3DSv2</td><td class="confluenceTd">An object containing data for secure verification process.</td><td class="confluenceTd">Not empty

</td></tr></tbody></table>

**Initialize3DSv2**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-61" style="width: 100%;"><colgroup><col style="width: 12.716049%;"></col><col style="width: 9.135802%;"></col><col style="width: 61.728395%;"></col><col style="width: 16.296296%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditaions**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of the card</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">challengeUrl</td><td class="confluenceTd">String</td><td class="confluenceTd">Callback url to handle redirect during Challenge (status CHALLENGE\_REQUIRED from response).  
Check sample implementation below.

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">browserDetails</td><td class="confluenceTd">BrowserDetails</td><td class="confluenceTd">Object with properties described below</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**BrowserDetails**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-62"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">timezoneOffset</td><td class="confluenceTd">String</td><td class="confluenceTd">Timezone offset - numeric</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">userAgent</td><td class="confluenceTd">String</td><td class="confluenceTd">User Agent</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">acceptHeader</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Accept Header</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">screenWidth</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Screen Width - numeric</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">screenHeight</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Screen Height</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">language</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Language - IETF BCP 47</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">browserIp</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Browser IP</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">screenColorDepth</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Screen Color Depth - numeric</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-10"><tbody><tr><td class="wysiwyg-macro-body">**Success callback with Initialize3DSv2Result**

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-63"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">initialize3DSv2Result</td><td class="confluenceTd">Initialize3DSv2Result</td><td class="confluenceTd">Contains necessary data for 3DS verification</td></tr></tbody></table>

**Initialize3DSv2Result**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-4" style="width: 100%;"><colgroup><col style="width: 17.901235%;"></col><col style="width: 8.271605%;"></col><col style="width: 73.703704%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">status</td><td class="confluenceTd">String</td><td class="confluenceTd">Status returned of operation. Status could be SUCCESS or CHALLENGE\_REQUIRED.  
For SUCCESS the Card is already verified and no more action is required.  
For CHALLENGE\_REQUIRED application should show WebView with content from *challengeHtmlFromBase64.*

</td></tr><tr><td class="confluenceTd">authenticationId</td><td class="confluenceTd">String</td><td class="confluenceTd">Card authentication id, used in finalize3DSv2 method.</td></tr><tr><td class="confluenceTd" colspan="1">acsUrl</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">ACS (Access Control Server) url. Required for CHALLENGE\_REQUIRED.</td></tr><tr><td class="confluenceTd" colspan="1">challengeHtmlFormBase64</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">64BASED html code provided ACQ/ASC. This should be displayed to Application User. Required for CHALLENGE\_REQUIRED.</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-initialize3dsv2%28"><tbody><tr><td class="wysiwyg-macro-body">```
fun initialize3DSv2(mobileDcApi : MobileDcApiKotlin){
    mobileDcApi
        .cardsService
        .initialize3DSv2(initialize3DSv2, { initialize3DSv2Result ->
            when (initialize3DSv2Result.status) {
                "SUCCESS" -> {
                    //3DS success, no more action is required
                }

                "CHALLENGE_REQUIRED" -> {
                    showWebView(initialize3DSv2Result.challengeHtmlFormBase64, challengeUrl)
                }

                else -> //failure
            }
        }, { throwable ->
        	// Something went wrong
            // Check exceptions described in Error handling chapter
        })
}


//WebView implementation

fun showWebView(challengeHtmlFormBase64: String, challengeUrl : String) {

    val viewPageContent = String(Base64.decode(challengeHtmlFormBase64, Base64.DEFAULT))
    val webViewUrlDetectionClient = WebViewUrlDetectionClient(challengeUrl)

    with(webView) {
        webViewClient = webViewUrlDetectionClient
		settings.javaScriptEnabled = true
		visibility = View.VISIBLE
        loadData(
            viewPageContent,
            "text/html; charset=UTF-8",
            "utf-8"
        )
    }
}


//sample WebViewClient implementation for handing redirect on challangeUrl
class WebViewUrlDetectionClient(private val challengeUrl: String): WebViewClient() {
    override fun onPageStarted(view: WebView, url: String, favicon: Bitmap?) {
        super.onPageStarted(view, url, favicon)
        if (url.equals(challengeUrl, true)) {
            //call finalize3DSv2(cardId, initialize3DSv2Result.authenticationId)
        }
    }
}
```

</td></tr></tbody></table>

### finalize3DSv2

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-30"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Card verification - finalize 3D Secure. Verifies the payment card by the 3D Secure.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-64"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">finalize3DSv2</td><td class="confluenceTd">Finalize3DSv2</td><td class="confluenceTd">An object containing data for secure finalization process.</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

####   


**Finalize3DSv2**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-65"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Id of the card.</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">authenticationId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifier of verification process from Initialize3DSv2Result</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2F-fa-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback/ Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-finalize3ds%28mobi-0"><tbody><tr><td class="wysiwyg-macro-body">```
fun finalize3DS(mobileDcApi : MobileDcApiKotlin) {

    val finalize3DSv2Input = Finalize3DSv2(cardId, authenticationId)

    mobileDcApi
        .cardsService
        .finalize3DSv2(
            finalize3DSv2Input, {
                //3DS finished with success
            }, { throwable ->
            	// Something went wrong
                // Check exceptions described in Error handling chapter
            }
        )
}
```

</td></tr></tbody></table>

### updateCard

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="62ccd748-1dd8-490f-825e-9fb87ed4cb5f" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-method-for-updating-"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Method for updating payment card data.</p>

</td></tr></tbody></table>

**Input**

<table class="confluenceTable" id="bkmrk-parameter-type-descr-66"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">updateCard</td><td class="confluenceTd" colspan="1">UpdateCard</td><td class="confluenceTd" colspan="1">An object containing card data to update</td></tr></tbody></table>

**UpdateCard**

<table class="confluenceTable" id="bkmrk-parameter-type-descr-67"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Unique card id</td></tr><tr><td class="confluenceTd">description</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card description</td></tr><tr><td class="confluenceTd">currency</td><td class="confluenceTd">CharArry</td><td class="confluenceTd">Card currency (ISO 4217, three letter code format)</td></tr><tr><td class="confluenceTd">isDefault</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Is this card default</td></tr><tr><td class="confluenceTd" colspan="1">visualId</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Card visual identifier</td></tr><tr><td class="confluenceTd">firstName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card holder first name - send only when lastName is not blank</td></tr><tr><td class="confluenceTd">lastName</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Card holder last name - send only when firstName is not blank</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2F-fa-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback/ Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-updatecard%28cardi"><tbody><tr><td class="wysiwyg-macro-body">```
fun updateCard(cardId: Long, description: CharArray?, isDefault: Boolean?, firstName: CharArray?, lastName: CharArray?){
	val updateCard = UpdateCard(cardId).apply {
		this.description = description
		this.firstName = firstName
		this.lastName = lastName
		this.isDefault = isDefault
	}

    mobileDcApi
        .cardsService
        .updateCard(updateCard) {
            // Card updated
        }, { throwable ->
            // Something went wrong, maybe any field is wrong? 
            // Check exceptions described in Error handling chapter
        })
}
```

</td></tr></tbody></table>

### verifyCard

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-31"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Card verification - verify card after 3ds.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-68"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">verifyCard</td><td class="confluenceTd" colspan="1">VerifyCard</td><td class="confluenceTd" colspan="1">An object containing card data to verify.</td></tr></tbody></table>

**VerifyCard**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-69" style="width: 100%;"><colgroup><col style="width: 8.641975%;"></col><col style="width: 11.234568%;"></col><col style="width: 80%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Unique card id</td></tr><tr><td class="confluenceTd">amount</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">If finalize3ds returns amountValidation set to false should be null otherwise value is amount freezed on the user account during card verification (value between 100 and 200 pennies).</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2F-fa-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback/ Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-verifycard%28cardi"><tbody><tr><td class="wysiwyg-macro-body">```
fun verifyCard(cardId: Long, amount: CharArray?, amountValidation: Boolean) {
    val verifyCard: VerifyCard = VerifyCard(cardId).apply {
        this.amount = if (amountValidation) amount else null
    }
    mobileDcApi
        .cardsService
        .verifyCard(verifyCard, {
            //handle success
        }, { throwable ->
            //handle failure
        })
}
```

</td></tr></tbody></table>

## Device domain

### pairByPassword (deprecated in 2.14.3)  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-32"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="c7e7b47e-b586-4ee7-be43-abe9635bfa92">Pairs device using given password and user identifier.</span></p>

<p class="callout info"><span class="inline-comment-marker" data-ref="c7e7b47e-b586-4ee7-be43-abe9635bfa92">Deprecated, use pairByPassword(PairByPassword)</span></p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="920192c0-ccc2-4ba9-8659-438b7e5694bc">Input</span>**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-70" style="width: 100%;"><colgroup><col style="width: 13.950617%;"></col><col style="width: 10.740741%;"></col><col style="width: 26.17284%;"></col><col style="width: 49.012346%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">userLoginType</td><td class="confluenceTd">UserType</td><td class="confluenceTd">User identifier type. One of: \[PHONE, EMAIL, INTERNAL\_ID, EXTERNAL\_ID\]

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">userLogin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User identifier. Depends on user identifier type</td><td class="confluenceTd" colspan="1">Email or Phone with country prefix

</td></tr><tr><td class="confluenceTd" colspan="1">userPassword</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">User password</td><td class="confluenceTd" colspan="1">Password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr><tr><td class="confluenceTd" colspan="1">fcmToken</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Token for push notifications</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">biometricAuthType</td><td class="confluenceTd" colspan="1">BiometricAuthType</td><td class="confluenceTd" colspan="1">Optional. One of: \[BIOMETRIC\_ONLY, BIOMETRIC\_WITH\_ALTERNATIVE\].

BIOMETRIC\_ONLY - enable only biometric authentication

BIOMETRIC\_WITH\_ALTERNATIVE - enable device level authentication

If not set any of above don't be enable.

</td><td class="confluenceTd" colspan="1">  
</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="cefb375f-5c7f-40f0-9218-4a314e3e4f3a">Output</span>**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-19"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f3fc93ca-244a-4803-b401-00a97dfd323e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-pairbypassword%28-"><tbody><tr><td class="wysiwyg-macro-body">```
fun pairByPassword(
    email: CharArray, //user email
    password: CharArray, //user password
    fcmToken: CharArray  // saved FCM token from Firebase service
) {

    mobileDcApi
        .deviceService
        .pairByPassword(UserType.EMAIL, email, password, fcmToken,
            {
                //device is paired, now you can use this device to manage Mobile DC resources
            },
            { throwable ->
                // Something went wrong, maybe any field is wrong?
                // Check exceptions described in Error handling chapter
            }
        )
}
```

</td></tr></tbody></table>

### pairByPassword  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="bdb4f40b-16a6-466d-b7e8-9395322829c4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-33"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="c7e7b47e-b586-4ee7-be43-abe9635bfa92">Pairs device using given password and user identifier.</span></p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="920192c0-ccc2-4ba9-8659-438b7e5694bc">Input</span>**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-71"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">pairByPassword</td><td class="confluenceTd">PairByPassword</td><td class="confluenceTd">An object containing user information to pair device.

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**PairByPassword**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-72" style="width: 100%;"><colgroup><col style="width: 14.320988%;"></col><col style="width: 13.950617%;"></col><col style="width: 18.024691%;"></col><col style="width: 53.580247%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">userLoginType</td><td class="confluenceTd">UserType</td><td class="confluenceTd">User identifier type. One of: \[PHONE, EMAIL, INTERNAL\_ID, EXTERNAL\_ID\]

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">userLogin</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User identifier. Depends on user identifier type</td><td class="confluenceTd">Email or Phone with country prefix

</td></tr><tr><td class="confluenceTd">userPassword</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User password</td><td class="confluenceTd">Password should be composed of at least 8 characters and include at least 3 out of the following 4 categories: upper-case letter, lower-case letter, special character and digit</td></tr><tr><td class="confluenceTd">cloudMessagingRegistrationToken</td><td class="confluenceTd">CloudMessagingRegistrationToken</td><td class="confluenceTd">An object containing cloud messaging registration token information.</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">biometricAuthType</td><td class="confluenceTd">BiometricAuthType</td><td class="confluenceTd">Optional. One of: \[BIOMETRIC\_ONLY, BIOMETRIC\_WITH\_ALTERNATIVE\].

BIOMETRIC\_ONLY - enable only biometric authentication

BIOMETRIC\_WITH\_ALTERNATIVE - enable device level authentication

If not set any of above don't be enable.

</td><td class="confluenceTd">  
</td></tr><tr><td>externalDeviceId</td><td>String?</td><td>External device id

</td><td>  
</td></tr></tbody></table>

**CloudMessagingRegistrationToken**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-73"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">type</td><td class="confluenceTd">CloudMessagingType</td><td class="confluenceTd">Mandatory. One of: \[FCM\].

FCM - Firebase Cloud Messaging

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">token</td><td class="confluenceTd">String</td><td class="confluenceTd">Token for push notifications

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="cefb375f-5c7f-40f0-9218-4a314e3e4f3a">Output</span>**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7a415e9-e54f-418b-8638-8749fce6d79a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-20"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f3fc93ca-244a-4803-b401-00a97dfd323e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-val-cloudmessagingre"><tbody><tr><td class="wysiwyg-macro-body">```
val cloudMessagingRegistrationToken: CloudMessagingRegistrationToken =
    CloudMessagingRegistrationToken(
        type: CloudMessagingType, //messaging token type
        token: String // saved cloud messaging token
    )
 
val pairByPassword: PairByPassword =
    PairByPassword(
        userLoginType: UserType, //user identifier type
        userLogin: CharArray, //user identifier
        password: CharArray, //user password
        cloudMessagingRegistrationToken: CloudMessagingRegistrationToken, //cloud messaging registration token information
        biometricAuthType: BiometricAuthType?, //Optional biometric authentication type
        externalDeviceId: String? //Optional external device id
)
 
fun pairByPassword(pairByPassword: PairByPassword) {
    mobileDcApi
        .deviceService
        .pairByPassword(pairByPassword,
            {
                //device is paired, now you can use this device to manage Mobile DC resources
            },
            { throwable ->
                // Something went wrong, maybe any field is wrong?
                // Check exceptions described in Error handling chapter
            }
        )
}
```

</td></tr></tbody></table>

### pairByTrustedIdentity (deprecared in 2.14.3)  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="aee94788-bdc6-4a95-8224-e0f5ff3c59c1" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-34"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Binds device to user in Mobile DC backend with Trusted Identity genetated by client server.</p>

<p class="callout info">Deprecated, use pairByTrustedIdentity(PairByTrustedIdentity).</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-74"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">trustedIdentity</td><td class="confluenceTd">String</td><td class="confluenceTd">JSON Web Token containing registration data

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">fcmRegistrationToken</td><td class="confluenceTd">CharArray</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="ce48baeb-cf63-42db-b50b-1a906bc791e9">FCM Cloud messaging registration token</span>

</td><td class="confluenceTd">Not empty

</td></tr></tbody></table>

**TrustedIdentity**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-75"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh" colspan="1">Parameter</th><th class="confluenceTh" colspan="1">Type</th><th class="confluenceTh" colspan="1">Description</th><th class="confluenceTh" colspan="1">Validation conditions

</th></tr><tr><td class="confluenceTd">userId</td><td class="confluenceTd">String</td><td class="confluenceTd">External user id given by the client

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="938b982f-76b9-472d-9776-9de893d5dbe0" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-21"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

Sample code for *trustedIdentity* generation (<span class="inline-comment-marker" data-ref="df185511-fdb4-471c-b2bb-17fe8f12383b">see also </span>*<span class="inline-comment-marker" data-ref="df185511-fdb4-471c-b2bb-17fe8f12383b">[Data signing and encryption](https://wiki.verestro.com/display/UCP/Data+signing+and+encryption)</span>* chapter):

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-trustedidentit-0"><tbody><tr><td class="wysiwyg-macro-body">```
class TrustedIdentity {
    fun generate() {
        val claims = JWTClaimsSet.Builder()
            .claim("userId", "externalUserId")
            .build();

        val trustedIdentity = JwtGenerator.generate(claims, certificates, privateKey);
        // ...
    }
}
```

</td></tr></tbody></table>

Usage of trustedIdentity in application:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f3fc93ca-244a-4803-b401-00a97dfd323e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-pairdevicebytrus"><tbody><tr><td class="wysiwyg-macro-body">```
fun pairDeviceByTrustedIdentity(
    mobileDcApi: MobileDcApiKotlin,
    trustedIdentity: String
) {

    val fcmToken = getFcmRegistartionToken() // get saved FCM token from FirebaseMessagingService, or from 
		//FirebaseInsanceId::getToken()

	mobileDcApi
        .deviceService
        .pairByTrustedIdentity(
            trustedIdentity,
            fcmToken, {
                //device is paired, now you can use this device to manage Mobile DC resources
            }, { throwable ->
                //some error occured, check exception
            })
}
```

</td></tr></tbody></table>

### pairByTrustedIdentity  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="aee94788-bdc6-4a95-8224-e0f5ff3c59c1" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-35"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Binds device to user in Mobile DC backend with Trusted Identity genetated by client server.</p>

  
</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-76" style="width: 100%;"><colgroup><col style="width: 20%;"></col><col style="width: 19.62963%;"></col><col style="width: 40.740741%;"></col><col style="width: 19.62963%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">pairByTrustedIdentity</td><td class="confluenceTd">PairByTrustedIdentity</td><td class="confluenceTd">An object containing user information to pair device.

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**PairByTrustedIdentity**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-77"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">trustedIdentity</td><td class="confluenceTd">String</td><td class="confluenceTd">JSON Web Token containing registration data

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">cloudMessagingRegistrationToken</td><td class="confluenceTd">CloudMessagingRegistrationToken</td><td class="confluenceTd">An object containing cloud messaging registration token information.

</td><td class="confluenceTd">Not empty

</td></tr><tr><td>externalDeviceId</td><td>String  
</td><td>External device id

</td><td></td></tr></tbody></table>

**TrustedIdentity**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-78"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh" colspan="1">**Parameter**</th><th class="confluenceTh" colspan="1">**Type**</th><th class="confluenceTh" colspan="1">**Description**</th><th class="confluenceTh" colspan="1">**Validation conditions**

</th></tr><tr><td class="confluenceTd">userId</td><td class="confluenceTd">String</td><td class="confluenceTd">External user id given by the client

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**CloudMessagingRegistrationToken**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-79"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">type</td><td class="confluenceTd">CloudMessagingType</td><td class="confluenceTd">Mandatory. One of: \[FCM\].

FCM - Firebase Cloud Messaging

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">token</td><td class="confluenceTd">String</td><td class="confluenceTd">Token for push notifications

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="938b982f-76b9-472d-9776-9de893d5dbe0" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-22"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

Sample code for *trustedIdentity* generation (<span class="inline-comment-marker" data-ref="df185511-fdb4-471c-b2bb-17fe8f12383b">see also </span>*<span class="inline-comment-marker" data-ref="df185511-fdb4-471c-b2bb-17fe8f12383b">[Data signing and encryption](https://wiki.verestro.com/display/UCP/Data+signing+and+encryption)</span>* chapter):

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="43fc608c-04c3-42b3-94c0-31190bb52ee0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-trustedidentit-1"><tbody><tr><td class="wysiwyg-macro-body">```
class TrustedIdentity {
    fun generate() {
        val claims = JWTClaimsSet.Builder()
            .claim("userId", "externalUserId")
            .build();

        val trustedIdentity = JwtGenerator.generate(claims, certificates, privateKey);
        // ...
    }
}
```

</td></tr></tbody></table>

Usage of trustedIdentity in application:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f3fc93ca-244a-4803-b401-00a97dfd323e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-val-cloudmessagingre-0"><tbody><tr><td class="wysiwyg-macro-body">```
val cloudMessagingRegistrationToken: CloudMessagingRegistrationToken =
    CloudMessagingRegistrationToken(
        type: CloudMessagingType, //messaging token type
        token: String // saved cloud messaging token
    )
 
val pairByTrustedIdentity: PairByTrustedIdentity =
    PairByTrustedIdentity(
        trustedIdentity: String, //JSON Web Token containing registration data
        cloudMessagingRegistrationToken: CloudMessagingRegistrationToken, //cloud messaging registration token information
        externalDeviceId: String? //Optional external device id
)
 
fun pairByTrustedIdentity(pairByTrustedIdentity: PairByTrustedIdentity) {
    mobileDcApi
        .deviceService
        .pairByTrustedIdentity(pairByTrustedIdentity,
            {
                //device is paired, now you can use this device to manage Mobile DC resources
            },
            { throwable ->
                // Something went wrong, maybe any field is wrong?
                // Check exceptions described in Error handling chapter
            }
        )
}
```

</td></tr></tbody></table>

###   


### pairByExternalCredentials (deprecated in 2.14.3)  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="501a32d9-eb50-4e3b-8c75-3c03cc79f384" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-36"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Binds device to user in Mobile DC backend using username and password.</p>

<p class="callout info">Deprecated, use pairByTrustedIdentity(PairByExternalCredentials).</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-80" style="width: 100%;"><colgroup><col style="width: 18.148148%;"></col><col style="width: 18.024691%;"></col><col style="width: 46.54321%;"></col><col style="width: 17.160494%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">username</td><td class="confluenceTd">String</td><td class="confluenceTd">User identifier

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">password</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User password</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">fcmRegistrationToken</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">FCM Cloud messaging registration token

</td><td class="confluenceTd">Not empty

</td></tr><tr><td class="confluenceTd" colspan="1">biometricAuthType</td><td class="confluenceTd" colspan="1">BiometricAuthType</td><td class="confluenceTd" colspan="1">Optional. One of: \[BIOMETRIC\_ONLY, BIOMETRIC\_WITH\_ALTERNATIVE\].

BIOMETRIC\_ONLY - enable only biometric authentication

BIOMETRIC\_WITH\_ALTERNATIVE - enable device level authentication

If not set any of above don't be enable.

</td><td class="confluenceTd" colspan="1">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="497eb30c-b59c-4a04-87a0-58683bec286d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-23"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="593e803b-eaf5-4268-ac4b-633d7867af23" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-pairbyexternalcr"><tbody><tr><td class="wysiwyg-macro-body">```
fun pairByExternalCredentials() {

    val username: CharArray = getCharArrayFromInput() //get username provided by user
    val password: CharArray = getCharArrayFromInput() //get password provided by user
    val fcmToken = getFcmToken() // get saved FCM token from Firebase service

    mobileDcApi
        .deviceService
        .pairByExternalCredentials(
            username,
            password,
            fcmToken, {
                //device is paired, now you can use this device to manage Mobile DC resources
            }, { throwable ->
                //some error occured, check exception
            })
}
```

</td></tr></tbody></table>

### pairByExternalCredentials  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="501a32d9-eb50-4e3b-8c75-3c03cc79f384" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-37"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Binds device to user in Mobile DC backend using username and password.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-81" style="width: 100%;"><colgroup><col style="width: 22.962963%;"></col><col style="width: 23.209877%;"></col><col style="width: 35.308642%;"></col><col style="width: 18.271605%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">pairByExternalCredentials</td><td class="confluenceTd">PairByExternalCredentials</td><td class="confluenceTd">An object containing user information to pair device.

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**PairByExternalCredentials**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-82"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">username</td><td class="confluenceTd">String</td><td class="confluenceTd">User identifier

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">password</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">User password</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">cloudMessagingRegistrationToken</td><td class="confluenceTd">CloudMessagingRegistrationToken</td><td class="confluenceTd">FCM Cloud messaging registration token

</td><td class="confluenceTd">Not empty

</td></tr><tr><td class="confluenceTd">biometricAuthType</td><td class="confluenceTd">BiometricAuthType</td><td class="confluenceTd">Optional. One of: \[BIOMETRIC\_ONLY, BIOMETRIC\_WITH\_ALTERNATIVE\].

BIOMETRIC\_ONLY - enable only biometric authentication

BIOMETRIC\_WITH\_ALTERNATIVE - enable device level authentication

If not set any of above don't be enable.

</td><td class="confluenceTd">  
</td></tr><tr><td>deviceExternalId</td><td>String  
</td><td>External device id

</td><td></td></tr></tbody></table>

**CloudMessagingRegistrationToken**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-83"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">type</td><td class="confluenceTd">CloudMessagingType</td><td class="confluenceTd">Mandatory. One of: \[FCM\].

FCM - Firebase Cloud Messaging

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">token</td><td class="confluenceTd">String</td><td class="confluenceTd">Token for push notifications

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="497eb30c-b59c-4a04-87a0-58683bec286d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-24"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="593e803b-eaf5-4268-ac4b-633d7867af23" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-val-cloudmessagingre-1"><tbody><tr><td class="wysiwyg-macro-body">```
val cloudMessagingRegistrationToken: CloudMessagingRegistrationToken =
    CloudMessagingRegistrationToken(
        type: CloudMessagingType, //messaging token type
        token: String //saved cloud messaging token
    )
 
val pairByExternalCredentials: PairByExternalCredentials = PairByExternalCredentials(
    userName: CharrArray, //username provided by user
    password: CharrArray, //password provided by user
    cloudMessagingRegistratinoToken: CloudMessagingRegistrationToken, //cloud messaging registration token information
    biometricAuthType: BiometricAuthType?, //Optional biometric authentication type
    externalDevice: String? //Optional external device id
)
 
fun pairByExternalCredentials(pairByExternalCredentials: PairByExternalCredentials) {
 
    mobileDcApi
        .deviceService
        .pairByExternalCredentials(pairByExternalCredentials,
            {
                //device is paired, now you can use this device to manage Mobile DC resources
            },
            { throwable ->
                // Something went wrong, maybe any field is wrong?
                // Check exceptions described in Error handling chapter
            }
        )
}
```

</td></tr></tbody></table>

### isDevicePaired

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="3b5a673b-4913-48fc-a8fa-2109156c02e5" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Method allow to check is Device already paired with MDC Backend.  
</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="2d274cb7-d7ff-43cb-8d45-5c66f70e21f2" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f45f933d-d457-4e35-a6e2-4ba9159c0256" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-25"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="e0152a11-495b-4976-a1f0-d52b84caf1b5">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e7cf8263-8c60-44e0-a8c1-8921372f7cfc" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-isdevicepaired%28%29"><tbody><tr><td class="wysiwyg-macro-body">```
fun isDevicePaired() {
    mobileDcApi
        .deviceService
        .isDevicePaired()
        {
           // return is device paired state
		},
		{throwable ->  
           // some error occurred, check exception
        }
}
```

</td></tr></tbody></table>

### unPairDevice

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="3b5a673b-4913-48fc-a8fa-2109156c02e5" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-38"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Removes all data collected by SDK and binding between user and device in Mobile DC backend.</p>

<p class="callout info">Pairing device to user can be made by &lt;&lt;pairBy...&gt;&gt; methods.</p>

</td></tr></tbody></table>

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="2d274cb7-d7ff-43cb-8d45-5c66f70e21f2" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-7"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">No input parameters.</p>

</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f45f933d-d457-4e35-a6e2-4ba9159c0256" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-26"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="b7021ba3-2ffd-47e7-980f-04c69342b040" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-unpairdevice%28%29-%7B"><tbody><tr><td class="wysiwyg-macro-body">```
fun unPairDevice() {
    
	mobileDcApi
        .deviceService
        .unPairDevice({
            //device is unPaired, SDK cannot be not longer used
            //application can remove all data in context of sDKDefaultBackoffStrategy
            //for use SDK again call pairBy.. method
        }, { throwable ->
            //some error occured, check exception
        })
}
```

</td></tr></tbody></table>

## Cloud messaging domain

### process

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a08899fb-56fd-4a6a-8d48-6cda5cec88b7" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-7"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Processes data sent by backend (push notification data).  
Application should check Verestro senderId in RemoteMessage object (RemoteMessage::from method) to verify sender. Method can throw InvalidPushException in case of invalid push content passed to it.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-84" style="width: 100%;"><colgroup><col style="width: 12.962963%;"></col><col style="width: 19.259259%;"></col><col style="width: 48.271605%;"></col><col style="width: 19.382716%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">pushData</td><td class="confluenceTd">Map&lt;String, String&gt;</td><td class="confluenceTd">Data received from notification service in *RemoteMessage*object

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-11"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success/failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="28e5697f-9e96-4bf0-9a9a-22065da37fb2" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Ffirebasemessagings"><tbody><tr><td class="wysiwyg-macro-body">```
//FirebaseMessagingService class from Firebase

override fun onMessageReceived(remoteMessage: RemoteMessage) {
    super.onMessageReceived(remoteMessage)

    val senderId: String? = remoteMessage.from
    val pushData = remoteMessage.data

	//check push source only when push source is Verestro sender Id

    if (isVerestroSenderId(senderId)) {
        mobileDcApi
            .cloudMessagingService
            .process(pushData, {
               //push sent to SDK
            }, {
                //some error
            })

    } else {
        //proceed push from another source
    }
}
```

</td></tr></tbody></table>

### getSource (Deprecated in 2.14.3)  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a08899fb-56fd-4a6a-8d48-6cda5cec88b7" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-8"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.</p>

<p class="callout info">Checks Verestro Backend service source of push content.</p>

<p class="callout info">Application should check senderId in RemoteMessage object (RemoteMessage::from method) before passing data to this method.</p>

<p class="callout info">Deprecated in 2.14.3, no longer required to use.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-85" style="width: 100%;"><colgroup><col style="width: 11.481481%;"></col><col style="width: 19.62963%;"></col><col style="width: 49.382716%;"></col><col style="width: 19.382716%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">pushData</td><td class="confluenceTd">Map&lt;String, String&gt;</td><td class="confluenceTd">Data received from notification service in *RemoteMessage*object

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-12"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with *source* of push.</p>

</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-86"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">source</td><td class="confluenceTd">String</td><td class="confluenceTd">Source of push content, where push data should be passed. Possible values: UCP

</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9a1aecba-262a-443a-b44b-6bfa16a49156" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="28e5697f-9e96-4bf0-9a9a-22065da37fb2" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Ffirebasemessagings-0"><tbody><tr><td class="wysiwyg-macro-body">```
//FirebaseMessagingService class from Firebase

override fun onMessageReceived(remoteMessage: RemoteMessage) {
    super.onMessageReceived(remoteMessage)

    val senderId: String? = remoteMessage.from
    val pushData = remoteMessage.data

	//check push source only when push source is uPaid sender Id

    if (isUpaidSenderId(senderId)) {

		//checking push source and passing to proper uPaid module

        mobileDcApi
            .cloudMessagingService
            .getSource(pushData, { source ->
                when (source) {
                    "UCP" -> processUcpPush(pushData)
                }
            }, {
                //some error
            })

    } else {
        //proceed push from another source
    }
}


private fun processUcpPush(pushData: Map<String, String>) {
    ucpApi
        .cloudMessagingService
        .process(pushData, {
            //push processed in UCP
        }, {
            //some error
        })
}
```

</td></tr></tbody></table>

### updateRegistrationToken  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f1626ffe-a12b-447f-b149-7a02e012eaf1" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-39"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Updates FCM Cloud Messaging registation token.</p>

<p class="callout info">Method should be called when application receive new registration token from FCM service.</p>

<p class="callout info">When updated application should still receive push notifications from Verestro Backend.</p>

<p class="callout info">Application should always retry update FCM Registration token if method failed.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-87"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">cloudMessagingRegistrationToken</td><td class="confluenceTd">CloudMessagingRegistrationToken</td><td class="confluenceTd">An object containing user information to update registration token.</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

CloudMessagingRegistrationToken

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-88"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">type</td><td class="confluenceTd">CloudMessagingType</td><td class="confluenceTd">Mandatory. One of: \[FCM\].

FCM - Firebase Cloud Messaging

</td><td class="confluenceTd">Not empty</td></tr><tr><td>token  
</td><td>String  
</td><td>Registration token

</td><td>Not empty  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="35d28b20-4678-4cd1-bc05-f634edb199b8" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-27"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="926bcb5a-198c-4e54-8349-39e6f1854961" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fapplication-should"><tbody><tr><td class="wysiwyg-macro-body">```
//application should listen for FCM token changes in FirebaseMessagingService::onNewToken method
val cloudMessagingRegistrationToken: CloudMessagingRegistrationToken =
    CloudMessagingRegistrationToken(
        type: CloudMessagingType, //messaging token type
        token: String //saved cloud messaging token
    )

fun updateRegistrationToken(cloudMessagingRegistrationToken: CloudMessagingRegistrationToken) {
    mobileDcApi
        .deviceService
        .isDevicePaired({ isPaired ->
            //token update is required only if device is already paired
            if (isPaired) {
                mobileDcApi
                    .cloudMessagingService
                    .updateRegistrationToken(cloudMessagingRegistrationToken, {
                        //token updated
                    }, {
                        //some error, always retry action until success
                        //when internet or server connection is not reachable try again later
                    })
            }
        }, {
            //some error
        })
}
```

</td></tr></tbody></table>

### updateFcmRegistrationToken (deprecated in 2.14.3)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f1626ffe-a12b-447f-b149-7a02e012eaf1" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-40"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Updates Cloud Messaging registation token for selected token type (FCM).</p>

<p class="callout info">Method should be called when application receive new registration token from FCM service.</p>

<p class="callout info">When updated application should still receive push notifications from Verestro Backend.</p>

<p class="callout info">Application should always retry update FCM Registration token if method failed.</p>

<p class="callout info">Deprecated in 2.14.3, use updateRegistrationToken.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-89"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**

</th></tr><tr><td class="confluenceTd">fcmToken</td><td class="confluenceTd">String</td><td class="confluenceTd">Registration token received from FCM service

</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="35d28b20-4678-4cd1-bc05-f634edb199b8" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-28"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback.</p>

</td></tr></tbody></table>

**Sample**

```
//application should listen for FCM token changes in FirebaseMessagingService::onNewToken method

private fun updateFcmToken(newFcmToken: String) {
    mobileDcApi
        .deviceService
        .isDevicePaired({ isPaired ->
            //token update is required only if device is already paired
            if (isPaired) {
                mobileDcApi
                    .cloudMessagingService
                    .updateFcmRegistrationToken(newFcmToken, {
                        //token updated
                    }, {
                        //some error, always retry action until success
                        //when internet or server connection is not reachable try again later
                    })
            }
        }, {
            //some error
        })
```

## TransactionsHistory domain

### getTransactionsHistory

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-41"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="d014bdc7-2c29-4e0b-a454-68e89e83bd22">Provides transaction history from Mobile DC backend with selected transactions filters.  
</span></p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-90" style="width: 100%;"><colgroup><col style="width: 11.604938%;"></col><col style="width: 20.864198%;"></col><col style="width: 51.481481%;"></col><col style="width: 15.925926%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">filters</td><td class="confluenceTd">TransactionsFilters</td><td class="confluenceTd">Filters for transactions history. Leave null to get all user's transactions with limit equals 10</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">nextPage</td><td class="confluenceTd">TransactionsNextPage</td><td class="confluenceTd">Indicates starting point of downloaded transaction history

Pass null for first request or pass object from getTransactionHistory result

</td><td class="confluenceTd">  
</td></tr></tbody></table>

**TransactionsFilters**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-91" style="width: 100%;"><colgroup><col style="width: 12.345679%;"></col><col style="width: 13.08642%;"></col><col style="width: 66.296296%;"></col><col style="width: 8.148148%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">String</td><td class="confluenceTd">Selected card id or null</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">ibanId</td><td class="confluenceTd">String</td><td class="confluenceTd">Selected iban id or null</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd" colspan="1">paymentTokenId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Selected paymentTokenId or null

Field is available in PaymentInstrument object in UCP module

</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">area</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Area of transaction, specific per project (e.g. "UCP"). Could be null in order to avoid filtering by area of transaction.</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">timestampFrom</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The date/time (in ISO 8601 extended format) indicating the timestamp from which transactions would be filtered (e.g. "2020-10-10T00:59:00.000000+02:00"). Could be null in order to avoid filtering by indicating the earliest date of transactions.</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">timestampTo</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The date/time (in ISO 8601 extended format) indicating the timestamp to which transactions would be filtered (e.g. "2020-10-10T00:59:00.000000+02:00"). Could be null in order to avoid filtering by indicating the latest date of transactions.</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">amountMinorMin</td><td class="confluenceTd" colspan="1">Long</td><td class="confluenceTd" colspan="1">The transaction minimum monetary amount (inclusive) in terms of the minor units of the currency.   
For example, for EUR 2.35 client should pass 235, and for BHD -1.345 should pass 1345. Absolute value is taken into consideration.

</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">amountMinorMax</td><td class="confluenceTd" colspan="1">Long</td><td class="confluenceTd" colspan="1">The transaction maximum monetary amount (inclusive) in terms of the minor units of the currency.   
For example, for EUR 2.35 client should pass 235, and for BHD -1.345 should pass 1345. Absolute value is taken into consideration.</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">amountType</td><td class="confluenceTd" colspan="1">AmountType</td><td class="confluenceTd" colspan="1">Transaction amount type. One of POSITIVE, NEGATIVE</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">limit</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Limit of transactions to get. When not changed default value is 10</td><td class="confluenceTd" colspan="1">  
</td></tr></tbody></table>

**TransactionsNextPage**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-92"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">seekId</td><td class="confluenceTd">String</td><td class="confluenceTd">Seek id of next transaction</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">seekTimestamp</td><td class="confluenceTd">String</td><td class="confluenceTd">Seek timestamp of next transaction</td><td class="confluenceTd">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-13"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with list of transactions history.</p>

</td></tr></tbody></table>

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-93" style="width: 100%;"><colgroup><col style="width: 16.91358%;"></col><col style="width: 17.530864%;"></col><col style="width: 65.432099%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">transactionHistory</td><td class="confluenceTd" colspan="1">TransactionHistory</td><td class="confluenceTd" colspan="1">An object containing list of TransactionDetails and TransactionNextPage to show transaction history</td></tr></tbody></table>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-94"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">transactions</td><td class="confluenceTd">List&lt;TransactionDetails&gt;</td><td class="confluenceTd">List of transactions history</td></tr><tr><td class="confluenceTd">nextPage</td><td class="confluenceTd">TransactionsNextPage</td><td class="confluenceTd">Object for getting next transactions history items</td></tr></tbody></table>

**TransactionDetails**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-5" style="width: 100%;"><colgroup><col style="width: 24.197531%;"></col><col style="width: 7.777778%;"></col><col style="width: 67.901235%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">id</td><td class="confluenceTd">Long</td><td class="confluenceTd">Internal transaction id</td></tr><tr><td class="confluenceTd">clientTransactionId</td><td class="confluenceTd">String</td><td class="confluenceTd">Client id of transaction</td></tr><tr><td class="confluenceTd">amountMinor</td><td class="confluenceTd">Long</td><td class="confluenceTd">The transaction monetary count in terms of the minor units of the currency</td></tr><tr><td class="confluenceTd">currency</td><td class="confluenceTd">String</td><td class="confluenceTd">Currency of the transaction amount. 3-digits ISO 4217 currency code</td></tr><tr><td class="confluenceTd">type</td><td class="confluenceTd">String</td><td class="confluenceTd">Transaction type. One of: PURCHASE, REFUND, PAYMENT, ATM\_WITHDRAWAL, CASH\_DISBURSEMENT, ATM\_DEPOSIT, ATM\_TRANSFER</td></tr><tr><td class="confluenceTd">status</td><td class="confluenceTd">String</td><td class="confluenceTd">Transaction status. One of: DECLINED, CLEARED, AUTHORIZED, REVERSED</td></tr><tr><td class="confluenceTd">timestamp</td><td class="confluenceTd">String</td><td class="confluenceTd">The date/time when the transaction occurred. In ISO8601 extended format</td></tr><tr><td class="confluenceTd">description</td><td class="confluenceTd">String</td><td class="confluenceTd">Description of transaction</td></tr><tr><td class="confluenceTd">cardId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Card id of transaction</td></tr><tr><td class="confluenceTd">paymentTokenId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of payment token</td></tr><tr><td class="confluenceTd">cardLastFourDigits</td><td class="confluenceTd">String</td><td class="confluenceTd">Last four digits of card</td></tr><tr><td class="confluenceTd">merchantName</td><td class="confluenceTd">String</td><td class="confluenceTd">The merchant name</td></tr><tr><td class="confluenceTd">merchantPostalCode</td><td class="confluenceTd">String</td><td class="confluenceTd">The postal code of the merchant</td></tr><tr><td class="confluenceTd">transactionCountryCode</td><td class="confluenceTd">String</td><td class="confluenceTd">The country in which the transaction was performed. Expressed as a 3-letter country code as defined in ISO 3166-1</td></tr><tr><td class="confluenceTd">comboCardAccountType</td><td class="confluenceTd">String</td><td class="confluenceTd">Indicator if Credit or Debit was chosen for a tokenized combo card at the time of the transaction. One of: CREDIT, DEBIT</td></tr><tr><td class="confluenceTd">issuerResponseInformation</td><td class="confluenceTd">String</td><td class="confluenceTd">Additional information provided by the issuer for declined transaction. One of: INVALID\_CARD\_NUMBER, FORMAT\_ERROR, MAX\_AMOUNT\_EXCEEDED,

EXPIRED\_CARD, PIN\_AUTHORIZATION\_FAILED, TRANSACTION\_NOT\_PERMITTED, WITHDRAWL\_AMOUNT\_EXCEEDED, RESTRICTED\_CARD,

WITHDRAWL\_COUNT\_EXCEEDED, PIN\_TRIES\_NUMBER\_EXCEEDED, INCORRECT\_PIN, DUPLICATE\_TRANSMISSION

</td></tr><tr><td class="confluenceTd">transactionChannel</td><td class="confluenceTd">String</td><td class="confluenceTd">Information about transaction channel. One of: CONTACTLESS, CLOUD, MONEYSEND

</td></tr><tr><td class="confluenceTd">ibanId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of iban as *sha256Hex*</td></tr><tr><td class="confluenceTd">mcc</td><td class="confluenceTd">String</td><td class="confluenceTd">4 digits merchant category code</td></tr><tr><td class="confluenceTd">mccCategory</td><td class="confluenceTd">String</td><td class="confluenceTd">Category of merchant category code</td></tr><tr><td>originalAmountMinor</td><td>Long</td><td>The transaction monetary amount in terms of the minor units of the original currency. For example, EUR 2.35 will return 235, and BHD -1.345 will return -1345. Negative amounts indicate a refund or payment</td></tr><tr><td>originalCurrency</td><td>String  
</td><td>3-character ISO 4217 original currency code of the transaction</td></tr><tr><td>exchangeRate</td><td>Double  
</td><td>Exchange rate of the original currency into the base currency</td></tr><tr><td>balanceMinorValueAfterTransaction</td><td>Long  
</td><td>Account balance value after transaction in terms of the minor units</td></tr><tr><td>commissionMinorValue</td><td>Long  
</td><td>Commission value in terms of the minor units</td></tr><tr><td>clearingTimestamp</td><td>String  
</td><td>The date/time when the transaction changed status on CLEARED. In ISO 8601 extended format</td></tr><tr><td>parentId</td><td>Long  
</td><td>Id of base transaction</td></tr><tr><td>attachmentStatus</td><td>String  
</td><td>Attachment status of transaction. One of: \[EMPTY, INCORRECT, TO\_APPROVE, APPROVED\]</td></tr><tr><td>incorrectAttachmentStatusReason</td><td>String  
</td><td>Reason of INCORRECT attachment status. Required only for this status. One of: \[ATTACHMENT\_UNREADABLE, ATTACHMENT\_INCORRECT, OTHER\]</td></tr></tbody></table>

**TransactionsNextPage**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-95"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">seekId</td><td class="confluenceTd">String</td><td class="confluenceTd">Seek id of next transaction</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">seekTimestamp</td><td class="confluenceTd">String</td><td class="confluenceTd">Seek timestamp of next transaction</td><td class="confluenceTd">  
</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6ad54252-40fd-478e-b5c5-1f5e0e53c4f5" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-%2F%2Fsample-filters-val"><tbody><tr><td class="wysiwyg-macro-body">```
//sample filters
val lastFiveTransactionForCard = TransactionsFilters()
lastFiveTransactionForCard.cardId = "1"
lastFiveTransactionForCard.limit = 5 //when not set default is 10

//another sample filters
val allTransactionsForUser: TransactionsFilters? = null

//another sample filters
val lastThreeTransactionsForUser = TransactionsFilters()
lastThreeTransactionsForUser.limit = 3


//indicates starting point of transaction history
//can be used while loading more history or for paging
var nextPage: TransactionsNextPage? = null


fun getTransactionsHistory(filters: TransactionsFilters?) {
    mobileDcApi
        .transactionsHistoryService
        .getTransactionsHistory(filters, nextPage, { transactionsHistory ->
                val transactions = transactionsHistory.transactions
                showTransactions(transactions)

                //save nextPage for getting next items
                nextPage = transactionsHistory.nextPage
            }, {
                //something went wrong, check exception
            })
}
```

</td></tr></tbody></table>

### getTransactionDetails

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-42"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="d014bdc7-2c29-4e0b-a454-68e89e83bd22">Provides transaction details from Mobile DC backend for selected transactionId.  
</span></p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-96" style="width: 100%;"><colgroup><col style="width: 20.246914%;"></col><col style="width: 19.876543%;"></col><col style="width: 27.777778%;"></col><col style="width: 31.975309%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">getTransactionDetails</td><td class="confluenceTd">GetTransactionDetails</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="de9e84bc-c339-467e-b2f4-e5ab2bd83f78">Contains id for requested transactionId</span></td><td class="confluenceTd">transactionId greater than 0 and not null</td></tr></tbody></table>

**GetTransactionDetails**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-97"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">transactionId</td><td class="confluenceTd">Long</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="54903450-46ae-443f-a363-47a20c244035">Selected id of transaction</span></td><td class="confluenceTd">Greater than 0 and not null</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-14"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with transaction details.</p>

</td></tr></tbody></table>

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-98"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">getTransactionDetailsResult</td><td class="confluenceTd" colspan="1">GetTransactionDetailsResult</td><td class="confluenceTd" colspan="1">An object containing details for requested transaction</td></tr></tbody></table>

**GetTransactionDetailsResult**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-6" style="width: 100%; height: 1370px;"><colgroup><col style="width: 15.308642%;"></col><col style="width: 11.604938%;"></col><col style="width: 72.962963%;"></col></colgroup><tbody><tr style="height: 29px;"><th class="confluenceTh" style="height: 29px;">**Field**</th><th class="confluenceTh" style="height: 29px;">**Type**</th><th class="confluenceTh" style="height: 29px;">**Description**</th></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">id</td><td class="confluenceTd" style="height: 29px;">Long</td><td class="confluenceTd" style="height: 29px;">Internal transaction id</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">clientTransactionId</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">Client id of transaction</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">amountMinor</td><td class="confluenceTd" style="height: 29px;">Long</td><td class="confluenceTd" style="height: 29px;">The transaction monetary count in terms of the minor units of the currency</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">currency</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">Currency of the transaction amount. 3-digits ISO 4217 currency code</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">type</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">Transaction type. One of: PURCHASE, REFUND, PAYMENT, ATM\_WITHDRAWAL, CASH\_DISBURSEMENT, ATM\_DEPOSIT, ATM\_TRANSFER</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">status</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">Transaction status. One of: DECLINED, CLEARED, AUTHORIZED, REVERSED</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">timestamp</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">The date/time when the transaction occurred. In ISO8601 extended format</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">description</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">Description of transaction</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">cardId</td><td class="confluenceTd" style="height: 29px;">Long</td><td class="confluenceTd" style="height: 29px;">Card id of transaction</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">paymentTokenId</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">Id of payment token</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">cardLastFourDigits</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">Last four digits of card</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">merchantName</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">The merchant name</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">merchantPostalCode</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">The postal code of the merchant</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">transactionCountryCode</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">The country in which the transaction was performed. Expressed as a 3-letter country code as defined in ISO 3166-1</td></tr><tr style="height: 45px;"><td class="confluenceTd" style="height: 45px;">comboCardAccountType</td><td class="confluenceTd" style="height: 45px;">String</td><td class="confluenceTd" style="height: 45px;">Indicator if Credit or Debit was chosen for a tokenized combo card at the time of the transaction. One of: CREDIT, DEBIT</td></tr><tr style="height: 145px;"><td class="confluenceTd" style="height: 145px;">issuerResponseInformation</td><td class="confluenceTd" style="height: 145px;">String</td><td class="confluenceTd" style="height: 145px;">Additional information provided by the issuer for declined transaction. One of: INVALID\_CARD\_NUMBER, FORMAT\_ERROR, MAX\_AMOUNT\_EXCEEDED,

EXPIRED\_CARD, PIN\_AUTHORIZATION\_FAILED, TRANSACTION\_NOT\_PERMITTED, WITHDRAWL\_AMOUNT\_EXCEEDED, RESTRICTED\_CARD,

WITHDRAWL\_COUNT\_EXCEEDED, PIN\_TRIES\_NUMBER\_EXCEEDED, INCORRECT\_PIN, DUPLICATE\_TRANSMISSION

</td></tr><tr style="height: 48px;"><td class="confluenceTd" style="height: 48px;">transactionChannel</td><td class="confluenceTd" style="height: 48px;">String</td><td class="confluenceTd" style="height: 48px;">Information about transaction channel. One of: CONTACTLESS, CLOUD, MONEYSEND

</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">ibanId</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">Id of iban as *sha256Hex*</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;"><span class="inline-comment-marker" data-ref="9d402d21-64fa-4fc5-b380-53ff7f8c0108">mcc</span></td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">4 digits merchant category code</td></tr><tr style="height: 29px;"><td class="confluenceTd" style="height: 29px;">mccCategory</td><td class="confluenceTd" style="height: 29px;">String</td><td class="confluenceTd" style="height: 29px;">Category of merchant category code</td></tr><tr style="height: 61px;"><td style="height: 61px;">originalAmountMinor</td><td style="height: 61px;">Long</td><td style="height: 61px;">The transaction monetary amount in terms of the minor units of the original currency. For example, EUR 2.35 will return 235, and BHD -1.345 will return -1345. Negative amounts indicate a refund or payment</td></tr><tr style="height: 45px;"><td style="height: 45px;">originalCurrency</td><td style="height: 45px;">String  
</td><td style="height: 45px;">3-character ISO 4217 original currency code of the transaction</td></tr><tr style="height: 45px;"><td style="height: 45px;">exchangeRate</td><td style="height: 45px;">Double  
</td><td style="height: 45px;">Exchange rate of the original currency into the base currency</td></tr><tr style="height: 61px;"><td style="height: 61px;">balanceMinorValueAfterTransaction</td><td style="height: 61px;">Long  
</td><td style="height: 61px;">Account balance value after transaction in terms of the minor units</td></tr><tr style="height: 45px;"><td style="height: 45px;">commissionMinorValue</td><td style="height: 45px;">Long  
</td><td style="height: 45px;">Commission value in terms of the minor units</td></tr><tr style="height: 45px;"><td style="height: 45px;">clearingTimestamp</td><td style="height: 45px;">String  
</td><td style="height: 45px;">The date/time when the transaction changed status on CLEARED. In ISO 8601 extended format</td></tr><tr style="height: 29px;"><td style="height: 29px;">parentId</td><td style="height: 29px;">Long  
</td><td style="height: 29px;">Id of base transaction</td></tr><tr style="height: 45px;"><td style="height: 45px;">attachmentStatus</td><td style="height: 45px;">String  
</td><td style="height: 45px;">Attachment status of transaction. One of: \[EMPTY, INCORRECT, TO\_APPROVE, APPROVED\]</td></tr><tr style="height: 61px;"><td style="height: 61px;">incorrectAttachmentStatusReason</td><td style="height: 61px;">String  
</td><td style="height: 61px;">Reason of INCORRECT attachment status. Required only for this status. One of: \[ATTACHMENT\_UNREADABLE, ATTACHMENT\_INCORRECT, OTHER\]</td></tr><tr style="height: 61px;"><td style="height: 61px;">attachments  
</td><td style="height: 61px;">List&lt;TransactionDetailsAttachment&gt;  
</td><td style="height: 61px;">Transaction attachments list  
</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="82b7f0d4-a085-40ee-b730-5ce1ff173ee1">TransactionDetailsAttachment</span>**

<table class="confluenceTable wrapped" id="bkmrk-parameter-type-descr-99" style="width: 100%;"><colgroup><col style="width: 11.604938%;"></col><col style="width: 7.530864%;"></col><col style="width: 80.740741%;"></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th></tr><tr><td class="confluenceTd" colspan="1">id</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Attachment id</td></tr><tr><td class="confluenceTd" colspan="1">name</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">File name</td></tr><tr><td class="confluenceTd" colspan="1">mimeType</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Mime type</td></tr><tr><td class="confluenceTd" colspan="1">link</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Url address valid by default 10 minutes. If link expires then API to generate link should be used. Mostly in this case minio will return 403 Forbidden</td></tr><tr><td class="confluenceTd" colspan="1">linkExpirationDate</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Url expiration date for given link in ISO 8601 extended format. Given link will be valid only short period of time</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6ad54252-40fd-478e-b5c5-1f5e0e53c4f5" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-%2F%2Fsample-entry-data-"><tbody><tr><td class="wysiwyg-macro-body">```
//sample entry data
val getTransactionDetails = GetTransactionDetails(1210L)

fun getTransactionDetails(getTransactionDetails: GetTransactionDetails) {
    mobileDcApi
        .transactionsHistoryService
		.getTransactionDetails(getTransactionDetails, { getTransactionDetailsResult ->
                //succes
            }, {
                //something went wrong, check exception
            })
}
```

</td></tr></tbody></table>

### storeAttachment

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-43"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="d014bdc7-2c29-4e0b-a454-68e89e83bd22">Stores attachment file in Mobile DC backend for selected transactionId.  
</span></p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-100"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">transactionAttachment</td><td class="confluenceTd">TransactionAttachment</td><td class="confluenceTd">Contains all data required to save attachment</td></tr></tbody></table>

**TransactionAttachment**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-101"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd">transactionId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Selected id of transaction</td><td class="confluenceTd">not null and greater or equal 0</td></tr><tr><td class="confluenceTd" colspan="1">attachmentInputStream</td><td class="confluenceTd" colspan="1">InputStream</td><td class="confluenceTd" colspan="1">Stream of file data</td><td class="confluenceTd" colspan="1">not null</td></tr><tr><td class="confluenceTd" colspan="1">mimeType</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="50414dc9-eb9b-4e64-a3b4-ebeade9cb080">MIME type of file. For example image/jpeg image/png</span></td><td class="confluenceTd" colspan="1">Is not empty</td></tr><tr><td class="confluenceTd" colspan="1">fileName</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="d407bbcb-ffb2-4b81-a1c6-6187cc67e5c4">Name of file. If null or blank then it is generated randomly with unique name. File extension is optional.</span></td><td class="confluenceTd" colspan="1">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback.</p>

</td></tr></tbody></table>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6ad54252-40fd-478e-b5c5-1f5e0e53c4f5" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-%2F%2Fsample-entry-data--0"><tbody><tr><td class="wysiwyg-macro-body">```
//sample entry data
val inputStream = contentResolver.openInputStream(uri)
val mimeType = contentResolver.getType(uri)

val transactionAttachment = TransactionAttachment(
    transactionId = 10023L,
    attachment = inputStream,
    mimeType = "image/jpeg"
)


//transaction attachment with optional file name
val transactionAttachment = TransactionAttachment(
    transactionId = 10023L,
    attachment = inputStream,
    mimeType = "image/png"
	fileName = "picture.png"
)


val transactionAttachment = TransactionAttachment(
    transactionId = 10023L,
    attachment = inputStream,
    mimeType = "image/png"
	fileName = "1636362847509"
)


fun storeAttachment(transactionAttachment: TransactionAttachment) {
    mobileDcApi
        .transactionsHistoryService
		.storeAttachment(transactionAttachment, {
                //succes
            }, {
                //something went wrong, check exception
            })
}

```

</td></tr></tbody></table>

### generateAttachmentLink

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-44"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info"><span class="inline-comment-marker" data-ref="d014bdc7-2c29-4e0b-a454-68e89e83bd22">Provides new link to load attachment when existing one fails with 403 HTTP status.</span></p>

</td></tr></tbody></table>

**Input**

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-102"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">generateAttachmentLink

</td><td class="confluenceTd">GenerateAttachmentLink

</td><td class="confluenceTd">Contains transactionId and attachmentId</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="ac253e8b-dea6-4975-9ed1-62c07858b52c">GenerateAttachmentLink</span>**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-103"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Parameter</th><th class="confluenceTh">Type</th><th class="confluenceTh">Description</th><th class="confluenceTh">Validation conditions</th></tr><tr><td class="confluenceTd">transactionId</td><td class="confluenceTd">Long</td><td class="confluenceTd">Selected id of transaction</td><td class="confluenceTd">not null and greater or equal 0</td></tr><tr><td class="confluenceTd" colspan="1">attachmentId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Selected attachment ID</td><td class="confluenceTd" colspan="1">is not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a7062c21-5902-48ed-9040-1d0367ebc93e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-15"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback with new attachment link and expiration date.</p>

</td></tr></tbody></table>

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-104"><colgroup><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd" colspan="1">generateAttachmentLinkResult</td><td class="confluenceTd" colspan="1">GenerateAttachmentLinkResult</td><td class="confluenceTd" colspan="1">An object containing new link and link expiry date</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="007ba296-09e9-4b16-a423-61b75c9eca94">GenerateAttachmentLinkResult</span>**

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti-7" style="width: 100%;"><colgroup><col style="width: 14.691358%;"></col><col style="width: 7.283951%;"></col><col style="width: 77.901235%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Field**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">link</td><td class="confluenceTd">String</td><td class="confluenceTd">Url address</td></tr><tr><td class="confluenceTd">linkExpirationDate</td><td class="confluenceTd">String</td><td class="confluenceTd">Url expiration date for given link in ISO 8601 extended format. Given link will be valid only short period of time</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="cee97680-b5a5-45ca-a6d6-cc2508a6063f">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6ad54252-40fd-478e-b5c5-1f5e0e53c4f5" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-%2F%2Fsample-entry-data--1"><tbody><tr><td class="wysiwyg-macro-body">```
//sample entry data
val generateAttachmentLink = GenerateAttachmentLink(1210L, "2145")

fun generateAttachmentLink(generateAttachmentLink: GenerateAttachmentLink) {
    mobileDcApi
        .transactionsHistoryService
		.generateAttachmentLink(generateAttachmentLink, { generateAttachmentLinkResult ->
                //succes
            }, {
                //something went wrong, check exception
            })
}


//sample usage when loading link from getTransactionDetails returns 403 HTTP status
fun getTransactionDetails() {
	mobileDcApi
		.transactionHistoryService
		.getTransactionDetails(GetTransactionDetails(transactionId), { getTransactionDetailsResult ->
			loadAttachmentsImages(getTransactionDetailsResult)
		}, {
			//something went wrong, check exception
		}
	)
}


private fun loadAttachmentsImages(getTransactionDetailsResult: GetTransactionDetailsResult) {
	val attachments: List<TransactionDetailsAttachment> = getTransactionDetailsResult.attachments
	attachments.forEach { transactionDetailAttachment ->
		loadImage(getTransactionDetailsResult.id, transactionDetailAttachment)
	}
}


private fun loadImage(attachment: TransactionDetailsAttachment, transactionId: Long) {
    //downloading file may differ in your project. This is only example in synchronised code
    val request = Request.Builder().url(attachment.link).build()
    val response = OkHttpClient().newCall(request).execute()
    val httpCode = response.code()
    when (httpCode) {
        403 -> {
            refreshAttachment(transactionId, attachment.id)
        }
        200 -> {
            //convert stream to bitmap and load into image view
        }
        else -> {
            //check other status
        }
    }
}

private fun refreshAttachment(transactionId: Long, attachmentId: String) {
    mobileDcApi
        .transactionsHistoryService
        .generateAttachmentLink(
            GenerateAttachmentLink(transactionId, attachmentId), { generateAttachmentLinkResult ->
				//sample with Glide library usage
				Glide.with(context).asBitmap()
					.load(generateAttachmentLinkResult.link)
					.into(nextImageView)
      	}, {
           //something went wrong, check exception
        })
}
```

</td></tr></tbody></table>

### deleteAttachment

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b6521ea5-fcb7-4b2d-bb43-bed6b3d36ace" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-45"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Delete attachment associated with provided transa<span class="inline-comment-marker" data-ref="9d791dca-ba39-4c37-b255-d74d8678d6a2">ction.</span></p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-105"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh" colspan="1">**Validation conditions**</th></tr><tr><td class="confluenceTd" colspan="1">deleteAttachment</td><td class="confluenceTd" colspan="1">DeleteAttachment</td><td class="confluenceTd" colspan="1">Plain object of DeleteAttachment

</td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**DeleteAttachment** object contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-106" style="width: 100%;"><colgroup><col style="width: 11.234568%;"></col><col style="width: 7.654321%;"></col><col style="width: 67.037037%;"></col><col style="width: 13.950617%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh" colspan="1">**Validation conditions**</th></tr><tr><td class="confluenceTd" colspan="1">transactionId</td><td class="confluenceTd" colspan="1">Long</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="56fea856-c937-4384-8eed-c82cf68c4707">Identifier of selected transaction. Id can be taken from GetTransactionDetailsResult object, check [getTransactionDetails](https://wiki.verestro.com/display/UCP/getTransactionDetails) method  
</span>

</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">attachmentId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="cf6f7c75-04fd-4886-bffc-66760a2cf6d8">Identifier of selected attachment. Id can be taken from TransactionDetailsAttachment, check [getTransactionDetails](https://wiki.verestro.com/display/UCP/getTransactionDetails) method  
</span></td><td class="confluenceTd" colspan="1">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2F-fa-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback/ Failure callback.</p>

</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="ee3ba144-2030-4661-b02f-95315f9ebcc2">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8df40eef-c58c-4cd5-9453-d934b38c602e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-val-transactiondetai"><tbody><tr><td class="wysiwyg-macro-body">```
val transactionDetailsResult: GetTransactionDetailsResult = GetTransactionDetails(1L)
val deleteAttachment: DeleteAttachment = DeleteAttachment(transactionDetailsResult.id, 
	transactionDetailsResult.transactionDetailsAttachment.id)

private fun deleteAttachment(deleteAttachment) {

    mobileDcApi.transactionService
        .deleteAttachment(deleteAttachment, {
                //Deletion of attachment went succesfully
            }, { throwable ->
                //Something went wrong, check exception with documentation
            })
}
```

</td></tr></tbody></table>

### updateSingleTransactionData

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b6521ea5-fcb7-4b2d-bb43-bed6b3d36ace" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-46"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.</p>

<p class="callout info">Updates single transaction data in Mobile DC backend by transactionId.</p>

</td></tr></tbody></table>

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-107"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd mceSelected">updateSingleTransactionData

</td><td class="confluenceTd mceSelected">UpdateSingleTransactionData

</td><td class="confluenceTd mceSelected">Transaction data to be updated</td><td class="confluenceTd mceSelected">Not empty</td></tr></tbody></table>

**UpdateSingleTransactionData**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-108"><colgroup><col></col><col></col><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th><th class="confluenceTh">**Validation conditions**</th></tr><tr><td class="confluenceTd mceSelected">transactionId

</td><td class="confluenceTd mceSelected">Long

</td><td class="confluenceTd mceSelected">Transaction ID</td><td class="confluenceTd mceSelected">Not empty</td></tr><tr><td>description

</td><td>String

</td><td>Description of transaction</td><td>  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="29129aa9-d04e-4dd6-9aad-94c44cdc43db" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2F-fa-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success callback/ Failure callback.</p>

</td></tr></tbody></table>

**Sample**

```
fun updateSingleTransactionData(updateSingleTransactionData: UpdateSingleTransactionData) {
    mobileDcApi
        .transactionsHistoryService
        .updateSingleTransactionData(updateSingleTransactionData, {
            //Transaction updated successfully
        }, {
            //Something went wrong, check exception with documentation
        })
}
```

## DOCUMENT CHANGELOG

Version 1.0.1

- Created.

Version 2.0.0

- Changed approach to SDK setup.
- Removed methods used to fingerprint authentication.
- Added NetworkConnection exception and CoreSdkException.
- Added new reason codes to existing exceptions.
- New methods in user domain: addUser, loginByTrustedIdentity, changePassword.
- New methods in device domain: pairByPassword, pairByExternalCredentials, unPairDevice.
- New methods in cards domain: getAll.
- New domains: ibans, transactionsHistory.

Version 2.1.0

- <span class="inline-comment-marker" data-ref="1f222a31-867a-4ab1-8476-cee93df3dead">Added new methods in User domain (authenticateByPin, loginByPin, changeWalletPin, resetWalletPin, initializeResetUserPassword, finilizeResetUserPassword).  
    </span>
- <span class="inline-comment-marker" data-ref="1f222a31-867a-4ab1-8476-cee93df3dead">Added new methods in Cards domain (addCard, initialize3ds, finalize3ds, deleteCard).</span>

<span class="inline-comment-marker" data-ref="1f222a31-867a-4ab1-8476-cee93df3dead">Version 2.1.1</span>

- Added information about SDK size.
- Added information about SDK ingetration on lower Android API level.

Version 2.2.0

- Improved Mobile DC SDK startup time.

Version 2.3.1

- Added new methods in user domain (isBiometricAuthenticationEnabled, enableBiometricAuthentication, startBiometricAuthentication, authenticateByBiometric, loginBySignature).
- Fixed security reports sending.
- Consumer proguard rules update.

Version 2.4.0

- Added optional log handler to MobileDcCoreConfigurationBuilder.
- Added disableBiometricAuthentication method.
- Added BiometricTypeAuth paramter to pairing methods.

Version 2.5.0

- Added getUser method.

Version 2.6.0

- Added addUser method.

Version 2.6.1

- Disabled sending native checksum in pairDevice process.

Version 2.7.0

- Added addresses service to facade.

Version 2.8.0

- Added addresses service to facade.
- Fixed checksum sending.
- Added apk certificate description.
- Added updateUser method to User domain.

Version 2.9.0

- Security issue codes are more precisely and give us more information about issue.
- Marked addAddress as deprecated.
- Added new one addAddress method which returning addressId of added address.

Version 2.9.3

- Device un-pairing device with *unPaidDevice* is now avaliable for not logged in users.
- Un-pair process (*unPaidDevice* method) requires application restart if UCP SDK is used and card was already digitized for another user.
- Login methods now clearing SDK data when device is removed from server
    
    When any login method fails with *BackendException* and *CANT\_FIND\_DEVICE* reason application should proceed with device pairing again.

Version 2.10.0

- Added new method for adding address with NewAddress model. Previous method is deprecated now.
- Added new method in Cards service: updateCard.
- Added new methods in Addresses servive: updateAddress, deleteAddres.

Version 2.10.1

- Removed false-positive security rules.
- Improved security reports sent to Wallet Server.

Version 2.11.2

- Added DeveloperOptions configuration in setup.
- Added logout method.

Version 2.11.3

- Updated security libraries.

Version 2.11.5

- Added new optional to DeveloperOptions, introducing new security checks.
- Added method verifyCard to verify card after 3DS. Card domain.
- Extended TransactionsFilters in getTransactionHistory. Transaction history domain.
- Added new method to addCard with AddCard model. The old method was marked as deprecated. Card domain.
- Added new response parameter to getAll method. Card domain.
- Added new request parameter to updateCard method. Card domain.
- Added new permission: <span class="devsite-heading">QUERY\_ALL\_PACKAGES</span> for security checks.

Version 2.11.6

- Minor fixes in user session.

Version 2.11.8

- Added new method for initializing reset user password with InitializeResetUserPassword model. Previous method is deprecated now.

Version 2.11.10

- Added new chapter Firebase Cloud Messaging configuration.
- Updated Security processes overview with Error codes handling in application.
- Introduced new approach to handling security issue. To provide better experience new status was added CoreSdkException with reason SECURITY\_EVENT\_OCCURRED. Error could be provided in every SDK methods if security issue was detected. Change doesn't impact on onSecurityIssue callback.

Version 2.11.12

- Added more protections for Android Keystore issues related to access by retrying and adding multi-thread synchronization.

Version 2.12.0

- IMPORTANT Updated security tools after EMV Security Evaluation. Please refer to [setup.](https://wiki.verestro.com/pages/viewpage.action?pageId=67340696) and [Application Isolated Process](https://wiki.verestro.com/display/UCP/Application+Isolated+Process).
    
    
    - added new security checks which which requires additional action on application side,
    - added new fields in DeveloperOptions object - allowDebug and enableAdditionalSecurityChecks.
- Updated Gradle and R8 tools.
- Added new methods related to transaction history and attachment in TransactionsHistoryService:
    
    
    - getTransactionDetails,
    - storeAttachment,
    - generateAttachmentLink,
    - deleteAttachment.
- Added new fields related to MCC (mcc, mccCategory) in methods getTransactionHistory and getTransactionDetails.

Version 2.12.1

- Fixed aggressive security process check from MDC SDK 2.12.0.

Version 2.13.2

- Updated documentation for Application Isolated Process with Magisk information.
- Updated <u>recommended configuration</u> and documentation for *extractNativeLibs* flag configuration, native libs should be in uncompressed form. Read more in Basic configuration section.
- Isolated security process mechanism improvements (related to *enableAdditionalSecurityChecks* configuration flag).
- Update Kotlin version to Kotlin version to 1.5.31 and Koin to 2.1.6.
- Updated Jackson dependency to 2.13.2 (with jackson-databind 1.13.2.2 security patch).
- Added new methods:
    
    
    - initialize3DSv2 in Cards domain,
    - finalize3DSv2 in Cards domain,
    - deleteUser in User domain.
- Added new field "nip" in AddUser model.
- Added logs for all facade methods (available in SDK debug version).

Version 2.13.3

- **IMPORTANT** Removed security check for disabling permission QUERY\_ALL\_PACKAGES i application AndroidManifest file.
    
    Read more in Basic configuration : Android permission chapter.

Version 2.13.5

- Added new value in additional DeveloperOptions, responsible for verification SDK code obfuscation.
- Added information about using SDK on Android API 31+ in [Basic Configuration](https://wiki.verestro.com/pages/viewpage.action?pageId=67340661) chapter.
- Wraped in try-catch block callbacks from setup method to prevent process breaking in SDK.

Version 2.13.6

- Added new returned fields to methods: *getTransactionsHistory* and *getTransactionDetails.*

Version 2.14.5

- **Important!** Introduced Play Integrity API instead Safetynet Attestation API - could require additional configuration. Read more in *Security processes overview* chapter*.* Enabling *r*equires Google API console changes.
- **Important!** Added optional configuration method - *MobileDcCloudMessagingConfiguration.* Interface allows to register not-paired devices in SSE service provided by Verestro. Significally optimizes RNS message delivery, usage is strongly recommended.
- Added method *updateSingleTransactionData* in transactions history service.
- Added new methods for device pairing - old methods became deprecated.
- Added new fileld optional to new *pair device* methods - *externalDeviceId.*
- Introduced *RefreshSession* mechanism for user HTTP token management - extends a duration of session and allows to use SDK methods.