# Technical Documentation VCP SDK

## VCP SDK Introduction

### Basic abbreviations and definitions

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-description-cd" style="width: 97.5%; height: 934.2px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected align-center" style="width: 12.4712%; height: 29.8px;">**Field**</th><th class="confluenceTh mceSelected align-center" style="width: 87.5431%; height: 29.8px;">**Description**</th></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">CDCVM</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Consumer Device Cardholder Verification Method</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">CVM</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Cardholder Verification Method</td></tr><tr style="height: 83px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 83px;">Contactless</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 83px;">Transactions performed by tapping the mobile device on a POS, which starts data exchange. On the Android device operating system passes received data from POS to the HCE service, implemented in the MPA,   
and then to VCP SDK. HCE support is required for contactless transactions

</td></tr><tr style="height: 60.6px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 60.6px;">DSRP</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 60.6px;">Digital Secure Remote Payments - transactions initiated from a mobile device, engaging interaction with  
the remote merchant system. HCE support is not required for DSRP transactions

</td></tr><tr style="height: 38.2px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 38.2px;">FCM</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 38.2px;">Firebase Cloud Messaging

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">HCE</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Host Card Emulation</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">IBAN</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Bank Account Number</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">MCBP</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Mastercard Cloud Based Payments</td></tr><tr style="height: 38.2px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 38.2px;">MDC</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 38.2px;">Mobile Data Core. Verestro core library.

</td></tr><tr style="height: 38.2px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 38.2px;">MPA</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 38.2px;">Mobile Payment Application - an application that uses VCP SDK for payments

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">NFC</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Near Field Communication</td></tr><tr style="height: 60.6px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 60.6px;">One tap</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 60.6px;">Flow in a contactless transaction, in which the consumer after authentication(using the PIN, fingerprint, etc.)  
taps the device to POS to start exchanging data

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">PAN</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Primary account number. Know as a card number. </td></tr><tr style="height: 68.6px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 68.6px;">Payment Instrument</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 68.6px;">Model keeping all data considering entity used for payments

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">POS</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Point Of Sale</td></tr><tr style="height: 60.6px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 60.6px;">QRC</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 60.6px;">QR Code transactions - allows consumer generate QR code to present to a merchant,  
who then scans it to take payment

</td></tr><tr style="height: 38.2px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 38.2px;">SUK</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 38.2px;">Single Use Key - unique credential used for single transaction for Mastercard

</td></tr><tr style="height: 29.8px;"><td style="width: 12.4712%; height: 29.8px;">LUK</td><td style="width: 87.5431%; height: 29.8px;">Limited Use Key - payment credential for usage with Visa

</td></tr><tr style="height: 60.6px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 60.6px;">Two tap </td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 60.6px;">Flow in a contactless transaction, in which consumer firstly taps device to POS,  
authenticates(using the PIN, fingerprint, etc.), then taps to POS one more time for exchanging data

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">TVC</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">Token Verification Code</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 12.4712%; height: 29.8px;">EWS</td><td class="confluenceTd mceSelected" style="width: 87.5431%; height: 29.8px;">External Wallet Server</td></tr><tr style="height: 29.8px;"><td style="width: 12.4712%; height: 29.8px;">VCP  
</td><td style="width: 87.5431%; height: 29.8px;">Verestro Cloud Payment</td></tr></tbody></table>

### What is VCP SDK?

The VCP (Verestro Cloud Payments) SDK is a module for digitization, payment, and token management for available payment instruments. Usage of VCP SDK depends on Mobile DC SDK which is the core of the Verestro module. Payment instruments can be provided to VCP SDK using the Mobile DC module.payment

### How VCP SDK works?

Provides methods to manage digitization using main domains:

- IBANs
- Payment
- Cloud Messaging
- Cards
- External Wallet Server

Depending on the selected payment instrument source (Card, Iban, External Wallet Server) VCP SDK allows to digitize it and provide methods for the payment process.

Usage of the following domains depends on client requirements.

### Versioning and backward compatibility

SDK version contains three digits. For example: 1.0.0.

- <span class="inline-comment-marker" data-ref="03becbf9-1eb0-4372-85dc-b8e25fd6091a">First version digit tracks compatibility-breaking changes in SDK public APIs. It is mandatory to update the application code to use SDK when this is incremented</span>.
- Second version digit tracks new, not compatibility-breaking changes in public API of SDK. It is optional to update the application code when this digit is incremented.
- Third version digit tracks internal changes in SDK. No updates in 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 a new ENUM value to input or output
- <span class="inline-comment-marker" data-ref="7c56a080-20be-4a7a-9ad3-a6b062d53896">Adding a new field in the input or output model</span>

## <span class="inline-comment-marker" data-ref="7c56a080-20be-4a7a-9ad3-a6b062d53896">Technical overview</span>

### <span class="inline-comment-marker" data-ref="7c56a080-20be-4a7a-9ad3-a6b062d53896">SDK Basic configuration</span>

The minSdkVersion must be at least 23 (Android 6.0). The application must use AndroidX.

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-" style="width: 95.9259%; height: 243px;"><tbody><tr style="height: 243px;"><td class="wysiwyg-macro-body" style="width: 99.8552%; height: 243px;">```
repositories{
	maven {
		credentials {
			username "<enter_username_here>"
			password "<enter_password_here>"
		}
		url "https://artifactory.upaid.pl/artifactory/libs-release-local/"


		//if the sync time takes too long, add filters to match the repository with specific modules as below
		content {
    		includeGroupByRegex "pl.upaid.*"
    		includeGroup "com.mastercard"
            includeGroup "com.visa" //Only when Visa is used
		}
	}
}
```

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

VCP SDK is available in two versions: debug and release.

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

**For release version:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a31f41c8-d313-47cf-a975-950aac95b09c" 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:ucpsdk:{version}'

    //Use below code ONLY if using Visa

    //implementation 'pl.upaid.internal.module:vts_v6:{verestroVtsModuleVersion}'
        
    //def strictVtsVersionBeta = "6.4.1-sandbox"
    //def strictVtsVersionProduction = "6.4.1-production"
    
    //implementation 'com.visa:cbp' + strictVtsVersionBeta
    //implementation 'com.visa:cbp' + strictVtsVersionProduction
}

```

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

**For debug version:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="0337931a-60ba-4853-83c1-81ff8fc35fe7" 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:ucpsdk:{version}-debug'

    //Use below code ONLY if using Visa

    //implementation 'pl.upaid.internal.module:vts_v6:{verestroVtsModuleVersion}-debug'
        
    //def strictVtsVersionBeta = "6.4.0-sandbox"
    //def strictVtsVersionProduction = "6.4.0-production"
    
    //implementation('com.visa:cbp') {
    //    version { strictly strictVtsVersionBeta }
    //}

    
}
```

</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.nativesecurity, 
pl.upaid.module.ucpsdk,
pl.upaid.module.mobiledc,
pl.upaid.internal.module.mcbp-v3,
pl.upaid.internal.module:vts_v6,
pl.upaid.internal.module.security, 
pl.upaid.internal.module.worker, 
com.mastercard.mpsdk,
com.visa.cbp" />
```

</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.

###   
VCP SDK Application Signing requirements

**Mastercard:**

There is no requirement related to Application signing.

**Visa:**

Both sandbox (test) and production environment require APK signed with valid key.  
To add Application as Trusted in Visa services please provide Signing Key Certificate from chain in PEM format using below script:

```
keytool -exportcert -keystore your_apk_keystore.jks -alias your_keystore_key_alias -rfc -file certificate.pem
```

Output will be provided in *certificate.pem* file.   
Please provide an result to Verestro representative with related *applicationId* (package).  
**Note:** When using only Google Play signing key tests local tests related to Visa tokenization and payments will be not possible.

### VCP SDK Size

The size of SDK is dependent on its distribution system.

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

<table class="wrapped relative-table confluenceTable" id="bkmrk-format-size-notes-ap" style="width: 100%; height: 139.8px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 14.7744%; height: 29.8px;">**Format**</th><th class="confluenceTh mceSelected" style="width: 12.643%; height: 29.8px;">**Size increment**</th><th class="confluenceTh mceSelected" style="width: 72.5965%; height: 29.8px;">**Notes**</th></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 14.7744%; height: 29.8px;">APK all architectures </td><td class="confluenceTd mceSelected" style="width: 12.643%; height: 29.8px;">~13,6 MB</td><td class="confluenceTd mceSelected" style="width: 72.5965%; height: 29.8px;">Size compared to empty application. Size already include Mobile DC library size as it's required dependency.</td></tr><tr><td style="width: 14.7744%;">APK Arm64</td><td style="width: 12.643%;">~2.8 MB</td><td style="width: 72.5965%;">Size compared to empty application. Size already include Mobile DC library size as it's required dependency.</td></tr></tbody></table>

**<span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">VCP size already includes Mobile DC SDK size.</span>**

<span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">Additional information:</span>

- size from the table above is referred to release version;
- <span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">size depends on configured proguard;</span><span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">  
    </span>

### <span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">VCP SDK Usage</span>

<span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">This chapter describes the structure and basic usage of VCP SDK.</span>

####   


#### <span class="inline-comment-marker" data-ref="0b504998-42ff-45b5-914f-e2eb8d437d7f">Domains</span>

Every of the described facades is divided into domains with different responsibilities. Available domains:

- IBANs
- Payment
- Cloud Messaging
- Cards
- External Wallet Server

Every domain contains domain-related methods.

#### Error handling

Works like in Mobile DC SDK, but provides additional BackendException reason codes (only when Verestro Wallet Server is used) and additional exceptions for specific methods.

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

**Note**: VCP SDK can throw exceptions from Mobile DC SDK as its core of the Verestro module.

<table class="wrapped relative-table confluenceTable" id="bkmrk-exception-type-excep"><tbody><tr><th class="confluenceTh mceSelected">**Exception type**</th><th class="confluenceTh mceSelected">**Exception class**</th><th class="confluenceTh mceSelected">**Description**</th></tr><tr><td class="confluenceTd mceSelected">SDK validation</td><td class="confluenceTd mceSelected">ValidationException</td><td class="confluenceTd mceSelected">Additional reason codes for ValidationException used in Mobile DC SDK </td></tr><tr><td class="confluenceTd mceSelected">Backend exception</td><td class="confluenceTd mceSelected">BackendException</td><td class="confluenceTd mceSelected">Additional reason codes for BackendException used in Mobile DC SDK.

**Note:** Not applicable for[ External Wallet Server domain ](https://wiki.verestro.com/display/UCP/External+Wallet+Server+domain)

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">SDK exception</td><td class="confluenceTd mceSelected" colspan="1">UcpSdkException</td><td class="confluenceTd mceSelected" colspan="1">Something went wrong on the SDK side, check the table below with possible reasons </td></tr><tr><td class="confluenceTd mceSelected">Process related</td><td class="confluenceTd mceSelected">-</td><td class="confluenceTd mceSelected">As every process is different some methods could throw a specified exception

Types of possible exceptions are described in the method description

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

Additional BackendException reason codes:

<table class="relative-table wrapped confluenceTable" id="bkmrk-reason-description-i" style="width: 100%; height: 944.4px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 32.7658%; height: 29.8px;">**Reason**</th><th class="confluenceTh mceSelected" style="width: 67.1151%; height: 29.8px;">**Description**

</th></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">INTERNAL\_ERROR</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Error occurred on server

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">VALIDATION\_ERROR

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Client sent invalid data

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CRYPTOGRAPHY\_ERROR

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Error occurred during cryptography operation

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PAYMENT\_CARD\_PREDIGITIZE\_ERROR

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Predigitize of payment card failed

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PAYMENT\_IBAN\_PREDIGITIZE\_ERROR

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Predigitize of payment IBAN failed

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PAYMENT\_CARD\_DIGITIZE\_ERROR

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Digitize of payment card failed

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PAYMENT\_IBAN\_DIGITIZE\_ERROR

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Digitize of payment IBAN failed

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 46.6px;">PAYMENT\_CARD\_PREDIGITIZE\_NOT\_EXECUTED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 46.6px;">Predigitize for payment card must be executed

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 46.6px;">PAYMENT\_IBAN\_PREDIGITIZE\_NOT\_EXECUTED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 46.6px;">Predigitize for payment IBAN must be executed

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CLIENT\_UNAUTHORIZED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Client of the API is unauthorized

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">USER\_UNAUTHORIZED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">User is unauthorized

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CANT\_FIND\_USER

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Cannot find user

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CANT\_FIND\_DEVICE

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Cannot find device

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CANT\_FIND\_IBAN

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Cannot find payment IBAN

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CANT\_FIND\_CARD

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Cannot find payment card

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">CANT\_FIND\_PAYMENT\_TOKEN

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Cannot find payment token

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">OPERATION\_NOT\_SUPPORTED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Requested operation is not supported

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">OPERATION\_NOT\_ALLOWED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Requested operation is not allowed

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">DEVICE\_TEMPORARILY\_LOCKED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Device is temporarily locked

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">DEVICE\_PERMANENTLY\_LOCKED

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Device is permanently locked

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 46.6px;">INVALID\_PAN

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 46.6px;">The PAN format is not valid, or other data associated with the PAN was incorrect or entered incorrectly

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">MISSING\_EXPIRY\_DATE

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">The expiry date is required for this product but was missing

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PAN\_INELIGIBLE

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">The PAN is not in an approved account range for TSP

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">DEVICE\_INELIGIBLE

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">The device is not supported for use

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PAN\_INELIGIBLE\_FOR\_DEVICE

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">The PAN is not allowed to be provisioned to the device because of Issuer rules

</td></tr><tr style="height: 29.8px;"><td style="width: 32.7658%; height: 29.8px;">PAN\_ALREADY\_PROVISIONED

</td><td style="width: 67.1151%; height: 29.8px;">The PAN is already provisioned for this device

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">IBAN\_INELIGIBLE

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">The financial account does not have an associated account range in TSP

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">PARALLEL\_REQUESTS\_ATTEMPTS

</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Action is already processing. Please try again after the time included in headers

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 32.7658%; height: 29.8px;">INVALID\_JWS\_TOKEN</td><td class="confluenceTd mceSelected" style="width: 67.1151%; height: 29.8px;">Specified JWS token is invalid</td></tr></tbody></table>

Additional ValidationException reason codes:

<table class="relative-table wrapped confluenceTable" id="bkmrk-reason-description-i-0"><tbody><tr><th class="confluenceTh mceSelected">**Reason**</th><th class="confluenceTh mceSelected">**Description**</th></tr><tr><td class="confluenceTd mceSelected">INVALID\_SECURITY\_CODE

</td><td class="confluenceTd mceSelected">Security code is empty

</td></tr><tr><td class="confluenceTd mceSelected">INVALID\_LANGUAGE\_CODE

</td><td class="confluenceTd mceSelected">Language code is empty

</td></tr><tr><td class="confluenceTd mceSelected">INVALID\_PAYMENT\_INSTRUMENT\_ID

</td><td class="confluenceTd mceSelected">Payment instrument id is empty</td></tr></tbody></table>

UcpSdkException reason codes:

<table class="relative-table wrapped confluenceTable" id="bkmrk-reason-description-p"><tbody><tr><th class="confluenceTh mceSelected">**Reason**</th><th class="confluenceTh mceSelected">**Description**</th></tr><tr><td class="confluenceTd mceSelected">PUSH\_INVALID\_SOURCE

</td><td class="confluenceTd mceSelected">Relates to push processing process. Push message should be consumed in another module

</td></tr><tr><td class="confluenceTd mceSelected">PUSH\_INVALID\_PUSH\_CONTENT

</td><td class="confluenceTd mceSelected">Cannot process push message. The message is invalid or some process failed

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">PAYMENT\_INSTRUMENT\_DEFAULT\_NOT\_FOUND

</td><td class="confluenceTd mceSelected" colspan="1">Cannot find default PaymentInstrument</td></tr><tr><td class="confluenceTd mceSelected">PAYMENT\_INSTRUMENT\_NOT\_FOUND

</td><td class="confluenceTd mceSelected">Selected PaymentInstrument cannot be found, is not digitized or active

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">APPLICATION\_PROCESS\_NOT\_KILLED</td><td class="confluenceTd mceSelected" colspan="1">Occurs when after using the reset method, there is a try of using any of the facade methods without previously stopping the application process

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

####   


#### Facade

The facade is an entry point to communication with VCP SDK.

Contains SDK initialization method and domains which allows for payment instrument management.

####   


#### Method structure

Please read Mobile DC Documentation for details.

####   


#### Multiple facade types

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

- UcpJavaApi for projects which use Java programming language.
- UcpKotlinApi 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 the same.

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

####   


#### HceApduService registration

To register HceApduService firstly it needs to be created a class that extends a default HostApduService. Added class needs to be added to the manifest file as a service.

Properly configured meta-data in service will also register an application as tap&amp;pay ready.

Exemplary service below:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="d22519fa-f9d1-440f-aecd-71ff1fc4b423" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%3Cservice-android%3Anam" style="width: 85.3086%; height: 180.8px;"><tbody><tr style="height: 180.8px;"><td class="wysiwyg-macro-body" style="width: 99.8734%; height: 180.8px;">```
<service
	android:name=".WalletHceService"
	android:exported="true"
	android:permission="android.permission.BIND_NFC_SERVICE">
		
		<intent-filter>
			<action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />		
		</intent-filter>
		
		<meta-data
			android:name="android.nfc.cardemulation.host_apdu_service"
			android:resource="@xml/hce_apdu_service" />
 </service>
```

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

Below listing of the default source file hce\_apud\_service.xml:

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="25a93d27-98a0-4d9a-885d-7cd3898f6105" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%3Chost-apdu-service-x" style="width: 105.185%; height: 361px;"><tbody><tr style="height: 392.6px;"><td class="wysiwyg-macro-body" style="width: 100%; height: 392.6px;">```
<host-apdu-service xmlns:android="http://schemas.android.com/apk/res/android"
	android:apduServiceBanner="@drawable/hce_logo"
	android:description="@string/hce_service_description"
	android:requireDeviceUnlock="false">
	<!-- If the requireDeviceUnlock is set to false, on some phones you can pay if the screen is not awake, 
    but on most devices the screen must be awake to make a payment. -->
	
	<aid-group
    	    android:category="payment"
    	    android:description="@string/aid_description">

		<!-- Following is a PPSE AID. You must always include this AID in order for payments to work-->

	 	<aid-filter android:name="325041592E5359532E4444463031" />

		<!-- Following AID list is specific to the application requirements.
	       If your application supports the type of card that these AID represents,
	       you must include those AID in your configuration file -->

		<aid-filter android:name="A0000000041010" /> <!-- Mastercard DEBIT/CREDIT -->
	    <aid-filter android:name="A0000000042203" /> <!-- Mastercard US DEBIT/CREDIT -->
	    <aid-filter android:name="A0000000043060" /> <!-- Maestro DEBIT -->
	    <aid-filter android:name="A0000000049100" /> <!-- Private label AID-->

        <!-- uncomment only when Visa is used-->
        <!--  <aid-filter android:name="A0000000031010" /> --> <!-- VISA DEBIT/CREDIT -->
        <!--  <aid-filter android:name="A0000000980840" /> --> <!-- US COMMON DEBIT -->
        <!--  <aid-filter android:name="A0000000032020" /> --> <!-- VPAY -->
        <!--  <aid-filter android:name="A0000000032010" /> --> <!-- VISA ELECTRON -->
        <!--  <aid-filter android:name="A0000000033010" /> --> <!-- VISA INTERLINK -->
        <!--  <aid-filter android:name="A00000000307010001" /> --> <!-- PRIVATE LABEL -->
	</aid-group>
</host-apdu-service>
```

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

Check if the application is set as default for payment.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="d85e34d7-a0d5-40e3-92b8-a1ae6a87df29" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-fun-issystemdefault%28"><tbody><tr><td class="wysiwyg-macro-body">```
fun isSystemDefault(): Boolean {
	val cardEmulation = CardEmulation.getInstance(NfcAdapter.getDefaultAdapter(context))
    return cardEmulation.isDefaultServiceForCategory(
        WalletHceService::class.java,
        CardEmulation.CATEGORY_PAYMENT
    )
}
```

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

Request for set your application as default for payment - will show a dialog for the user to approve the changes.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a727ccf5-39af-4d76-ac09-6444d47e6e2d" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-fun-requestforsystem"><tbody><tr><td class="wysiwyg-macro-body">```
fun requestForSystemDefault() {
    val intent = Intent().apply {
        action = "android.nfc.cardemulation.action.ACTION_CHANGE_DEFAULT"
        putExtra("component", WalletHceService::class.java)
        putExtra("category", CardEmulation.CATEGORY_PAYMENT)
    }
    context.startActivity(intent)
}
```

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

If the application is not set as default for payment and wants to make payment from opened application needs to set the preferred service. Requires system option "On top application is the default for HCE" enabled.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a24ce388-246e-4adc-bdc5-193d89f5c9c4" data-macro-name="code" data-macro-parameters="language=java" data-macro-schema-version="1" id="bkmrk-fun-registerasontoph"><tbody><tr><td class="wysiwyg-macro-body">```
fun registerAsOnTopHceApplication() {
	val cardEmulation = CardEmulation.getInstance(NfcAdapter.getDefaultAdapter(context))
    cardEmulation.setPreferredService(
        activity, ComponentName(activity, WalletHceService::class.java)
    )
}


fun unregisterFromOnTopHceApplication() {
	val cardEmulation = CardEmulation.getInstance(NfcAdapter.getDefaultAdapter(context))
    cardEmulation.unsetPreferredService(activity)
}
```

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

####   


#### Models

##### PaymentInstrument

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr" style="width: 100%; height: 1046px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 28.3066%; height: 29.8px;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 22.0016%; height: 29.8px;">**Type**</th><th class="confluenceTh mceSelected" style="width: 49.6919%; height: 29.8px;">**Description**</th></tr><tr style="height: 102.6px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 102.6px;"><span class="inline-comment-marker" data-ref="10b1b523-a3e5-485e-8027-4458b10cb6fe">id</span></td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 102.6px;">String</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 102.6px;">Id of payment instrument. For card it is cardId, for IBAN sha256Hex.

In the context of the External Wallet Server use tokenUniqueReference from MDES

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 46.6px;">paymentTokenId</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 46.6px;">String</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 46.6px;">Id of payment token. Used for getting transactions history (see Mobile DC documentation) only for selected token id </td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 35.4px;">displayablePanDigits</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 35.4px;">String</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 35.4px;">Token last 4 digits which can be used to display

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 35.4px;">paymentInstrumentStatus</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 35.4px;">PaymentInstrumentStatus</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 35.4px;">Enum with status of payment instrument.

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 57.8px;">contactlessSupported</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 57.8px;">Boolean</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 57.8px;">Information if payment instrument supports contactless transactions.

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 57.8px;">dsrpSupported</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 57.8px;">Boolean</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 57.8px;">Information if the payment instrument supports DSRP transactions.

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 57.8px;">qrcSupported</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 57.8px;">Boolean</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 57.8px;">Information if the payment instrument supports QR transactions.

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 35.4px;">onDeviceCvmSupported</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 35.4px;">Boolean</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 35.4px;">Information about supporting CVM on device.

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 35.4px;">credentialsCount</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 35.4px;">Int</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 35.4px;">Amount of credentials that can be used for payments.

Always 0 for Visa Cards.

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 57.8px;">isDefaultForContactlessPayment

</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 57.8px;">Boolean</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 57.8px;">Information if payment instrument is default for contactless payments.

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 28.3066%; height: 57.8px;">isDefaultForRemotePayment</td><td class="confluenceTd mceSelected" style="width: 22.0016%; height: 57.8px;">Boolean</td><td class="confluenceTd mceSelected" style="width: 49.6919%; height: 57.8px;">Information if payment instrument is default for remote payments.

</td></tr><tr style="height: 80.2px;"><td style="width: 28.3066%; height: 80.2px;">additionalAuthenticationRequired</td><td style="width: 22.0016%; height: 80.2px;">Boolean  
</td><td style="width: 49.6919%; height: 80.2px;">Is additional authentication for payment token activation required. If true, available authentication methods can be obtained using getAdditionalAuthenticationMethods

</td></tr><tr style="height: 80.2px;"><td style="width: 28.3066%; height: 80.2px;">tokenLastFourDigits</td><td style="width: 22.0016%; height: 80.2px;">String?  
</td><td style="width: 49.6919%; height: 80.2px;">Payment Token last four digits. Present only when multistep digitization is used(checkEligibility and digitize called separately).

</td></tr><tr style="height: 80.2px;"><td style="width: 28.3066%; height: 80.2px;">paymentInstrumentExpirationDate</td><td style="width: 22.0016%; height: 80.2px;">String?  
</td><td style="width: 49.6919%; height: 80.2px;">Payment instrument expiry date in format MM/YY. Present only when multistep digitization is used(checkEligibility and digitize called separately).

</td></tr><tr style="height: 80.2px;"><td style="width: 28.3066%; height: 80.2px;">paymentInstrumentLastFourDigits  
</td><td style="width: 22.0016%; height: 80.2px;">String?  
</td><td style="width: 49.6919%; height: 80.2px;">Payment instrument last four digits. Present only when multistep digitization is used(checkEligibility and digitize called separately).

</td></tr><tr style="height: 80.2px;"><td style="width: 28.3066%; height: 80.2px;">productConfig  
</td><td style="width: 22.0016%; height: 80.2px;">ProductConfig?  
</td><td style="width: 49.6919%; height: 80.2px;">Payment Token configuration. Present only when multistep digitization is used(checkEligibility and digitize called separately).

</td></tr><tr style="height: 35.4px;"><td style="width: 28.3066%; height: 35.4px;">provisioningStatus  
</td><td style="width: 22.0016%; height: 35.4px;">String  
</td><td style="width: 49.6919%; height: 35.4px;">Current state of provisioning process. One of:   
IN\_PROGRESS - in case of waiting for *onProvisioningSuccess*(),   
SUCCESS - when token is provisioned.

</td></tr><tr><td style="width: 28.3066%;">paymentTokenExpirationDate</td><td style="width: 22.0016%;">String?</td><td style="width: 49.6919%;">Payment token expiry date in format MM/YY. Not present when External Wallet Server is enabled.

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

###   


##### PaymentInstrumentStatus

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-description-in" style="width: 90.9877%;"><tbody><tr><th class="confluenceTh mceSelected" style="width: 15.8485%;">**Field**</th><th class="confluenceTh mceSelected" style="width: 84.1515%;">**Description**</th></tr><tr><td class="confluenceTd mceSelected" style="width: 15.8485%;">INACTIVE</td><td class="confluenceTd mceSelected" style="width: 84.1515%;">Payment instrument is not <span class="inline-comment-marker" data-ref="feec450f-de11-4043-9fb1-7708355745fe">active</span>, it can not be used for transactions.

The activation process depends on integration. Read the product overview for more information.

</td></tr><tr><td class="confluenceTd mceSelected" style="width: 15.8485%;">ACTIVE</td><td class="confluenceTd mceSelected" style="width: 84.1515%;">Payment instrument is active and it can be used for transactions.

</td></tr><tr><td class="confluenceTd mceSelected" style="width: 15.8485%;">SUSPENDED</td><td class="confluenceTd mceSelected" style="width: 84.1515%;">Payment instrument is suspended.</td></tr><tr><td class="confluenceTd mceSelected" style="width: 15.8485%;">DELETED</td><td class="confluenceTd mceSelected" style="width: 84.1515%;">Payment instrument is DELETED.

</td></tr><tr><td class="confluenceTd mceSelected" style="width: 15.8485%;">UNKNOWN</td><td class="confluenceTd mceSelected" style="width: 84.1515%;">Payment instrument status is unknown.</td></tr></tbody></table>

#####   


##### AdditionalAuthenticationMethod

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-0" style="width: 100%; height: 286.2px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 15.3276%; height: 29.8px;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 27.3165%; height: 29.8px;">**Type**</th><th class="confluenceTh mceSelected" style="width: 57.356%; height: 29.8px;">**Description**</th></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 15.3276%; height: 29.8px;">id</td><td class="confluenceTd mceSelected" style="width: 27.3165%; height: 29.8px;">String</td><td class="confluenceTd mceSelected" style="width: 57.356%; height: 29.8px;">Identifier of additional authentication method </td></tr><tr style="height: 150.2px;"><td class="confluenceTd mceSelected" style="width: 15.3276%; height: 150.2px;">name</td><td class="confluenceTd mceSelected" style="width: 27.3165%; height: 150.2px;">String</td><td class="confluenceTd mceSelected" style="width: 57.356%; height: 150.2px;">Method name. One of:

OTP\_TO\_CARDHOLDER\_NUMBER, OTP\_TO\_CARDHOLDER\_EMAIL, CARDHOLDER\_TO\_CALL\_CUSTOMER\_SERVICE, CARDHOLDER\_TO\_VISIT\_WEBSITE, CARDHOLDER\_TO\_USE\_ISSUER\_MOBILE\_APPLICATION, ISSUER\_TO\_CALL\_CARDHOLDER\_NUMBER

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 15.3276%; height: 29.8px;">value</td><td class="confluenceTd mceSelected" style="width: 27.3165%; height: 29.8px;">String</td><td class="confluenceTd mceSelected" style="width: 57.356%; height: 29.8px;">Value depends on method name. Described below. </td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" colspan="1" style="width: 15.3276%; height: 46.6px;">issuerParameters</td><td class="confluenceTd mceSelected" colspan="1" style="width: 27.3165%; height: 46.6px;">AuthMethodsIssuerParameters?</td><td class="confluenceTd mceSelected" colspan="1" style="width: 57.356%; height: 46.6px;">Non null if method is CARDHOLDER\_TO\_USE\_ISSUER\_MOBILE\_APPLICATION</td></tr></tbody></table>

####   


##### Additional authentication method values:

<div id="bkmrk-method-value-descrip"><table class="relative-table confluenceTable" style="width: 105.679%; height: 364.6px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 42.398%; height: 29.8px;">**Method**</th><th class="confluenceTh mceSelected" style="width: 14.0915%; height: 29.8px;">**Value**</th><th class="confluenceTh mceSelected" style="width: 43.5105%; height: 29.8px;">**Description**</th></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 42.398%; height: 57.8px;">`OTP_TO_CARDHOLDER_NUMBER`</td><td class="confluenceTd mceSelected" style="width: 14.0915%; height: 57.8px;">Masked phone number

</td><td class="confluenceTd mceSelected" style="width: 43.5105%; height: 57.8px;">Text message to Account holder’s mobile phone number. The value will be the Account holder’s masked mobile phone number.</td></tr><tr style="height: 49px;"><td class="confluenceTd mceSelected" style="width: 42.398%; height: 49px;">`OTP_TO_CARDHOLDER_EMAIL`</td><td class="confluenceTd mceSelected" style="width: 14.0915%; height: 49px;">Masked email

</td><td class="confluenceTd mceSelected" style="width: 43.5105%; height: 49px;">Email to Account holder’s email address. The value will be the Account holder’s masked email address.</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" colspan="1" style="width: 42.398%; height: 57.8px;">`CARDHOLDER_TO_CALL_CUSTOMER_SERVICE`</td><td class="confluenceTd mceSelected" colspan="1" style="width: 14.0915%; height: 57.8px;">Phone number

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 43.5105%; height: 57.8px;">Account holder-initiated call. The value will be the phone number for the Account holder to call Customer Service.

</td></tr><tr style="height: 51.6px;"><td class="confluenceTd mceSelected" colspan="1" style="width: 42.398%; height: 51.6px;">`CARDHOLDER_TO_VISIT_WEBSITE`</td><td class="confluenceTd mceSelected" colspan="1" style="width: 14.0915%; height: 51.6px;">Website URL

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 43.5105%; height: 51.6px;">Account holder to visit a website. The value will be the website URL.

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" colspan="1" style="width: 42.398%; height: 57.8px;">`CARDHOLDER_TO_USE_ISSUER_MOBILE_APPLICATION`</td><td class="confluenceTd mceSelected" colspan="1" style="width: 14.0915%; height: 57.8px;">Application name

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 43.5105%; height: 57.8px;">(Conditional) Issuer’s mobile app name. The method is available for both MDES and VTS but the value will be presented only for VTS.

</td></tr><tr style="height: 60.8px;"><td class="confluenceTd mceSelected" colspan="1" style="width: 42.398%; height: 60.8px;">`ISSUER_TO_CALL_CARDHOLDER_NUMBER`</td><td class="confluenceTd mceSelected" colspan="1" style="width: 14.0915%; height: 60.8px;">Masked phone number

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 43.5105%; height: 60.8px;">Issuer-initiated voice call to Account holder’s phone. The value will be the Account holder’s masked voice call phone number.

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

</div>####   


##### AuthMethodsIssuerParameters contains the following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-1" style="width: 100%;"><tbody><tr><th class="confluenceTh mceSelected" style="width: 11.2481%;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 31.8915%;">**Type**</th><th class="confluenceTh mceSelected" style="width: 56.8603%;">**Description**</th></tr><tr><td class="confluenceTd mceSelected" style="width: 11.2481%;">mdes</td><td class="confluenceTd mceSelected" style="width: 31.8915%;">AuthMethodsIssuerParametersMdes?</td><td class="confluenceTd mceSelected" style="width: 56.8603%;">Plain AuthMethodsIssuerParametersMdes object, required for MDES Payment Token</td></tr><tr><td class="confluenceTd mceSelected" style="width: 11.2481%;">vts</td><td class="confluenceTd mceSelected" style="width: 31.8915%;">AuthMethodsIssuerParametersVts?</td><td class="confluenceTd mceSelected" style="width: 56.8603%;">Required for VTS Payment token</td></tr></tbody></table>

####   


##### AuthMethodsIssuerParametersMdes contains following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-2" style="width: 100%;"><tbody><tr><th class="confluenceTh mceSelected" style="width: 11.3721%;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 36.2145%;">**Type**</th><th class="confluenceTh mceSelected" style="width: 52.4134%;">**Description**</th></tr><tr><td class="confluenceTd mceSelected" colspan="1" style="width: 11.3721%;">android</td><td class="confluenceTd mceSelected" colspan="1" style="width: 36.2145%;">AuthMethodsIssuerParametersMdesAndroid</td><td class="confluenceTd mceSelected" colspan="1" style="width: 52.4134%;">Plain AuthMethodsIssuerParametersMdesAndroid object. Required for Android device</td></tr><tr><td class="confluenceTd mceSelected" colspan="1" style="width: 11.3721%;">ios</td><td class="confluenceTd mceSelected" colspan="1" style="width: 36.2145%;">AuthMethodsIssuerParametersMdesIos</td><td class="confluenceTd mceSelected" colspan="1" style="width: 52.4134%;">Plain AuthMethodsIssuerParametersMdesIos object. Required for IOS device</td></tr></tbody></table>

####   


##### AuthMethodsIssuerParametersMdesAndroid contains following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-3" style="width: 100%;"><colgroup><col style="width: 13.2254%;"></col><col style="width: 9.14786%;"></col><col style="width: 77.6267%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">action</td><td class="confluenceTd">String?</td><td class="confluenceTd">Name of the action to be performed</td></tr><tr><td class="confluenceTd">packageName</td><td class="confluenceTd">String?</td><td class="confluenceTd">The package name of the issuer's mobile app</td></tr><tr><td class="confluenceTd" colspan="1">extraTextValue</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Contains the data to be passed through to the target app in the intent as an extra key/value pair with key ‘android.intent.extra.TEXT’. This is Base64-encoded data of a JSON object of the MobileAppActivationParameters. This object is not described since the whole payload is passed to the issuer app</td></tr></tbody></table>

##### AuthMethodsIssuerParametersMdesIos contains following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-4" style="width: 100%;"><colgroup><col style="width: 14.0915%;"></col><col style="width: 7.91314%;"></col><col style="width: 77.9954%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">deepLinkingUrl</td><td class="confluenceTd">String?</td><td class="confluenceTd">The deep linking URL of the issuer’s iOS mobile app. This identifies the app that the URL will resolve to. If the app is not installed on the user’s device, this URL can be used to open a link to the appropriate iOS app store for the user to download and install the app.</td></tr><tr><td class="confluenceTd">extraTextValue</td><td class="confluenceTd">String?</td><td class="confluenceTd">Contains the data to be passed through to the target app in the deep linking URL as a query parameter. It should be appended to the deepLinkingUrl when invoked in the format: deepLinkingUrl + ‘?extraTextValue=’ + extraTextValue. This is Base64-encoded data of a JSON object of the MobileAppActivationParameters. This object is not described since the whole payload is passed to the issuer app.</td></tr></tbody></table>

##### AuthMethodsIssuerParametersVts contains following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-5" style="width: 100%; height: 123px;"><colgroup><col style="width: 10.5068%;"></col><col style="width: 35.353%;"></col><col style="width: 54.1402%;"></col></colgroup><tbody><tr style="height: 29.8px;"><th class="confluenceTh" style="height: 29.8px;">**Parameter**</th><th class="confluenceTh" style="height: 29.8px;">**Type**</th><th class="confluenceTh" style="height: 29.8px;">**Description**</th></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">android</td><td class="confluenceTd" style="height: 46.6px;">AuthMethodsIssuerParametersVtsAndroid?</td><td class="confluenceTd" style="height: 46.6px;">Plain AuthMethodsIssuerParametersVtsAndroid object.   
Required for Android devices</td></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">ios</td><td class="confluenceTd" style="height: 46.6px;">AuthMethodsIssuerParametersVtsIos?</td><td class="confluenceTd" style="height: 46.6px;">Plain AuthMethodsIssuerParametersVtsIos object.   
Required for IOS devices</td></tr></tbody></table>

##### AuthMethodsIssuerParametersVtsAndroid contains following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-6" style="width: 100%;"><colgroup><col style="width: 14.4623%;"></col><col style="width: 8.40437%;"></col><col style="width: 77.1333%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">appId</td><td class="confluenceTd">String?</td><td class="confluenceTd">Unique identifier for the application within the application store.</td></tr><tr><td class="confluenceTd">appUrl</td><td class="confluenceTd">String?</td><td class="confluenceTd">URL of the application in the application store.</td></tr><tr><td class="confluenceTd" colspan="1">intentUrl</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">URL of banking app designed to respond to authentication code handling.</td></tr><tr><td class="confluenceTd" colspan="1">requestPayload</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The request payload is to be sent to the banking application on behalf of Visa.   
This field is opaque to wallet providers.</td></tr></tbody></table>

##### AuthMethodsIssuerParametersVtsIos contains following fields:

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-7" style="width: 100%;"><colgroup><col style="width: 13.9679%;"></col><col style="width: 9.02226%;"></col><col style="width: 77.0099%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">appId</td><td class="confluenceTd">String?</td><td class="confluenceTd">Unique identifier for the application within the application store.</td></tr><tr><td class="confluenceTd">appUrl</td><td class="confluenceTd">String?</td><td class="confluenceTd">URL of the application in the application store.</td></tr><tr><td class="confluenceTd" colspan="1">intentUrl</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">URL of banking app designed to respond to authentication code handling.</td></tr><tr><td class="confluenceTd" colspan="1">requestPayload</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The request payload is to be sent to the banking application on behalf of Visa.   
This field is opaque to wallet providers.</td></tr></tbody></table>

#####   


##### ContactlessTransactionInformation

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-8" style="width: 100%;"><tbody><tr><th class="confluenceTh mceSelected" style="width: 19.2831%;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 26.4529%;">**Type**</th><th class="confluenceTh mceSelected" style="width: 54.2641%;">**Description**</th></tr><tr><td class="confluenceTd mceSelected" style="width: 19.2831%;">currencyCode</td><td class="confluenceTd mceSelected" style="width: 26.4529%;">ByteArray</td><td class="confluenceTd mceSelected" style="width: 54.2641%;">Code of currency, that was used in transaction. Formatted in ISO 4271.

</td></tr><tr><td class="confluenceTd mceSelected" style="width: 19.2831%;">amount</td><td class="confluenceTd mceSelected" style="width: 26.4529%;">ByteArray</td><td class="confluenceTd mceSelected" style="width: 54.2641%;">Transaction amount in bytes. Can be formatted as Int in pennies.</td></tr><tr><td class="confluenceTd mceSelected" colspan="1" style="width: 19.2831%;">transactionRange</td><td class="confluenceTd mceSelected" colspan="1" style="width: 26.4529%;">ContactlessTransactionRange</td><td class="confluenceTd mceSelected" colspan="1" style="width: 54.2641%;">Type of transaction range.

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1" style="width: 19.2831%;"><span class="inline-comment-marker" data-ref="45fc6055-c369-48d3-b068-ecaf126a6b33">richTransactionType</span></td><td class="confluenceTd mceSelected" colspan="1" style="width: 26.4529%;">ContactlessRichTransactionType</td><td class="confluenceTd mceSelected" colspan="1" style="width: 54.2641%;">Rich transaction type.

</td></tr><tr><td class="confluenceTd mceSelected" colspan="1" style="width: 19.2831%;"><span class="inline-comment-marker" data-ref="94cd9284-9531-46be-b500-f7a1a4a53b71">merchantAndLocation</span></td><td class="confluenceTd mceSelected" colspan="1" style="width: 26.4529%;">ByteArray</td><td class="confluenceTd mceSelected" colspan="1" style="width: 54.2641%;">Merchant and location data from terminal. Can be formatted as String, by using UTF\_8 Charset.</td></tr></tbody></table>


**ContactlessTransactionRange**

<table class="relative-table wrapped confluenceTable" id="bkmrk-value-description-lv"><colgroup><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">**Value**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">LVT</td><td class="confluenceTd">Low value transaction</td></tr><tr><td class="confluenceTd" colspan="1">HVT</td><td class="confluenceTd" colspan="1">High value transaction

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

**ContactlessRichTransactionType**

<table class="relative-table wrapped confluenceTable" id="bkmrk-value-purchase-refun"><colgroup><col></col></colgroup><tbody><tr><th class="confluenceTh">**Value**</th></tr><tr><td class="confluenceTd">PURCHASE</td></tr><tr><td class="confluenceTd" colspan="1">REFUND</td></tr><tr><td class="confluenceTd" colspan="1">CASH</td></tr><tr><td class="confluenceTd" colspan="1">TRANSIT</td></tr><tr><td class="confluenceTd" colspan="1">PURCHASE\_WITH\_CASHBACK</td></tr><tr><td class="confluenceTd" colspan="1">UNKNOWN</td></tr></tbody></table>


##### DsrpTransactionInfo

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-9" style="width: 63.4568%; height: 165.771px;"><tbody><tr style="height: 29.7917px;"><th class="confluenceTh mceSelected" style="width: 30.1658%; height: 29.7917px;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 10.3417%; height: 29.7917px;">**Type**</th><th class="confluenceTh mceSelected" style="width: 59.2331%; height: 29.7917px;">**Descruption**</th></tr><tr style="height: 29.7917px;"><td class="confluenceTd mceSelected" style="width: 30.1658%; height: 29.7917px;">amount</td><td class="confluenceTd mceSelected" style="width: 10.3417%; height: 29.7917px;">Long</td><td class="confluenceTd mceSelected" style="width: 59.2331%; height: 29.7917px;">Transaction amount</td></tr><tr style="height: 35.3958px;"><td class="confluenceTd mceSelected" style="width: 30.1658%; height: 35.3958px;">currencyCode</td><td class="confluenceTd mceSelected" style="width: 10.3417%; height: 35.3958px;">Int</td><td class="confluenceTd mceSelected" style="width: 59.2331%; height: 35.3958px;"><del class="diffdel"></del>Code of currency, that was used in transaction.

<del class="diffdel"></del></td></tr><tr style="height: 35.3958px;"><td class="confluenceTd mceSelected" style="width: 30.1658%; height: 35.3958px;">countryCode</td><td class="confluenceTd mceSelected" style="width: 10.3417%; height: 35.3958px;">Int</td><td class="confluenceTd mceSelected" style="width: 59.2331%; height: 35.3958px;">Code of country.

</td></tr><tr style="height: 35.3958px;"><td class="confluenceTd mceSelected" style="width: 30.1658%; height: 35.3958px;">issuerCryptogramType</td><td class="confluenceTd mceSelected" style="width: 10.3417%; height: 35.3958px;">String</td><td class="confluenceTd mceSelected" style="width: 59.2331%; height: 35.3958px;">Cryptogram type.</td></tr></tbody></table>

##### TransactionAbortReason

<table class="wrapped confluenceTable" id="bkmrk-value-description-wa" style="width: 100%; height: 483px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 28.4477%; height: 29.8px;">**Value**</th><th class="confluenceTh mceSelected" style="width: 71.5523%; height: 29.8px;">**Description**</th></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 28.4477%; height: 29.8px;">WALLET\_CANCEL\_REQUEST</td><td class="confluenceTd mceSelected" style="width: 71.5523%; height: 29.8px;">Indicates that the wallet has requested a transaction cancellation during payment.</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 28.4477%; height: 57.8px;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">CARD\_ERROR</span></td><td class="confluenceTd mceSelected" style="width: 71.5523%; height: 57.8px;">This indicates that a problem has been detected in the MChipEngine processing.

In some implementations, this can indicate badly formatted card profile data.

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 28.4477%; height: 35.4px;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">TERMINAL\_ERROR</span></td><td class="confluenceTd mceSelected" style="width: 71.5523%; height: 35.4px;">This indicates incorrect terminal behavior.

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" style="width: 28.4477%; height: 46.6px;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">NO\_TRANSACTION\_CREDENTIALS </span></td><td class="confluenceTd mceSelected" style="width: 71.5523%; height: 46.6px;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">There are no transaction credentials to finalize payment. The application should call replenish Credentials method to enable payment possibility.  
</span></td></tr><tr style="height: 46.6px;"><td class="confluenceTd mceSelected" style="width: 28.4477%; height: 46.6px;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">NO\_CARDS</span></td><td class="confluenceTd mceSelected" style="width: 71.5523%; height: 46.6px;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">There is no active PaymentInstrument to start payment</span>. Called when no card is added to Wallet or SDK is cleared by Security Issue (onSecurityIssueAppeared event).</td></tr><tr style="height: 237px;"><td class="confluenceTd mceSelected" style="width: 28.4477%; height: 237px;">TERMINAL\_INACTIVITY\_TIMEOUT</td><td class="confluenceTd mceSelected" style="width: 71.5523%; height: 237px;">There is a problem with communication between the terminal and payment device.

For example, the terminal could abort communication with the mobile device for  
a long period of time and then trigger a timeout.

Usually, a mobile device loses connection during payment due to a wrong or too short tap on the terminal.

The application should ignore this status as SDK waits for connection establishment and it could produce getting duplicate callbacks during payment.

**Note:** When user authentication is already provided it could be cleared - the application should handle card selection (if a non-default card is selected) and payment authentication again.

**Note:** Deprecated in 2.6.7, no longer used due to time difference between connection lost and providing result to application. Replaced by CONNECTION\_LOST which works immediatelly.

</td></tr><tr><td style="width: 28.4477%;">CONNECTION\_LOST  
</td><td style="width: 71.5523%;">Connection between terminal and device is lost and payment is terminated.

</td></tr><tr><td style="width: 28.4477%;">PAYMENT\_NOT\_ALLOWED</td><td style="width: 71.5523%;">Payment is not allowed at this moment.   
Mastercard: Application should show error and user should retry payment.  
  
Visa: Visa requires online security services connection before performing payment on Android versions below 11.   
When connected internet connection is no more required until application close.  
During a Payment application should wait for UcpVtsPaymentAllowedListener::onPaymentAllowed()

<div style="background-color: #ffffff; color: #080808;">  
</div></td></tr></tbody></table>

##### NewTransaction

<table class="relative-table wrapped confluenceTable" id="bkmrk-field-type-descripti" style="width: 100%; height: 701px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 22.8677%; height: 29.8px;">**Field**</th><th class="confluenceTh mceSelected" style="width: 8.28244%; height: 29.8px;">**Type**</th><th class="confluenceTh mceSelected" style="width: 68.8498%; height: 29.8px;">**Description**</th></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 35.4px;">clientTransactionId

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 35.4px;">String?

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 35.4px;">Identifier of transaction in TSP

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 57.8px;">type

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 57.8px;">String

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 57.8px;">The transaction type. One of: \[UNKNOWN, PURCHASE, REFUND, PAYMENT, ATM\_WITHDRAWAL, CASH\_DISBURSEMENT, ATM\_DEPOSIT, ATM\_TRANSFER\]

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 57.8px;">amountMinor

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 57.8px;">Long

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 57.8px;">The monetary amount in terms of the minor units of the currency. For example,   
`EUR 2.35' will return 235, and `BHD -1.345' will return -1345

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 35.4px;">currency

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 35.4px;">String

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 35.4px;">3-digit ISO 4217 currency code

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 35.4px;">timestamp

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 35.4px;">String

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 35.4px;">The date/time when the transaction occurred. In ISO 8601 extended format

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 35.4px;">merchantName

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 35.4px;">String?

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 35.4px;">The merchant (``doing business as'') name

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 35.4px;">merchantPostalCode

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 35.4px;">String?

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 35.4px;">The postal code of the merchant

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 57.8px;">transactionCountryCode

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 57.8px;">String?

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 57.8px;">The country in which the transaction was performed. Expressed as a 3-letter (alpha-3) country code as defined in ISO 3166-1

</td></tr><tr style="height: 57.8px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 57.8px;">comboCardAccountType

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 57.8px;">String?

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 57.8px;">An indicator if Credit or Debit was chosen for a tokenized combo card at the time of the transaction. One of: \[UNKNOWN, CREDIT, DEBIT\]

</td></tr><tr style="height: 169.8px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 169.8px;">issuerResponseInformation

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 169.8px;">String?

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 169.8px;">Additional information is provided by the issuer for a declined transaction. Only returned if the transaction is declined. One of: \[UNKNOWN, 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: 57.8px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 57.8px;">status

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 57.8px;">String

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 57.8px;">The authorization status of the transaction. One of: \[AUTHORIZED, DECLINED, CLEARED, REVERSED\]

</td></tr><tr style="height: 35.4px;"><td class="confluenceTd mceSelected" style="width: 22.8677%; height: 35.4px;">paymentTokenId

</td><td class="confluenceTd mceSelected" style="width: 8.28244%; height: 35.4px;">String

</td><td class="confluenceTd mceSelected" style="width: 68.8498%; height: 35.4px;">Identifier of payment token in VCP

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

##### ContactlessTransactionData

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-10" style="width: 100%;"><colgroup><col style="width: 19.1595%;"></col><col style="width: 27.0677%;"></col><col style="width: 53.7728%;"></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">currencyNumber</td><td class="confluenceTd" colspan="1">Int</td><td class="confluenceTd" colspan="1">Currency number assigned to the currencyCode in ISO 4271 e.g.: for PLN is 985.</td></tr><tr><td class="confluenceTd">currencyCode</td><td class="confluenceTd">String?</td><td class="confluenceTd">Code of currency, that was used in transaction formatted in ISO 4271. e.g.: PLN

Could be null as the terminal provides only the currencyNumber and a valid code could be not found.

</td></tr><tr><td class="confluenceTd">amountMinor</td><td class="confluenceTd">Long</td><td class="confluenceTd">The monetary amount in terms of the minor units of the currency. For example, `EUR 2.35' will return 235,</td></tr><tr><td class="confluenceTd" colspan="1">transactionRange</td><td class="confluenceTd" colspan="1">ContactlessTransactionRange</td><td class="confluenceTd" colspan="1">Type of transaction range.

</td></tr><tr><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="45fc6055-c369-48d3-b068-ecaf126a6b33">richTransactionType</span></td><td class="confluenceTd" colspan="1">ContactlessRichTransactionType</td><td class="confluenceTd" colspan="1">Rich transaction type.

</td></tr><tr><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="94cd9284-9531-46be-b500-f7a1a4a53b71">merchantAndLocation</span></td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Merchant and location data from terminal.

**Deprecated** - field shouldn't be used as it could be not configured in terminal configuration or provides invalid data.

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

**ContactlessTransactionRange**

<table class="relative-table wrapped confluenceTable" id="bkmrk-value-description-lv-0"><colgroup><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Value</th><th class="confluenceTh">Description

</th></tr><tr><td class="confluenceTd">LVT</td><td class="confluenceTd">Low value transaction</td></tr><tr><td class="confluenceTd" colspan="1">HVT</td><td class="confluenceTd" colspan="1">High value transaction

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

**ContactlessRichTransactionType**

<table class="relative-table wrapped confluenceTable" id="bkmrk-value-description-pu"><colgroup><col></col><col></col></colgroup><tbody><tr><th class="confluenceTh">Value</th><th class="confluenceTh" colspan="1">Description</th></tr><tr><td class="confluenceTd">PURCHASE</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">REFUND</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">CASH</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">TRANSIT</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">PURCHASE\_WITH\_CASHBACK</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">UNKNOWN</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">WITHDRAWAL</td><td class="confluenceTd" colspan="1">  
</td></tr><tr><td class="confluenceTd" colspan="1">ATM\_CONTACTLESS</td><td class="confluenceTd" colspan="1">  
</td></tr></tbody></table>

##### Report

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-11"><tbody><tr><th class="confluenceTh mceSelected">**Parameter**</th><th class="confluenceTh mceSelected">**Type**</th><th class="confluenceTh mceSelected">**Description**</th></tr><tr><td class="confluenceTd mceSelected">name</td><td class="confluenceTd mceSelected">String</td><td class="confluenceTd mceSelected">Action name</td></tr><tr><td class="confluenceTd mceSelected">description</td><td class="confluenceTd mceSelected">String</td><td class="confluenceTd mceSelected">Action details message.</td></tr><tr><td class="confluenceTd mceSelected">isSuccess</td><td class="confluenceTd mceSelected">Boolean</td><td class="confluenceTd mceSelected">Result of action. True when action is finished successfully, false otherwise.</td></tr><tr><td class="confluenceTd mceSelected">timestamp</td><td class="confluenceTd mceSelected">Long</td><td class="confluenceTd mceSelected">Time when the action occurred.</td></tr><tr><td class="confluenceTd mceSelected" colspan="1">errorMessage</td><td class="confluenceTd mceSelected" colspan="1">String?</td><td class="confluenceTd mceSelected" colspan="1">Detailed error message when isSuccess is false.</td></tr></tbody></table>

##### ContactlessAdvice

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-descriptio" style="width: 100%; height: 264.8px;"><tbody><tr style="height: 29.8px;"><th class="confluenceTh mceSelected" style="width: 24.9686%; height: 29.8px;">**Parameter**</th><th class="confluenceTh mceSelected" style="width: 75.0314%; height: 29.8px;">**Description**</th></tr><tr style="height: 102.6px;"><td class="confluenceTd mceSelected" colspan="1" style="width: 24.9686%; height: 102.6px;">DECLINE</td><td class="confluenceTd mceSelected" colspan="1" style="width: 75.0314%; height: 102.6px;">Declines a processing transaction.

When provided by SDK in *getFinalDecisionForTransaction* wallet should not overrule a DECLINE.

If the MPA overrules a DECLINE (and forces it into PROCEED), the transaction is likely to be declined by the issuer in the authorization response.

</td></tr><tr style="height: 102.6px;"><td class="confluenceTd mceSelected" style="width: 24.9686%; height: 102.6px;">AUTHENTICATION\_REQUIRED</td><td class="confluenceTd mceSelected" style="width: 75.0314%; height: 102.6px;">An user authentication is required for transaction processing, which could be overruled on the MPA side.  
When the MPA decision is AUTHENTICATION\_REQUIRED, SDK will ask for user authentication in the *onAuthRequiredForContactless* method.

</td></tr><tr style="height: 29.8px;"><td class="confluenceTd mceSelected" style="width: 24.9686%; height: 29.8px;">PROCEED</td><td class="confluenceTd mceSelected" style="width: 75.0314%; height: 29.8px;">Transaction can be processed.</td></tr></tbody></table>

##### ContactlessTransactionResult

<p class="callout warning">**Important:** MPA should always refer to transaction results on the terminal.</p>

<table class="wrapped relative-table confluenceTable" id="bkmrk-value-description-is" style="width: 100%;"><tbody><tr><th class="confluenceTh mceSelected" style="width: 24.5974%;">**Value**</th><th class="confluenceTh mceSelected" style="width: 63.2889%;">**Description**</th><th class="confluenceTh mceSelected" colspan="1" style="width: 12.1137%;">**Is success on MPA side**

</th></tr><tr><td class="confluenceTd mceSelected" style="width: 24.5974%;">AUTHORIZE\_ONLINE</td><td class="confluenceTd mceSelected" style="width: 63.2889%;">This indicates that the SDK returned an ARQC cryptogram using valid credentials and the POS will send the transaction online for authorization.

The SDK is not informed whether or not the issuer actually approved or declined the transaction since this information is only returned to the terminal.

Should be treated as transaction success on the MPA side.

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 12.1137%;">Yes</td></tr><tr><td class="confluenceTd mceSelected" style="width: 24.5974%;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">AUTHENTICATE\_OFFLINE</span></td><td class="confluenceTd mceSelected" style="width: 63.2889%;">This indicates that the POS requested a decline (AAC) with a CDA signature.

SDK will have returned a cryptogram using valid credentials and the POS can authenticate the card offline using the CDA signature.

Typically a POS will request a decline when it simply wants to authenticate that a legitimate digital card is being used without requesting any authorization.

Should be treated as transaction success on the MPA side.

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 12.1137%;">Yes</td></tr><tr><td class="confluenceTd mceSelected" style="width: 24.5974%;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">DECLINE\_BY\_TERMINAL</span></td><td class="confluenceTd mceSelected" style="width: 63.2889%;">The POS has requested a decline without a CDA signature. This may correspond to a real decline by the terminal, or (in rare cases) to an online authentication request.

Paying on the terminal with offline-only network connectivity can also return this callback.

<span class="markedContent">Application Cryptogram was generated with genuine credentials.</span>

Should be treated as transaction success on the MPA side.

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 12.1137%;">Yes</td></tr><tr><td class="confluenceTd mceSelected" style="width: 24.5974%;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">DECLINE\_BY\_CARD</span></td><td class="confluenceTd mceSelected" style="width: 63.2889%;">The digitized card has declined the transaction. A non-exhaustive list of possible reasons may be:

- Context mismatch between first and second tap
- Terminal is offline-only
- Terminal is a transit gate, and transit transactions are not allowed by the card profile
- Transaction is international, while the card profile is domestic-only

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 12.1137%;">No</td></tr><tr><td class="confluenceTd mceSelected" style="width: 24.5974%;"><span class="inline-comment-marker" data-ref="eb10ac78-95d8-4275-a8a6-1010777c6da8">WALLET\_ACTION\_REQUIRED</span></td><td class="confluenceTd mceSelected" style="width: 63.2889%;">If the *getFinalDecisionForTransaction* returns an AUTHENTICATION\_REQUIRED status then this result will be returned.

The SDK will have declined the transaction but requested that the POS should keep the context active for a subsequent tap.

If the POS does not support mobile devices then the merchant may need to repeat the transaction with the same amount so that the second tap can take place.

</td><td class="confluenceTd mceSelected" colspan="1" style="width: 12.1137%;">No</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<del class="diffdel"></del>
- com.google.zxing:core
- <del class="diffdel"></del>net.sf.flexjson:flexjson

## VCP SDK Setup

VCP SDK has to be configured every time when is used. Before VCP SDK usage Mobile DC SDK should be already configured.

### setup

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b1181dc1-aac2-4c0e-8e31-6b09aa2b3aa4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-synchronous.-offline" style="border-collapse: collapse; width: 100%; height: 147.4px;"><tbody><tr style="height: 147.4px;"><td class="wysiwyg-macro-body" style="width: 99.8765%; height: 147.4px;"><p class="callout info">Synchronous. Offline.  
Contains all the necessary data to configure SDK.  
Should be called at the very beginning of the application lifecycle. For example in the Android Application::onCreate method.</p>

<p class="callout info">Requires MobileDC setup() already finished</p>

<p class="callout info">Setup methods could be called in another thread then Main to improve application start time. In case of calling setup method in another thread application must check before every SDK usage if setup method is already finished.</p>

<p class="callout info">When SDK is integrated into the app and user can enable or disable it as a featere - the SDK setup can be ommited during Application start and loaded on demand.</p>

<p class="callout warning">**Important:** Before calling VCP SDK setup you must call setup from Mobile DC SDK.  
</p>

<p class="callout info"><u>Implementation of Application::on Create should be as quick as possible. Invocation time directly impacts on the performance of payment and loading first aplication screen.</u></p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-12" style="width: 100.247%;"><colgroup><col style="width: 16.375%;"></col><col style="width: 16.5%;"></col><col style="width: 46.625%;"></col><col style="width: 20.5%;"></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">ucpConfiguration</td><td class="confluenceTd">UcpConfiguration</td><td class="confluenceTd">VCP configuration provided in builder described below.

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

**UcpConfigurationBuilder** contains the following methods:

<table class="relative-table wrapped confluenceTable" id="bkmrk-metod-parameter-desc" style="width: 108.272%; height: 1170px;"><colgroup><col style="width: 25.9852%;"></col><col style="width: 24.432%;"></col><col style="width: 38.6174%;"></col><col style="width: 10.9654%;"></col></colgroup><tbody><tr style="height: 60.4px;"><th class="confluenceTh" style="height: 60.4px;">**Metod**</th><th class="confluenceTh" style="height: 60.4px;">**Parameter**</th><th class="confluenceTh" style="height: 60.4px;">**Description**</th><th class="confluenceTh" style="height: 60.4px;">**Validation conditions**

</th></tr><tr style="height: 29.8px;"><td class="confluenceTd" style="height: 29.8px;">withApplication</td><td class="confluenceTd" style="height: 29.8px;">Application</td><td class="confluenceTd" style="height: 29.8px;">Application context.</td><td class="confluenceTd" style="height: 29.8px;">Not empty</td></tr><tr style="height: 82.8px;"><td class="confluenceTd" style="height: 82.8px;">withCvmModel</td><td class="confluenceTd" style="height: 82.8px;">WalletCvmModel (enum)</td><td class="confluenceTd" style="height: 82.8px;">Customer Verification Method: CDCVM\_ALWAYS, FLEXIBLE\_CDCVM, CARD\_LIKE

</td><td class="confluenceTd" style="height: 82.8px;">Not empty</td></tr><tr style="height: 105.2px;"><td class="confluenceTd" style="height: 105.2px;">withUserAuthMode</td><td class="confluenceTd" style="height: 105.2px;">WalletAuthMode (enum)</td><td class="confluenceTd" style="height: 105.2px;">User authentication mode: WALLET\_PIN, CUSTOM, NONE

Contact Verestro to select proper configuration

</td><td class="confluenceTd" style="height: 105.2px;">Not empty</td></tr><tr style="height: 60.4px;"><td class="confluenceTd" style="height: 60.4px;"><span class="inline-comment-marker" data-ref="e01423e9-624c-4dbc-b4b6-892ce67f4e66">withUcpPaymentInstrument  
EventListener</span>

</td><td class="confluenceTd" style="height: 60.4px;">UcpPaymentInstrument  
EventListener

</td><td class="confluenceTd" style="height: 60.4px;">Global listener for actions on PaymentInstrument.

</td><td class="confluenceTd" style="height: 60.4px;">Not empty</td></tr><tr style="height: 97px;"><td class="confluenceTd" style="height: 97px;"><span class="inline-comment-marker" data-ref="a5682a66-0bf0-46a2-a368-2704014a3b24">withUcpTransaction  
EventListener</span></td><td class="confluenceTd" style="height: 97px;">UcpTransactionEventListener

</td><td class="confluenceTd" style="height: 97px;">Deprecated - use MobileDcApiConfigurationBuilder.withOptionalMobileDcTransactionEventListener from MDC SDK instead. Global listener for actions during transaction processing

</td><td class="confluenceTd" style="height: 97px;">Not empty</td></tr><tr style="height: 63.4px;"><td class="confluenceTd" style="height: 63.4px;">withTransactionAcceptance  
EventListener</td><td class="confluenceTd" style="height: 63.4px;">UcpTransactionAcceptance  
EventListener</td><td class="confluenceTd" style="height: 63.4px;">Global listener which allow application take final decision about transaction acceptance during transaction</td><td class="confluenceTd" style="height: 63.4px;">Not empty</td></tr><tr style="height: 60.4px;"><td class="confluenceTd" style="height: 60.4px;">withReplenishThreshold</td><td class="confluenceTd" style="height: 60.4px;">Int</td><td class="confluenceTd" style="height: 60.4px;">Number of credentials below which replenish process will automatically begin

</td><td class="confluenceTd" style="height: 60.4px;">Not empty</td></tr><tr style="height: 150px;"><td class="confluenceTd" style="height: 150px;"><span class="inline-comment-marker" data-ref="4d39da91-8e0f-477d-9549-efa093d2069d">withMcbpPinningCertificates</span></td><td class="confluenceTd" style="height: 150px;">List&lt;String&gt;</td><td class="confluenceTd" style="height: 150px;">List of public key certificates in PEM format.

Pass list with empty String if *withOptionalUcpMcbpHttpExecutor* mentioned below is used with custom HTTP communication.

</td><td class="confluenceTd" style="height: 150px;">Not empty List

</td></tr><tr style="height: 80.2px;"><td class="confluenceTd" style="height: 80.2px;">withOptionalEventsReports</td><td class="confluenceTd" style="height: 80.2px;">UcpEventReportListener</td><td class="confluenceTd" style="height: 80.2px;"><span class="inline-comment-marker" data-ref="c2970197-56be-4e91-8754-2e76fc136377">Global listener for most important internal SDK actions related to token management. Could be useful for logs grabbing and debugging on debug.  
</span></td><td class="confluenceTd" style="height: 80.2px;">Optional</td></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">withOptional  
ExternalWalletServer</td><td class="confluenceTd" style="height: 46.6px;">  
</td><td class="confluenceTd" style="height: 46.6px;">Prepares SDK for using external wallet server.</td><td class="confluenceTd" style="height: 46.6px;">Optional</td></tr><tr style="height: 113.8px;"><td class="confluenceTd" style="height: 113.8px;">withOptional  
UcpMcbpHttpExecutor</td><td class="confluenceTd" style="height: 113.8px;">UcpMcbpHttpExecutor/  
DefaultUcpMcbpHttpExecutor</td><td class="confluenceTd" style="height: 113.8px;">Global listener for connection between SDK and MasterCards API. Could be use for adding action before connection - use DefaultUcpMcbpHttpExecutor or for completely replace this connection - use UcpMcbpHttpExecutor.</td><td class="confluenceTd" style="height: 113.8px;">Optional</td></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">withOptional  
UcpReProvisionEventListener</td><td class="confluenceTd" style="height: 46.6px;">UcpReProvisionEventListener</td><td class="confluenceTd" style="height: 46.6px;">Global listener for actions during reprovisioning.</td><td class="confluenceTd" style="height: 46.6px;">Optional</td></tr><tr style="height: 97px;"><td style="height: 97px;">withOptional  
UcpTransactionConfiguration  
</td><td style="height: 97px;">UcpTransactionConfiguration  
</td><td style="height: 97px;">Transaction configuration. Allow to enable deprecated authentication timer called when authentication is peformed.

Timer is disabled by default, usage is not recomended.

</td><td style="height: 97px;">Optional  
</td></tr><tr style="height: 46.6px;"><td style="height: 46.6px;">withOptionalWallet  
McbpHttpExecutor</td><td style="height: 46.6px;">  
</td><td style="height: 46.6px;">Prepares SDK for processing CMS-D HTTP requests with Wallet Server proxy.

</td><td style="height: 46.6px;">Optional</td></tr><tr style="height: 29.8px;"><td style="height: 29.8px;">withOptionalEnableVisaSDK</td><td style="height: 29.8px;">  
</td><td style="height: 29.8px;">Enables Visa SDK usage, requires gradle dependencies configuration

</td><td style="height: 29.8px;">Optional</td></tr><tr><td>withOptionalVtsPayment  
ReadyCallback</td><td><div style="background-color: #ffffff; color: #080808;">UcpVtsPaymentAllowedListener</div></td><td>Provides information if payment with Visa Token is allowed with callback onPaymentAllowed().   
Application should wait for callback when Visa Card is used. Receiving callback requires enabled internet connection. Can be switched anytime and SDK will detect connection change.  
  
When connected internet connection is no more required until application close.

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

**UcpPaymentInstrumentEventListener**

Contains callbacks for PaymentInstrument.

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-name-paramete" style="width: 102.346%;"><colgroup><col style="width: 18.665%;"></col><col style="width: 19.5303%;"></col><col style="width: 61.8047%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Method name**</th><th class="confluenceTh">**Parameters**</th><th class="confluenceTh">**Description**

</th></tr><tr><td class="confluenceTd">onProvisioning  
Success</td><td class="confluenceTd">paymentInstrument: PaymentInstrument

</td><td class="confluenceTd">Method called after provisioning process. Information about PaymentInstrument activation process will be provided in onPaymentInstrumentStatusChanged callback described below

</td></tr><tr><td class="confluenceTd">onProvisioning  
Failure</td><td class="confluenceTd">errorMessage: String?,

exception: Exception?

</td><td class="confluenceTd">Method called after provisioning failure. Try processing digitization again

</td></tr><tr><td class="confluenceTd">onReplenish  
Success</td><td class="confluenceTd">paymentInstrument: PaymentInstrument

numberOfTransactionCredentials: Int

</td><td class="confluenceTd">Method called after successfully transaction credentials replenish. Provides information about PaymentInstrument and number of new transaction credentials.

Depending on flow is called after activation process and when requested by SDK based on *replenishThreshold* configuration.

**Note:** Replenish could be called just after transaction based on *withRplenishThreshold* configuration. It's recommended to not do complex process here. It could affect on next transaction processing time when multiple transactions are done in row

</td></tr><tr><td class="confluenceTd">onReplenish  
Failure</td><td class="confluenceTd">paymentInstrument: PaymentInstrument,

errorMessage: String?,

exception: Exception?

</td><td class="confluenceTd">Method called after replenish failure with PaymentInstrument

**Note:** Replenish could be called just after transaction based on *withRplenishThreshold* configuration. It's recommended to not do complex process here. It could affect on next transaction processing time when multiple transactions are done in row

</td></tr><tr><td class="confluenceTd">onPayment  
Instrument  
StatusChanged</td><td class="confluenceTd">newStatus: PaymentInstrument  
Status

paymentInstrumentId: String

</td><td class="confluenceTd">Provides information about PaymentInstrumentStatus state (check model) for selected payment instrument id

</td></tr><tr><td class="confluenceTd" colspan="1">onNewTransaction</td><td class="confluenceTd" colspan="1">newTransaction: <span class="inline-comment-marker" data-ref="0cd57191-533f-4d1d-ac3e-3a5e723c1394">NewTransaction</span>

</td><td class="confluenceTd" colspan="1">Provides online result with details of transaction processed in VCP

Works only when application is online

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

**UcpTransactionEventListener**

Callbacks related to transaction process.

<p class="callout warning">**Important:** It's recommended to not do complex process in there callbacks. It could <span lang="en">significantly</span> affect on transaction processing time.</p>

<table class="wrapped confluenceTable" id="bkmrk-method-name-paramete-0" style="width: 140.37%; height: 805.8px;"><colgroup><col style="width: 14.8343%;"></col><col style="width: 36.2163%;"></col><col style="width: 48.9493%;"></col></colgroup><tbody><tr style="height: 29.8px;"><th class="confluenceTh" style="height: 29.8px;">Method name</th><th class="confluenceTh" style="height: 29.8px;">Parameters</th><th class="confluenceTh" style="height: 29.8px;">Description

</th></tr><tr style="height: 80.2px;"><td class="confluenceTd" style="height: 80.2px;">onAuthRequired  
ForContactless

</td><td class="confluenceTd" style="height: 80.2px;">paymentInstrument: PaymentInstrument, transactionInformation:   
<s>ContactlessTransactionInformation</s>  
transactionData: ContactlessTransactionData

</td><td class="confluenceTd" style="height: 80.2px;">Called when user authentication is required during contactless transaction

ContactlessTransactionInformation is deprecated in version 2.2.4.

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">onAuthRequired  
ForDsrp

</td><td class="confluenceTd" style="height: 46.6px;">paymentInstrument: PaymentInstrument, dsrpTransactionInfo: DsrpTransactionInfo

</td><td class="confluenceTd" style="height: 46.6px;">Called when user authentication is required during Dsrp transaction

</td></tr><tr style="height: 113.8px;"><td class="confluenceTd" style="height: 113.8px;"><span style="text-decoration: line-through;">onAuthTimer</span>  
<span style="text-decoration: line-through;">Updated</span></td><td class="confluenceTd" style="height: 113.8px;">secondsRemaining: Int</td><td class="confluenceTd" style="height: 113.8px;">Called on every update of remaining time for performing transaction, as SDK starts transaction timer based on card profile configuration.  
Note: Deprecated and disabled by default in version 2.6.7.

To enable use configuration avaialble in SDK *setup::withOptionalUcpTransactionConfiguration.*

</td></tr><tr style="height: 130.6px;"><td style="height: 130.6px;">onContactless  
PaymentStarted

</td><td style="height: 130.6px;">\-

</td><td style="height: 130.6px;">Called on very beginnging of every transaction start (SELECT\_PPSE APDU command). E.g. first tap to terminal or second tap if *onAuthRequiredForContactless* method was called.  
  
Locks communication until method is finished.   
Method duration directly impacts on transaction time.

</td></tr><tr style="height: 147.4px;"><td class="confluenceTd" style="height: 147.4px;">onContactless  
Payment  
Completed

</td><td class="confluenceTd" style="height: 147.4px;">paymentInstrument: PaymentInstrument  
transactionInformation: <s>ContactlessTransactionInformation</s>

transactionResult: ContactlessTransactionResult  
transactionData : ContactlessTransactionData,

transactionId:String

</td><td class="confluenceTd" style="height: 147.4px;">Called when transaction is completed with information about transaction and result.

ContactlessTransactionInformation is deprecated in version 2.2.4.

transactionId - transaction identifier for Mastercard transactions, allow to match transaction with processed transaction notification from Mobile DC SDK: *EventNewTransaction::clientTransactionId.*

</td></tr><tr style="height: 63.4px;"><td class="confluenceTd" style="height: 63.4px;">onContactless  
Payment  
Incident

</td><td class="confluenceTd" style="height: 63.4px;">paymentInstrument: PaymentInstrument,

exception: Exception

</td><td class="confluenceTd" style="height: 63.4px;">Called when something went wrong during transaction and Mastercard marked transaction as incident

</td></tr><tr style="height: 147.4px;"><td class="confluenceTd" style="height: 147.4px;">onContactless  
Payment  
Aborted

</td><td class="confluenceTd" style="height: 147.4px;">paymentInstrument: PaymentInstrument?,

abortReason: TransactionAbortReason,

exception: Exception

</td><td class="confluenceTd" style="height: 147.4px;">Called when transaction is aborted during payment from some reason described in method parameter

PaymentInstrument could be null if abortReason = TransactionAbortReason.NO\_CARDS is returned.

Note: SDK clears passed selected card with method *selectForPayment()* and authentication with *setUserAuthenticatedForPayment()*

</td></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;"><span style="text-decoration: line-through;">onTransaction</span>  
<span style="text-decoration: line-through;">Stopped</span>

</td><td class="confluenceTd" style="height: 46.6px;">  
</td><td class="confluenceTd" style="height: 46.6px;">Method called on transaction stopped by SDK.  
Deprecated in version 2.6.7, no longer used.

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

**UcpTransactionAcceptanceEventListener**

Callbacks related to transaction process.

<p class="callout warning">**Important:** It's recommended to not do complex process in there callbacks. It could <span lang="en">significantly</span> affect on transaction processing time.</p>

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

</th></tr><tr><td class="confluenceTd">getFinal  
Decision  
ForTransaction

</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="6d6b39f4-d179-4d4b-9722-41d965d00c4b">isUserAuthenticated : Boolean</span>

<span class="inline-comment-marker" data-ref="6d6b39f4-d179-4d4b-9722-41d965d00c4b">recommendedAdvice : ContactlessAdvice</span>

<span class="inline-comment-marker" data-ref="6d6b39f4-d179-4d4b-9722-41d965d00c4b">trasactionInformation : <s>ContactlessTransactionInformation</s></span>

<span class="inline-comment-marker" data-ref="6d6b39f4-d179-4d4b-9722-41d965d00c4b">transactionData : ContactlessTransactionData  
</span>

</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="9e549d88-6ffd-42a0-a7ea-65d7457c8f90">Called on every transaction for the final decision about transaction processing</span>

<span class="inline-comment-marker" data-ref="9e549d88-6ffd-42a0-a7ea-65d7457c8f90">An application can decide based on information about authentication, transaction details like amount, currency, and transaction types</span>

<span class="inline-comment-marker" data-ref="9e549d88-6ffd-42a0-a7ea-65d7457c8f90">The method also provide recommended by MCBP advice based on transaction</span>

<span class="inline-comment-marker" data-ref="9e549d88-6ffd-42a0-a7ea-65d7457c8f90">ContactlessTransactionInformation is deprecated in version 2.2.4.</span>

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

**UcpEventReportsListener**

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

</th></tr><tr><td class="confluenceTd">onNewReport

</td><td class="confluenceTd">report: Report

</td><td class="confluenceTd">Return logs related to token management.

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

**UcpReProvisionEventListener**

Called when transaction is completed with information about transaction and result.

ContactlessTransactionInformation is deprecated in version 2.2.4.

<table class="wrapped confluenceTable" id="bkmrk-method-name-paramete-3" style="width: 100%;"><colgroup><col style="width: 18.9122%;"></col><col style="width: 19.532%;"></col><col style="width: 61.5558%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Method Name**</th><th class="confluenceTh">**Parameters**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">onReProvisionSuccess</td><td class="confluenceTd">paymentInstrument: PaymentInstrument</td><td class="confluenceTd">Method called after reProvisioning process.   
Information about PaymentInstrument activation process will be provided in onPaymentInstrumentStatusChanged callback.

</td></tr><tr><td class="confluenceTd" colspan="1">onReProvisionFailure</td><td class="confluenceTd" colspan="1">paymentInstrument : PaymentInstrument

errorMessage : String?

exception : Exception?

</td><td class="confluenceTd" colspan="1">Method called after reProvisioning failure. Try again.

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

**UcpMcbpHttpExecutor**

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-name-paramete-4" style="width: 100%;"><colgroup><col style="width: 8.89988%;"></col><col style="width: 34.758%;"></col><col style="width: 56.3421%;"></col></colgroup><thead><tr><th class="confluenceTh">Method name

</th><th class="confluenceTh">Parameters

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

</th></tr></thead><tbody><tr><td class="confluenceTd">execute

</td><td class="confluenceTd">ucpMcbpRequestType: UcpMcbpHttpExecutorRequestType,  
ucpMcbpHttpMethod:

UcpMcbpHttpMethod,  
url: String,  
requestData:Any,  
requestProperties:

Map&lt;String, String&gt;

</td><td class="confluenceTd">Called on every time if SDK want to connect to MasterCard and should return UcpMcbpHttpResponse.

requestData could be one of request data type: UcpMcbpRequestSessionRequestData,  
UcpMcbpReplenishRequestData, UcpMcbpProvisionRequestData, UcpMcbpNotifyProvisioningResultRequestData,  
UcpMcbpChangeMobilePinRequestData, UcpMcbpDeleteRequestData.

```
ucpMcbpHttpMethod could be one of: POST, GET.
```

```
ucpMcbpRequestType could be one of: REQUEST_SESSION, REPLENISH, PROVISION,<br></br>NOTIFY_PROVISIONING_RESULT, CHANGE_MOBILE_PIN, DELETE.
```

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

**DefaultUcpMcbpHttpExecutor**

<table class="relative-table wrapped confluenceTable" id="bkmrk-method-name-paramete-5" style="width: 118.765%;"><colgroup><col style="width: 9.02349%;"></col><col style="width: 35.6048%;"></col><col style="width: 55.3717%;"></col></colgroup><thead><tr><th class="confluenceTh">Method name

</th><th class="confluenceTh">Parameters

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

</th></tr></thead><tbody><tr><td class="confluenceTd">execute

</td><td class="confluenceTd">ucpMcbpRequestType: UcpMcbpHttpExecutorRequestType

ucpMcbpHttpMethod: UcpMcbpHttpMethod

url: String

requestData: Any

requestProperties: Map&lt;String, String&gt;

</td><td class="confluenceTd">Called on every time if SDK want to connect to MasterCard and should return super.execute method.

requestData could be one of request data type: UcpMcbpRequestSessionRequestData,  
UcpMcbpReplenishRequestData, UcpMcbpProvisionRequestData, UcpMcbpNotifyProvisioningResultRequestData,  
UcpMcbpChangeMobilePinRequestData, UcpMcbpDeleteRequestData.

```
ucpMcbpHttpMethod could be one of: POST, GET.
```

```
ucpMcbpRequestType could be one of: REQUEST_SESSION, REPLENISH, PROVISION,<br></br>NOTIFY_PROVISIONING_RESULT, CHANGE_MOBILE_PIN, DELETE.
```

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

**UcpTransactionConfiguration**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-13" style="width: 118.765%;"><colgroup><col style="width: 18.2897%;"></col><col style="width: 12.7328%;"></col><col style="width: 68.9529%;"></col></colgroup><thead><tr><th class="confluenceTh">Parameter

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

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

</th></tr></thead><tbody><tr><td class="confluenceTd">enableTransaction  
AuthenticationTimer

</td><td class="confluenceTd">Boolean  
</td><td class="confluenceTd">Allows to enable deprecated authentication timer.

Timer is started along *setUserAuthenticatedForPayment(),* result is available in *onAuthTimerUpdated().*

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

**<span class="inline-comment-marker" data-ref="e549c1d0-32d9-408c-a644-7043266241c5">Callback samples:</span>**

**UcpTransactionEventListener**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f95cd121-bc54-44fb-8357-739aa373e85a" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2F-ucptransactioneve"><tbody><tr><td class="wysiwyg-macro-body">```
// UcpTransactionEventListener comments

class BankingAppUcpTransactionEventListener : UcpTransactionEventListener {

    override fun onAuthRequiredForContactless(event: EventAuthRequiredForContactless) {
        //authorization is required for transaction, open payment screen with authorization
        //show PaymentInstrument and ContactlessTransactionData available in event object

        showPaymentScreen(event.paymentInstrument, event.transactionData)
    }


    override fun onAuthRequiredForDsrp(event: EventAuthRequiredForDsrp) {
        //authorization is required for transaction, open payment screen with authorization
        //show PaymentInstrument and DSRP transaction information available in event object

        showPaymentScreen(event.paymentInstrument, event.dsrpTransactionInfo)
    }

    override fun onAuthTimerUpdated(event: EventAuthTimerUpdated) {
        //check if user is on payment screen and update timer
        //when timer is 0, application should close payment with failure
        
		//deprcated, disabled by default, read method description how to enable
    }

    override fun onContactlessPaymentAborted(event: EventContactlessPaymentAborted) {
        //looks like payment is aborted, can provide result to payment screen 
        //and show user what is abort reason
    }

    override fun onContactlessPaymentCompleted(event: EventContactlessPaymentCompleted) {
        //payment completed, provide result to payment information
        //REMEMBER Transaction is processed on terminal and this is where 
        //you will see final transaction result
    }

    override fun onContactlessPaymentIncident(event: EventContactlessPaymentIncident) {
        //something went wrong during transaction, provide result to user
    }

    override fun onTransactionStopped() {
        //deprecated, not used anymore, 
    }
    
    override fun onContactlessPaymentStarted() {
        //Payment started or resumed after callback onAuthReqiredForContactless
        //Best place for checking if user is authenticated for payment and call
        //setUserAuthenticatedForPayment() and selectForPayment() methods if non-defaut card is selected
    }
}
```

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

**UcpPaymentInstrumentEventListener**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="597e1056-57b0-45d3-a5b0-ec74775319fe" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-bankingapppaym"><tbody><tr><td class="wysiwyg-macro-body">```
class BankingAppPaymentInstrumentEventListener : UcpPaymentInstrumentEventListener {

    override fun onNewTransaction(event: EventNewTransaction) {
        //information about new transaction processed by issuer
    }

    override fun onPaymentInstrumentStatusChanged(event: EventPaymentInstrumentStatusChanged) {
        //status of payment instrument was changed, refresh list, inform user about new status
    }

    override fun onProvisioningFailure(event: EventProvisioningFailure) {
        //provisioning failed, try again
    }

    override fun onProvisioningSuccess(event: EventProvisioningSuccess) {
        //provisioning success, wait for status and replenish changes until user can pay 
        //or provide activation method when required
    }

    override fun onReplenishFailure(event: EventReplenishFailure) {
        //transaction credentials replenish failed
    }

    override fun onReplenishSuccess(event: EventReplenishSuccess) {
        //transaction credentials replenish success
    }
}
```

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

**UcpTransactionAcceptanceEventListener**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="d25ff082-144f-4320-b2bf-49db69852c0e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-bankingappucpt"><tbody><tr><td class="wysiwyg-macro-body">```
class BankingAppUcpTransactionAcceptanceEventListener : UcpTransactionAcceptanceEventListener {

    //Sample implementation of transaction acceptance listener
    
	//For the scanario when authentication is required on issuer side for every transaction 
    //field even.isUserAuthenticated must be always true, otherwise 
    //ContactlessAdvice.AUTHENTICATION_REQUIRED should be returned

    override fun getFinalDecisionForTransaction(event: EventGetFinalDecision): ContactlessAdvice {

        val isScreenUnlocked = isScreenUnlocked()
        val isScreenProtectedByKeyguard = isScreenUnlocked()

        val isLvtTransaction =
            event.transactionInformation.transactionRange == ContactlessTransactionRange.LVT

        //discard all Transit transaction
        if (event.transactionInformation.richTransactionType == ContactlessRichTransactionType.TRANSIT) {
            return ContactlessAdvice.DECLINE
        }

        //allow for transaction when user is authenticated for payment and screen unlocked
        if (event.isUserAuthenticated && isScreenUnlocked) {
            return ContactlessAdvice.PROCEED
        }

        //allow for LVT transaction on unlocked screen when protected and don't require authentication
        if (isLvtTransaction && isScreenProtectedByKeyguard && isScreenUnlocked) {
            return ContactlessAdvice.PROCEED
        }

        // ...
        // much more cases

        //require authentication anyway
        return ContactlessAdvice.AUTHENTICATION_REQUIRED
    }
}
```

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

**UcpEventReportsListener**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="594bbdc2-a343-41e2-8554-b74d8411ec8e" data-macro-name="code" data-macro-schema-version="1" id="bkmrk-class-bankreporteven"><tbody><tr><td class="wysiwyg-macro-body">```
class BankReportEventListener : UcpEventReportsListener {

    override fun onNewReport(report: Report) {
       //may be used for debugging SDK or gathering reports on client's app or backend
  	}
}
```

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

**UcpMcbpHttpExecutor**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="d3abd2c6-fa50-4d28-b215-7776e03857ef" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fuse-ucpmcbphttpexe"><tbody><tr><td class="wysiwyg-macro-body">```
//Use UcpMcbpHTtpExecutor as supertype if you want to replace connection
class BankUcpMcbpHttpExecutor : UcpMcbpHttpExecutor {
 
    override fun execute(
        ucpMcbpRequestType: UcpMcbpHttpExecutorRequestType,
        ucpMcbpHttpMethod: UcpMcbpHttpMethod,
        url: String,
        requestData: Any,
        requestProperties: Map<String, String>
    ): UcpMcbpHttpResponse {
 
 
        //additional action before request
 
 
        //invoke connect by custom connector
        return when (ucpMcbpRequestType) {
            UcpMcbpHttpExecutorRequestType.REQUEST_SESSION -> {
                executeRequestSession(ucpMcbpHttpMethod, url, requestData as UcpMcbpRequestSessionRequestData, 
                requestProperties)
            }
            UcpMcbpHttpExecutorRequestType.PROVISION -> {
                executeProvision(ucpMcbpHttpMethod, url, requestData as UcpMcbpProvisionRequestData, 
                requestProperties)
            }
            UcpMcbpHttpExecutorRequestType.REPLENISH -> {
                executeReplenish(ucpMcbpHttpMethod, url, requestData as UcpMcbpReplenishRequestData, 
                requestProperties)
            }
            UcpMcbpHttpExecutorRequestType.NOTIFY_PROVISIONING_RESULT -> {
                executeNotifyProvisioningResult(ucpMcbpHttpMethod, url, 
                requestData as UcpMcbpNotifyProvisioningResultRequestData, requestProperties)
            }
            UcpMcbpHttpExecutorRequestType.CHANGE_MOBILE_PIN -> {
                executeChangeMobilePin(ucpMcbpHttpMethod, url, 
                requestData as UcpMcbpChangeMobilePinRequestData, requestProperties)
            }
            UcpMcbpHttpExecutorRequestType.DELETE -> {
                executeDelete(ucpMcbpHttpMethod, url, requestData as UcpMcbpDeleteRequestData, 
                requestProperties)
            }
        }
    }
}
```

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

**DefaultUcpMcbpHttpExecutor**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="806653f8-cb70-4ee6-b03a-af2146adbda9" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fuse-defaultucpmcbp"><tbody><tr><td class="wysiwyg-macro-body">```
//Use DefaultUcpMcbpHTtpExecutor as supertype if you want to only add some action before connection
class BankDefaultUcpMcbpHttpExecutor : DefaultUcpMcbpHttpExecutor() {
    override fun execute(
        ucpMcbpRequestType: UcpMcbpHttpExecutorRequestType,
        ucpMcbpHttpMethod: UcpMcbpHttpMethod,
        url: String,
        requestData: Any,
        requestProperties: Map<String, String>
    ): UcpMcbpHttpResponse {
 
        //additional action before request
 
        return super.execute(
            ucpMcbpRequestType,
            ucpMcbpHttpMethod,
            url,
            requestData,
            requestProperties
        )
    }
}
```

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

**UcpReProvisionEventListener**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="0b90198d-9290-4443-86c6-3b0a6bd847ea" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-bankingappucpr"><tbody><tr><td class="wysiwyg-macro-body">```
class BankingAppUcpReProvisiongEventListener : UcpReProvisionEventListener() {
     override fun onReProvisionSuccess(event: EventReProvisionSuccess) {
     	//reProvisioning success, wait for status and replenish changes until user can pay 
  	}
 	
	override fun onReProvisionFailure(event: EventReProvisionFailure) {
       //reProvisioning failed, try again.
  	}
}
```

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

**UcpTransactionConfiguration**

```
class BankingAppUcpTransactionConfiguration : UcpTransactionConfiguration {
    override val enableTransactionAuthenticationTimer: Boolean = false
}
```

**UcpVtsPaymentAllowedListener**

```
class BankingAppUcpVtsPaymentAllowedListener : UcpVtsPaymentAllowedListener {
    override fun onPaymentAllowed() {
        //when during a payment an status of PAYMENT_NOT_ALLOWED is received 
        //Application UI should show transaction error and wait for onPaymentAllowed() callback
        //When received callback shouuld inform UI to process transaction again
    }}
```

**Sample VCP SDK setup implementation**

Mobile DC setup() and VCP setup() method could be called on MainThread in Application:onCreate as blocking or another thread.  
When applicaiton has multiple dependencies there is possible to call both setup() methods on another thread (MobileDC setup() method must be already finished until VCP setup() is called).   
<span style="text-decoration: underline;">Important:</span> In case of loading SDK on another thread and using contactless payments HostApduService must be used asynchronous way to prevet using SDK until loading is finished - check sample for method *PaymentService:processHceApduCommand*.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="6b18f40a-c6e5-4a00-b778-5ad8749ac94a" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-setup%28-applicati"><tbody><tr><td class="wysiwyg-macro-body">```
fun setup(
    application: Application,
    walletCvmModel: WalletCvmModel,
    walletAuthUserMode: WalletAuthUserMode,
    mcbpPinningCertificates: List<String>,
    replenishThreshold: Int
) {

    val ucpConfiguration = UcpConfiguration.create(
        UcpConfigurationBuilder()
            .withApplication(application)
            .withCvmModel(walletCvmModel)
            .withUserAuthMode(walletAuthUserMode)
            //marked as deprecated - see description above
            .withUcpTransactionEventListener(BankingAppUcpTransactionEventListener())
            .withUcpPaymentInstrumentEventListener(BankingAppPaymentInstrumentEventListener())
            .withMcbpPinningCertificates(mcbpPinningCertificates)
            .withUcpTransactionAcceptanceEventListener(BankingAppUcpTransactionAcceptanceEventListener())
            .withReplenishThreshold(replenishThreshold)
			.withOptionalEventsReports(BankReportEventListener())
    		.withOptionalUcpMcbpHttpExecutor(BankUcpMcbpHttpExecutor())
			//if you want to only add additional action before connection use below implementation
			//.withOptionalUcpMcbpHttpExecutor(BankDefaultUcpMcbpHttpExecutor())
			.withOptionalUcpReProvisionEventListener(BankingAppUcpReProvisionEventListener())
            //if you want to change standard transaction configuration use configuration below
            .withOptionalUcpTransactionConfiguration(BankingAppUcpTransactionConfiguration())
            //.withOptionalEnableVisaSDK() //optional when Visa is used
            //.withOptionalVtsPaymentReadyCallback(BankingAppUcpVtsPaymentAllowedListener()) //optional when Visa is used
    )

    UcpApiKotlin().setup(ucpConfiguration)
}
```

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

### reset (DEPRECATED - use restart instead)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b1181dc1-aac2-4c0e-8e31-6b09aa2b3aa4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-synchronous.-offline-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Synchronous. Offline.  
Method for resetting SDK to uninitialized state.  
**NOTE:** According to MCBP Deployment team there is no possibility for resetting SDK without killing application process for clearing all MC SDK local variables. **<span class="inline-comment-marker" data-ref="446c57fc-0c0a-4914-bf39-874fb230ecc1">Please kill application process after using this method</span>**<span class="inline-comment-marker" data-ref="446c57fc-0c0a-4914-bf39-874fb230ecc1">. Trying using any facade method without stopping application process will cause throwing UcpSdkException.   
</span><span class="inline-comment-marker" data-ref="446c57fc-0c0a-4914-bf39-874fb230ecc1">To avoid closing application use restart() methods.  
</span></p>

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

**Input**

No input.

**Output**

No output.

**Sample**

**Sample VCP SDK reset implementation:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="d3abd2c6-fa50-4d28-b215-7776e03857ef" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-reset%28%29-%7B-ucpapi"><tbody><tr><td class="wysiwyg-macro-body">```
fun reset() {
    UcpApiKotlin().reset()

	//Terminating JVM according to MC SDK Sample Application
    Runtime.getRuntime().exit(0);
}
```

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

### restart

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b1181dc1-aac2-4c0e-8e31-6b09aa2b3aa4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-synchronous.-offline-1"><tbody><tr><td class="wysiwyg-macro-body">Synchronous. Offline.

Method for resetting SDK to uninitialized state.

Replaces reset() method which requires killing application process.

When restart finishes with error, application should repeat action.

**NOTE:** SDK must be already initialized to call restart() method. During restart() SDK internally initializes SDK again.

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

**Input**

No input.

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e51e890a-09ee-49e9-8443-c0ded3d4e3de" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-whe" style="width: 95.5556%;"><tbody><tr><td class="wysiwyg-macro-body" style="width: 100%;"><p class="callout success">Success callback when SDK data is cleared and SDK is ready to use again. No any action is required to call facade methods.</p>

<p class="callout danger">Failure callback when something went wrong during restart. Application should repeat action.</p>

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

**Sample**

**Sample VCP SDK reset implementation:**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="d3abd2c6-fa50-4d28-b215-7776e03857ef" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-ucpapikotlin%28%29.resta"><tbody><tr><td class="wysiwyg-macro-body">```
UcpApiKotlin().restart({
    //restart finished with success. UCP & MDC data is cleared, SDK is now ready to use without calling MDC & UCP setup methods
}, {
    //some error occured, please repeat action
})
```

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

##   
Cards domain  


### delete

<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"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.|  
Method allows delete PaymentInstument from VCP.  
Payment token will be removed remote and local storage.  
Result of action will be notified with *onPaymentInstrumentStatusChanged*.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-14" style="width: 78.2716%;"><colgroup><col style="width: 24.0126%;"></col><col style="width: 15.0079%;"></col><col style="width: 35.543%;"></col><col style="width: 25.5944%;"></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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of PaymentInstrument to delete

</td><td class="confluenceTd">Not empty.</td></tr><tr><td class="confluenceTd" colspan="1">reason</td><td class="confluenceTd" colspan="1">CharArray?</td><td class="confluenceTd" colspan="1">Optional reason of deletion

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="dcd90cf0-b262-4524-b6fe-3b8cff9622cb" 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="8df40eef-c58c-4cd5-9453-d934b38c602e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-delete%28paymentin"><tbody><tr><td class="wysiwyg-macro-body">```
fun delete(paymentInstrumentId: String, reason: CharArray?) {
    ucpApi.cardsService
            .delete(paymentInstrumentId, reason,
                    {
                        //PaymentInstrument delete requested
                        //wait for confirmation from onPaymentInstrumentStatusChanged
                    },
                    { throwable ->
                        //Something went wrong, check excetpion with documentation
                    }
            )
}
```

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

### checkEligibility

<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-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Check eligibility required to process digitize.</p>

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

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-15"><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">checkEligibility</td><td class="confluenceTd">CheckEligibility</td><td class="confluenceTd">CheckEligibility object

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

CheckEligibility

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

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

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

</th></tr></thead><tbody><tr><td class="confluenceTd">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifier of payment instrument

</td></tr><tr><td class="confluenceTd">paymentInstrumentType</td><td class="confluenceTd">PaymentInstrumentType</td><td class="confluenceTd">Payment instrument type. One of: \[MASTERCARD,VISA\]

</td></tr><tr><td class="confluenceTd" colspan="1">userLanguage</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">User language</td></tr><tr><td class="confluenceTd" colspan="1">userCountry</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">User country</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9b441ed3-52d6-4cd8-a6ba-ab0c8adbec43" 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 CheckEligibilityResult.</p>

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

CheckEligibilityResult

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

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

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

</th></tr></thead><tbody><tr><td class="confluenceTd">termsAndConditionsAssetId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifier of Terms and Conditions asset

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

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="cf58172a-fbda-4ffa-af0f-0ba7e291634e" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

**Sample**

<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-private-fun-checkeli"><tbody><tr><td class="wysiwyg-macro-body">```
private fun checkEligibility(
    paymentInstrumentId: String,
    paymentInstrumentType: PaymentInstrumentType,
    userLanguage: String,
    userCountry: String
) {

    ucpApi.cardsService
        .checkEligibility(
            CheckEligibility(
                paymentInstrumentId,
                paymentInstrumentType,
                userLanguage,
                userCountry
            ),
            { checkEligibilityResult ->
                //Handle result
            },
            { throwable ->
                //Something went wrong, check exception with documentation
            }
        )
}
```

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

### digitize 

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a54b4d7c-d37c-434c-98d3-7a795fca28b1" 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.  
Use only when *checkEligibility* method is used.  
Creates payment token in VCP backend.  
Expect push after successful finish and then proceed using process method in Cloud Messaging domain.</p>

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

####   


**Input**

<table class="relative-table wrapped 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 conditions</th></tr><tr><td class="confluenceTd">digitizationRequest</td><td class="confluenceTd">DigitizationRequest</td><td class="confluenceTd">Plain object of DigitizationRequest

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

DigitizationRequest object contains following fields:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-19" style="width: 100%;"><colgroup><col style="width: 20.7658%;"></col><col style="width: 21.5086%;"></col><col style="width: 37.2064%;"></col><col style="width: 20.5192%;"></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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifier of payment instrument

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">paymentInstrumentType</td><td class="confluenceTd">PaymentInstrumentType</td><td class="confluenceTd">Payment instrument type. One of: \[MASTERCARD,VISA\]

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd"><span class="inline-comment-marker" data-ref="8d18a631-d814-480a-b35c-d2a68e3024ca">securityCode</span></td><td class="confluenceTd">CharArray?</td><td class="confluenceTd">Optional. The CVC2 for the card to be digitized</td><td class="confluenceTd">  
</td></tr><tr><td><span class="inline-comment-marker" data-ref="8d18a631-d814-480a-b35c-d2a68e3024ca">externalPaymentTokenId</span></td><td>String?</td><td>Optional. Unique external identifier of Payment Token</td><td>  
</td></tr></tbody></table>

####   


**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e51e890a-09ee-49e9-8443-c0ded3d4e3de" 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 success">Success callback with DigitizationResult object</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-20" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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">digitizationResult</td><td class="confluenceTd">DigitizationResult</td><td class="confluenceTd"><span class="inline-comment-marker" data-ref="0b849460-ccc7-4dd0-a6e4-e930d9eb4b7f">Plain object of DigitizationResult</span>

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

DigitizationResult contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-21" style="width: 107.407%;"><colgroup><col style="width: 28.6703%;"></col><col style="width: 33.6141%;"></col><col style="width: 37.6909%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">paymentInstrument</td><td class="confluenceTd">PaymentInstrument</td><td class="confluenceTd">Plain object of PaymentInstrument

</td></tr><tr><td class="confluenceTd">additionalAuthenticationMethods</td><td class="confluenceTd">List&lt;AdditionalAuthenticationMethod&gt;?</td><td class="confluenceTd">All available additional authentication method</td></tr><tr><td class="confluenceTd">productConfig</td><td class="confluenceTd">ProductConfig</td><td class="confluenceTd">Plain object of ProductConfig, contains Payment Token configuration</td></tr><tr><td>externalPaymentTokenId</td><td>String?</td><td>Optional. External payment token id configured by the consumer. In case of identifier duplicate an random id is generated</td></tr></tbody></table>

ProductConfig contains following fields.

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-22" style="width: 100%;"><colgroup><col style="width: 23.9769%;"></col><col style="width: 13.106%;"></col><col style="width: 62.9172%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">isCoBranded</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Whether the product is co-branded</td></tr><tr><td class="confluenceTd" colspan="1">coBrandName</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Name of the co-branded partner</td></tr><tr><td class="confluenceTd" colspan="1">foregroundColor</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Foreground color, used to overlay text on top of the card image</td></tr><tr><td class="confluenceTd" colspan="1">backgroundColor</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Background color, used to overlay text on top of the card image</td></tr><tr><td class="confluenceTd" colspan="1">labelColor</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Label color of the mobile wallet entry for the card</td></tr><tr><td class="confluenceTd" colspan="1">issuerName</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Name of the issuing bank</td></tr><tr><td class="confluenceTd">shortDescription</td><td class="confluenceTd">String</td><td class="confluenceTd">A short description for this product</td></tr><tr><td class="confluenceTd" colspan="1">longDescription</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">A long description for this product</td></tr><tr><td class="confluenceTd" colspan="1">custoremServiceUrl</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Customer service website of the issuing bank</td></tr><tr><td class="confluenceTd" colspan="1">customerServiceEmail</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Customer service email address of issuing bank</td></tr><tr><td class="confluenceTd" colspan="1">customerServicePhoneNumber</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Customer service phone number of the issuing bank</td></tr><tr><td class="confluenceTd" colspan="1">productConfigIssuer</td><td class="confluenceTd" colspan="1">ProductConfigIssuer?</td><td class="confluenceTd" colspan="1">Contains one or more mobile app details that may be used to deep link from the Mobile Payment App to the issuer mobile app</td></tr><tr><td class="confluenceTd" colspan="1">onlineBankingLoginUrl</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Login URL for the issuing bank's online banking website</td></tr><tr><td class="confluenceTd" colspan="1">termsAndConditionsUrl</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">URL linking to the issuing bank's terms and conditions for this product</td></tr><tr><td class="confluenceTd" colspan="1">privacyPolicyUrl</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">URL linking to the issuing bank's privacy policy for this product</td></tr><tr><td class="confluenceTd" colspan="1">issuerProductConfigCode</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Freeform identifier for this product configuration as assigned by the issuer</td></tr><tr><td class="confluenceTd" colspan="1">contactName</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Name of the issuing bank</td></tr><tr><td class="confluenceTd" colspan="1">bankAppName</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Name of banking application for display</td></tr><tr><td class="confluenceTd" colspan="1">bankAppAddress</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The package name for the destination mobile application</td></tr><tr><td class="confluenceTd" colspan="1">unsupportedPresentationTypes</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The presentation types that are not supported such as "MSR" (for example). This is an advisory field to tell the wallet provider that they should not include the unsupported presentation type returned in this field in the provisioning request</td></tr><tr><td class="confluenceTd" colspan="1">unsupportedCardVerificationTypes</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The card verification types that are not supported such as "AVS" (for example). This is an advisory field to let the wallet provider know which card verification services are not supported for a given payment instrument. The wallet provider can use this information to relax any field validations on the Customer UI (such as Address)</td></tr><tr><td class="confluenceTd" colspan="1">issuerFlags</td><td class="confluenceTd" colspan="1">List&lt;ProductConfigIssuerFlags&gt;?</td><td class="confluenceTd" colspan="1">List of plain ProductConfigIssuerFlags object. Contains issuer flags</td></tr><tr><td class="confluenceTd" colspan="1">brandLogoAssetId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The Mastercard or Maestro brand logo associated with this card. Provided as an Asset ID</td></tr><tr><td class="confluenceTd" colspan="1">issuerLogoAssetId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The logo of the issuing bank. Provided as a Asset ID</td></tr><tr><td class="confluenceTd" colspan="1">coBrandLogoAssetId</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The co-brand logo (if any) for this product. Provided as an Asset ID</td></tr><tr><td class="confluenceTd" colspan="1">cardBackgroundCombinedAssetId</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The card image used to represent the digital card in the wallet. This ‘combined’ option contains the Mastercard, bank and any co-brand logos. Provided as an Asset ID</td></tr><tr><td class="confluenceTd" colspan="1">cardBackgroundAssetId</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">The card image used to represent the digital card in the wallet. This ‘non-combined’ option does not contain the Mastercard, bank, or cobrand logos. Provided as an Asset ID</td></tr><tr><td class="confluenceTd" colspan="1">iconAssetId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The icon representing the primary brand(s) associated with this product. Provided as an Asset ID</td></tr></tbody></table>

ProductConfigIssuer contains following fields.

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-23" style="width: 100%;"><colgroup><col style="width: 30.9023%;"></col><col style="width: 39.5567%;"></col><col style="width: 29.541%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">openIssuerAndroidIntent</td><td class="confluenceTd">ProductConfigOpenIssuerAndroidIntent?</td><td class="confluenceTd">AndroidIntent object can be used to open the issuer mobile app</td></tr><tr><td class="confluenceTd">activateWithIssuerAndroidIntent</td><td class="confluenceTd">ProductConfigActivateWithIssuerAndroidIntent?</td><td class="confluenceTd">AndroidIntent object can be used to open the issuer mobile app</td></tr><tr><td class="confluenceTd" colspan="1">openIssuerIOSDeepLinkingUrl</td><td class="confluenceTd" colspan="1">ProductConfigOpenIssuerIOSDeepLinkingUrl?</td><td class="confluenceTd" colspan="1">IOSDeepLinkingUrl object can be used to open the issuer mobile app</td></tr><tr><td class="confluenceTd" colspan="1">activateWithIssuerIOSDeepLinkingUrl</td><td class="confluenceTd" colspan="1">ProductConfigActivateWithIssuerIOSDeepLinkingUrl?</td><td class="confluenceTd" colspan="1">IOSDeepLinkingUrl object can be used to open the issuer mobile app</td></tr></tbody></table>

ProductConfigOpenIssuerAndroidIntent contains following fields.

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-24" style="width: 100%;"><colgroup><col style="width: 13.3494%;"></col><col style="width: 8.15868%;"></col><col style="width: 78.492%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">action</td><td class="confluenceTd">String</td><td class="confluenceTd">The name of the action to be performed. This is a fully qualified name including the package name in order to create an explicit intent</td></tr><tr><td class="confluenceTd">packageName</td><td class="confluenceTd">String</td><td class="confluenceTd">The package name of the issuer’s mobile app. This identifies the app that the intent will resolve to. If the app is not installed on the user’s device, this package name can be used to open a link to the appropriate Android app store for the user to download and install the app</td></tr><tr><td class="confluenceTd" colspan="1">extraTextValue</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Contains the data to be passed through to the target app in the intent as an extra key/value pair with key ‘android.intent.extra.TEXT’. This is Base64-encoded data of a JSON object</td></tr></tbody></table>

ProductConfigActivateWithIssuerAndroidIntent contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-25" style="width: 100%;"><colgroup><col style="width: 13.4734%;"></col><col style="width: 7.66561%;"></col><col style="width: 78.861%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">action</td><td class="confluenceTd">String</td><td class="confluenceTd">The name of the action to be performed. This is a fully qualified name including the package name in order to create an explicit intent</td></tr><tr><td class="confluenceTd">packageName</td><td class="confluenceTd">String</td><td class="confluenceTd">The package name of the issuer’s mobile app. This identifies the app that the intent will resolve to. If the app is not installed on the user’s device, this package name can be used to open a link to the appropriate Android app store for the user to download and install the app</td></tr><tr><td class="confluenceTd">extraTextValue</td><td class="confluenceTd">String</td><td class="confluenceTd">Contains the data to be passed through to the target app in the intent as an extra key/value pair with key ‘android.intent.extra.TEXT’. This is Base64-encoded data of a JSON object</td></tr></tbody></table>

ProductConfigOpenIssuerIOSDeepLinkingUrl contains following fields.

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-26" style="width: 100%;"><colgroup><col style="width: 13.2262%;"></col><col style="width: 7.90932%;"></col><col style="width: 78.8645%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">deepLinkinUrl</td><td class="confluenceTd">String</td><td class="confluenceTd">The deep linking URL of the issuer’s iOS mobile app. This identifies the app that the URL will resolve to. If the app is not installed on the user’s device, this URL can be used to open a link to the appropriate iOS app store for the user to download and install the app</td></tr><tr><td class="confluenceTd">extraTextValue</td><td class="confluenceTd">String</td><td class="confluenceTd">Contains the data to be passed through to the target app in the deep linking URL as a query parameter.It should be appended to the deepLinkingUrl when invoked in the format: deepLinkingUrl + ‘?extraTextValue=’ + extraTextValue. This is Base64-encoded data of a JSON object</td></tr></tbody></table>

ProductConfigActivateWithIssuerIOSDeepLinkingUrl contains following fields.

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-27" style="width: 100%;"><colgroup><col style="width: 13.8443%;"></col><col style="width: 7.53849%;"></col><col style="width: 78.6173%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">deepLinkingUrl</td><td class="confluenceTd">String</td><td class="confluenceTd">The deep linking URL of the issuer’s iOS mobile app. This identifies the app that the URL will resolve to. If the app is not installed on the user’s device, this URL can be used to open a link to the appropriate iOS app store for the user to download and install the app</td></tr><tr><td class="confluenceTd">extraTextValue</td><td class="confluenceTd">String</td><td class="confluenceTd">Contains the data to be passed through to the target app in the deep linking URL as a query parameter. It should be appended to the deepLinkingUrl when invoked in the format: deepLinkingUrl + ‘?extraTextValue=’ + extraTextValue. This is Base64-encoded data of a JSON object</td></tr></tbody></table>

ProductConfigIssuerFlags contains following fields.

<table class="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">deviceBinding</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Device binding</td></tr><tr><td class="confluenceTd">cardholderVerification</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Whether the issuer participating in step-up flow</td></tr><tr><td class="confluenceTd" colspan="1">trustedBeneficiaryEnrollment</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Whether this is a trusted beneficiary enrollment</td></tr><tr><td class="confluenceTd" colspan="1">delegateAuthenticationSupported</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Whether issuer supports delegated authentication</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

Sample

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="2497edf6-c01c-4fee-a32b-bf770f7230ba" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-digitizecard%28dig"><tbody><tr><td class="wysiwyg-macro-body">```
fun digitizeCard(digitizationRequest: DigitizationRequest) {

    ucpApi.cardsService
            .digitize( digitizationRequest,
                    { digitizationResult ->
                        //digitization success, provisioning is in progress
                        //application should listen to push message and provide content to UCP
                        //refresh you payment instrument list form Cards::getPaymentInstruments
                        //new PaymentInstrument should be visible with INACTIVE state

                        //when push processed wait for onProvisioningSuccess or Failure callback
                        //and status change
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

###   


### digitize (deprecated)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a54b4d7c-d37c-434c-98d3-7a795fca28b1" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Deprecated - use digitize(DigitizationGreenPath) instead.  
Creates payment token in VCP backend.  
Expect push after successful finish and then proceed using process method in Cloud Messaging domain.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-29" style="width: 100%; height: 188.8px;"><colgroup><col style="width: 16.44%;"></col><col style="width: 10.8779%;"></col><col style="width: 57.4781%;"></col><col style="width: 15.204%;"></col></colgroup><tbody><tr style="height: 46.6px;"><th class="confluenceTh" style="height: 46.6px;">**Parameter**</th><th class="confluenceTh" style="height: 46.6px;">**Type**</th><th class="confluenceTh" style="height: 46.6px;">**Description**</th><th class="confluenceTh" style="height: 46.6px;">**Validation conditions**</th></tr><tr style="height: 49px;"><td class="confluenceTd" style="height: 49px;">paymentInstrumentId</td><td class="confluenceTd" style="height: 49px;">String</td><td class="confluenceTd" style="height: 49px;">Identifier of payment instrument

</td><td class="confluenceTd" style="height: 49px;">Not empty.</td></tr><tr style="height: 57.8px;"><td class="confluenceTd" colspan="1" style="height: 57.8px;">userLanguage</td><td class="confluenceTd" colspan="1" style="height: 57.8px;">String</td><td class="confluenceTd" colspan="1" style="height: 57.8px;">Language preference selected by the consumer. Formatted as an   
ISO-639-1 two letter language code

</td><td class="confluenceTd" colspan="1" style="height: 57.8px;">Not empty.</td></tr><tr style="height: 35.4px;"><td class="confluenceTd" colspan="1" style="height: 35.4px;">securityCode</td><td class="confluenceTd" colspan="1" style="height: 35.4px;">CharArray?</td><td class="confluenceTd" colspan="1" style="height: 35.4px;">Optional. The CVC2 for the card to be digitized

</td><td class="confluenceTd" colspan="1" style="height: 35.4px;">  
</td></tr></tbody></table>

####   


**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-0"><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="2497edf6-c01c-4fee-a32b-bf770f7230ba" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-digitizecard%28-pa"><tbody><tr><td class="wysiwyg-macro-body">```
fun digitizeCard(
        paymentInstrumentId: String,
        languageCode: String,
        securityCode: CharArray) {

    ucpApi.cardsService
            .digitize(paymentInstrumentId, languageCode, securityCode,
                    {
                        //digitization success, provisioning is in progress
                        //application should listen to push message and provide content to UCP
                        //refresh you payment instrument list form Cards::getPaymentInstruments
                        //new PaymentInstrument should be visible with INACTIVE state

                        //when push processed wait for onProvisioningSuccess or Failure callback
                        //and status change
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### digitize

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a54b4d7c-d37c-434c-98d3-7a795fca28b1" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Creates payment token in VCP backend.  
Expect push after successful finish and then proceed using process method in Cloud Messaging domain.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-30"><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">digitizationGreenPath</td><td class="confluenceTd">DigitizationGreenPath</td><td class="confluenceTd">Plain object of DigitizationGreenPath

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

DigitizationGreenPath contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-31"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifier of payment instrument

</td></tr><tr><td class="confluenceTd">paymentInstrumentType</td><td class="confluenceTd">PaymentInstrumentType</td><td class="confluenceTd">Payment instrument type. One of: \[MASTERCARD,VISA\]</td></tr><tr><td class="confluenceTd">securityCode</td><td class="confluenceTd">CharArray?</td><td class="confluenceTd">Optional. The CVC2 for the card to be digitized</td></tr><tr><td>userLanguage</td><td>String</td><td>User language</td></tr><tr><td>userCountry</td><td>String</td><td>User country</td></tr><tr><td>externalPaymentTokenId</td><td>String?</td><td>Optional. Unique external identifier of Payment Token</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback</p>

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

#####   


**Sample**

```
fun digitizeCard(digitizationGreenPath: DigitizationGreenPath) {

    ucpApi.cardsService
            .digitize(digitizationGreenPath,
                    {
                        //digitization success, provisioning is in progress
                        //application should listen to push message and provide content to UCP
                        //refresh you payment instrument list form Cards::getPaymentInstruments
                        //new PaymentInstrument should be visible with INACTIVE state

                        //when push processed wait for onProvisioningSuccess or Failure callback
                        //and status change
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

### getAdditionalAuthenticationMethods

<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-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Retrieves additional user authentication methods.</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" colspan="1">**Validation conditions**</th></tr><tr><td class="confluenceTd" colspan="1">getAdditionalAuthenticationMethods</td><td class="confluenceTd" colspan="1">GetAdditionalAuthenticationMethods</td><td class="confluenceTd" colspan="1">Plain object of GetAdditionalAuthenticationMethods

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

Fields of GetAdditionalAuthenticationMethods object:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-33"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifier of payment instrument</td></tr></tbody></table>

####   


**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e51e890a-09ee-49e9-8443-c0ded3d4e3de" 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 success">Success callback with AdditionalAuthenticationMethods object.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-34"><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">additionalAuthenticationMethods</td><td class="confluenceTd">AdditionalAuthenticationMethods</td><td class="confluenceTd">Object carrying list of AdditionalAuthenticationMethod</td></tr></tbody></table>

AdditionalAuthenticationMethods contains following value:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-35"><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">additionalAuthenticationMethods</td><td class="confluenceTd" colspan="1">List&lt;AdditionalAuthenticationMethod&gt;</td><td class="confluenceTd" colspan="1">List of AdditionalAuthenticationMethod objects</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f01d9d4e-b2a1-483a-b5e8-c35e98aefe29" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback."><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="85dfd7e7-6a3a-4ea3-b833-870c773db788" data-macro-name="code" data-macro-parameters="language=java|theme=Eclipse" data-macro-schema-version="1" id="bkmrk-private-fun-getaddit"><tbody><tr><td class="wysiwyg-macro-body">```
private fun getAdditionalAuthenticationMethods() {
    val getAdditionalAuthenticationMethod =
        GetAdditionalAuthenticationMethods("paymentInstrumentId")

    ucpApi
        .cardsService
        .getAdditionalAuthenticationMethods(
            getAdditionalAuthenticationMethod,
            { additionalAuthenticationMethods ->
                //Handle result
            },
            { throwable ->
                //Something went wrong, check exception with documentation
            })
}
```

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

### submitTokenAuthenticationValue

<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-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Submit authentication code when additional user authentication is required.</p>

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

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-36"><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">paymentInstrumentId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Identifier of payment instrument

</td></tr><tr><td class="confluenceTd">authenticationCode</td><td class="confluenceTd">String</td><td class="confluenceTd">Authentication code</td></tr></tbody></table>

####   


**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9b441ed3-52d6-4cd8-a6ba-ab0c8adbec43" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2Ffai" style="width: 35.679%;"><tbody><tr><td class="wysiwyg-macro-body" style="width: 100%;"><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="8df40eef-c58c-4cd5-9453-d934b38c602e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-private-fun-submitau"><tbody><tr><td class="wysiwyg-macro-body">```
private fun submitAuthenticationValue(paymentInstrumentId: String, authenticationCode: String) {

    ucpApi.cardsService
        .submitAuthenticationValue(
            SubmitAuthenticationValue(
                paymentInstrumentId,
                authenticationCode
            ),
            {
                //Handle success
            },
            { throwable ->
                //Something went wrong, check exception with documentation
            }
        )
}
```

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

### submitTokenAuthenticationMethod

<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-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Submit authentication method when additional user authentication is required.</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: 21.3844%;"></col><col style="width: 9.01967%;"></col><col style="width: 69.5959%;"></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">paymentInstrumentId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Identifier of payment instrument

</td></tr><tr><td class="confluenceTd">authenticationMethodId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of authentication method. Get it when digitize method return additionalAuthenticationRequired set to true.</td></tr></tbody></table>

####   


**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9b441ed3-52d6-4cd8-a6ba-ab0c8adbec43" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2Ffai-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="8df40eef-c58c-4cd5-9453-d934b38c602e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-private-fun-submitau-0"><tbody><tr><td class="wysiwyg-macro-body">```
private fun submitAuthenticationMethod(paymentInstrumentId: String, authenticationMethodId: String) {

    ucpApi.cardsService
        .submitAuthenticationMethod(
            SubmitAuthenticationMethod(
                paymentInstrumentId,
                authenticationMethodId
            ),
            {
                //Handle success
            },
            { throwable ->
                //Something went wrong, check exception with documentation
            }
        )
}
```

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

### getAllPaymentInstruments

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e4ba943f-9372-45a7-b692-23d020ff7e44" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-online-7" style="width: 66.7901%; height: 102.6px;"><tbody><tr style="height: 102.6px;"><td class="wysiwyg-macro-body" style="width: 99.7665%; height: 102.6px;"><p class="callout info">Asynchronous. Online/Offline.  
<span class="inline-comment-marker" data-ref="c2d25370-36c1-48bc-80c0-1abbef4f5385">Method for getting all payment instruments from local or remote storage.  
</span><span class="inline-comment-marker" data-ref="c2d25370-36c1-48bc-80c0-1abbef4f5385">Local storage is always instant available and should be used to increase UX.  
</span><span class="inline-comment-marker" data-ref="c2d25370-36c1-48bc-80c0-1abbef4f5385">Use remote way when possible to keep your payment instruments always up to date.   
</span></p>

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

**Input**

<table class="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">refresh</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Refresh all PaymentInstrument objects state with remote VCP server (network and user session required)</td><td class="confluenceTd">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e51e890a-09ee-49e9-8443-c0ded3d4e3de" 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 success">Success callback with list of PaymentInstrument objects.</p>

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

<table class="relative-table 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">paymentInstruments</td><td class="confluenceTd">List&lt;PaymentInstrument&gt;</td><td class="confluenceTd">List of retrieved payment instruments from local or remote storage</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f01d9d4e-b2a1-483a-b5e8-c35e98aefe29" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a320a087-fbca-4ef7-9175-1ca82f95518d" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getallpaymentins"><tbody><tr><td class="wysiwyg-macro-body">```
fun getAllPaymentInstrument(refresh: Boolean) {
    ucpApi.cardsService
            .getAllPaymentInstruments( refresh,
                    { paymentInstruments ->
                        //List of PaymentInstrument from local or remote storage
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

###   


### getPaymentInstrument (deprecated)

<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-8"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online/Offline.  
Deprecated - use getAllPaymentInstruments instead.  
Method for getting single PaymentInstrument from local or remote storage object based on id.  
Local storage is always instant available and should be used to incerese UX.  
<span class="inline-comment-marker" data-ref="244d20e5-2a70-4cf7-8e4c-4a38449cb9a2">Use remote way when possible to keep your payment instruments always up to date.   
</span></p>

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

**Input**

<table class="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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of instrument to retrieve</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">refresh</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Refresh selected PaymentInstrument state with remote VCP server (network required)</td><td class="confluenceTd">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" 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 success">Success callback with PaymentInstument object.</p>

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

<table class="wrapped relative-table 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">paymentInstrument</td><td class="confluenceTd">PaymentInstrument</td><td class="confluenceTd">Retrieved payment instrument</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="8668e3d2-4616-4c98-838c-bad5528bf323" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="ad2e11bd-9f0d-4d79-b59d-f48b867f05e0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getpaymentinstru"><tbody><tr><td class="wysiwyg-macro-body">```
fun getPaymentInstrument(paymentInstrumentId: String, refresh: Boolean) {
    ucpApi.cardsService
            .getPaymentInstrument(paymentInstrumentId, refresh,
                    { paymentInstrument ->
                        //PaymentInstrument from local or remote storage
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

##   


## IBANs domain

###   


### digitize

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="ee592d11-5678-49f6-bdee-71cd093ae072" 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.  
Registers user and device if already not registered in VCP backend. Creates payment token in VCP backend.  
Expect push after successfull finish and then proceed using process method in Cloud Messaging domain.</p>

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

**Input**

<table class="relative-table confluenceTable wrapped" id="bkmrk-parameter-type-descr-42" style="width: 100%;"><colgroup><col style="width: 18.4178%;"></col><col style="width: 9.88799%;"></col><col style="width: 57.85%;"></col><col style="width: 13.8443%;"></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

Instruction how to sign data with JWT can be found in *Data signing and encryption* chapter in Mobile DC documentation

</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">languageCode</td><td class="confluenceTd">String</td><td class="confluenceTd">Language preference selected by the consumer. Formatted as an ISO-639-1 two letter language code

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

**AccountInfo:**

<table class="relative-table confluenceTable wrapped" id="bkmrk-parameter-type-descr-43"><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

</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="7c700f72-2bbf-40d7-8787-008c86ac6cce" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback.-ca"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback. Called when device token digitization finished with success .Result contains *IbanDigitizationResult* object.</p>

<p class="callout info">Note: Cloud token digitization fail doesn't affect on success/failure callback.</p>

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

IbanDigitizationResult contains following fields:

<table class="relative-table confluenceTable wrapped" id="bkmrk-parameter-type-descr-44" style="width: 100%;"><colgroup><col style="width: 27.8121%;"></col><col style="width: 20.0255%;"></col><col style="width: 52.1624%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">(DEPRECATED) cloudDigitizationSuccess</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Cloud Token Digitization Details</td></tr><tr><td class="confluenceTd" colspan="1">result</td><td class="confluenceTd" colspan="1">CloudDigitizationResult</td><td class="confluenceTd" colspan="1">Cloud Token Digitization Details. One of: SUCCEED, FAILED, DISABLED, UNKNOWN</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="60c0b11e-990c-484a-9113-b82ec678c03d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-ca" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback. Called when **device token** digitization finished with failure.</p>

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

**Sample**

Sample generation of *signedAccountInfo* (see *Data signing and encryption* chapter in Mobile DC documentation)

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="7ee370b6-1f92-4eb2-88b1-8749961cd4f1" 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="edfea95a-000f-4f04-94df-cce9eaff0e79" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-digitizeiban%28-si"><tbody><tr><td class="wysiwyg-macro-body">```
fun digitizeIban(
        signedAccountInfo: String,
        fcmRegistrationToken: CharArray,
        languageCode: String) {

    ucpApi.ibansService
            .digitize(signedAccountInfo, fcmRegistrationToken, languageCode,
                    { ibanDigitizationResult ->

                        //Device token digitization finished with success
                        //wait for onProvisioning(Success/Failure) callback and onTokenStatusChanged when success

                        val cloudDigitizationResult = ibanDigitizationResult.result

                        //check status of Cloud Token
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

###   


### createTVC  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="635a2ae5-f214-4546-b9ad-3897645013b3" 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.  
Provides Transaction Verification Code required to process cloud payments.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-45" style="width: 100%;"><colgroup><col style="width: 14.2151%;"></col><col style="width: 8.27634%;"></col><col style="width: 63.2935%;"></col><col style="width: 14.2151%;"></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">signedIbanInfo</td><td class="confluenceTd">String</td><td class="confluenceTd">Signed IbanInfo per RFC 7519

Instruction how to sign data with JWT can be found in *Data signing and encryption* chapter in Mobile DC documentation

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

IbanInfo

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-46"><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">ibanId</td><td class="confluenceTd">String</td><td class="confluenceTd">Iban id returned in *addUserWithIban* methdod or *sha256Hex(iban)*

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" 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 Tvc object or encrypted Tvc object as String.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-47" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; width: 100%;"><colgroup><col style="width: 10.8776%;"></col><col style="width: 10.5068%;"></col><col style="width: 78.6156%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">plainTvc</td><td class="confluenceTd">PlainTvc?</td><td class="confluenceTd">Plain PlainTvc object

</td></tr><tr><td class="confluenceTd">encryptedTvc</td><td class="confluenceTd">CharArray?</td><td class="confluenceTd">Encrypted PlainTvc object per RFC 7516

Present when client decide to encrypt data. Instruction how tu use JWE can be found in *Data signing and encryption* chapter in Mobile DC documentation

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

PlainTvc object contains following fields.

<table class="relative-table wrapped 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">accountNumber</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Primary Account Number for the transaction – this is the Token PAN

</td></tr><tr><td class="confluenceTd">dynamicExpiryDate</td><td class="confluenceTd">CharArray</td><td class="confluenceTd">Dynamic expiration date for the token. Expressed in YYMM format

</td></tr><tr><td class="confluenceTd" colspan="1">dynamicCVC</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">Dynamic CVC</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="32685088-3a3d-41b8-b304-d969d6331ead" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-whe"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback when TVC cannot be created.</p>

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

**Sample**

Sample generation of *signedIbanInfo* (see *Data signing and encryption* chapter in Mobile DC documentation)

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="471ef791-1f27-4e88-bde6-41937f9b2650" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-signedibaninfo"><tbody><tr><td class="wysiwyg-macro-body">```
class SignedIbanInfo {
    fun generate() {
        val claims = JWTClaimsSet.Builder()
            .claim("ibanId", "798c5c64d93c87b8ed7f108cde4753eb66faff760121ef2a05d0f44fb066b03b")
            .build();

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

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

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a8bfba8b-21c4-4989-840a-11b87f27ce72" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-createtvc%28signed"><tbody><tr><td class="wysiwyg-macro-body">```
fun createTvc(signedIbanInfo: String) {
    ucpApi.ibansService
            .createTVC(signedIbanInfo, { tvc ->
                //result object could contains encrypted TVC
                val encryptedTvc: String? = tvc.encryptedTvc

                //or decrypted(plain) TVC object with parameters described in documentation
                val plainTvc = tvc.plainTvc
            }, { throwable ->
                //Something went wrong, check exception with documentation
            })
}
```

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

### createPaymentData

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="635a2ae5-f214-4546-b9ad-3897645013b3" 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.  
This method is responsible for creating payment data for given IBAN. Depending on configuration returned data are dedicated for payment using UCAF or TVC. Also depending on configuration payment data are returned in plain or encrypted form.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-49" style="width: 100%;"><colgroup><col style="width: 10.754%;"></col><col style="width: 7.53773%;"></col><col style="width: 66.7515%;"></col><col style="width: 14.9567%;"></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">signedIbanInfo</td><td class="confluenceTd">String</td><td class="confluenceTd">Signed IbanInfo per RFC 7519

Instruction how to sign data with JWT can be found in *Data signing and encryption* chapter in Mobile DC documentation

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

IbanInfo

<table class="relative-table wrapped 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">ibanId</td><td class="confluenceTd">String</td><td class="confluenceTd">Iban id returned in *addUserWithIban* methdod or *sha256Hex(iban)*

</td><td class="confluenceTd">Not empty.</td></tr><tr><td class="confluenceTd" colspan="1">userId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">External user id given by the client</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="7c700f72-2bbf-40d7-8787-008c86ac6cce" 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 success">Success callback with <span class="inline-comment-marker" data-ref="994dfca1-269e-494c-b163-9081ead35090">PaymentData</span> object or encrypted payment data object as String.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-51" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; width: 100%;"><colgroup><col style="width: 16.6873%;"></col><col style="width: 13.2215%;"></col><col style="width: 70.0913%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">plainPaymentData</td><td class="confluenceTd">PlainPaymentData?</td><td class="confluenceTd">Plain PlainPaymentData object

</td></tr><tr><td class="confluenceTd">encryptedPaymentData</td><td class="confluenceTd">String?</td><td class="confluenceTd">Encrypted PlainPaymentData object per RFC 7516

Present when client decide to encrypt data. Instruction how tu use JWE can be found in *Data signing and encryption* chapter in Mobile DC documentation

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

PlainPaymentData object contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-52" style="width: 100%;"><colgroup><col style="width: 18.9122%;"></col><col style="width: 8.52722%;"></col><col style="width: 72.5605%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">accountNumber</td><td class="confluenceTd">String</td><td class="confluenceTd">Primary Account Number for the transaction – this is the Token PAN

</td></tr><tr><td class="confluenceTd" colspan="1">applicationExpiryDate</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Required only for UCAF. Application expiry date for the Token. Expressed in YYMMDD format</td></tr><tr><td class="confluenceTd" colspan="1">panSequenceNumber</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Rrquired only for UCAF. Application PAN sequence number for the Token</td></tr><tr><td class="confluenceTd" colspan="1">track2Equivalent</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Required only for UCAF. Track 2 equivalent data for the Token. Expressed according to ISO/IEC 7813, excluding start sentinel, end sentinel, and Longitudinal Redundancy Check (LRC), using hex nibble 'D' as field separator, and padded to whole bytes using one hex nibble 'F' as needed</td></tr><tr><td class="confluenceTd" colspan="1">ucafCryptogram</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Required only for UCAF. UCAF cryptogram</td></tr><tr><td class="confluenceTd">dynamicExpiryDate</td><td class="confluenceTd">String?</td><td class="confluenceTd">Dynamic expiration date for the token. Expressed in YYMM format

</td></tr><tr><td class="confluenceTd" colspan="1">dynamicCVC</td><td class="confluenceTd" colspan="1">String?</td><td class="confluenceTd" colspan="1">Dynamic CVC</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="32685088-3a3d-41b8-b304-d969d6331ead" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-whe-0"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback when PaymentData cannot be created.</p>

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

**Sample**

<span class="inline-comment-marker" data-ref="a2b69958-1b22-459d-9cfc-9cad6072164e">Sample generation of </span>*<span class="inline-comment-marker" data-ref="a2b69958-1b22-459d-9cfc-9cad6072164e">signedIbanInfo</span>*<span class="inline-comment-marker" data-ref="a2b69958-1b22-459d-9cfc-9cad6072164e"> (see [Data signing and encryption](https://wiki.verestro.com/display/UCP/Data+signing+and+encryption)</span><span class="inline-comment-marker" data-ref="a2b69958-1b22-459d-9cfc-9cad6072164e"> chapter in Mobile DC documentation)</span>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="471ef791-1f27-4e88-bde6-41937f9b2650" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-signedibaninfo-0"><tbody><tr><td class="wysiwyg-macro-body">```
class SignedIbanInfo {
    fun generate() {
        val claims = JWTClaimsSet.Builder()
            .claim("ibanId", "798c5c64d93c87b8ed7f108cde4753eb66faff760121ef2a05d0f44fb066b03b")
			.claim("userId", "123")
            .build();

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

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

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a8bfba8b-21c4-4989-840a-11b87f27ce72" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-createpaymentdat"><tbody><tr><td class="wysiwyg-macro-body">```
fun createPaymentData(signedIbanInfo: String) {
    ucpApi.ibansService
            .createPaymentData(signedIbanInfo, { paymentData ->
                //result object could contains encrypted PaymentData
                val encryptedPaymentData: String? = paymentData.encryptedPaymentData

                //or decrypted(plain) PaymentData object with parameters described in documentation
                val plainPaymentData = paymentData.plainPaymentData
            }, { throwable ->
                //Something went wrong, check exception with documentation
            })
}
```

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

### getAllPaymentInstruments  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e4ba943f-9372-45a7-b692-23d020ff7e44" 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/Offline.  
<span class="inline-comment-marker" data-ref="93dd5d97-9101-45b8-b284-b4fc95d0b1b7">Method for getting all payment instruments from local or remote storage.  
</span>Local storage is always instant available and should be used to incerese UX.  
<span class="inline-comment-marker" data-ref="93dd5d97-9101-45b8-b284-b4fc95d0b1b7">Use remote way when possible to keep your payment instruments always up to date.   
</span></p>

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

**Input**

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-53" style="width: 100%;"><colgroup><col style="width: 10.754%;"></col><col style="width: 9.26765%;"></col><col style="width: 62.673%;"></col><col style="width: 17.3053%;"></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">refresh</td><td class="confluenceTd">Boolean</td><td class="confluenceTd">Refresh all PaymentInstrument objects state with remote VCP server (network required)</td><td class="confluenceTd">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e51e890a-09ee-49e9-8443-c0ded3d4e3de" 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 success">Success callback with list of PaymentInstrument objects</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-54" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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">paymentInstruments</td><td class="confluenceTd">List&lt;PaymentInstrument&gt;</td><td class="confluenceTd">List of retrieved payment instruments</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f01d9d4e-b2a1-483a-b5e8-c35e98aefe29" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-1"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="a320a087-fbca-4ef7-9175-1ca82f95518d" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getallpaymentins-0"><tbody><tr><td class="wysiwyg-macro-body">```
fun getAllPaymentInstrument(refresh: Boolean) {
    ucpApi.ibansService
            .getAllPaymentInstruments( refresh,
                    { paymentInstruments ->
                        //List of PaymentInstrument from local or remote storage
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### getPaymentInstrument(deprecated)

<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-13" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online/Offline.  
Use *getAllPaymentInstruments* instead.  
<span class="inline-comment-marker" data-ref="c9628f10-fb48-409f-9322-fe238fc987f6">Method for getting single PaymentInstrument from local or remote storage object based on id.  
</span>Local storage is always instant available and should be used to incerese UX.  
<span class="inline-comment-marker" data-ref="c9628f10-fb48-409f-9322-fe238fc987f6">Use remote way when possible to keep your payment instruments always up to date.   
</span></p>

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

**Input**

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-55" style="width: 100%; height: 139.8px;"><colgroup><col style="width: 18.9122%;"></col><col style="width: 8.52874%;"></col><col style="width: 55.5009%;"></col><col style="width: 17.0581%;"></col></colgroup><tbody><tr style="height: 46.6px;"><th class="confluenceTh" style="height: 46.6px;">**Parameter**</th><th class="confluenceTh" style="height: 46.6px;">**Type**</th><th class="confluenceTh" style="height: 46.6px;">**Description**</th><th class="confluenceTh" style="height: 46.6px;">**Validation conditions**</th></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">paymentInstrumentId</td><td class="confluenceTd" style="height: 46.6px;">String</td><td class="confluenceTd" style="height: 46.6px;">Id of instrument to retrieve.</td><td class="confluenceTd" style="height: 46.6px;">Not empty</td></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">refresh</td><td class="confluenceTd" style="height: 46.6px;">Boolean</td><td class="confluenceTd" style="height: 46.6px;">Refresh selected PaymentInstrument state with remote VCP server (network required)</td><td class="confluenceTd" style="height: 46.6px;">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" 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 success">Success callback with PaymentInstument object</p>

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

<table class="wrapped confluenceTable" id="bkmrk-parameter-type-descr-56" style="width: 62.2222%; height: 76.4px;"><colgroup><col style="width: 29.4363%;"></col><col style="width: 29.2276%;"></col><col style="width: 41.3361%;"></col></colgroup><tbody><tr style="height: 29.8px;"><th class="confluenceTh" style="height: 29.8px;">**Parameter**</th><th class="confluenceTh" style="height: 29.8px;">**Type**</th><th class="confluenceTh" style="height: 29.8px;">**Description**</th></tr><tr style="height: 46.6px;"><td class="confluenceTd" style="height: 46.6px;">paymentInstrument</td><td class="confluenceTd" style="height: 46.6px;">PaymentInstrument</td><td class="confluenceTd" style="height: 46.6px;">Retrieved payment instrument</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="8668e3d2-4616-4c98-838c-bad5528bf323" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="ad2e11bd-9f0d-4d79-b59d-f48b867f05e0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getpaymentinstru-0"><tbody><tr><td class="wysiwyg-macro-body">```
fun getPaymentInstrument(paymentInstrumentId: String, refresh: Boolean) {
    ucpApi.ibansService
            .getPaymentInstrument(paymentInstrumentId, refresh,
                    { paymentInstrument ->
                        //PaymentInstrument from local or remote storage
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### delete

<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-14"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Method allows delete PaymentInstument from VCP.  
Payment token will be removed remote and local storage.  
Result of action will be notified with *onPaymentInstrumentStatusChanged*.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-57" style="width: 75.4321%; height: 131px;"><colgroup><col style="width: 25.2459%;"></col><col style="width: 14.588%;"></col><col style="width: 36.2317%;"></col><col style="width: 23.9344%;"></col></colgroup><tbody><tr style="height: 46.6px;"><th class="confluenceTh" style="height: 46.6px;">Parameter</th><th class="confluenceTh" style="height: 46.6px;">Type</th><th class="confluenceTh" style="height: 46.6px;">Description</th><th class="confluenceTh" style="height: 46.6px;">Validation conditions</th></tr><tr style="height: 49px;"><td class="confluenceTd" style="height: 49px;">paymentInstrumentId</td><td class="confluenceTd" style="height: 49px;">String</td><td class="confluenceTd" style="height: 49px;">Id of PaymentInstrument to delete

</td><td class="confluenceTd" style="height: 49px;">Not empty.</td></tr><tr style="height: 35.4px;"><td class="confluenceTd" colspan="1" style="height: 35.4px;">reason</td><td class="confluenceTd" colspan="1" style="height: 35.4px;">CharArray?</td><td class="confluenceTd" colspan="1" style="height: 35.4px;">Optional reason of deletion

</td><td class="confluenceTd" colspan="1" style="height: 35.4px;">  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="dcd90cf0-b262-4524-b6fe-3b8cff9622cb" 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="8df40eef-c58c-4cd5-9453-d934b38c602e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-delete%28paymentin-0"><tbody><tr><td class="wysiwyg-macro-body">```
fun delete(paymentInstrumentId: String, reason: CharArray?) {
    ucpApi.ibansService
            .delete(paymentInstrumentId, reason,
                    {
                        //PaymentInstrument delete requested
                        //wait for confirmation from onPaymentInstrumentStatusChanged
                    },
                    { throwable ->
                        //Something went wrong, check excetpion with documentation
                    }
            )
}
```

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

## Payment domain

### setDefaultForContactless

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0408a777-6d92-4c95-bb91-6e10011084e1" 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.  
Sets payment instrument as default for contactless payment.  
Payment instrument set as default will be used if no other payment instrument was selected by method selectForPayment.  
Default payment instrument will be used automatically after linking with PoS terminal.  
Make sure PaymentInstrument status is ACTIVE. Only active payments instruments can be set as default.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-58"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Payment instrument identity

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="5a3e0346-d3fd-470d-95f0-5ae1748666ff" 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="ad2e11bd-9f0d-4d79-b59d-f48b867f05e0" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-setdefaultforcon" style="width: 67.4074%; height: 277px;"><tbody><tr style="height: 277px;"><td class="wysiwyg-macro-body" style="width: 99.8055%; height: 277px;">```
fun setDefaultForContactless(paymentInstrument: PaymentInstrument) {

    if (paymentInstrument.status != PaymentInstrumentStatus.ACTIVE) {
        //make sure selected PaymentInstrument can be seta as default
        return
    }

    val paymentInstrumentId = paymentInstrument.id

    ucpApi.paymentService
            .setDefaultForContactless(paymentInstrumentId, {
                //success
            }, { throwable ->
                //Something went wrong, check exception with documentation
            })
}
```

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

###   


### getDefaultForContactless

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="209f58fa-983c-4619-a63d-d982a7fcbdcf" 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.Provides default PaymentInstrument for contactless payment.</p>

<p class="callout info">Throws DefaultPaymentInstrumentNotFoundException when no PaymentInstrument is set as default.</p>

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

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="ff8ee823-139a-41da-b076-5e7bb90aa668" 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="5a3e0346-d3fd-470d-95f0-5ae1748666ff" 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 success">Success callback with id new default PaymentInstrument</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-59" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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">paymentInstrument</td><td class="confluenceTd">PaymentInstrument</td><td class="confluenceTd">Default Payment instrument</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0f33776b-48dc-492d-a3cc-e513cfebd6f2" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e1adc42d-9693-455d-ae91-301dcb439c9c" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getdefaultforcon"><tbody><tr><td class="wysiwyg-macro-body">```
fun getDefaultForContactless() {
    ucpApi.paymentService
            .getDefaultForContactless({ paymentInstrument ->
                // use PaymentInstrument
            }, { throwable ->
                when (throwable) {
                    is DefaultPaymentInstrumentNotFoundException -> {
                        //there is no default PaymentInstrument
                    }
                    else -> {
                        //check another exception with documentation
                    }
                }
            })
}
```

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

### setDefaultForRemote (deprecated)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a49b6595-0410-4024-896f-78e4e01fcbab" 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.  
Sets payment instrument as default for DSRP payment.  
Payment instrument set as default will be used if no other payment instrument was selected by method selectForPayment.  
Default payment instrument will be used automatically to remote payments.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-60" style="width: 77.284%;"><colgroup><col style="width: 27.0945%;"></col><col style="width: 10.3387%;"></col><col style="width: 34.0463%;"></col><col style="width: 28.5205%;"></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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Payment instrument identity

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="35741875-bc30-4c64-9fa7-d5c05a4b6b14" 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>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f2e32868-55d5-4153-b507-e53cb84f6b2d" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-setdefaultforrem"><tbody><tr><td class="wysiwyg-macro-body">```
fun setDefaultForRemote(paymentInstrument: PaymentInstrument) {

    if (paymentInstrument.status != PaymentInstrumentStatus.ACTIVE
            && !paymentInstrument.dsrpSupported) {
        
        //make sure selected PaymentInstrument can be set as default
        return
    }

    val paymentInstrumentId = paymentInstrument.id

    ucpApi.paymentService
            .setDefaultForRemote(paymentInstrumentId, {
                //success
            }, { throwable ->
                //Something went wrong, check exception with documentation
            })
}
```

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

### getDefaultForRemote (deprecated)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="209f58fa-983c-4619-a63d-d982a7fcbdcf" 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.  
Provides default PaymentInstrument for remote payments.  
Throws DefaultPaymentInstrumentNotFoundException when no PaymentInstrument is set as default.</p>

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

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="ff8ee823-139a-41da-b076-5e7bb90aa668" 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="5a3e0346-d3fd-470d-95f0-5ae1748666ff" 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 success">Success callback with id new default PaymentInstrument</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-61" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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">paymentInstrument</td><td class="confluenceTd">PaymentInstrument</td><td class="confluenceTd">Default Payment instrument</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0f33776b-48dc-492d-a3cc-e513cfebd6f2" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="239ae538-313d-4744-8c45-4a384ad1613f" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getdefaultforrem"><tbody><tr><td class="wysiwyg-macro-body">```
fun getDefaultForRemote() {
    ucpApi.paymentService
            .getDefaultForRemote({ paymentInstrument ->
                // use PaymentInstrument
            }, { throwable ->
                when (throwable) {
                    is DefaultPaymentInstrumentNotFoundException -> {
                        //there is no default PaymentInstrument
                    }
                    else -> {
                        //check another exception with documentation
                    }
                }
            })
}
```

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

### selectForPayment

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="c079b4b4-46c7-4a9d-8cc8-e415b7e3894c" 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.  
Sets payment instrument as primary for next incoming payment.</p>

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

**Input**

<table class="relative-table wrapped 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">paymentInstrumentd</td><td class="confluenceTd">String</td><td class="confluenceTd">Payment instrument identity

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="793c4579-5a04-4ac4-bf42-9d90fb6975cc" 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**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="c7979339-4ea1-4e7d-bc32-f28b4f369d9f" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-note%3A-this-is-only-s"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">**Note:** This is only sample payment scenation</p>

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

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="64245325-87a7-4ca7-a004-27bb7db77a6e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fsample-scenario-of"><tbody><tr><td class="wysiwyg-macro-body">```
//sample scenario of starting payment with authentication before payment

fun startPayment(paymentInstrument: PaymentInstrument) {

    //checking conditions before payment
    val isActive = paymentInstrument.status != PaymentInstrumentStatus.ACTIVE
    val isContactlessSupported = paymentInstrument.contactlessSupported
    val hasTransactionCredentials = paymentInstrument.credentialsCount > 0

    if (!isActive || !isContactlessSupported || !hasTransactionCredentials) {
        //PaymentInstrument doesn't meet requirements for payment
        return
    }
    
    //selecting PaymentInstrument to payment
    ucpApi.paymentService
            .selectForPayment(paymentInstrument.id, {
                //selection success

                //request user authentication when 
                //... authentication presented

                //use setUserAuthenticatedForPayment method

            }, { throwable ->
                //something went wrong, check exception with documentation
            })
}
```

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

### setUserAuthenticatedForPayment

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0b5cc75e-efd7-4403-bf84-f7bcf1a5b3fc" 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.  
Sets user as authenticated to payment with provided payment instrument.  
</p>

<p class="callout info">Authentication clearing depends on authentication timer configuration in *UcpTransactionConfiguration:enableTransactionAuthenticationTimer*.  
By default timer is disabled and authentication is cancelled when user perform transaction and SDK send callback *onContactlessPaymentCompleted/Aborted/Incident* from *UcpTransactionEventListener*.  
When timer is enabled authentication is cleared when auth timer finishes - it could casue problems when user start to pay just before timer finish. Authentication could be cleared by SDK during payement.  
</p>

<p class="callout info">If application call *setUserAuthenticatedForPayment* without contactless payment context and authentication timer is disabled, authentication is never cleared by SDK. To clear authentication use *abortUserAuthenticationForPayment.*</p>

<p class="callout info">*UcpTransactionEventListener:onContactlessPaymentStarted* is recommended place for payment authentication.</p>

<p class="callout warning">**Note:** User can be authenticated based on conditions like screen unlock. Method must be called before payment in method UcpTransactionEventListener:onContactlessPaymentStarted()  
Make sure that authentication on this step is done securely. Transaction information is not available on this step.  
</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-63"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Payment instrument identity

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">pin</td><td class="confluenceTd" colspan="1">CharArray?</td><td class="confluenceTd" colspan="1">PIN or null for CUSTOM WalletAuthUserMode

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="cf7c5544-d338-4397-82c3-c70f04210d2c" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Success / failure callback</p>

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

**Sample**

Basic user authentication usage below, call when user is authenticated.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e9c29c14-9bd0-416c-ade7-3d41ac9a155b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-private-fun-setusera"><tbody><tr><td class="wysiwyg-macro-body">```
private fun setUserAuthenticatedForPayment(
    paymentInstrument: PaymentInstrument,
    pinProvidedByUser: CharArray
) {
    ucpApi
        .paymentService
        .setUserAuthenticatedForPayment(paymentInstrument.id, pinProvidedByUser,
            {
                //user authentication provided
                //start one tap payment or continue two tap with 2nd tap to terminal after authentication
                //listen for auth timer changes
                //user abortUserAuthentication method when transaction cancelled by user
            }, { throwable ->
                //some error, check exception
            })
}
```

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

Optional authentication before making transaction based on custom conditions.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="66a17e97-a2e6-4bef-af75-29a4e8bfeccb" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-wallethceservi"><tbody><tr><td class="wysiwyg-macro-body">```
override fun onContactlessPaymentStarted() {

    //check internal conditions
    //like user performed authentication, is logged in application, is device unlocked etc
    val isUserAuthenticated = true

    //check if use selected any token for payment and select it in UCP SDK
    //otherwise default token will be used
    if (getSelectedPaymentInstrumentId() != null) {

        ucpApi
            .paymentService
            .selectForPayment(
                paymentInstrumentId = getSelectedPaymentInstrumentId(),
                success = {
                    //token will be used for actual payment
                    //call setUserAuthenticatedForPayment here - sample below in "else" block
                },
                failure = { throwable ->
                    //something went wrong, check throwable with documentation
                }
            )
    } else {

        if (isUserAuthenticated) {
            ucpApi
                .paymentService
                .setUserAuthenticatedForPayment(
                    paymentInstrumentId = getSelectedPaymentInstrumentId(),
                    pin = null, //or pin if MobilePin is used
                    success = 
                        //user authenticated in SDK
                    }, failure = {
                        //authentication failure, check exception
                    }
                )
        }
    }
}
```

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

### abortUserAuthenticationForPayment

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b9579cd8-fe2a-484c-a114-b7f7a3a62044" 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">Abort user authentication during ongoing transaction. After calling this method transaction is cancelled and timer stopped.</p>

<p class="callout info">  
</p>

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

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="d4674c46-0b7b-42f1-af3a-59a045da0ce0" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-1"><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="f6d2960c-b4b5-4929-99e8-a0f163fc1b7d" 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="e9c29c14-9bd0-416c-ade7-3d41ac9a155b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-abortuserauthent"><tbody><tr><td class="wysiwyg-macro-body">```
fun abortUserAuthenticationForPayment() {
    ucpApi
            .paymentService
            .abortUserAuthenticationForPayment(
                    {
                        //user authentication aborted
                        //listen for auth timer changes
                    },
                    { throwable ->
                        //some error, check exception
                    })
}
```

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

### processHceApduCommand

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="483f5b4c-f2ab-4b71-ac5d-03c5c8512159" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-synchronous.-offline-2"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Synchronous. Offline.  
Processes APDU command from Point Of Sale (PoS) terminal. Returns callback APDU command to pass back to PoS.  
Should be called inside registered Android Service extending HostApduService in implementation of overridden processCommandApdu method.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-64" style="width: 100%;"><colgroup><col style="width: 12.6059%;"></col><col style="width: 10.1383%;"></col><col style="width: 61.5575%;"></col><col style="width: 15.6984%;"></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">context</td><td class="confluenceTd">Context</td><td class="confluenceTd">Application context, can be provided from HostApduService

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">apdu</td><td class="confluenceTd" colspan="1">ByteArray</td><td class="confluenceTd" colspan="1">APDU command from HostApduService::processCommandApdu method parameter

</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">extras</td><td class="confluenceTd" colspan="1">Bundle?</td><td class="confluenceTd" colspan="1">Extras object from HostApduService::processCom mandApdu method parameter

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="f6d2960c-b4b5-4929-99e8-a0f163fc1b7d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-apdu-result---method"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Apdu result - method called synchronous without callback</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter.-type-desc"><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">apdu</td><td class="confluenceTd">ByteArray</td><td class="confluenceTd">APDU command to return in implementation of overridden processCommandApdu method

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

**Sample (synchronized HostApduService)**

Use this version if MobileDC:setup and UCP:setup() method is called in Application:onCreate on Main Thread.

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="2ab5facc-87fb-4fd3-9e15-c239d976beb3" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2Fwallethceservice-m"><tbody><tr><td class="wysiwyg-macro-body">```
//WalletHceService must be registerd in AndroidManifest as nfc service 
class WalletHceService : HostApduService() {

	//...
    //private val ucpApi = ..

    override fun processCommandApdu(commandApdu: ByteArray, extras: Bundle?): ByteArray? {
        return ucpApi 
            .paymentService
            .processHceApduCommand(this, commandApdu, extras)
    }
	//..
}
```

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

**Sample (aynchronous HostApduService)**

Use this version if SDK is called on another thread and HostApduService can receive APDU until VCP SDK is still in loading state.

```
//WalletHceService must be registerd in AndroidManifest as nfc service 
class WalletHceService : HostApduService() {

	//...
    //private val ucpApi = ..
    
	override fun processCommandApdu(commandApdu: ByteArray, extras: Bundle?): ByteArray? {

		//UcpSdkStateApplicationSingleton is sample class which keep SDK state and allow to observe when SDK load is finished
    	if (UcpSdkStateApplicationSingleton.isLoaded()) {
        	val result = processCommandApduInUcpSdk(context, commandApdu, extras)
        	sendResponseApdu(result)
    	} else {
        	sendResponseApdu(null)

        	UcpSdkStateApplicationSingleton.listenForSdkReady(
            	onSdkLoadListener = {
                	val result = processCommandApduInUcpSdk(context, commandApdu, extras)
                	sendResponseApdu(result)
            	}
        	)
    	}

    	return null
	}

	override fun onDeactivated(reason: Int) {
    	if (UcpSdkStateApplicationSingleton.isLoaded()) {
        	return ucpApi
            	.paymentService
            	.handleHceApduDeactivationEvent(reason)
    	}
	}
	
    
    private fun processCommandApduInUcpSdk(
        context: Context,
        commandApdu: ByteArray,
        extras: Bundle?
    ): ByteArray? {
        return ucpApi
            .paymentService
            .processHceApduCommand(context, commandApdu, extras)
    }
}

//sample objec which helps to listen SDK state
object UcpSdkStateApplicationSingleton : UcpSdkState {

	//flag could be synchronized
    private var isLoaded = false

    private var onSdkLoadListener: (() -> Unit)? = null

    override fun listenForSdkReady(onSdkLoadListener: () -> Unit) {
        this.onSdkLoadListener = onSdkLoadListener
        if (isLoaded) this.onSdkLoadListener?.invoke()
    }
        
	//call when SDK loading thread is finished
    //setupMdc() -> setupUcp() -> UcpSdkStateApplicationSingleton.onUcpSdkLoaded()
    override fun onUcpSdkLoaded() {
        isLoaded = true
        onSdkLoadListener?.invoke()
    }

    override fun isLoaded(): Boolean {
        return isLoaded
    }
}
```

### replenishCredentials

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="ed743d68-0c46-47ef-86a4-65498d35fa21" 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. User login session not required.  
Method for manually replenishing payment credentials.  
Application will receive push notification and notified about replenish process with global callback described in *setup* chapter. </p>

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

**Input**

<table class="relative-table wrapped 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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of paymentInstrument that needs it credentials replenished

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" 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>

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="b4e132e8-2961-48ad-8fd7-07578a20bd4e" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-replenishcredent"><tbody><tr><td class="wysiwyg-macro-body">```
fun replenishCredentials(paymentInstrumentId: String) {
    ucpApi.paymentService
            .replenishCredentials(paymentInstrumentId,
                    {
                        //request for credentials replenish finished with success
                        //wait for push notification and pass to valid module
                        //when push processed application will be informed about replenish success/failure
                        //read chapter with setup for more information
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    })
}
```

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

### restartContactlessAuthTimer

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="2118fa5b-e6dd-47fa-8c10-2b2d47f8220e" 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.  
Resets auth timer during payment. After calling method auth countdown will start again with default value from card profile.  
Default auth time is provided by card profile.</p>

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

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="96e99f31-5827-4832-8d56-9f7f1c9c40a4" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-2"><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="ee6c320e-67f9-4576-b443-e7f6d8a33861" 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>

### requestAuthenticationCodeForPayment

<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-16"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Method dedicated for requesting authentication code for payment. Authentication code is delivered via Issuer. Only one valid Authentication Code can exist at a time for a given paymentInstrumentId and authenticationRequestId. Multiple valid codes can exist for the same token if different authenticationRequestIds are provided each in a different call. Once an Authentication Code has been generated for a given paymentInstrumentId and authenticationRequestId, it will be valid for a limited validity period, after which the code will expire. Method can be called again with the same authenticationRequestId and token unique reference , in order to trigger re-send. When an active authentication code exists for a given paymentInstrumentId and authenticationRequestId it is delivered again to the issuer. If the code has expired or the attempts has been exceeded then new code will be generated.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-66" style="width: 100%;"><colgroup><col style="width: 25.7108%;"></col><col style="width: 26.0813%;"></col><col style="width: 34.7345%;"></col><col style="width: 13.4734%;"></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">requestAuthenticationCodeForPayment</td><td class="confluenceTd" colspan="1">RequestAuthenticationCodeForPayment</td><td class="confluenceTd" colspan="1">Plain RequestAuthenticationCodeForPayment object

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

RequestAuthenticationCodeForPayment object contains following fields

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-67" style="width: 100%;"><colgroup><col style="width: 21.2608%;"></col><col style="width: 7.17133%;"></col><col style="width: 59.7014%;"></col><col style="width: 11.8665%;"></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">paymentInstrumentId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Identifier of payment instrument

</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd">authenticationRequestId</td><td class="confluenceTd">String</td><td class="confluenceTd">Authentication request id up to 64 alphanumeric characters long.   
A new id should be used for each instance than an account holder needs to be authenticated</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="9b441ed3-52d6-4cd8-a6ba-ab0c8adbec43" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback%2Ffai-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="e5e7394c-6a47-4b31-bd26-67faeb268f18" data-macro-name="code" data-macro-parameters="language=java|theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-requestauthentic"><tbody><tr><td class="wysiwyg-macro-body">```
fun requestAuthenticationCodeForPayment(requestAuthenticationCodeForPayment: RequestAuthenticationCodeForPayment) {
    ucpApi.paymentService
            .requestAuthenticationCodeForPayment( requestAuthenticationCodeForPayment,
                    { 
                        //Requesting Authentication Code went successfully.
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### validateAuthenticationCodeForPayment

<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-17"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Online.  
Method dedicated for validation of an Authentication Code generated by the requestAuthenticationCodeForPayment() method. It is given limited number of attempts to enter a correct Authentication Code(typically 3 attempts), after which the Authentication Code becomes invalid.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-68"><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">validateAuthenticationCodeForPayment</td><td class="confluenceTd" colspan="1">ValidateAuthenticationCodeForPayment</td><td class="confluenceTd" colspan="1">Plain ValidateAuthenticationCodeForPayment object

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

ValidateAuthenticationCodeForPayment object contains following fields

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-69" style="width: 100%;"><colgroup><col style="width: 20.6423%;"></col><col style="width: 8.28229%;"></col><col style="width: 56.4895%;"></col><col style="width: 14.5859%;"></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">paymentInstrumentId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Identifier of payment instrument

</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd">authenticationRequestId</td><td class="confluenceTd">String</td><td class="confluenceTd">Authentication request id provided to the requestAuthenticationCodeForPayment when the authentication code was requested.</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">authenticationCode</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Authentication Code to authenticate the account holder</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="9b441ed3-52d6-4cd8-a6ba-ab0c8adbec43" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-10"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback with ValidateAuthenticationCodeForPaymentResult object.</p>

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

ValidateAuthenticationCodeForPaymentResult object contains following field

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-70"><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">signedAuthenticationProcessData</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Signed AuthenticationProcessData per RFC 7519

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

AuthenticationProcessData model

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-71"><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">authenticationRequestId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Authentication request id

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e5e7394c-6a47-4b31-bd26-67faeb268f18" data-macro-name="code" data-macro-parameters="language=java|theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-validateauthenti"><tbody><tr><td class="wysiwyg-macro-body">```
fun validateAuthenticationCodeForPayment(validateAuthenticationCodeForPayment: ValidateAuthenticationCodeForPayment) {
    ucpApi.paymentService
            .validateAuthenticationCodeForPayment( validateAuthenticationCodeForPayment,
                    { validateAuthenticationCodeForPaymentResult ->
                        //ValidateAuthenticationCodeForPaymentResult plain object, 
                        //contains data to validate on backend
						val signedAuthenticationProcessData = ValidateAuthenticationCodeForPaymentResult
                        		.signedAuthenticationProcessData
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

Sample verification of signedAuthenticationProcessData (see *Data signing and encryption* chapter in Mobile DC documentation)

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="471ef791-1f27-4e88-bde6-41937f9b2650" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-class-signedauthenti"><tbody><tr><td class="wysiwyg-macro-body">```
class SignedAuthenticationProcessData {
    fun verifyAndGetAuthenticationRequestID() {
        val jwtClaimsSet = JWTVerifier.verify(signedAuthenticationProcessData, rsaPublicKey, 600);
        val authenticationRequestId = jwtClaimsSet.getStringClaim("authenticationRequestId")        
        // ...
    }
}
```

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

### processDsrpTransaction(deprecated)

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="0b5cc75e-efd7-4403-bf84-f7bcf1a5b3fc" 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>

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

**Input**

<table class="relative-table confluenceTable" id="bkmrk-parameter-type-descr-72"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Payment instrument identity

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="cf7c5544-d338-4397-82c3-c70f04210d2c" 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 success">Success callback with cryptogram for payment</p>

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

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="abe44ba2-0122-4253-80a8-2bc9c563b86c" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-3"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

### processDsrpTransaction

<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.-offlin-7"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.  
Method dedicated for starting DSRP transaction.  
Every DSRP transaction has to be authenticated before processing.  
Depending on implementation payment can be process with OTP authentication or device level authentication.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-73" style="width: 90.1235%;"><colgroup><col style="width: 22.6704%;"></col><col style="width: 22.5313%;"></col><col style="width: 33.1015%;"></col><col style="width: 21.6968%;"></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">processDsrpTransaction</td><td class="confluenceTd" colspan="1">ProcessDsrpTransaction</td><td class="confluenceTd" colspan="1">Plain ProcessDsrpTransaction object

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

ProcessDsrpTranasction object contains following fields

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-74" style="width: 89.6296%; height: 134.172px;"><colgroup><col style="width: 24.4648%;"></col><col style="width: 21.2538%;"></col><col style="width: 31.8043%;"></col><col style="width: 22.3242%;"></col></colgroup><tbody><tr style="height: 46.5938px;"><th class="confluenceTh" style="height: 46.5938px;">**Parameter**</th><th class="confluenceTh" style="height: 46.5938px;">**Type**</th><th class="confluenceTh" style="height: 46.5938px;">**Description**</th><th class="confluenceTh" colspan="1" style="height: 46.5938px;">**Validation conditions**</th></tr><tr style="height: 57.7812px;"><td class="confluenceTd" colspan="1" style="height: 57.7812px;">paymentInstrumentId</td><td class="confluenceTd" colspan="1" style="height: 57.7812px;">String</td><td class="confluenceTd" colspan="1" style="height: 57.7812px;">Identifier of payment instrument

</td><td class="confluenceTd" colspan="1" style="height: 57.7812px;">Not empty</td></tr><tr style="height: 29.7969px;"><td class="confluenceTd" style="height: 29.7969px;">dsrpTransactionInfo</td><td class="confluenceTd" style="height: 29.7969px;">DsrpTransactionInfo</td><td class="confluenceTd" style="height: 29.7969px;">Plain DsrpTransactionInfo object</td><td class="confluenceTd" colspan="1" style="height: 29.7969px;">Not empty</td></tr></tbody></table>

DsrpTransactionInfo object contains following fields

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-75" style="width: 100%;"><colgroup><col style="width: 14.8331%;"></col><col style="width: 12.9752%;"></col><col style="width: 60.3252%;"></col><col style="width: 11.8665%;"></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">amountMinor</td><td class="confluenceTd">Long</td><td class="confluenceTd">A long representing the transaction amount without the decimal. For instance 119.00 USD will be 11900 </td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">currencyCode</td><td class="confluenceTd">String</td><td class="confluenceTd">A char (integer) representing the transaction currency code with 3 numeric digits as per ISO 4217. For instance, value will be 840 for USD. The maximum value allowed is 999.</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd">countryCode</td><td class="confluenceTd">String?</td><td class="confluenceTd">A 3 digit ISO 3166 numeric country code, e.g., 826 for UK. If not sent, this value is initialized with 000.</td><td class="confluenceTd">  
</td></tr><tr><td class="confluenceTd">issuer  
Cryptogram  
Type</td><td class="confluenceTd">DsrpIssuer  
Cryptogram  
Type</td><td class="confluenceTd">Enum with value represented by "UCAF" or "DE55" depending on cryptogram data format is to be used.</td><td class="confluenceTd">Not empty</td></tr><tr><td>unpredictable  
Number</td><td>Long  
</td><td>A long representing the random number generated by the merchant or by the Payment Gateway. The maximum value is 4,294,967,295.</td><td>Not empty</td></tr><tr><td>transactionType  
</td><td>Dsrp  
Transaction  
Type  
</td><td>A type of financial transaction, one of: PURCHASE, CASH, PURCHASE\_WITH\_CASHBACK, REFUND  
</td><td>Not empty</td></tr><tr><td>transactionDate  
</td><td>Date?  
</td><td>A Date object indicating date of transaction.</td><td>  
</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9b441ed3-52d6-4cd8-a6ba-ab0c8adbec43" 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 success">Success callback with ProcessDsrpTransactionResult object.</p>

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

ProcessDsrpTransactionResult object contains following field

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-76" style="width: 100%; height: 433.4px;"><colgroup><col style="width: 16.5637%;"></col><col style="width: 12.6054%;"></col><col style="width: 70.8309%;"></col></colgroup><tbody><tr style="height: 29.8px;"><th class="confluenceTh" style="height: 29.8px;">**Parameter**</th><th class="confluenceTh" style="height: 29.8px;">**Type**</th><th class="confluenceTh" style="height: 29.8px;">**Description**</th></tr><tr style="height: 66.2px;"><td class="confluenceTd" style="height: 66.2px;"><span class="line" id="bkmrk-transactioncryptogra" lang="kotlin"><span class="py">transaction  
Cryptogram  
Data</span></span></td><td class="confluenceTd" style="height: 66.2px;">ByteArray</td><td class="confluenceTd" style="height: 66.2px;">A byte array containing a formatted response, either UCAF or a set of TLV data for the merchant to populate DE55 data.

</td></tr><tr style="height: 35.4px;"><td style="height: 35.4px;"><span class="line" id="bkmrk-pan" lang="kotlin"><span class="py">pan  
</span></span></td><td style="height: 35.4px;">String  
</td><td style="height: 35.4px;">String containing the PAN of the card used.

</td></tr><tr style="height: 49.4px;"><td style="height: 49.4px;"><span class="line" id="bkmrk-pansequencenumber" lang="kotlin"><span class="py">panSequence  
Number</span></span></td><td style="height: 49.4px;">Int  
</td><td style="height: 49.4px;">An integer value specifying the PAN Sequence Number (PSN) of the card used.

</td></tr><tr style="height: 66.2px;"><td style="height: 66.2px;"><span class="line" id="bkmrk-cryptogramtype" lang="kotlin"><span class="py">cryptogramType</span></span></td><td style="height: 66.2px;">DsrpIssuer  
Cryptogram  
Type</td><td style="height: 66.2px;">Enum value as UCAF or DE55 depending on cryptogram data format is used.

</td></tr><tr style="height: 35.4px;"><td style="height: 35.4px;"><span class="line" id="bkmrk-track2data" lang="kotlin"><span class="py">track2Data  
</span></span></td><td style="height: 35.4px;">String  
</td><td style="height: 35.4px;">String containing the data elements of track 2 according to ISO/IEC 7813.

</td></tr><tr style="height: 80.2px;"><td style="height: 80.2px;"><span class="line" id="bkmrk-par" lang="kotlin"><span class="py">par  
</span></span></td><td style="height: 80.2px;">String  
</td><td style="height: 80.2px;">String representation of byte array of permanent account reference. A non-financial reference assigned to each unique PAN and used to link a Payment Account represented by that PAN to affiliated Payment Tokens.

</td></tr><tr style="height: 35.4px;"><td style="height: 35.4px;"><span class="line" id="bkmrk-expirationdate" lang="kotlin"><span class="py">expirationDate  
</span></span></td><td style="height: 35.4px;">String  
</td><td style="height: 35.4px;">Date in ISO-8601 (YYYY-MM-DD) format indicating expiry date of the card.

</td></tr><tr style="height: 35.4px;"><td style="height: 35.4px;"><span class="line" id="bkmrk-transactionid" lang="kotlin"><span class="py">transactionId  
</span></span></td><td style="height: 35.4px;">String  
</td><td style="height: 35.4px;">Hexed byte array containing a Transaction Identifier.

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

<span class="inline-comment-marker" data-ref="bf38c412-2250-4f3f-a858-09457dead5b7">**Errors**</span>

<span class="inline-comment-marker" data-ref="bf38c412-2250-4f3f-a858-09457dead5b7"><span class="line" id="bkmrk-dsrppaymentexception-1" lang="kotlin"><span class="nc">DsrpPaymentException exception throwed on error in DSRP processing  
</span></span></span>

<table class="relative-table wrapped confluenceTable" id="bkmrk-dsrppaymentexception-0" style="width: 100%; height: 510.2px;"><colgroup><col style="width: 33.1194%;"></col><col style="width: 66.8806%;"></col></colgroup><tbody><tr style="height: 29.8px;"><th class="confluenceTh" style="height: 29.8px;">**DsrpPaymentException.reason**</th><th class="confluenceTh" style="height: 29.8px;">**Description**</th></tr><tr style="height: 41px;"><td style="height: 41px;"><span class="line" id="bkmrk-dsrp_invalid_input" lang="kotlin"><span class="py">DSRP\_INVALID\_INPUT</span></span></td><td style="height: 41px;">Invalid input data.

</td></tr><tr style="height: 41px;"><td style="height: 41px;"><span class="line" id="bkmrk-dsrp_unexpected_data" lang="kotlin"><span class="py">DSRP\_UNEXPECTED\_DATA  
</span></span></td><td style="height: 41px;">Provided data is valid in context of validation, but doesn't mee

</td></tr><tr style="height: 60.6px;"><td class="confluenceTd" style="height: 60.6px;">DSRP\_AUTHENTICATION\_REQUIRED</td><td class="confluenceTd" style="height: 60.6px;">Authentication is not provided for DSRP payment. Authenticate and process DSRP transaction again.

</td></tr><tr style="height: 46.6px;"><td style="height: 46.6px;"><span class="line" id="bkmrk-dsrp_token_inactive" lang="kotlin"><span class="py">DSRP\_TOKEN\_INACTIVE  
</span></span></td><td style="height: 46.6px;">Token used for DSRP is inactive.

</td></tr><tr style="height: 60.6px;"><td style="height: 60.6px;"><span class="line" id="bkmrk-dsrp_no_transaction_" lang="kotlin"><span class="py">DSRP\_NO\_TRANSACTION\_CREDENTIALS</span></span></td><td style="height: 60.6px;">There is no transaction credentials to procees DSRP payment

</td></tr><tr style="height: 49.4px;"><td style="height: 49.4px;"><span class="line" id="bkmrk-dsrp_not_supported_b" lang="kotlin"><span class="py">DSRP\_NOT\_SUPPORTED\_BY\_CARD</span></span></td><td style="height: 49.4px;">DSRP is not suported by Card.

</td></tr><tr style="height: 46.6px;"><td style="height: 46.6px;"><span class="line" id="bkmrk-dsrp_transaction_dec" lang="kotlin"><span class="py">DSRP\_TRANSACTION\_DECLINED  
</span></span></td><td style="height: 46.6px;">Transaction is declined by Card.

</td></tr><tr style="height: 41.4px;"><td style="height: 41.4px;"><span class="line" id="bkmrk-dsrp_incompatible_pr" lang="kotlin"><span class="py">DSRP\_INCOMPATIBLE\_PROFILE  
</span></span></td><td style="height: 41.4px;">Card profile is incomaptible with DSRP.

</td></tr><tr style="height: 46.6px;"><td style="height: 46.6px;"><span class="line" id="bkmrk-dsrp_wrong_state" lang="kotlin"><span class="py">DSRP\_WRONG\_STATE  
</span></span></td><td style="height: 46.6px;">DSRP transaction is in wrong state.

</td></tr><tr style="height: 46.6px;"><td style="height: 46.6px;"><span class="line" id="bkmrk-dsrp_internal_error" lang="kotlin"><span class="py">DSRP\_INTERNAL\_ERROR  
</span></span></td><td style="height: 46.6px;">Unknowne error during DSRP processing.

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

<span class="inline-comment-marker" data-ref="bf38c412-2250-4f3f-a858-09457dead5b7">**Sample** **DSRP transaction with device level authentication**</span>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="e5e7394c-6a47-4b31-bd26-67faeb268f18" data-macro-name="code" data-macro-parameters="language=java|theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2F-after-merchant-ap"><tbody><tr><td class="wysiwyg-macro-body">```
// After Merchant App delivers DSRP data application should authenticate user with device level authentication 
// and next execute setUserAuthenticationForPayment().

// Values for DsrpTransactionInfo delivered by Merchant APP 

val dsrpTransactionInfo: DsrpTransactionInfo = 
	DsrpTransactionInfo(amount, currencyCode, countryCode, issuerCryptographyType)
val processDsrpTransaction: ProcessDsrpTransaction = 
	ProcessDsrpTransaction(paymentInstrumentId, dsrpTransactionInfo)

private fun setUserAuthenticatedForPayment(
    paymentInstrumentId: String,
    pinProvidedByUser: CharArray
) {
    ucpApi
        .paymentService
        .setUserAuthenticatedForPayment(paymentInstrumentId, pinProvidedByUser,
            {
                //After succesfully authentication for payment MPA should execute processDsrpTransaction()
            }, { throwable ->
                //some error, check exception
            })
}

fun processDsrpTransaction(processDsrpTransaction : ProcessDsrpTransaction) {
    ucpApi.paymentService
            .processDsrpTransaction( processDsrpTransaction,
                    { processDsrpTranasctionResult ->
                        //DSRP transaction result with details went successfully result 
                        //should be delivered to Merchant APP
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

**Sample DSRP transaction with OTP authentication**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="85dfd7e7-6a3a-4ea3-b833-870c773db788" data-macro-name="code" data-macro-parameters="language=java|theme=Eclipse" data-macro-schema-version="1" id="bkmrk-%2F%2F-after-merchant-ap-0"><tbody><tr><td class="wysiwyg-macro-body">```
// After Merchant App delivers DSRP data user should request authentication 
// code for payment with selected paymentInstrument.

// Values for DsrpTransactionInfo delivered by Merchant APP 

val dsrpTransactionInfo: DsrpTransactionInfo = 
		DsrpTransactionInfo(amount, currencyCode, countryCode, issuerCryptographyType)
val processDsrpTransaction: ProcessDsrpTransaction = 
		ProcessDsrpTransaction(paymentInstrumentId, dsrpTransactionInfo)

val requestAuthenticationCodeForPayment: RequestAuthenticationCodeForPayment = 
		RequestAuthenticationCodeForPayment(paymentInstrumentId, authenticationRequestId)
fun requestAuthenticationCodeForPayment(requestAuthenticationCodeForPayment) {
   		ucpApi.paymentService.requestAuthenticationCodeForPayment( requestAuthenticationCodeForPayment,
                    {
                        //When requesting went successfully User will get authentication code. 
						//In next step authentication code should be passed to MPA and application 
                        //should validate this code with validateAuthenticationCode() method
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}

val validateAuthenticationCode: ValidateAuthenticationCode = 
	ValidateAuthenticationCode(paymentInstrumentId, authenticationRequestId, authenticationCodeProvidedByUser)
fun validateAuthenticationCode(validateAuthenticationCode) {
    ucpApi.paymentService
            .validateAuthenticationCode( validateAuthenticationCode,
                    { validateAuthenticationCodeResulty ->
                        //ValidateAuthenticationCodeResult plain object
                        val signedAuthenticationProcessData = validateAuthenticationCodeResulty
                        		.signedAuthenticationProcessData

						//If validation went successfully MPA should show authentication view, 
                        //and after valid authentication MPA should execute setUserAuthenticatedForPayment()
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}

private fun setUserAuthenticatedForPayment(
    paymentInstrumentId: String,
    pinProvidedByUser: CharArray
) {
    ucpApi
        .paymentService
        .setUserAuthenticatedForPayment(paymentInstrumentId, pinProvidedByUser,
            {
                //After succesfully authentication for payment MPA should execute processDsrpTransaction()
            }, { throwable ->
                //some error, check exception
            })
}

fun processDsrpTransaction(processDsrpTransaction : ProcessDsrpTransaction) {
    ucpApi.paymentService
            .processDsrpTransaction( processDsrpTransaction,
                    { processDsrpTransactionResult ->
	                    //DSRP transaction result with details went successfully result 
                        //should be delivered to Merchant APP
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

**Sample input and output DSRP data:**

```Java
Input:
amountMinor: 4321,
countryCode: 840, 
currencyCode: 840,
issuerCryptogramType: UCAF,
transactionDate: Apr 25, 2023 09:41:05, //Date() toString() format
transactionType: PURCHASE,
unpredictableNumber: 29496729

Output:
pan: 5204830959972699
track2Data: 5204830959972699D26052010000000000000
expirationDate: 2026-05-31 //YYYY-MM-DD
par: 500170A4PEV2GLWPFD00N6H5AX2YB
panSequenceNumber: 0
transactionId: df25a522a075680acbaa407fdc8a0348a321f77afa2f0231cd38f28e7ae691e2
cryptogramType: UCAF
transactionCryptogramData: 414d506a6d4a474650306149414155427768575a47674144464b553d //in Hex
```

## Cloud messaging domain

### process (deprecated in 2.6.7)  


<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="8c55c77f-922b-4c51-9bb8-f34f7baff5c6" 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. User login session not required.  
Processes data sent by VCP backend (push notification data).  
Application should check senderId in RemoteMessage object (RemoteMessage::from method) and check source in Mobile DC SDK before passing data to this method.  
Method can throw InvalidPushException in case of invalid push content passed to it.  
Refer Mobile DC documentation how to handle push.</p>

<p class="callout info">Deprecated in 2.6.7, use MobileDC:CloudMessaging:process() instead.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-77" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; width: 100%;"><colgroup><col style="width: 11.7429%;"></col><col style="width: 18.6607%;"></col><col style="width: 51.9202%;"></col><col style="width: 17.6761%;"></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 object 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="b1aad203-ab5c-49ac-b183-c1e790e77d4c" 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. When request fails try again</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8cdeb452-493e-403b-af7e-b06de0d12a7b" 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 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 Mobile DC
        }, {
            //some error
        })
}
```

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

### processMcbpNotificationData

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="8c55c77f-922b-4c51-9bb8-f34f7baff5c6" 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"><span class="inline-comment-marker" data-ref="59ac763c-290b-4ded-a793-34fba23bb346">Asynchronous. Offline.   
</span><span class="inline-comment-marker" data-ref="2d8f4d78-cdb8-4193-944a-b4d98e1ad6c2">Processes data sent by MC</span><span class="inline-comment-marker" data-ref="82acd20d-2d28-4a95-9d45-c2e57c15c6a4">BP.  
</span><span class="inline-comment-marker" data-ref="59ac763c-290b-4ded-a793-34fba23bb346">Application should check senderId in RemoteMessage object before passing data to VCP SDK.  
</span><span class="inline-comment-marker" data-ref="59ac763c-290b-4ded-a793-34fba23bb346">Basic configuration for push processing from External Wallet Server: [External Wallet Server domain](https://wiki.verestro.com/display/UCP/External+Wallet+Server+domain).  
</span><span class="inline-comment-marker" data-ref="59ac763c-290b-4ded-a793-34fba23bb346">Method can throw InvalidPushException in case of invalid push content passed to it.</span></p>

<p class="callout warning"><span class="inline-comment-marker" data-ref="59ac763c-290b-4ded-a793-34fba23bb346">**Note:** External Wallet Server Registration process mus be finished before push processing.   
</span></p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-78" style="width: 98.3951%;"><colgroup><col style="width: 16.8342%;"></col><col style="width: 7.66095%;"></col><col style="width: 55.9069%;"></col><col style="width: 19.598%;"></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">encryptedPayload</td><td class="confluenceTd">String</td><td class="confluenceTd">Data received from notification service in object 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="ef08529c-1412-4f11-981d-4eccd90a9f60" 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>

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="0cbf03b5-8f75-4d45-8af6-7f6ee45c67d9" 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 based on senderId
    if (isVerestroSenderId(senderId)) {

        val verestroPayload: String = readVerestrpPushContent(pushData)

        ucpApi
            .cloudMessagingService
            .processMcbpNotificationData(verestroPayload, {
                //push processed in VCP
            }, {
                //some error
            })
        
    } else {
        //proceed push from another source
    }
}
```

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

## External Wallet Server domain

Chapter contains method for SDK when External Wallet Server is used.

Usage of method requires additional configuration with external API.

Basic MDES cloud messaging configuration:

<table class="relative-table confluenceTable" id="bkmrk-environment-fcm-send" style="width: 37.5309%;"><colgroup><col style="width: 47.9263%;"></col><col style="width: 52.0737%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Environment**</th><th class="confluenceTh">**FCM Sender Id**</th></tr><tr><td class="confluenceTd">MTF</td><td class="confluenceTd">502118574555</td></tr><tr><td class="confluenceTd">PRODUCTION</td><td class="confluenceTd">993764297204</td></tr></tbody></table>

### prepareRegistrationData

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="90ae7cc4-9c04-47a6-b153-a3819765a665" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-8" style="width: 46.2963%;"><tbody><tr><td class="wysiwyg-macro-body" style="width: 100%;"><p class="callout info">Asynchronous. Offline.  
Method for preparing data used for activation.  
Should be used before calling register method.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-79" style="width: 100%;"><colgroup><col style="width: 21.2608%;"></col><col style="width: 10.7497%;"></col><col style="width: 47.9647%;"></col><col style="width: 20.0247%;"></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">paymentAppInstanceId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Identifier for the specific Mobile Payment App instance</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">paymentAppProviderId</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">Globally unique identifier for the Wallet Provider, as assigned by MDES</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="7c1986b8-a0e6-4695-9f3c-88a1ee35635a">publicKeyCertificate</span></td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">CMS-D public key certificate in pem format</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd">mobilePin</td><td class="confluenceTd">CharArray?</td><td class="confluenceTd">Mobile PIN used to payment confirmation

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" 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 success">Success callback with PrepareRegistrationResponse object.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-80"><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"><span class="inline-comment-marker" data-ref="f160b01e-9b7b-49f0-b4c7-bfe62506219c">publicKeyCertificateFingerprint</span></td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">CMS certificate fingerprint. Used algorithm: hex(sha1(certificate.encoded))</td></tr><tr><td class="confluenceTd">encryptedRgk</td><td class="confluenceTd">String</td><td class="confluenceTd">Encrypted randomly-generated 128-bit AES key.</td></tr><tr><td class="confluenceTd" colspan="1"><span class="inline-comment-marker" data-ref="a7aaba43-296b-46cc-b960-11e798147132">deviceInfo</span></td><td class="confluenceTd" colspan="1">EwsDeviceInfo</td><td class="confluenceTd" colspan="1">Device info.</td></tr><tr><td class="confluenceTd">deviceFingerprint</td><td class="confluenceTd">String</td><td class="confluenceTd">Unique device fingerprint.</td></tr><tr><td class="confluenceTd">encryptedPin</td><td class="confluenceTd">String?</td><td class="confluenceTd">Encrypted pin (if passed in input).</td></tr></tbody></table>

<span class="inline-comment-marker" data-ref="5b2eba54-b6c6-44dc-94a1-77b016e6aea9">EwsDeviceInfo</span> model:

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-81"><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">deviceName</td><td class="confluenceTd">String</td><td class="confluenceTd">Device model name.</td></tr><tr><td class="confluenceTd" colspan="1">formFactor</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The form factor of the target provisioned device.</td></tr><tr><td class="confluenceTd" colspan="1">storageTechnology</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The architecture or technology used for token storage.</td></tr><tr><td class="confluenceTd" colspan="1">osName</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The name of the operating system of the target provisioned device.</td></tr><tr><td class="confluenceTd" colspan="1">osVersion</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The version of the operating system of the target provisioned device.</td></tr><tr><td class="confluenceTd" colspan="1">nfcCapable</td><td class="confluenceTd" colspan="1">Boolean</td><td class="confluenceTd" colspan="1">Whether the target provisioned device has NFC capability.

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

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e3542ff8-9509-4889-a7cf-aa179dcdce47" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="f144678d-f76d-4bce-9b3b-f6ef3a7d1525" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-prepareregistrat"><tbody><tr><td class="wysiwyg-macro-body">```
fun prepareRegistrationData(
        paymentAppInstanceId: String,
        paymentAppProviderId: String,
        publicKeyCertificate: String,
        mobilePin: CharArray?) {

    ucpApi
            .ewsService
            .prepareRegistrationData(paymentAppInstanceId,
                    paymentAppProviderId,
                    publicKeyCertificate,
                    mobilePin,
                    { prepareRegistrationResponse ->
                        //Prepared data for registration including encryptedMobilePin if mobilePin is used
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### register

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="c1929180-fa9c-46e6-94b9-f4f4538f68e8" 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.  
Method used for registration new Mobile Payment App instance with MDES for use.</p>

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

**Input**

<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">mobileKeysetId</td><td class="confluenceTd">String</td><td class="confluenceTd">Identifies the Mobile Keys used for this remote management session

</td><td class="confluenceTd">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">ewsMobileKeys</td><td class="confluenceTd" colspan="1">EwsMobileKeys</td><td class="confluenceTd" colspan="1">Contains the mobile keys used to secure the communication during subsequent remote management sessions

</td><td class="confluenceTd" colspan="1">Not empty</td></tr><tr><td class="confluenceTd" colspan="1">remoteManagementUrl</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The URL endpoint for subsequent remote management sessions

The Mobile Payment App must store this URL for future use in order to be able to request new remote management sessions

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

<span class="inline-comment-marker" data-ref="b8a79bc3-29a7-4cf3-874a-50a55f086f31">EwsMobileKeys</span>

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-83" style="width: 100%;"><colgroup><col style="width: 17.9234%;"></col><col style="width: 10.2509%;"></col><col style="width: 71.8258%;"></col></colgroup><tbody><tr><th class="confluenceTh">**Parameter**</th><th class="confluenceTh">**Type**</th><th class="confluenceTh">**Description**</th></tr><tr><td class="confluenceTd">transportKey</td><td class="confluenceTd">String</td><td class="confluenceTd">The Mobile Transport Key used to provide confidentiality of data at the transport level between the Mobile Payment App and MDES

</td></tr><tr><td class="confluenceTd" colspan="1">macKey</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The Mobile MAC Key used to provide integrity of data at the transport level between the Mobile Payment App and MDES

</td></tr><tr><td class="confluenceTd" colspan="1">dataEncryptionKey</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The Mobile Data Encryption Key used to encrypt any sensitive data at the data field level between the Mobile Payment App and MDES

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="2537f605-96bb-4a57-9323-85c318916f61" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-12" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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="a5061c05-1058-49ec-a30b-db1a55f7807e">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="4d7e78ad-1754-4a4c-a677-f5b8558226cd" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-register%28-mobile"><tbody><tr><td class="wysiwyg-macro-body">```
fun register(
        mobileKeysetId: String,
        ewsMobileKeys: EwsMobileKeys,
        remoteManagementUrl: String) {

    ucpApi
            .ewsService
            .register(mobileKeysetId, ewsMobileKeys, remoteManagementUrl,
                    {
                        //Device registration success 
                        //application should listen to push messages and UcpPaymentInstrumentEventListener callbacks
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation  
                    }
            )
}
```

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

### activate

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9f6ec765-6e80-48e4-812b-18ce55b0fe8c" 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.  
Method to <span class="inline-comment-marker" data-ref="ff9d0111-3920-44a2-b330-463baf9590fa">activate</span> PaymentInstrument.  
Should be used only on PaymentInstrumens which PaymentInstrumentStatus is <span class="inline-comment-marker" data-ref="1d2e0778-2b5f-434a-9e52-b1830fb9616f">SUSPENDED or INACTIVE</span>.  
Changes PaymentInstrumentStatus to <span class="inline-comment-marker" data-ref="dd4d9205-50e7-47a0-84f0-3c339107fff1">ACTIVE</span>, calls for transaction credentials replenish and set PaymentInstrument as default for payment when no other PaymentInstrument is available.  
Method can be used when onProvisioningSuccess callback is trigerred to instantly activate card.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-84"><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"><span class="inline-comment-marker" data-ref="3166a877-9c9a-461e-9079-2b095d1dd082">paymentInstrumentId</span></td><td class="confluenceTd">String</td><td class="confluenceTd">Id of paymentInstrument to activate.</td><td class="confluenceTd">Not empty.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="650992b9-37f6-4086-98af-1af4af596154" 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>

**<span class="inline-comment-marker" data-ref="299a20fa-c6e7-4d9a-a57d-41bc8c8aa147">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8333bc00-d86d-4db1-84e9-114273160b9b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-activate%28payment"><tbody><tr><td class="wysiwyg-macro-body">```
fun activate(paymentInstrumentId: String) {
    ucpApi
		.ewsService
        .activate(paymentInstrumentId,
		{
         	//Changes PaymentInstrumentStatus to ACTIVE, set card as default for payment if another 
            //is not already setted Performing replenish, 
            //application should listen to push message with information about replenish success/failure 
        }, 
		{ throwable ->
        	//Something went wrong, check exception with documentation
        }
	)
}
```

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

### suspend

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="569b41ca-4709-4ecd-9ae2-2348dd7812f9" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-9"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.  
Method for suspending paymentInstrument.  
Changes PaymentInstrumentStatus to <span class="inline-comment-marker" data-ref="9c3b02cf-ddf4-42a1-9d19-31999c7e7998">SUSPENDED</span>.  
Use activate method to allow payments again.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-85"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of paymentInstrument to suspend.</td><td class="confluenceTd">Not empty.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7f7ad572-ce70-48b9-800b-2d2fa0222ad3" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-%2F-failure-ca-14" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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="6d9aaca9-6653-4fdc-92d9-e1ea110e536a">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8333bc00-d86d-4db1-84e9-114273160b9b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-suspend%28paymenti"><tbody><tr><td class="wysiwyg-macro-body">```
fun suspend(paymentInstrumentId: String) {
    	ucpApi
			.ewsService
            .suspend(paymentInstrumentId,
			{
           		 //Changes PaymentInstrumentStatus to SUSPENDED.
            }, 
			{ throwable ->
            	 //Something went wrong, check exception with documentation
            }
	)
}
```

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

### getPaymentInstrument

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="30e98e58-ee95-4078-941d-9461cf478a5a" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-10"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.  
Method for getting single PaymentInstrument from local storage object based on id.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-86"><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">paymentInstrumentId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of paymentInstrument to get.

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

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="2d9978ce-35b8-42ef-a8cc-c06769fbfec2" 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 success">Success callback with PaymentInstrument object.</p>

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

<table class="wrapped relative-table confluenceTable" id="bkmrk-parameter-type-descr-87"><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">paymentInstrument</td><td class="confluenceTd">PaymentInstrument</td><td class="confluenceTd">Retrieved paymentInstrument</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="06a47435-610a-49fc-9c46-f39594598d54" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-4"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8333bc00-d86d-4db1-84e9-114273160b9b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getpaymentinstru-1"><tbody><tr><td class="wysiwyg-macro-body">```
fun getPaymentInstrument(paymentInstrumentId: String) {
    ucpApi.ewsService
            .getPaymentInstrument(paymentInstrumentId,
                    { paymentInstrument ->
                        //PaymentInstrument from local storage
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### getAllPaymentInstruments

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="e4ba943f-9372-45a7-b692-23d020ff7e44" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-11"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout info">Asynchronous. Offline.  
Method for getting all payment instruments from local storage.</p>

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

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="70fd3419-b36d-47be-9687-92a9a981f00c" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-3"><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="657c7a09-2a79-4aa4-a9f8-940e67440972" 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 success">Success callback with list of PaymentInstrument objects.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-88"><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">paymentInstruments</td><td class="confluenceTd">List&lt;PaymentInstrument&gt;</td><td class="confluenceTd">List of retrieved payment instruments from local storage</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="3eb083bb-d94b-4e7f-a167-fda57e44e705" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="edbfe0cc-6fb4-4c4f-b8ed-1ab98260ff59" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getallpaymentins-1"><tbody><tr><td class="wysiwyg-macro-body">```
fun getAllPaymentInstrument() {
    ucpApi.ewsService
            .getAllPaymentInstruments(
                    { paymentInstruments ->
                        //List of PaymentInstrument from local storage
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

### getEncryptedPin

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="b9579cd8-fe2a-484c-a114-b7f7a3a62044" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-asynchronous.-offlin-12" style="width: 80.1235%; height: 83.8px;"><tbody><tr style="height: 83.8px;"><td class="wysiwyg-macro-body" style="width: 99.8459%; height: 83.8px;"><p class="callout info">Asynchronous. Offline.|  
Method for encrypting mobilePin. When updated on MDES call method onMobilePinChganged.</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" colspan="1">pin</td><td class="confluenceTd" colspan="1">CharArray</td><td class="confluenceTd" colspan="1">PIN to encrypt.</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="650992b9-37f6-4086-98af-1af4af596154" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-16" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px; width: 42.8395%; height: 35.3906px;"><tbody><tr style="height: 35.3906px;"><td class="wysiwyg-macro-body" style="width: 100%; height: 35.3906px;"><p class="callout success">Success callback with encrypted mobile PIN.</p>

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

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-90" style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Roboto, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; font-size: 14px;"><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">encryptedMobilePin</td><td class="confluenceTd">String</td><td class="confluenceTd">Hex encoded encrypted mobile PIN.</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="a8bc88db-1fb1-48ee-94d1-c49cc14446e0" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback.-6"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback.</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8333bc00-d86d-4db1-84e9-114273160b9b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getencryptedpin%28"><tbody><tr><td class="wysiwyg-macro-body">```
fun getEncryptedPin(pin: CharArray) {
    ucpApi
            .ewsService
            .getEncryptedPin(pin, { encryptedPin ->
                //call to Wallet Server with new created encrypted mobile PIN
                //when updated call onMobilePinChanged method
            }, {
                //Something went wrong, check exception with documentation
            })
}


```

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

### onMobilePinChanged

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="264aa8f7-d4d2-4ff2-845a-11ddb240a5c8" 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.  
<span class="inline-comment-marker" data-ref="e9698825-23b8-4d3f-953f-83d66d42e2b6">Method for informing SDK about mobilePin change</span>.  
Should be used when mobilePin changed.  
<span class="inline-comment-marker" data-ref="6c5a335c-8200-4bbe-9a8c-fbf847ca371d">The result of action is deletion of existing transaction credentials and replenish.</span></p>

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

**Input**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="1f5c7de8-ff6f-4367-bba9-421ef1eac5a8" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-no-input-parameters-4"><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="54a8a571-d66b-4f7a-8e2f-a57692b1ea0b" 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="edbfe0cc-6fb4-4c4f-b8ed-1ab98260ff59" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-reactonmobilepin"><tbody><tr><td class="wysiwyg-macro-body">```
fun reactOnMobilePinChanged() {
    ucpApi
        .ewsService
        .onMobilePinChanged(
            {
				// Informing SDK about changing mobile pin processed succesfully.
				// SDK should delete and next replenish transaction credentials. 
				// Listen for UcpPaymentInstrumentEventListener events
            }, { throwable ->
				// Something went wrong, check exception with documentation.
            })
}
```

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

### delete 

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="9f6ec765-6e80-48e4-812b-18ce55b0fe8c" 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"><span class="inline-comment-marker" data-ref="2b97399e-8161-4657-8e08-afbd39460d45">Asynchronous. Online.  
</span><span class="inline-comment-marker" data-ref="2b97399e-8161-4657-8e08-afbd39460d45">Method to removing PaymentInstrument.  
</span><span class="inline-comment-marker" data-ref="2b97399e-8161-4657-8e08-afbd39460d45">Removed transaction credentials and PaymentInstrument from local storage and in MDES.  
</span>When success PaymentInstrument will be no longer available in *getPaymentInstrument* and *getPaymentInstruments* methods.</p>

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

**Input**

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-91"><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"><span class="inline-comment-marker" data-ref="3166a877-9c9a-461e-9079-2b095d1dd082">paymentInstrumentId</span></td><td class="confluenceTd">String</td><td class="confluenceTd">Id of paymentInstrument to delete.</td><td class="confluenceTd">Not empty.</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="650992b9-37f6-4086-98af-1af4af596154" 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>

**<span class="inline-comment-marker" data-ref="299a20fa-c6e7-4d9a-a57d-41bc8c8aa147">Sample</span>**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8333bc00-d86d-4db1-84e9-114273160b9b" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-delete%28paymentin-1"><tbody><tr><td class="wysiwyg-macro-body">```
fun delete(paymentInstrumentId: String) {
    ucpApi
            .ewsService
            .delete(paymentInstrumentId,
                    {
                        //Selected Payment instrument is removed
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

## Assets Domain

### getAsset

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="ee592d11-5678-49f6-bdee-71cd093ae072" 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.  
Method for getting all assets for selected assetId.</p>

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

**Input**

<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">assetId</td><td class="confluenceTd">String</td><td class="confluenceTd">Id of assets to retrive</td><td class="confluenceTd">Not empty</td></tr></tbody></table>

**Output**

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="7c700f72-2bbf-40d7-8787-008c86ac6cce" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-success-callback-wit-17"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout success">Success callback with list of Assets objects.</p>

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

<table class="confluenceTable" id="bkmrk-parameter-type-descr-93"><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">ucpAsset</td><td class="confluenceTd">UcpAsset</td><td class="confluenceTd">Plain UcpAsset object</td></tr></tbody></table>

UcpAsset object contains following field

<table class="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">content</td><td class="confluenceTd">List&lt;UcpAssetContent&gt;</td><td class="confluenceTd">Plain list of UcpAssetContent objects</td></tr></tbody></table>

UcpAssetContent contains following fields.

<table class="relative-table wrapped confluenceTable" id="bkmrk-parameter-type-descr-95"><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">data</td><td class="confluenceTd">String</td><td class="confluenceTd">The data for this asset. Base64-encoded data, given in the format as specified in type.</td></tr><tr><td class="confluenceTd" colspan="1">type</td><td class="confluenceTd" colspan="1">String</td><td class="confluenceTd" colspan="1">The data MIME type. One of: application/pdf, text/plain, text/html, image/png, image/svg+xml, image/pdf.</td></tr><tr><td class="confluenceTd" colspan="1">width</td><td class="confluenceTd" colspan="1">Long?</td><td class="confluenceTd" colspan="1">For image assets, the width of this image. Specified in pixels.</td></tr><tr><td class="confluenceTd" colspan="1">height</td><td class="confluenceTd" colspan="1">Long?</td><td class="confluenceTd" colspan="1">For image assets, the width of this image. Specified in pixels.</td></tr></tbody></table>

<table class="wysiwyg-macro" data-macro-body-type="RICH_TEXT" data-macro-id="60c0b11e-990c-484a-9113-b82ec678c03d" data-macro-name="info" data-macro-schema-version="1" id="bkmrk-failure-callback-5"><tbody><tr><td class="wysiwyg-macro-body"><p class="callout danger">Failure callback</p>

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

**Sample**

<table class="wysiwyg-macro" data-macro-body-type="PLAIN_TEXT" data-macro-id="8ce351a1-4a82-4e0f-be90-0f5be6a1c1c7" data-macro-name="code" data-macro-parameters="theme=Eclipse" data-macro-schema-version="1" id="bkmrk-fun-getasset%28assetid"><tbody><tr><td class="wysiwyg-macro-body">```
fun getAsset(assetId: String) {
    ucpApi.assetsService
            .getAssets( assetId,
                    { ucpAsset ->
                        //List of assets of selected assetId
						val ucpAssetContentList = ucpAsset.content
                    },
                    { throwable ->
                        //Something went wrong, check exception with documentation
                    }
            )
}
```

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

## DOCUMENT CHANGELOG

Vesion 2.10.12

- **IMPORTANT: Mobile DC dependency can no longer be declared as saperate dependency in the same application when UCP is declared. MDC will be available as default.**
- UCP is now built as a [fused library](https://developer.android.com/build/publish-library/fused-library)
- Updated Mobile DC to 2.17.5
- Updated AGP to 9.0.1
- Updated Gradle to 9.3.1

Vesion 2.10.10

- Added new field for digitization: *formFactor*
- Mobile DC updated to 2.17.3

Vesion 2.10.0

- Introduced support for 16kb page sizes: [https://developer.android.com/guide/practices/page-sizes](https://developer.android.com/guide/practices/page-sizes)
- Security tools updated to newest version
- Kotlin version updated to 2.0.21(minimum Kotlin version in an application using SDK is 1.8.22)
- AGP updated to 8.11.1
- Mobile DC updated to 2.17.0

Version 2.9.10

- Added new parameter *transactionId* to method *onContactlessPaymentCompleted* for Mastercard transactions.   
    New transaction identifier allow to match transaction with processed transaction notification *MobileDC::EventNewTransaction::clientTransactionId.*
- Mobile DC updated to 2.16.12

  
Version 2.9.8

- **IMPORTANT: Security tools updated to newest version. Recommneded update when using version 2.9.x due to changes fixes in security tools.**
- Visa SDK updated to 6.4.0
- Mobile DC updated to 2.16.10

Version 2.9.5

- Added MC *mtf* host name
- Update Mobile DC to 2.16.5

Version 2.9.4

- **Important:** Apply security and functional certification changes related to intruduction new security tools. Changes in security thread management and working in background
- Update Mobile DC to 2.16.4

Version 2.8.7

- Update Mobile DC to 2.15.8

Version 2.8.6

- Small fixes to 2.8.5

Version 2.8.5

- Update Proguard rules related to R8 changes

Version 2.8.2

- Added new field "externalPaymentTokenId" in DigitizationGreenPath, DigitizationRequest and DigitizationResult models.
- Added new optional configuration withOptionalWalletMcbpHttpExecutor
- Marked configuration withUcpTransactionEventListener from UcpConfigurationBuilder as deprecated. Use MobileDcTransactionEventListener.optionalMobileDcTransactionEventListener from MDC SDK instead.

Version 2.7.4

- Added new field "paymentTokenExpirationDate" in PaymentInstrument model.

Version 2.7.3

- update MobileDC dependency to 2.15.3

Version 2.7.1

- update MobileDC dependency to 2.15.1

Version 2.7.0

- update MobileDC dependency to 2.15.0

Version 2.6.9.2

- update MobileDC dependency to 2.14.7.2

Version 2.6.9.1 - Hotfix possible OutOfMemoryException in MDC 2.14.7

- update MobileDC dependency to 2.14.7.1

Version 2.6.9 - don't use, could cause OOM Exception

<div class="wiki-content" id="bkmrk--90"></div><div class="wiki-content" id="bkmrk--91"></div><div class="wiki-content" id="bkmrk--139"></div><div class="wiki-content" id="bkmrk--140"></div>- Updated Mobile DC dependency to 2.14.7.
- Updated *processDsrpTransaction* method.

Version 2.6.7

<div class="wiki-content" id="bkmrk-updated-mobile-dc-de-0"><div class="wiki-content">- Updated Mobile DC dependency to 2.14.6
- Added support for Mastercard India datacenter.
- **important** Added new method to UcpTransactionEventListener - *onContactlessPaymentStarted()***.** Callback allows application to get event about new transaction and it's a best place for token selection and user authentication. Read more in Product Overview.
- Due to adding new place for contactless payment authentiocation also updated code samples for *HostApduSevice* implementation and method *setUserAuthenthenticatedForPayment()*
- **Important** CloudMessagingService:process became deprecated due to introducing delivery message from server service. Read more in Product Overview and Mobile DC specification.
- **Important** Added new status *AbortReason:CONNECTION\_LOST* for *UcpTransactionEventListener:onContactlessPaymentAborted.* Status TERMINAL\_INACTIVITY\_TIMEOUT became deprecated. Change significally improves contactless payment UX. Method works immediatelly when connection between device and terminal is lost.
- **Important** Aded new optional configuration for *UcpTransactionConfiguration* with field *enableTransactionAuthenticationTimer.* Timer is now disabled by default, previously was always enabled and could cause problems when authentication time leading to zero and user performs transaction. It could cause clearing user authentication during processing payment on terminal. Change is related to other payments optimizations and introducing *onContactlessPaymentStarted()* and new *AbortReason CONNECTION\_LOST.* Please align your code to new changes, enabling timer is not recommended.

</div></div>Version 2.5.7

<div class="wiki-content" id="bkmrk-updated-mobile-dc-de"><div class="wiki-content">- Updated Mobile DC dependency to 2.13.7

</div></div>Version 2.5.6

<div class="wiki-content" id="bkmrk-resolved-google-play">- Resolved Google Play Console Security warning
- Updated Mobile DC dependency to 2.13.6

</div>Version 2.5.5

<div class="wiki-content" id="bkmrk-wrap-in-try-catch-bl">- Wrap in try-catch block callbacks from SDK *setup()* method to prevent breaking process in SDK. Read more in *setup*() method description.

</div>Version 2.5.3

- Update internal libraries. **IMPORTANT** Read more in Mobile DC changelog for version 2.13.3

Version 2.5.2

- Fixed UcpMcbpHttpExecutor from version 2.5.1. The issue doesn't impact on other functionality

Version 2.5.1

- Methods marked as deprecated:
    
    
    - reset (use restart instead)
    - getPaymentInstrument (use getAllPaymentInstruments instead)
    - setDefaultForRemote (usage is redundant)
    - getDefaultForRemote (usage is redundant)
    - processDsrpTransaction(use new processDsrpTransaction method with *ProcessDsrpTransaction* added model)
- Added new methods related to OTP authentication code:
    
    
    - requestAuthenticationCodeForPayment
    - validateAuthenticationCodeForPayment
- Added new methods for supporting yellow-path token activation:
    
    
    - checkEligibility
    - digitize (new version with support for checkEligibility usage)
    
    
    - submitTokenAuthenticationMethod
    - submitTokenAuthenticationValue
    - getAdditionalAuthenticationMethods
- Fixed getPaymentInstrument method (case invalid error when session expired error occurred).
- Updated Kotlin version to 1.5.31 and Koin to 2.1.6.
- Removed unused permissions *ACCESS\_FINE\_LOCATION* and *com.google.android.c2dm.permission.RECEIVE .*
- Added logs for all facade methods (available in SDK debug version).

Version 2.4.4

- Updated MDC SDK to 2.12.1 - fixed aggressive security process check
- Updated documentation for TransactionAbortReason:TERMINAL\_INACTIVITY\_TIMEOUT model

Version 2.4.3

- IMPORTANT Update security tools after EMV Security Evaluation - refer to Mobile DC technical documentation version changelog (version 2.12.0)
- Update Gradle and R8 tools
- Handled authentication flow for ContactlessRichTransactionType REFUND. SDK requires authentication if not provided.
- Improved description for ContactlesssTransactionResult model in documentation.
- Added new ContactlessRichTransactionType: WITHDRAWAL and ATM\_CONTACTLESS

Version 2.3.24

- Added new state for TransactionAbortReason::TERMINAL\_INACTIVITY\_TIMEOUT. Previously status was part of TransactionAbortReason::TERMINAL\_ERROR and produces contactless payment aborted handling problems. Status is used in onContactlessPaymentAborted callback. Application can ignore this state and do not perform any action.
- Added method on UcpApi for SDK restart(). Unlike reset() new method is asynchronous and allows to usage VCP SDK without application kill. Method clears all VCP SDK data and restarts to initial state.
- Introduced new approach to handling security issue. When application will call any SDK method after security issue reporting, UcpSkdExpcetion with SECURITY\_EVENT\_OCCURRED will be returned. Previously APPLICATION\_PROCESS\_NOT\_KILLED was returned. Change doesn't impact onSecurityIssue callback.
- Added Assets Domain and getAsset() method.
- Added verification of input parameters in token profile and transaction credentials replenish.
- Added more details in callbacks onProvisioningFailure and onReplenishFailure about errors in token related operations.

Version 2.3.22.2 - hotfix

- Added more validation for input parameters for External Wallet Server service
- Added data verification before accessing data in CMS-D processes
- Improved catching exceptions for MCBP processes
- Improved flow for reset() method - added protection agains processing messaging after SDK reset()
- Changed algorithm for calculating publicKeyCertificateFingerprint in PrepareRegistrationDataResponse. From hex(sha1(certificate.publicKey.encoded)) to hex(sha1(certificate.encoded))
- Added support for multiple calling setUserAuthenticatedForPayment() method

Version 2.3.22

- Improved internal SDK logs reporting
- Using androidX in end project is necessary now
- Improved automatic replenish credentials process
- Added handling ReDigititzation process in SDK. Use withOptionalReProvisionEventListener method in SDK setup method to observe PaymentInstrument changes

Version 2.3.21

- Added optional UcpHttpExecutor for handling CMS-D communication to UcpConfiguration
- Replenish process optimization

Version 2.3.18

- Updated security libraries

Version 2.3.17

- Fixed parsing merchantAndLocation field from ContactlessTransactionData.
- Added EWS configuration parameter in setup.

Version 2.3.13

- Added new parameter *result* to IbanDigitizationResult model
- Parameter *cloudDigitizationSuccess* in IbanDigitizationResult is now deprecated

Version 2.3.12

- Core module with update.
- Added new reports to Wallet Server.

Version 2.3.11

- Added new method in Payment Service: processDsrpTransaction
- Added new method in User Service: resendOtp
- Added new paremeter in createPaymentData IbanInfo model: userId
- Improved default PaymentInstrument management
- Fixed clearing SDK state when unpairing device (MobileDC unPair method)

<div class="wiki-content" id="bkmrk--93"></div><div class="wiki-content" id="bkmrk--94"></div>Version 2.3.8

- Improved facade exception throwing, now contains more details about error.
- Removing whitespaces from merchantAndLocation in ContectlessTransactionData model
- Updated security harmful process check mechanism
- Added MCBP cloud messaging queue handling to prevent processing errors

Version 2.3.2

- Fixed SDK provisionning process on Google Pixel devices
- Improved default Payment Instrument management
- Updated security harmful process check mechanism

Version 2.3.1

- Added *delete* method in External Wallet Server domain
- Added more detailed descriptions for methods from External Wallet Server domain
- Added more information about models related to payment processing

Version 2.2.7

- Added reset functionality.
- Addded method in Ibans service createPaymentDat.
- Method createTVC iban service is now deprecated.
- Added global listener for most important internal SDK actions related to token managem

Version 2.2.6

- Added new exception parameter to EventContactlessPaymentAborted, EventContactlessPaymentIncident, EventReplenishFailure, EventProvisioningFailure
- Fixed problem with flow cutting on digitalization process

Version 2.2.4

- Added new enum state TransactionAbortReason.NO\_CARDS. Callback onContactlessPaymentAborted is now called when no card is available for payment.
- Added new model ContactlessTransactionData with better formatting terminal data. New object is added for events EventGetFinalDecision, EventAuthRequiredForContactless, EventContactlessPaymentCompleted.
- ContactlessTransactionInformation is now deprecated.

<span class="inline-comment-marker" data-ref="e46aa36d-3f39-4af7-8b36-e51edeafeec3">Version 2.2.3</span>

- Fixed setting default PaymentInstrument after activation
- Fixed doubled callback onPaymentInstrumentStatusChanged for DELETED status

Version 2.2.2

- Fixed dependencies conflicts
- Consumer Proguard rules update
- <span class="inline-comment-marker" data-ref="e46aa36d-3f39-4af7-8b36-e51edeafeec3">Certificate pinning implementation improvement</span>

Version 2.2.0

- Added new method in EWS Service - getEncryptedPin
- SDK startup optimization

<span class="inline-comment-marker" data-ref="3e5bebb4-c150-4421-ba64-9bb54287b905">Version 2.1.1</span>

- Fixed dependencies for release version
- Added information about SDK size
- Added information about SDK integration on lower Android API level

Version 2.1.0

- <span class="inline-comment-marker" data-ref="3e5bebb4-c150-4421-ba64-9bb54287b905">Added new methods in External Wallet Server domain (activate, suspend, getPaymentInstrument, getPaymentInstruments, onMobilePinChanged)</span>

Version 2.0.0

- Changed approach to SDK setup
- Added UcpSdkException
- Added new reason codes to existing exceptions
- New methods in cards domain: digitize, getPaymentInstrument, getAllPaymentInstruments, delete
- New methods in ibans domain: digitize, getPaymentInstrument, getAllPaymentInstruments, delete
- New methods in cloud messaging domain: processMcbpNotificationData
- New methods in payment domain: abortUserAuthenticationForPayment, replenishCredentials, restartContactlessTimer
- New methods in external wallet server domain: prepareRegistrationData, register

Version 1.0.1

- Created

<div class="notranslate" id="bkmrk--114" style="all: initial;"></div><div class="notranslate" id="bkmrk--97" style="all: initial;"></div>