# Use Cases (MDES&VTS)

<span class="inline-comment-marker" data-ref="1f01a141-77b9-4ab5-b9af-74a2b46a6fc6">Version 2.2  
</span><span class="inline-comment-marker" data-ref="1f01a141-77b9-4ab5-b9af-74a2b46a6fc6">October 2025</span>

<span class="inline-comment-marker" data-ref="1f01a141-77b9-4ab5-b9af-74a2b46a6fc6">This section is dedicated for use cases which can be done by different API and initiated from different sources.  
</span>

### <span class="inline-comment-marker" data-ref="1f01a141-77b9-4ab5-b9af-74a2b46a6fc6">Wallet Server LC API Initiated</span>

This section describes use cases which can be initiated using Wallet Server LC API. <span class="inline-comment-marker" data-ref="e431807d-6f59-4a18-8aa7-4ecdd9f2d09c">This API should be used by</span> Customers to manage Users and cards data on Wallet Server.

#### User with Card Registration

User with Card Registration is process when user and cards are transferred to Wallet Server to make possible use them in different processes (e.g. digitization) later in the application. Registration needs to be done as the first step

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant Issuer  
Issuer -&gt; WS: 1. addUserWithCard(userData, cardData)  
activate Issuer  
activate WS  
WS --&gt; Issuer: 2. response(cardId)  
deactivate WS  
Issuer -&gt; Issuer: 3. storeCardId  
deactivate Issuer  
@enduml

#### Card Reissuing

Since plastic cards have expiration date, Issuers may want to reissue them. In most cases PAN remains the same and only expiration date is extended.

**TSP MDES**

It is worth to mention that MDES does not check PAN expiry date for transactions performed with Payment Token. MDES offers API for Issuers where is possibility to update expiration date or even whole PAN for already provisioned Payment Tokens. In context of integration there are a few options:

- Issuer has own processor which is integrated with Customer Service MDES API and there is a possibility to update PAN or expiration date. Then reissuing is done only on processor side. Wallet Server will be notified by MDES about the change.
- Issuer uses Verestro Token Management Platform and reissuing is possible using LC API.
- Issuer uses only Wallet Server which acts as Token Requestor and there is no possibility to update PAN or expiration date for given Payment Token. Issuer needs to delete previous card and add new one. Users need to make digitization again.

All options needs to be considered individually and discussed with Verestro representative.

**TSP VTS**

//todo

#### User Deletion

During this process all data related to given User are deleted. Payment Tokens are deleted asynchronously.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant Issuer  
participant "TSP" as TSP  
Issuer -&gt; WS: 1. deleteUser(userId)  
activate Issuer  
activate WS  
WS -&gt; WS: 2. delete cards, devices  
WS --&gt; Issuer: 3. response  
deactivate Issuer  
loop All Payment Tokens for given User  
WS -&gt; TSP: 4. delete token  
activate TSP  
TSP --&gt; WS: 5. response  
opt  
WS -&gt;&gt; Issuer: 6. send Payment Token event   
end  
deactivate WS  
deactivate TSP  
end  
@enduml

<div id="bkmrk-%40startuml-skinparam-" style="color: #000000; background-color: #fffffe; font-family: 'Droid Sans Mono', 'monospace', monospace; font-weight: normal; font-size: 14px; line-height: 19px; white-space: pre;"></div>#### Card Deletion

During card deletion process all data related to given card are deleted. Payment Tokens are deleted asynchronously.

**TSP MDES**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
Issuer -&gt; WS: 1. deleteCard(cardId)  
activate WS  
activate Issuer  
WS -&gt; WS: 2. deleteCard  
WS --&gt; Issuer: 3. response  
deactivate Issuer  
loop All Payment Tokens for card  
WS -&gt; MDES: 4. Delete token  
activate MDES  
MDES -&gt; MDES: 5. Delete token mapping  
MDES --&gt; WS: 6. response  
opt  
WS -&gt;&gt; Issuer: 7. send Payment Token event  
end  
deactivate MDES  
WS -&gt; SDK: 8. deliverMessage(paymentTokenDelete)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
deactivate MPA  
activate SDK  
alt Request session if required  
SDK -&gt; MDES: 9. request session  
activate MDES  
MDES --&gt; SDK: 10. response  
MDES -&gt; WS: 11. sendRemoteNotificationMessage  
deactivate MDES  
activate WS  
WS -&gt; SDK: 12. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
deactivate MPA  
end  
SDK -&gt; MDES: 13. delete(tokenUniqueReference)  
activate MDES  
MDES --&gt; SDK: 14. response  
deactivate MDES  
SDK -&gt; SDK: 15. Delete transaction credentials, card profile  
SDK -&gt; MPA: 16. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
end  
deactivate MPA  
@enduml

**TSP VTS**

@startuml  
autonumber  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "VTS" as TSP  
participant Issuer  
Issuer -&gt; WS: deleteCard(cardId)  
activate WS  
activate Issuer  
WS -&gt; WS: deleteCard  
WS --&gt; Issuer: response  
deactivate Issuer  
loop All Payment Tokens for card  
WS -&gt; TSP: delete token  
activate TSP  
TSP -&gt; TSP: delete token mapping  
TSP --&gt; WS: response  
deactivate TSP  
opt  
WS -&gt;&gt; Issuer: send Payment Token event  
end  
WS -&gt; SDK: deliverMessage(paymentTokenDelete)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK -&gt; SDK: delete transaction credentials, card profile  
SDK -&gt; MPA: onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
end  
@enduml

### Wallet SDK Initiated

#### Wallet SDK Setup

Setup of Wallet SDK (both modules VCP SDK and MDC SDK) is main step which needs to be made at very beginning. During setup main configuration should be provided. Moreover there is some configuration which is related with HCE payments: MPA should be registered as default application for payment (Tap &amp; Pay) and also should implement HostApduService to emulate an NFC card inside an Android service component. Please find more details in *Wallet SDK API* document.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
participant MPA  
participant "Wallet SDK" as SDK  
MPA -&gt; SDK: 1. MDC:setup(configuration)  
activate MPA  
activate SDK  
SDK --&gt; MPA: 2. result  
MPA -&gt; SDK: 3. UCP:setup(configuration)  
SDK --&gt; MPA: 4. result  
deactivate MPA  
deactivate SDK  
@enduml

#### Pair Device on Wallet Server

This section describes pairing device process. Device pairing is process which authenticates device in context of given user. During this process device data and keys used in communication are exchanged with Wallet Server. To make possible device pairing, user needs to be already registered on the Wallet Server. Every device is identified by unique identifier. After every pairing device request, Wallet Server gives unique installation identifier. It means that particular installation of the application installed on particular device belongs to given User. Different Users can use same device for separate installations. If any active installation on given device already exists during pairing device, Wallet Server will delete and create new installation in context of new user. Only one active installation is possible on particular device. Device pairing is the first process which should be done after user registration. Pairing device should be done only once for individual installation.

<div class="wiki-content" id="bkmrk--3"></div><div id="bkmrk--4"><div class="no-print" id="bkmrk--58"></div></div>##### Pair Device By Trusted Identity

In the integrated model, [Trusted Identity](https://developer.verestro.com/books/user-lifecycle-card-management-api-sdk/page/trusted-identity) is used to proof User authenticity. User is firstly authenticated on the Customer side. Trusted Identity should be generated on Issuer backend side and pass via Wallet SDK, since mobile environment is treated as unsecure. Algorithm of generating Trusted Identity is placed in Wallet SDK API specification.

Access to User data stored on Wallet Server is possible only when session is established. After paring device session is automatically generated for particular User.

If previously on given device was installation which had Payment Tokens, during pairing these Payment Tokens are deleted asynchronously.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "Issuer" as Issuer  
participant "MDES" as MDES  
MPA-&gt;Issuer: 1. authenticate  
activate MPA  
activate Issuer  
Issuer-&gt;Issuer: 2. generateTrustedIdentity - signed user id  
Issuer--&gt; MPA: 3. response(trustedIdentity)  
deactivate Issuer  
MPA -&gt; MPA: 4. obtainRNSToken(walletFirebase)  
MPA-&gt; SDK: 5. MDC:pairDeviceByTrustedIdentity\\r(trustedIdentity, rnsRegistrationToken)  
activate SDK  
SDK -&gt; SDK: 6. isDevicePaired  
alt isDevicePaired=true  
SDK --&gt; MPA: 7. result  
else isDevicePaired=false  
SDK-&gt; WS: 8. pairDeviceByTrustedIdentity\\r(trustedIdentity, rnsRegistrationToken, deviceInfo)  
activate WS  
WS-&gt; WS: 9. verify trusted identity  
alt isActiveInstallationOnGivenDevice  
WS -&gt; WS: 10. deleteActiveInstallation  
WS -&gt; MDES: 11. deleteDeviceTokens  
activate MDES  
deactivate MDES  
note left: asynchronous  
end  
WS -&gt; WS: 12. createNewDeviceInstallationRecordForUser  
WS --&gt; SDK: 13. response\\r (userSessionToken, installationId)  
deactivate WS  
SDK -&gt; SDK: 14. store userSessionToken  
SDK--&gt;MPA: 15. result  
deactivate MPA  
deactivate SDK  
end  
@enduml

#### Card Digitization

Card digitization is process which allows to transform plastic card into <span class="inline-comment-marker" data-ref="46eb6b92-02a7-4b31-bc4b-4b13f9cdbcf8">Payment Token</span>. To perform digitization, card data should be placed already on Wallet Server and device should be already paired. Card digitization process uses Wallet Server identifier of the card. There are two ways of performing card digitization. Usage of the API's depends on needs in given implementation.

<div class="wiki-content" id="bkmrk--6"></div><div id="bkmrk--7"><div class="no-print" id="bkmrk--59"></div></div>##### Card Digitization Ways

Depending on implementation card can be digitized in different way using different approach. There are following ways of card digitization:

- one step - which is the simplest way of card digitization and should be used in project implementation where card can be just digitized without any additional staff like additional User authentication or showing T&amp;C or showing card art from TSP,
- multi step - which should be used when digitization will require additional User authentication, showing T&amp;C or showing card art from TSP.

##### Card Digitization Ways - One Step

One step digitization is dedicated for implementations where there is no additional User authentication and <span class="inline-comment-marker" data-ref="3576f8a9-b10e-4e3d-905f-5cd80ceaebc4">there is no need to show terms and conditions before every digitization or show card art from TSP</span>. Mostly it should be used in Issuer applications where NFC payments is added as a new functionality without additional staff which is used in dedicated wallets. Only transaction outcomes APPROVED(see APPROVED) or DECLINE(see DECLINE) are expected in this type of digitization.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant "MPA" as MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
participant Issuer  
MPA -&gt; SDK: 1. UCP:Cards#digitize\\r(paymentInstrumentId=verestroCardId, userLanguageCode, securityCode?)  
activate MPA  
activate SDK  
SDK -&gt; SDK: 2. isDeviceRegisteredForPayment  
alt isDeviceRegisteredForPayment=false  
SDK -&gt; WS: 3. getPkCertificate  
activate WS  
WS -&gt; MDES: 4. getPkCertificate  
activate MDES  
MDES --&gt; WS: 5. response(pkCertificate)  
WS --&gt; SDK: 6. response(pkCertificate)  
SDK -&gt; SDK: 7. prepareDataForRegistration(pkCertificate)  
SDK -&gt; WS: 8. registerDeviceForPayment\\r (paymentDeviceInfo, userSessionToken)  
WS -&gt; MDES: 9. registerMobilePaymentApplication\\r (paymentDeviceInfo)  
MDES --&gt; WS: 10. response(mobileKeys,\\r remoteManagementUrl)  
WS --&gt; SDK: 11. response(mobileKeys,\\r remoteManagementUrl)  
end  
SDK -&gt; SDK: 12. isPaymentInstrumentDigitized  
alt isPaymentInstrumentDigitized=true  
SDK --&gt; MPA: 13. result  
else isPaymentInstrumentDigitized=false  
SDK -&gt; WS: 14. digitizeCard\\r (cardId, userSessionToken)  
WS -&gt; MDES: 15. checkEligibility(cardData, paymentAppId,\\r paymentAppInstanceId)  
MDES --&gt; WS: 16. response (eligibilityReceipt)  
WS -&gt; MDES: 17. digitize(eligibilityReceipt)  
MDES --&gt; WS: 18. response  
deactivate MDES  
WS --&gt; SDK: 19. response(paymentTokenInfo)  
deactivate WS  
SDK --&gt; MPA: 20. result  
deactivate SDK  
deactivate MPA  
end  
deactivate SDK  
deactivate MPA  
note over SDK, WS #1C1E3F: See Card digitization outcome Approved or Decline diagram  
@enduml

##### Card Digitization Ways - Multi step

Multi step digitization should be used in implementations where terms and <span class="inline-comment-marker" data-ref="cc8ef17e-fba8-4e96-8e39-04999b5fc855">conditions</span> are displayed before every digitization, additional user authentication is needed or card art need to be used from TSP. Multi step digitization consists of following steps:

- checking card eligibility
- showing T&amp;C
- digitizing card

Digitization may finished with different outcomes(see Card Digitization Outcomes).

**TSP MDES**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam maxMessageSize 120  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant Issuer  
MPA -&gt; SDK: 1. UCP:Cards#checkEligibility(paymentInstrumentId=verestroCardId, locale)  
activate MPA  
activate SDK  
SDK -&gt; SDK: 2. isDeviceRegisteredForPayment  
alt isDeviceRegisteredForPayment=false  
SDK -&gt; WS: 3. getPkCertificate  
activate WS  
WS -&gt; MDES: 4. getPkCertificate  
activate MDES  
MDES --&gt; WS: 5. response(pkCertificate)  
WS --&gt; SDK: 6. response(pkCertificate)  
SDK -&gt; SDK: 7. prepareDataForRegistration(pkCertificate)  
SDK -&gt; WS: 8. registerDeviceForPayment (paymentDeviceInfo, userSessionToken)  
WS -&gt; MDES: 9. registerMobilePaymentApplication (paymentDeviceInfo)  
MDES --&gt; WS: 10. response(mobileKeys, remoteManagementUrl)  
WS --&gt; SDK: 11. response(mobileKeys, remoteManagementUrl)  
end  
SDK -&gt; WS: 12. checkEligibility(paymentInstrumentId,userSessionToken)  
WS -&gt; MDES: 13. checkEligibility(card)  
MDES --&gt;WS: 14. response(termsAndConditionsAssetId, eligibilityReceipt)  
WS --&gt; SDK: 15. response(termsAndConditionsAssetId, digitizationRef)  
SDK --&gt; MPA: 16. result(termsAndConditionsAssetId)  
MPA -&gt; SDK: 17. UCP:getAsset(termsAndConditionsAssetId)  
SDK -&gt; WS: 18. getAsset(termsAndConditionsAssetId)  
WS -&gt; MDES: 19. getAsset(termsAndConditionsAssetId)  
MDES --&gt; WS: 20. response(content)  
deactivate MDES  
WS --&gt; SDK: 21. response(content)  
deactivate WS  
SDK --&gt; MPA: 22. result  
deactivate SDK  
MPA -&gt; User: 23. show T&amp;C  
deactivate MPA  
User -&gt; MPA: 24. accept  
activate MPA  
MPA -&gt; SDK: 25. UCP:Cards#digitize(paymentInstrumentId, cvc?)  
activate SDK  
SDK -&gt; WS: 26. digitize(digitizationRef, cvc?, userSessionToken)  
activate WS  
WS -&gt;MDES: 27. digitize(eligibilityReceipt, cvc?)  
activate MDES  
MDES --&gt; WS: 28. response(additionalAuthenticationRequired, authenticationMethods?, tokenInfo, productConfig)  
deactivate MDES  
WS --&gt; SDK: 29. response(additionalAuthenticationRequired, authenticationMethods?, tokenInfo, productConfig)  
deactivate WS  
SDK --&gt; MPA: 30. result  
deactivate SDK  
MPA -&gt; User: 31. please wait  
deactivate MPA  
note over SDK, WS #1C1E3F: See Card digitization outcome Approved or Decline or Require Additional Authentication diagram  
@enduml

<div id="bkmrk--2" style="background-color: #ffffff; color: #080808;"></div><div id="bkmrk--5" style="background-color: #ffffff; color: #080808;"></div><div id="bkmrk--8" style="background-color: #ffffff; color: #080808;"></div><div id="bkmrk--9" style="background-color: #ffffff; color: #080808;"></div><div id="bkmrk--10" style="background-color: #ffffff; color: #080808;"></div><div id="bkmrk--1" style="background-color: #ffffff; color: #080808;"></div><div id="bkmrk--11" style="background-color: #ffffff; color: #080808;"></div>**TSP VTS**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant VTS  
participant Issuer  
MPA -&gt; SDK: UCP:Cards#checkEligibility(paymentInstrumentId=verestroCardId, \\nuserLanguageCode, userCountryCode, securityCode?)  
activate MPA  
activate SDK  
SDK -&gt; SDK: isDeviceEnrolledInVts()  
alt isDeviceEnrolled=false  
SDK -&gt; WS: getDeviceData(uniqueDeviceId)  
activate WS  
WS --&gt; SDK: response(deviceData)  
deactivate WS  
SDK -&gt; SDK: create vtsEnrollDeviceRequest &amp; vtsEnrollDpeDeviceRequest  
SDK -&gt; WS: enroll(uniqueDeviceId, vtsEnrollDeviceRequest, dpeEnrollDeviceRequest, userSessionToken)  
activate WS  
WS -&gt; VTS: enrollDevice(vtsEnrollDeviceRequest)  
activate VTS  
VTS --&gt; WS: response(vtsEnrollDeviceResponse)  
WS -&gt; VTS: enrollDevice(vtsDpeEnrollDeviceRequest)  
VTS --&gt; WS: response(vtsDpeEnrollDeviceResponse)  
WS --&gt; SDK: response(vtsEnrollDeviceDpeResponse)  
deactivate WS  
deactivate VTS  
SDK -&gt; SDK: processEnrollDasResponse(vtsEnrollDeviceDpeResponse)  
SDK -&gt; VTS: Async::initialize with DPE Service  
activate VTS  
VTS --&gt; SDK: Async::DPE login complete  
deactivate VTS  
end  
SDK -&gt; WS: getPkCertificate  
activate WS  
WS --&gt; SDK: response(pkCertificate)  
SDK -&gt; WS: enrollPan(paymentInstrumentId=verestroCardId, \\nuserLanguageCode, userCountryCode, securityCode?, userSessionToken)  
WS -&gt; VTS: panEnrollments(card, cvv2)  
activate VTS  
VTS --&gt; WS: response(vPanEnrollmentId, termsAndConditionsAssetId)  
deactivate VTS  
WS --&gt; SDK: response(termsAndConditionsAssetId, digitizationRef)  
deactivate WS  
SDK --&gt; MPA: result(termsAndConditionsAssetId)  
alt termsAndConditionsAssetId != null  
MPA -&gt; SDK: UCP:getAsset(termsAndConditionsAssetId)  
SDK -&gt; WS: getAsset(termsAndConditionsAssetId)  
activate WS  
WS -&gt; VTS: getContent(termsAndConditionsAssetId)  
activate VTS  
VTS --&gt; WS: response(content)  
deactivate VTS  
WS --&gt; SDK: response(content)  
deactivate WS  
SDK --&gt; MPA: result  
deactivate SDK  
MPA -&gt; User: show T&amp;C  
User -&gt; MPA: accept  
deactivate MPA  
end  
MPA -&gt; SDK: UCP:Cards#digitize(paymentInstrumentId, securityCode?)  
activate MPA  
activate SDK  
SDK -&gt; WS: provision(digitizationRef, securityCode?, userSessionToken)  
WS -&gt; VTS: panEnrollments(vPanEnrollmentId, cvv2?)  
activate VTS  
VTS --&gt; WS: response(vtsProvisioningResponse, vProvisionedTokenId,\\nstepUpRequest presets?, tokenInfo, productConfig)  
deactivate VTS  
WS --&gt; SDK: response(vtsProvisioningResponse, \\nadditionalAuthenticationRequired, \\nauthenticationMethods?,\\ntokenInfo, productConfig)  
SDK --&gt; MPA: result  
deactivate WS  
deactivate SDK  
deactivate MPA  
note over MPA, WS #1C1E3F: See Card digitization outcome Approved or Decline or Require Additional Authentication diagram  
@enduml

##### Card Digitazation Outcomes

There are following digitization outcomes which should be handled differently:

- APPROVED
- DECLINED
- REQUIRE\_ADDITIONAL\_AUTHENTICATION

##### APPROVED

This digitization outcome always refers to green path digitization decision. When digitization is APPROVED then profile provisioning(See Profile Provisioning) starts automatically.

**TSP MDES**

According to MDES architecture just after digitization Payment Token is in INACTIVE state even though does not require additional User authentication. Due that fact new flag (additionalAuthenticationRequired) was introduced which informs which Payment Token exactly needs to be additionally authenticated. After successful provisioning token is activated and then SDK will perform Transaction Credentials - Initial Replenishment.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
participant Issuer  
group APPROVED  
MDES --&gt; WS : 1. responseFromDigitization(APPROVED, cardDigitizationData)  
activate MDES  
activate WS  
opt  
WS -&gt;&gt;Issuer: 2. send Payment Token Event  
end  
WS --&gt; SDK : 3. response(digitizatonData, paymentToken)  
deactivate WS  
activate SDK  
SDK --&gt; MPA : 4. result  
activate MPA  
MPA --&gt; User : 5. result  
deactivate MPA  
... Profile Provisioning ...  
note over MPA, MDES #1C1E3F: See Profile Provisioning diagram  
... MDES Token Activation ...  
SDK -&gt; MDES: 6. notifyProvisioningResult  
MDES -&gt; MDES: 7. createTokenMapping  
MDES -&gt; WS: 8. notifyTokenUpdated(Active)  
deactivate MDES  
activate WS  
opt  
WS -&gt;&gt;Issuer: 9. send Payment Token Event  
end  
WS -&gt; SDK: 10. deliverMessage(paymentTokenActive)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
SDK -&gt; SDK: 11. updateTokenStatus  
SDK -&gt; MPA: 12. onPaymentInstrumentStatusChanged(id, status)  
deactivate MPA  
deactivate SDK  
... Initial Replenishment ...  
note over SDK, MDES #1C1E3F: Just after token activation transaction credentials initial replenishment is performed by SDK\\r. See Transaction Credentials Initial Replenishment diagram  
end  
@enduml

**TSP VTS** VTS Payment token just after digitization is in ACTIVE state and contains transaction credentials making Token ready to use.

@startuml  
autonumber  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "VTS" as VTS  
participant Issuer  
group APPROVED  
VTS --&gt; WS: response from Provision(tokenStatus=ACTIVE)  
activate WS  
opt  
WS -&gt;&gt; Issuer: send Payment Token event  
end  
WS --&gt; SDK: response from Provision(\\ntokenStatus=ACTIVE\\nadditionalAuthenticationRequired=false)  
deactivate WS  
... Profile Provisioning ...  
note over MPA, VTS #1C1E3F: See Profile Provisioning diagram  
... Card Digitization Activation ...  
SDK -&gt; MPA: onPaymentInstrumentStatusChanged(id, status)  
deactivate MPA  
end  
@enduml

##### DECLINE

This digitization outcome refers to red digitization decision.

**TSP MDES**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
group APPROVED  
MDES --&gt; WS : 1. responseFromDigitization(DECLINED)  
activate MDES  
deactivate MDES  
activate WS  
WS --&gt; SDK : 2. response(error)  
deactivate WS  
activate SDK  
SDK --&gt; MPA : 3. result  
deactivate SDK  
activate MPA  
MPA --&gt; User : 4 result  
deactivate MPA  
@enduml

**TSP VTS**

<div id="bkmrk-%40startumlautonumbers-2" style="background-color: #ffffff; color: #080808;">@startuml  
autonumber  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "VTS" as VTS  
participant Issuer  
VTS --&gt; WS: response from Provision(DECLINE)  
activate WS  
opt  
WS -&gt;&gt; Issuer: send Payment Token event  
end  
WS --&gt; SDK: response(error)  
deactivate WS  
activate SDK  
SDK -&gt; MPA: error  
deactivate SDK  
activate MPA  
MPA -&gt; User: error  
deactivate MPA  
deactivate User  
@enduml</div>##### REQUIRE\_ADDITIONAL\_AUTHENTICATION

This digitization outcome always refers to yellow path digitization decision. When digitization is REQUIRE\_ADDITIONAL\_AUTHENTICATION then profile provisioning(See Profile Provisioning) starts automatically but remain INACTIVE until the User is authenticated(see Card Digitization Activation). Flag *additionalAuthenticationRequired* informs if additional user authentication is needed or not.

**TSP MDES**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
participant Issuer  
group REQUIRE\_ADDITIONAL\_AUTHENTICATION  
MDES --&gt; WS : 1. responseFromDigitization(response(additionalAuthenticationRequired=true, authenticationMethods?, tokenInfo, productConfig))  
activate MDES  
deactivate MDES  
activate WS  
opt  
WS -&gt;&gt; Issuer: 2. send Payment Token event  
end  
WS --&gt; SDK : 3. response(response(additionalAuthenticationRequired=true, authenticationMethods?, tokenInfo, productConfig))  
deactivate WS  
activate SDK  
SDK --&gt; MPA : 4. result  
deactivate SDK  
activate MPA  
MPA --&gt; User : 5. result  
deactivate MPA  
... Profile Provisioning ...  
note over MPA, MDES #1C1E3F: See Profile Provisioning diagram  
... Card Digitization Activation ...  
note over MPA, MDES #1C1E3F: See Card Digitization Activation diagram  
end  
@enduml

**TSP VTS**

@startuml  
autonumber  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "VTS Backend" as VTS  
participant Issuer  
group REQUIRE\_ADDITIONAL\_AUTHENTICATION  
VTS --&gt; WS: response from Provision(tokenStatus=INACTIVE, stepUpRequest presents)  
activate WS  
opt  
WS -&gt;&gt; Issuer: send Payment Token event  
end  
WS --&gt; SDK: response from Provision(tokenStatus=INACTIVE,\\nadditionalAuthenticationRequired=true,\\nauthenticationMethods)  
deactivate WS  
deactivate MPA  
... Profile Provisioning ...  
note over MPA, VTS #1C1E3F: See Profile Provisioning diagram  
... Card Digitization Activation ...  
note over MPA, VTS #1C1E3F: See Card Digitization Activation diagram  
end  
@enduml

##### Card Digitization Activation

This process is applicable only if digitization has infomation that additional authentication is required. During this process User can choose one of the additional authentication methods. If user-entered authentication code is chosen then TSP will send authentication code which later should be provided by User for submission. Once user enters correct authentication code, Payment Token is activated by TSP asynchronously. After activation Wallet Server is notified that Payment Token is activated and this information is passed to Wallet SDK. After Payment Token activation, Wallet SDK start Transaction Credentials - Initial Replenishment.

**TSP MDES**

NOTE: Submit authentication value is allowed only if provisioning is finished.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
alt Just after digitization  
MDES --&gt; WS : 1. responseFromDigitization(additionalAuthenticationRequired=true, \\rauthenticationMethods?, tokenInfo,productConfig)  
activate MDES  
activate WS  
WS --&gt; SDK : 2. response(additionalAuthenticationRequired=true, \\rauthenticationMethods?, tokenInfo, productConfig)  
activate SDK  
SDK --&gt; MPA: 3. result(authenticationMethods)  
activate MPA  
else Activation not finished after digitization  
User -&gt; MPA: 4. activate token  
MPA -&gt; SDK: 5. UCP::getAdditionalAuthenticationMethods(paymentInstrumentId)  
SDK -&gt; WS: 6. getAuthenticationMethods(cardId, userSessionToken)  
WS --&gt; SDK: 7. response(authenticationMethods)  
SDK --&gt; MPA: 8. result(authenticationMethods)  
end  
MPA --&gt; User: 9. show authentication methods  
User -&gt; MPA: 10. select authentication method  
MPA -&gt; SDK: 11. UCP::submitTokenAuthenticationMethod(authenticationMethod)  
deactivate MPA  
SDK -&gt; WS: 12. submitTokenAuthenticationMethod(authenticationMethod, userSessionToken)  
deactivate SDK  
WS -&gt; MDES: 13. submitAuthenticationMethod(authenticationMethod)  
deactivate WS  
MDES -&gt; Issuer: 14. deliverAuthCode(authCode)  
deactivate MDES  
activate Issuer  
Issuer -&gt; User: 15. deliver authCode  
deactivate Issuer  
alt Provisioning finished - onProvisioningSuccess(paymentInstrumentId) was called  
User -&gt; MPA: 16. enter authCode  
NOTE LEFT: User should have possibility to enter code\\n only when provisioning finished  
activate MPA  
MPA -&gt; SDK: 17. UCP::submitTokenAuthenticationValue(authCode)  
activate SDK  
SDK -&gt; WS: 18. submitTokenAuthenticationValue(authCode, userSessionToken)  
activate WS  
WS -&gt; WS: 19. checkProvisioningStatus  
WS -&gt; MDES: 20. submitAuthenticationValue(authCode)  
activate MDES  
MDES -&gt; MDES: 21. verify authCode  
MDES --&gt; WS: 22. response  
WS --&gt; SDK: 23. response  
deactivate WS  
SDK --&gt; MPA: 24. response  
deactivate SDK  
deactivate MPA  
MDES -&gt; MDES: 25. createTokenMapping  
MDES -&gt; WS: 26. notifyTokenUpdated(Active)  
deactivate MDES  
activate WS  
opt  
WS -&gt;&gt;Issuer: 27. send Payment Token event  
end  
WS -&gt; SDK: 28. deliverMessage(paymentTokenActive)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
SDK -&gt; SDK: 29. updateTokenStatus  
SDK -&gt; MPA: 30. onPaymentInstrumentStatusChanged(id, status)  
deactivate MPA  
deactivate SDK  
end  
... Initial Replenishment ...  
note over SDK, MDES #1C1E3F: Just after token activation transaction credentials initial replenishment is performed by SDK\\r. See Transaction Credentials Initial Replenishment diagram  
@enduml

**TSP VTS**

@startuml  
autonumber  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "VTS" as VTS  
participant Issuer  
alt Just after digitization  
VTS --&gt; WS: response from Provision(tokenStatus=INACTIVE,\\nstepUpRequest presents)  
activate VTS  
activate WS  
WS --&gt; SDK: response from Provision(\\ntokenStatus=INACTIVE\\nadditionalAuthenticationRequired=true\\nadditionalAuthenticationMethods)  
activate SDK  
SDK --&gt; MPA: result(authenticationMethods)  
activate MPA  
else Activation not finished after digitization  
User -&gt; MPA: activate token  
MPA -&gt; SDK: UCP::getAdditionalAuthenticationMethods(\\r GetAdditionalAuthenticationMethods)  
SDK -&gt; WS: getAuthenticationMethods(paymentTokenId)  
WS --&gt; SDK: response(authenticationMethods)  
SDK --&gt; MPA: result(authenticationMethods)  
end  
MPA --&gt; User: show authenticationMethods  
User -&gt; MPA: select authentication method  
MPA -&gt; SDK: UCP::submitAuthenticationMethod(SubmitAuthenticationMethod)  
deactivate MPA  
SDK -&gt; WS: submitAuthenticationMethod(\\r paymentTokenId, authenticationMethodId)  
deactivate SDK  
WS -&gt; VTS: stepUpRequest(id)  
deactivate WS  
VTS -&gt; Issuer: deliverAuthCode(authCode)  
deactivate VTS  
activate Issuer  
Issuer -&gt; User: deliver authCode  
deactivate Issuer  
alt Provisioning finished  
User -&gt; MPA: enter authentication code  
NOTE LEFT: User should have possibility to enter code\\n only when provisioning finished  
activate MPA  
MPA -&gt; SDK: UCP::submitAuthenticationValue(SubmitAuthenticationValue)  
deactivate MPA  
activate SDK  
SDK -&gt; WS: submitAuthenticationValue(\\r paymentTokenId, authenticationCode)  
activate WS  
WS -&gt; WS: checkProvisioningStatus  
WS -&gt; VTS: validate OTP(authenticationCode)  
activate VTS  
VTS -&gt; VTS: verify OTP  
VTS --&gt; WS: response  
WS --&gt; SDK: response  
deactivate WS  
SDK --&gt; MPA: result  
deactivate SDK  
activate MPA  
MPA -&gt; User: show: please wait  
deactivate MPA  
VTS -&gt; VTS: createTokenMapping  
VTS -&gt; WS: token status updated(Active)  
deactivate VTS  
activate WS  
opt  
WS -&gt;&gt; Issuer: send Payment Token event  
end  
WS -&gt; SDK: deliverMessage(paymentTokenActive)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK -&gt; SDK: updateTokenStatus(ACTIVE)  
SDK -&gt; MPA: onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
activate MPA  
MPA -&gt; User: show: card activated  
deactivate MPA  
end  
... Initial Replenishment ...  
note over SDK, MDES #1C1E3F: Just after token activation transaction credentials initial replenishment is performed by SDK.\\rSee Transaction Credentials Initial Replenishment diagram  
@enduml

#### Handle Message From Server

In whole system there are processes where server needs to send messages to the device. Wallet Server has separate component which is responsible for sending messages to the device. This component uses different channels for message delivery. There are two channels: SSE(Server Sent Events) and RNS(Remote Notification Service). When message is ready for delivery, Wallet Server uses both channels to deliver such message. In first versions of Wallet Server only RNS was used, however sometimes messages were not delivered and to improve delivery new SSE channel was introduced. This channel helps in processes which start from the device and device expects message from the server. Moreover device checks messages which are still not delivered on actions where such messages are expected. Below diagram describes how delivery message process works and how needs to be handled on MPA side.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant "MPA" as MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "RNS" as RNS  
opt  
SDK -&gt; WS: 1. callActionAfterWhichMessageIsExpected  
WS --&gt; SDK: 2. response  
SDK -&gt; WS: 3. openSSEConnection  
end  
WS -&gt; WS: messageReadyForDelivery  
opt If device has opened connection  
WS -&gt; SDK: 4. deliverUsingSSE  
end  
WS -&gt; RNS: 5. deliverMessage  
RNS --&gt; WS: 6. response  
RNS -&gt; MPA: 7. deliverMessage  
MPA -&gt; MPA: 8. checkWalletSenderId  
MPA-&gt; SDK: 9. MDC:CloudMessage#process(pushData)  
SDK -&gt; SDK: 10. deduplicateMessage  
SDK -&gt; WS: 11. acknowledgeMessage  
WS --&gt; SDK: 12. response  
SDK -&gt; SDK: 13. processMessage  
...Obtain pending messages...  
MPA -&gt; SDK: 14. someActionWhereMessageMayBeStillPending  
SDK -&gt; SDK: 15. doAction  
SDK -&gt;&gt; WS: 16. getPendingMessages  
WS --&gt; SDK: 17. response  
SDK -&gt; SDK: do actions from 10 to 13

@enduml

#### Update RNS Token

Wallet Server is responsible for sending push notifications to the Wallet SDK. For that reason RNS token is passed to Wallet Server during pairing device or in some cases is obtained by SDK from MPA whenere is needed. However this token can be <span class="inline-comment-marker" data-ref="7c0abc8d-e6eb-4ccd-bd51-3df8c31751fa">updated</span>. MPA will be notified when token is being updated and then needs to obtain new RNS token and update via Wallet SDK on Wallet Server. Retrieving push notifications and RNS tokens is responsibility of the MPA.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "Remote Notification Service" as RNS  
activate RNS  
RNS -&gt; MPA: 1. onTokenRefresh  
deactivate RNS  
activate MPA  
MPA -&gt; MPA: 2. obtainNewToken(walletFirebase)  
MPA -&gt; SDK: 3. MDC::updateRegistrationToken(newRNSToken)  
activate SDK  
SDK -&gt; WS: 4. updateRNSToken(deviceInstallationId, newRNSToken)  
activate WS  
WS -&gt; WS: 5. updateRNSToken  
WS --&gt; SDK: 6. response  
deactivate WS  
SDK --&gt; MPA: 7. result  
deactivate SDK  
deactivate MPA  
deactivate RNS  
@enduml

#### Profile Provisioning

During this process digitized card profile is delivered to the device. This process is triggered automatically after successful digitization where outcome is APPROVED or REQUIRE\_ADDITIONAL\_AUTHENTICATION. It is not possible to retry provisioning itself. To retry provisioning, previous token needs to be deleted and new digitization called hence when SDK reports that provisioning has failed then given token is automatically deleted and User can perform digitization once again. During process there is few point of failures and provisioning can be not finished at all. In this scenario Payment Tokens which are not provisioned for long period of time are delete by Wallet Server (see Removing Not Provisioned Tokens). From User perspective it can be good approach to treat digitization and provisioning as one process and inform User about steps(if User has to wait more then 1minute from digitzation without any information then can treat this as some failure). From MPA perspective can be also good approach to wait for provisioning status as long as User stays on view dedicated to it. If User wants to cancel the process because provisioning status is not available for long period of time it is recommended to delete Payment Token(see Delete Payment Token via SDK) once User click cancel or back. Thanks to deletion, new digitization can be called and User does not have to wait until Payment Token is deleted by Wallet Server due to lack of provisioning.

**TSP MDES**

Provisioning process is asynchronosus, after digitization profile is provided to Wallet SDK using different channel. Application should wait for 1minute for provisionig success or failure callback.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
MDES-&gt;WS: 1. sendRemoteNotificationMessage(mdesRemoteMessage)  
activate MDES  
deactivate MDES  
activate WS  
WS-&gt; SDK: 2. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK-&gt; MDES: 3. provision  
activate MDES  
MDES --&gt; SDK: 4. response(cardProfile)  
SDK-&gt; MDES: 5. notify provisioning result  
MDES --&gt; SDK: 6. response  
deactivate MDES  
SDK -&gt; SDK: 7. store card profile  
SDK -&gt; WS: 8. confirmProvisioningStatus(SUCCESS/FAILURE)  
activate WS  
alt FAILURE  
WS -&gt; MDES: 9. deleteToken  
activate MDES  
MDES --&gt; WS: 10. response  
deactivate MDES  
WS --&gt; SDK: 11. response  
SDK -&gt; SDK: 12. deleteToken  
SDK -&gt; MPA: 13. onProvisioningFailure  
activate MPA  
MPA -&gt; User: 14. please try again  
deactivate MPA  
else SUCCESS  
WS --&gt; SDK: 15. response  
deactivate WS  
SDK -&gt; MPA: 16. onProvisioningSuccess(paymentInstrument)  
deactivate SDK  
activate MPA  
MPA -&gt; User: 17. card digitized successfully  
deactivate MPA  
end  
@enduml

**TSP VTS**

Provisioning process is part of digitiaztion and called internally after performing cad digitization on Wallet Server. After digitization profile is saved internally, but requires internal communication with 20s timeout. Application should wait or onProvisioningSuccess or onProvisioningFailure.

#### Getting Asset

Every field which's name consists of *assetId* is an identifier to some static asset. This asset can be:

- Card art
- Mastercard brand logos
- Issuers's logos
- Terms and Conditions

There are different types of assets and multiple formats may be supported. For example a single image may be supported in various file formats or variant sizes and most appropriate format to use for a particular device.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "TSP" as TSP  
MPA -&gt; SDK: 1. UCP::getAsset(assetId)  
activate SDK  
SDK -&gt; WS: 2. getAsset(assetId)  
activate WS  
WS -&gt; TSP: 3. get(assetId)  
activate TSP  
TSP --&gt; WS: 4. response(content)  
deactivate TSP  
WS --&gt; SDK: 5. response(content)  
deactivate WS  
SDK --&gt; MPA: 6. result(content)  
deactivate SDK  
@enduml

#### Transaction Credentials Replenishment

Transaction Credentials are unique per transactions keys that are used to calculate cryptograms in transactions. Each set of credentials is linked with a unique Application Transaction Counter (ATC). Each set of credentials can only be used for one transaction. There is a limit (set on MDES onboarding) of transaction credentials stored on device.

<div class="wiki-content" id="bkmrk--17"></div><div id="bkmrk--18"><div class="no-print" id="bkmrk--60"></div></div>##### Transaction Credentials - Automatic Replenishment

After every transaction Wallet SDK checks if number of transaction credentials is below, <span class="inline-comment-marker" data-ref="2bbc5830-4941-47f2-bd97-a3a35569a276">preconfigured during SDK setup, threshold</span>. If yes then SDK will call replenish. During replenish process transaction credentials are being delivered to mobile <span class="inline-comment-marker" data-ref="b8671fd3-4188-4ecc-9fbb-0403986e0acc">application.</span>

<span class="inline-comment-marker" data-ref="b8671fd3-4188-4ecc-9fbb-0403986e0acc">@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
SDK-&gt;SDK: 1. detectTransactionCredentialsRemainingBelowThreshold  
alt Request session if required  
activate SDK  
SDK-&gt; MDES: 2. requestSession  
activate MDES  
MDES--&gt; SDK: 3. response  
MDES-&gt; WS: 4. sendRemoteNotificationMessage(mdesRemoteMessage)  
deactivate MDES  
activate WS  
WS -&gt; SDK: 5. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK-&gt; MDES: 6. replenish  
activate MDES  
MDES-&gt; MDES: 7. checkIfPaymentTokenIsActive  
MDES--&gt;SDK: 8. response(transactionCredentials)  
deactivate MDES  
SDK-&gt;MPA: 9. onReplenishSuccess(paymentInstrument)  
deactivate SDK  
@enduml</span>

##### Transaction Credentials - Initial Replenishment

**TSP MDES**

Initial replenishment is process which starts directly after successful token activation. Wallet SDK is notified by Wallet Server using push notification or refreshing payment instruments. <span class="inline-comment-marker" data-ref="63c21bed-4be0-4176-9511-0039ab9652fe">No action is needed by MP</span>A.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
WS -&gt; SDK: 1. notifyTokenUpdated(Active)  
activate WS  
deactivate WS  
activate SDK  
alt Request session if required  
SDK-&gt; MDES: 2. requestSession  
activate MDES  
MDES--&gt; SDK: 3. response  
MDES-&gt; WS: 4. sendRemoteNotificationMessage(mdesRemoteMessage)  
deactivate MDES  
activate WS  
WS-&gt; SDK: 5. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK-&gt; MDES: 6. replenish  
activate MDES  
MDES-&gt; MDES: 7. checkIfPaymentTokenIsActive  
MDES--&gt;SDK: 8. response(transactionCredentials)  
deactivate MDES  
SDK -&gt; MPA: 9. onReplenishSuccess(paymentInstrument)  
deactivate SDK  
@enduml

**TSP VTS**

VTS Initiali Transaction Credentials Replenishement process depends on token Status after provisioning.   
\* For ACTIVE state replenishment process is not called and LUK is saved immediatelly along Token Profile  
\* For INACTIVE process is called directly after Token Activation

//todo diagram

##### Transaction Credentials - Manual Replenishment

**TSP MDES**

There are scenarios when automatic replenish is not possible <span class="inline-comment-marker" data-ref="59014813-e32f-41fd-bb97-2860cfca193d">(user is not able to connect with Internet)</span> and after some number of transactions, transaction credentials number will decrease to 0. In such case MPA should handle NO\_TRANSACTION\_CREDENTIALS error from transaction listener, show user proper alert and call replenish method manually. MPA can also check number of transaction credentials at any other time.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES as MDES  
MPA -&gt; SDK: 1. UCP::replenishCredentials(paymentInstrumentId)  
activate MPA  
deactivate MPA  
activate SDK  
alt Request session if required  
SDK-&gt; MDES: 2. requestSession  
activate MDES  
MDES--&gt; SDK: 3. response  
MDES-&gt; WS: 4. sendRemoteNotificationMessage  
deactivate MDES  
activate WS  
WS-&gt; SDK: 5. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK-&gt; MDES: 6. replenish  
activate MDES  
MDES-&gt; MDES: 7. checkIfPaymentTokenIsActive  
MDES--&gt;SDK: 8. response(transactionCredentials)  
deactivate MDES  
SDK -&gt; MPA: 9. onReplenishSuccess(paymentInstrument)  
deactivate SDK  
@enduml

**TSP VTS**

VTS uses LUK mechnism which allows to perform transaction after reaching max credentials usage (depends on Issuer configuration, usually 5). Then VTS allow to process up to next 5 transactions until returning DECLINE.  
Verestro SDK along VTS performs LUK Credentials replenishement automatically when internet connection is available.  
//todo verifivation with Visa if Mechanism starts automatically when User enable internet connection or requires start Application.

#### Transacting

Wallet SDK provides functionalities to make contactless payments (using HCE) and e-commerce payments.

<div class="wiki-content" id="bkmrk--22"></div><div id="bkmrk--23"><div class="no-print" id="bkmrk--61"></div></div>##### Contactless Transaction

<span class="inline-comment-marker" data-ref="b7d3ee33-9998-413f-8a70-ebd438c7a880">Contactless transaction uses Android HCE. On MPA side HostApduService should be implemented. Depending on chosen</span> CDCVM and on how transaction is started, user experience is different and MPA should interact with Wallet SDK in different way. The final decision about transaction processing belongs to MPA. Wallet SDK provides transaction information and based on that and User authentication, MPA can advise to proceed, decline or require authentication(if User should be authenticated but was not). For contactless transaction Wallet SDK provides result of transaction. This result is only from the communication between <span class="inline-comment-marker" data-ref="fae99527-edc8-46b7-bebb-f80dd3ed609f">MPA</span> and Terminal. Transaction Processing with <span class="inline-comment-marker" data-ref="f5f5c410-628a-4113-bf98-2dbc95aeed51">Payment Network</span> is done separately (see Transaction Processing). Also after every contactless transaction, Transaction Credentials Replenishment is performed automatically by SDK if needed(see Transaction Credentials - Automatic Replenishment).

NOTE: The way of authentication depends on MPA. For transaction User may also choose specific card. If no card is chosen, SDK will use the one which is set as default for contactless payments. Whenever user is authenticated or chose card for payment MPA should pass this information when *onContactlessPaymentStarted* is called.

As was described above, the final decision(PROCEED, DECLINE, AUTHENTICATION\_REQUIRED) for given transaction is taken on MPA side based on transaction information and User authentication. Because of that reason there could be different scenarios which may occur and transaction experience will be single or double tap.

Sample scenarios:

- User can be already authenticated and if MPA will not decline transaction then will be processed as single tap,
- velocity check counters can be applied and even if User was not authenticated MPA can decide to proceed transaction without authentication, taking decision based on transaction information,
- User was not authenticated but MPA recognised transaction as authentication needed. MPA returns AUTHENTICATION\_REQUIRED decision and and SDK informs MPA that authentication is needed.

**TSP MDES**

All transactions can be performed offline from the MPA perspective.   
In case of lack transaction credentials an transaction will be stopped by Wallet SDK and user requested to replenish credentials.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam maxMessageSize 120  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "HostApduService" as HAS  
participant "Wallet SDK" as SDK  
participant Terminal as TER  
opt User selects particular card for payment  
MPA -&gt; User: 1. showCards  
activate MPA  
User -&gt; MPA: 2. selectCard  
deactivate MPA  
end  
User -&gt; MPA: 3. pay  
User -&gt; TER : 4. contactless 1st tap  
activate TER  
loop  
TER -&gt; HAS: 5. processCommandApdu(commandApdu, extras)  
activate HAS  
HAS -&gt; SDK: 6. UCP::Pay#processHceApduCommand(apdu, extras)  
activate SDK  
group Select PPSE  
SDK -&gt; MPA: 7. onContactlessPaymentStarted()  
activate MPA  
MPA -&gt; MPA: 8. checkIsUserAuthenticated  
alt isAuthenticated=true  
MPA -&gt; SDK: 9. UCP::Pay#setUserAuthenticatedForPayment(paymentInstrumentId, pin?)  
end  
alt selectedCard == null  
SDK -&gt; SDK: 10. useDefaultPaymentInstrumentForContactless  
else selectedCard != null  
MPA -&gt; SDK: 11. UCP::Pay#selectForPayment(selectedPaymentInstrumentId)  
deactivate MPA  
end  
end  
group Generate AC command  
SDK -&gt; MPA: 12. getFinalDecisionForTransaction(isUserAuthenticated,recommendedAdvice, trxInfo)  
activate MPA  
MPA -&gt; MPA: 13. checkTrxAndAuthentication  
MPA --&gt; SDK: 14. result(advice)  
deactivate MPA  
end  
SDK --&gt; HAS: 15. responseApdu  
HAS --&gt; TER: 16. responseApdu  
deactivate HAS  
end  
alt advice=AUTHENTICATION\_REQUIRED  
SDK -&gt; MPA: 17. onAuthRequiredForContactless(paymentInstrument, trxInfo)  
activate MPA  
MPA -&gt; User: 18. show authentication view with trx info  
User -&gt; MPA: 19. authenticate  
User -&gt; TER: 20. contactless 2nd tap  
loop  
TER -&gt; HAS: 21. processCommandApdu(commandApdu, extras)  
activate HAS  
HAS -&gt; SDK: 22. UCP::Pay#processHceApduCommand(apdu, extras)  
group Select PPSE  
SDK -&gt; MPA: 23. onContactlessPaymentStarted()  
MPA -&gt; MPA: 24. checkIsUserAuthenticated  
alt isAuthenticated=true  
MPA -&gt; SDK: 25. UCP::Pay#setUserAuthenticatedForPayment(paymentInstrumentId, pin?)  
end  
alt selectedCard == null  
SDK -&gt; SDK: 26. useDefaultPaymentInstrumentForContactless  
else selectedCard != null  
MPA -&gt; SDK: 27. UCP::Pay#selectForPayment(selectedPaymentInstrumentId)  
end  
end  
group Generate AC command  
SDK -&gt; MPA: 28. getFinalDecisionForTransaction(isUserAuthenticated=true,recommendedAdvice, trxInfo)  
MPA -&gt; MPA: 29. checkTrxAndAuthentication  
MPA --&gt; SDK: 30. result(PROCEED)  
end  
SDK --&gt; HAS: 31. responseApdu  
HAS --&gt; TER: 32. responseApdu  
deactivate HAS  
deactivate TER  
end  
end  
SDK -&gt; MPA: 33. onContactlessPaymentCompleted(paymentInstrument, trxInfo, trxResult)  
deactivate SDK  
MPA -&gt; User: 34. show trx info view  
deactivate MPA  
...Transaction Processing ...  
note over HAS #1C1E3F: See Transaction Processing diagram  
...Transaction Credentials Automatic Replenishment ...  
note over HAS #1C1E3F: See Transaction Credentials Automatic Replenishment diagram  
@enduml

**TSP VTS**

Using MPA in offline mode for perfoming transaction depends on Android Version. Starting from Android 11(API Level 30) payment can be possible without internet connection. For Android version 8-10 VTS SDK performs intenally HTTP request to Visa Security Services and obtain secure session. It's done once until application closed (by User or System).   
Visa uses LUK (Limited Use Key) as transaction credential. During project onboarding Wallet Provider configures credentials threshold and Issuer defines their threshold. Usually values 5 and 10. It means replenish is called after 5 payments, byt Issuer allows to pay up to 10 payments without replenish credentials. Additionally LUK expires after 27 days from replenishement.  
For offline transacion (eg transit) VTS SDK uses ODA certificated which is valid for 2months.

@startuml  
autonumber  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "HostApduService" as HAS  
participant "Wallet SDK" as SDK  
participant Terminal as TER  
participant VTS as VTS  
User -&gt; MPA: tap&amp;pay on Terminal or launch MPA  
activate User  
deactivate User  
alt Verestro SDK not initialized  
... Verestro SDK initialization ...  
MPA -&gt; SDK: initialize MDC SDK &amp; UCP SDK  
activate SDK  
deactivate SDK  
... VTS SDK initialization ...  
SDK -&gt; SDK: VTS#initialize  
activate SDK  
alt Android &gt;= 11  
SDK -&gt; SDK: VTS#VerifyApps offline  
alt VTS#VerifyApps success  
SDK -&gt; SDK: VTS#enableOfflinePayments()  
SDK -&gt; MPA: onPaymentAllowed  
deactivate SDK  
else VTS#VerifyApps failure  
...All Visa card payments will finish with ABORTED due to security verification failed ...  
end

else Android &lt; 11 &amp; user is online  
SDK -&gt; VTS: VTS#DPELogin online  
activate SDK  
alt VTS#DPELogin success  
VTS -&gt; SDK: response(dpeLoginSession)  
SDK -&gt; MPA: onPaymentAllowed  
deactivate SDK  
else VTS#DPELogin failure  
... all Visa card payments will finish with failure (PAYMENT\_NOT\_ALLOWED) ...  
end  
end  
end  
opt User selects particular card for payment  
MPA -&gt; User: showCards  
activate User  
activate MPA  
User -&gt; MPA: selectCard  
deactivate User  
deactivate MPA  
end  
User -&gt; MPA: pay  
activate User  
User -&gt; TER : contactless 1st tap  
deactivate User  
activate TER  
loop  
TER -&gt; HAS: processCommandApdu(commandApdu, extras)  
activate HAS  
HAS -&gt; SDK: UCP::Pay#processHceApduCommand(context, apdu, extras)  
activate SDK  
SDK -&gt; MPA: onContactlessPaymentStarted()  
activate MPA  
SDK -&gt; SDK: Recognize Visa Card and verify\\nif Payment Allowed for Android Version below 11  
alt Payment using Visa Card and VTS not allow to payment  
SDK -&gt; VTS: Async::Perform DPE Login  
SDK --&gt; MPA: onContactlessPaymentAborted(PAYMENT\_NOT\_ALLOWED)\\nMPA must wait for onPaymentAllowed callback  
MPA --&gt; User: Verify internet connection\\nand wait for instructions  
destroy User  
alt DPE login success (requires internet connection)  
VTS --&gt; SDK: Async::DPE login session  
SDK --&gt; MPA: onPaymentAllowed()  
MPA --&gt; User: Request retry payment  
destroy User  
end  
end  
activate SDK  
group Select PPSE  
MPA -&gt; MPA: checkIsUserAuthenticated  
alt isAuthenticated=true  
MPA -&gt; SDK: UCP::Pay#setUserAuthenticatedForPayment(paymentInstrumentId, pin?)  
end  
alt selectedCard == null  
SDK -&gt; SDK: useDefaultPaymentInstrumentForContactless  
else selectedCard != null  
MPA -&gt; SDK: UCP::Pay#selectForPayment(selectedPaymentInstrumentId)  
end  
end  
group Generate AC command  
SDK -&gt; MPA: getFinalDecisionForTransaction(isUserAuthenticated, recommendedAdvice, trxInfo, trxData)  
MPA -&gt; MPA: checkTrxAndAuthentication  
MPA --&gt; SDK: result(advice)  
deactivate MPA  
end  
SDK --&gt; HAS: responseApdu  
HAS --&gt; TER: responseApdu  
deactivate HAS  
end  
alt advice=AUTHENTICATION\_REQUIRED  
SDK -&gt; MPA: onAuthRequiredForContactless(paymentInstrument, trxInfo, trxData)  
activate MPA  
activate User  
MPA -&gt; User: show authentication view with trx info  
User -&gt; MPA: authenticate  
User -&gt; TER: contactless 2nd tap  
deactivate User  
loop  
TER -&gt; HAS: processCommandApdu(commandApdu, extras)  
activate HAS  
HAS -&gt; SDK: UCP::Pay#processHceApduCommand(context, apdu, extras)  
SDK -&gt; MPA: onContactlessPaymentStarted()  
group Select PPSE  
activate MPA  
deactivate MPA  
MPA -&gt; MPA: checkIsUserAuthenticated  
alt isAuthenticated=true  
MPA -&gt; SDK: UCP::Pay#setUserAuthenticatedForPayment(paymentInstrumentId, pin?)  
end  
alt selectedCard == null  
SDK -&gt; SDK: useDefaultPaymentInstrumentForContactless  
else selectedCard != null  
MPA -&gt; SDK: UCP::Pay#selectForPayment(selectedPaymentInstrumentId)  
end  
end  
group Generate AC command  
SDK -&gt; MPA: getFinalDecisionForTransaction(isUserAuthenticated=true, recommendedAdvice, trxInfo, trxData)  
MPA -&gt; MPA: checkTrxAndAuthentication  
MPA --&gt; SDK: result(PROCEED)  
end  
SDK --&gt; HAS: responseApdu  
HAS --&gt; TER: responseApdu  
deactivate HAS  
deactivate TER  
end  
end  
SDK -&gt; MPA: onContactlessPaymentCompleted(paymentInstrument, trxInfo, trxResult, trxData)  
deactivate SDK  
MPA -&gt; User: show trx info view  
deactivate MPA  
...Transaction Processing ...  
note over HAS #1C1E3F: See Transaction Processing diagram  
...Transaction Credentials Automatic Replenishment ...  
note over HAS #1C1E3F: See Transaction Credentials Automatic Replenishment diagram  
@enduml

##### E-commerce transaction

**TSP MDES**

E-commerce transaction can be processed using DSRP. Every DSRP transaction has to be authenticated. Depending on implementation e-commerce payment can be preceded with one time password authentication or just device level authentication.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
box "Consumer mobile android device" #white  
participant "Merchant App" as MerchantApp  
participant MPA  
participant "Wallet SDK" as SDK  
end box  
participant Merchant  
participant "Wallet Server" as WS  
participant MDES  
participant Issuer  
participant "Payment Gateway" as PG  
User -&gt; MerchantApp: 1. pay  
activate MerchantApp  
MerchantApp -&gt; Merchant: 2. startTransaction  
activate Merchant  
Merchant --&gt; MerchantApp: 3. response(transactionId,\\r unpredictableNumber)  
deactivate Merchant  
MerchantApp -&gt; MPA: 4. getDsrpData(transactionId, trxInfo)  
deactivate MerchantApp  
activate MPA  
alt One Time Password  
MPA -&gt; User: 5. select payment instrument  
User -&gt; MPA: 6. payment instrument  
MPA -&gt; SDK: 7. UCP::requestAuthCodeForPayment(transactionId \\ras authenticationRequestId)  
activate SDK  
SDK -&gt; WS: 8. requestAuthenticationCodeForPayment(authenticationRequestId)  
activate WS  
WS -&gt; MDES: 9. requestAuthenticationCodeForPayment(authenticationRequestId)  
activate MDES  
MDES -&gt; Issuer: 10. sendAuthenticationCode  
activate Issuer  
Issuer --&gt; MDES: 11. response  
MDES --&gt; WS: 12. response  
deactivate MDES  
WS --&gt; SDK: 13. response  
deactivate WS  
SDK --&gt; MPA: 14. result  
Issuer -&gt; User: 15. sendAuthenticationCode(authenticationCode)  
deactivate Issuer  
User -&gt; MPA: 16. provide authentication code  
MPA -&gt; SDK: 17. UCP::validateAuthenticationCodeForPayment(authenticationCode,\\r transactionId)  
SDK -&gt; WS: 18. validateAuthenticationCodeForPayment(authenticationCode,\\r authenticationRequestId)  
WS -&gt; MDES: 19. authenticate(authenticationCode,\\r authenticationRequestId)  
MDES --&gt; WS: 20. response  
deactivate MDES  
WS -&gt; WS: 21. createDigitalSignature(authenticationRequestId)  
WS --&gt; SDK: 22. response(digitlSignature)  
SDK --&gt; MPA: 23. result(digitalSignature)  
else Device Level Auth  
MPA -&gt; User: 24. show authentication view  
User -&gt; MPA: 25. authenticate  
end  
MPA -&gt; SDK: 26. UCP::setUserAuthenticatedForPayment(id, pin?)  
MPA -&gt; SDK: 27. UCP::processDsrpTransaction(id, trxInfo)  
SDK --&gt; MPA: 28. result(dsrpData)  
MPA --&gt; MerchantApp: 29. result(dsrpData)  
activate MerchantApp  
MerchantApp -&gt; MerchantApp: 30. encryptPaymentDataForTransit(dsrpData)  
MerchantApp -&gt; Merchant: 31. finishTransaction(encryptedPaymentData, \\rdigitalSignature?, transactionId)  
activate Merchant  
opt  
Merchant -&gt; Merchant: 32. validateSignature  
note right: this check is needed to proof that given transactionId\\n\\r was preceded with OTP  
end  
Merchant -&gt; PG: 33. processPayment(pan, exp, cryptogram)  
activate PG  
PG --&gt; Merchant: 34. response  
Merchant --&gt; MerchantApp: 35. response  
MerchantApp -&gt; User: 36. show result  
deactivate PG  
deactivate Merchant  
deactivate MerchantApp  
@enduml  
  
**TSP VTS**

Not available in Verestro SDK.

##### Transaction Processing

Transaction Processing starts after contactless communication between terminal and MPA in case of contactless payment or after payment gateway transaction authorization initiation in case of e-commerce payment. After authorization TSP notifies Wallet Server about the result of the authorization and sends transaction information. Transaction information is sent to MPA.

**TSP MDES**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "Terminal/PG" as TER  
participant "Payment Network" as PN  
participant MDES  
participant Issuer  
TER -&gt; PN: 1. authorizeTransaction(tokenPAN, cryptogram)  
activate PN  
activate TER  
PN -&gt; MDES: 2. detokenize  
activate MDES  
MDES -&gt; MDES: 3. lookup token mapping  
MDES --&gt; PN: 4. response(PAN)  
deactivate MDES  
PN -&gt; Issuer: 5. authorize(PAN)  
activate Issuer  
Issuer --&gt; PN: 6. response  
deactivate Issuer  
PN --&gt; TER: 7. response  
deactivate TER  
PN -&gt; MDES: 8. storeTransactionDetails  
deactivate PN  
activate MDES  
MDES -&gt; WS: 9. pushTransactionDetails  
deactivate MDES  
activate WS  
alt store transaction enabled  
WS -&gt; WS: 10. storeTransaction  
end  
opt  
WS -&gt;&gt;Issuer: 11. send transaction event  
end  
WS -&gt; SDK: 12. deliverMessage(trxInfo)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK -&gt; MPA: 13. onNewTransaction(trxDetails)  
deactivate SDK  
activate MPA  
MPA -&gt; User: 14. showSystemNotification(trxDetails)  
deactivate MPA  
@enduml  
  
**TSP VTS** //todo works like MDES

#### Setting Defaults for Payment

SDK manages default Payment Instrument for contactless payments. After digitization, if there is no default Payment Instrument, SDK sets digitized Payment Instrument after activation as default. In case where there are more than one active Payment Instruments and current default Payment Instrument is deleted or suspended, the SDK will set first active Payment Instrument as default. Default Payment Instrument can be changed at any time. Only active Payment Instrument can be set as default.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
MPA-&gt;User: 1. payment instrument list  
activate MPA  
User-&gt;MPA: 2. choose default for contactless payment)  
MPA-&gt;SDK: 3. UCP::setDefaultForContactless(paymentInstrumentId)  
activate SDK  
SDK-&gt; SDK: 4. storeDefault  
SDK--&gt;MPA: 5. result  
deactivate MPA  
deactivate SDK  
@enduml

#### Login On Wallet Server

User data are protected by User session token which is issued by Wallet Server after providing authentication factor. Authentication factor is provided first in pairing device and then session is created. Since session has limited period of validity, it needs to be refreshed using login on Wallet Server methods.

<div class="no-print" id="bkmrk--62"></div>Login on Wallet Server using Trusted Identity

<span class="inline-comment-marker" data-ref="9f5a29d0-cb23-4250-8d69-36eb12a9f054">In the Integrated implementation model </span><span class="inline-comment-marker" data-ref="69b19563-486d-488b-83c4-a22b63866f30">User authentication doesn't occur directly on Wallet Server</span><span class="inline-comment-marker" data-ref="9f5a29d0-cb23-4250-8d69-36eb12a9f054">. Wallet Server will require User authentication when some user data will be requested.</span><span class="inline-comment-marker" data-ref="2b4f7219-a07f-4150-8e26-7f7fb8df1303"> If</span><span class="inline-comment-marker" data-ref="9f5a29d0-cb23-4250-8d69-36eb12a9f054"> User session token is no longer valid, </span><span class="inline-comment-marker" data-ref="34504657-2221-4043-a22a-fc5cc2215dc2">SDK will return USER\_UNATHORIZED error</span><span class="inline-comment-marker" data-ref="9f5a29d0-cb23-4250-8d69-36eb12a9f054">. In such case Trusted Identity needs to be prepared on </span><span class="inline-comment-marker" data-ref="5cb1b457-14e4-4c99-96eb-08e5fa81ff03">Issuer server</span><span class="inline-comment-marker" data-ref="9f5a29d0-cb23-4250-8d69-36eb12a9f054"> and sent via Wallet SDK in loginByTrustedIdentity method. </span><span class="inline-comment-marker" data-ref="9f5a29d0-cb23-4250-8d69-36eb12a9f054">MPA can decide whether ask User to provide authentication data or not. The latter case regards situation when user is already authenticated and Trusted Identity can be immediately returned from Issuer based on already valid session on Issuer side</span>. During login process Wallet Server checks if given device still exists, if not then responds with CANT\_FIND\_DEVICE status which is interpreted on SDK side as given device is deleted and all local data stored on SDK side are cleared.

Since MDC 2.14.5 for devices which are already paired, Wallet SDK will try to asynchronously register device in new delivery message service. To make it possible *CloudMessagingRegistrationProvider* needs to be implemented and provided within setup.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "Issuer" as Issuer  
MPA -&gt; SDK: 1. invoke API  
activate MPA  
activate SDK  
SDK -&gt; WS: 2. invoke API  
activate WS  
WS --&gt; SDK: 3. response(USER\_UNATHORIZED)  
deactivate WS  
SDK --&gt; MPA: 4. result(USER\_UNATHORIZED)  
MPA-&gt;User: 5. show authenticate view  
User-&gt;MPA: 6. put authentication data  
MPA-&gt;Issuer: 7. authenticate  
activate Issuer  
Issuer -&gt; Issuer: 8. generateTrustedIdentity - signed user id  
Issuer --&gt; MPA: 9. response(trustedIdentity)  
deactivate Issuer  
MPA-&gt; SDK: 10. MDC::loginByTrustedIdentity(trustedIdentity)  
SDK-&gt; WS: 11. loginByTrustedIdentity(trustedIdentity)  
alt Device not registered in new delivery message service  
SDK -&gt; MPA: 12. CloudMessagingRegistrationProvider::getRegistrationToken  
SDK -&gt;&gt; WS: 13. registerDeviceForNewMessageDelivery(cloudMessageToken)  
WS --&gt; SDK: 14. response  
end  
activate WS  
WS -&gt; WS: 15. check if device exists  
alt device exists  
WS-&gt; WS: 16. verify trusted identity  
WS --&gt; SDK: 17. response(userSessionToken)  
SDK -&gt; SDK: 18. store(userSessionToken)  
SDK--&gt;MPA: 19. result  
MPA -&gt; SDK: 20. invoke API  
else device not exists  
WS --&gt; SDK: 21. response(CANT\_FIND\_DEVICE)  
deactivate WS  
SDK -&gt; SDK: 22. clearAllLocalData  
SDK --&gt; MPA: 23. result(CANT\_FIND\_DEVICE)  
deactivate MPA  
deactivate SDK  
... Pair device ...  
note over MPA, WS #1C1E3F: See Pairing Device diagram  
MPA -&gt; SDK: 24. invoke API  
end  
@enduml

#### Getting Cards

When cards are already placed on Wallet Server, then they can be displayed to User in the application. Cards have identifiers which can be used e.g. for digitization.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
MPA-&gt;SDK: 1. MDC::getAllCards  
activate MPA  
activate SDK  
SDK -&gt; WS: 2. getAllCards(userSessionToken)  
WS --&gt; SDK: 3. response(userCards)  
deactivate WS  
SDK --&gt; MPA: 4. result(cardList)  
deactivate SDK  
deactivate MPA  
@enduml

#### Getting Payment Intruments

After digitization process, payment instrument is stored in VCP SDK module of Wallet SDK. Payment instrument in context of VCP SDK is digitized card and contains i<span class="inline-comment-marker" data-ref="c217c90e-aeb1-45cd-b912-b94a8b187a0f">nformation like</span>:

- id (specified id which helps MPA to identify payment instrument which was digitized from MPA),
- status,
- transaction credentials count,
- paymentTokenId etc. .

MPA can get information about all Payment Instruments from the Wallet SDK at any time. Payment instruments will be retrieved only from local storage that is part of SDK. Payment Tokens for Payment Instruments can be refreshed/pulled from Wallet Server on demand. This scenario should be considered only when User e.g. makes swipe to refresh.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant "Issuer" as IS  
MPA-&gt;SDK: 1. UCP::getAllPaymentInstruments(refresh)  
activate MPA  
alt refresh = true  
activate SDK  
SDK -&gt; WS: 2. getAllPaymentTokens(userSessionToken)  
activate WS  
WS -&gt; SDK: 3. response(devicePaymentTokens)  
deactivate WS  
SDK -&gt; SDK: 4. updateLocalStorage  
end  
SDK --&gt; MPA: 5. result(paymentInstrumentList)  
deactivate SDK  
deactivate MPA  
@enduml

#### Getting Transaction History

<span class="inline-comment-marker" data-ref="219e0d06-3d08-4c8e-b07b-edf00a9646e4">It is possible that transaction history will be stored on Wallet Server for infinite time</span>. <span class="inline-comment-marker" data-ref="9a21ab0b-13b1-4d44-a1c2-d37b19917ae3">This should be specified during onboarding.</span> <span class="inline-comment-marker" data-ref="d3c6fb05-0ad6-4801-a5a5-0b57de8724a4">If this options is enabled, MPA can retrieve transaction history for given user and filtering.</span> Transactions are returned in corresponding parts for better user experience. If next part is available then response from previous part contain information needed for requesting next part. MPA should check if next part is not empty and then make another request.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
loop next != null  
MPA-&gt;SDK: 1. MDC::getTransactionsHistory(filters, next?)  
activate MPA  
activate SDK  
SDK -&gt; WS: 2. getTransactionHistory(filters, next?, userSessionToken, ...)  
activate WS  
WS -&gt; SDK: 3. response(transactionHistoryList, next?)  
deactivate WS  
SDK --&gt; MPA: 4. result(transactionHistoryList, next?)  
deactivate SDK  
deactivate MPA  
end  
@enduml

#### Payment Token Lifecycle Management via SDK

Payment Token lifecycle management can be done via SDK.

<div class="no-print" id="bkmrk--63"></div>##### Delete Payment Token via SDK

Payment Token can be deleted using SDK.

**TSP MDES**

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant Issuer  
User -&gt; MPA: 1. Delete payment token  
activate MPA  
MPA -&gt; SDK: 2. UCP::delete(paymentInstrumentId, reason)  
deactivate MPA  
activate SDK  
SDK -&gt; WS: 3. deletePaymentToken(userSessionToken, paymentTokenId, reason)  
activate WS  
WS -&gt; MDES: 4. Delete token  
activate MDES  
MDES -&gt; MDES: 5. Delete token mapping  
MDES --&gt; WS: 6. response  
deactivate MDES  
WS --&gt; SDK: 7. response  
opt  
WS -&gt;&gt; Issuer: 8. send Payment Token event  
end  
deactivate WS  
alt Request session if required  
SDK -&gt; MDES: 9. request session  
activate MDES  
MDES --&gt; SDK: 10. response  
MDES -&gt; WS: 11. sendRemoteNotificationMessage  
deactivate MDES  
activate WS  
WS -&gt; SDK: 12. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK -&gt; MDES: 13. delete(tokenUniqueReference)  
activate MDES  
MDES --&gt; SDK: 14. response  
deactivate MDES  
SDK -&gt; SDK: 15. Delete transaction credentials, card profile  
SDK -&gt; MPA: 16. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
MPA --&gt; User: 17. show update view  
deactivate MPA  
@enduml

**TSP VTS**

//todo works like MDES

#### Errors Reporting

<span class="inline-comment-marker" data-ref="52e5d7e3-97f6-45df-ad12-9c992171ea03">Wallet SDK performs some security checks. When any issue is detected, Wallet SDK reports error to Wallet Server and clears own data. Also notification to MPA is called.</span>

<span class="inline-comment-marker" data-ref="52e5d7e3-97f6-45df-ad12-9c992171ea03">@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
SDK -&gt; SDK: 1. detectSecurityIssue  
activate SDK  
SDK -&gt; SDK: 2. clearSDKData  
SDK -&gt; WS: 3. reportSecurityIssue  
activate WS  
deactivate WS  
deactivate SDK  
SDK -&gt; MPA: 4. onSecurityIssueAppeared(event)  
activate MPA  
deactivate MPA  
MPA -&gt; User: 5. show information  
@enduml  
</span>

#### Device Unpairing

Unpairing device clears all modules data and report that fact only if possible to server. If server receives this signal then removes all device data including provisioned Payment Tokens. If not then data are cleared locally only - similar like during app uninstallation. This can be used for scenario when MPA does not want to use SDK at all or for scenario when MPA supports switching between users accounts on the same installation. If MPA detects that new User is trying to log into application in case when previous had digitized cards, immediately should clear all data from previous, since SDK stores data in context of one User only.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
MPA -&gt; SDK: 1. MDC::unpairDevice  
activate MPA  
activate SDK  
opt  
SDK -&gt; WS: 2. unpairDevice  
activate WS  
WS --&gt; SDK: 3. response  
deactivate WS  
end  
SDK -&gt; SDK: 4. clearAllData  
SDK --&gt; MPA: 5. result  
deactivate SDK  
deactivate MPA  
@enduml

#### MDES Initiated

This section describes use cases which are initiated from MDES.

<div class="no-print" id="bkmrk--64"></div>##### Re-digitization

Re-digitization process can be triggered by MDES for several use cases:

**Token Expiry**

One month before token expiry MDES will request for redigitization.

**Attribute Change**

Issuer may perform an attribute change at the BIN account-range level impacting theri MDES enabled ranges. Some device tokens may need to have their data refreshed to match the new attributes.

**BIN Account-Range Split**

Issuer may perform a BIN account-range split. Some existing tokens may need to be updated to ensure that they are linked to the correct funding BIN account ranges internally.

**PAN Update in Different Account Range**

Issuer may update existing PAN with new Pan in a different BIN account range.

For above cases:

- token unique reference remains the same
- token expiration date is extended by three years from the date of redigitization

After successful redigitization process transaction credentials replenishment is called in case where Payment Token is active.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
MDES -&gt; WS: 1. notifyTokenUpdated(redigitize=true)  
activate MDES  
activate WS  
WS -&gt; MDES: 2. redigitize  
MDES --&gt; WS: 3. response  
WS --&gt; MDES: 4. response  
deactivate MDES  
deactivate WS  
MDES-&gt;WS: 5. sendRemoteNotificationMessage(mdesRemoteMessage)  
activate MDES  
deactivate MDES  
activate WS  
WS-&gt; SDK: 6. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK-&gt; MDES: 7. provision(redigitize=true)  
activate MDES  
MDES --&gt; SDK: 8. response(cardProfile)  
SDK-&gt; MDES: 9. notify provisioning result(redigitize=true)  
MDES --&gt; SDK: 10. response  
SDK -&gt; WS: 11. confirmReProvisioningStatus(SUCCESS/FAILURE)  
alt FAILURE  
WS -&gt; WS: 12. markRedigitizationAsFailed  
note left: redigitization process will be retried after some period of time  
SDK -&gt; MPA: 13. onReProvisioningFailure(paymentInstrument)  
else SUCCESS  
SDK -&gt; SDK: 14. clearTransactionCredentials  
SDK -&gt; MPA: 15. onReProvisioningSuccess(paymentInstrument)  
deactivate SDK  
MDES -&gt; WS: 16. notifyTokenUpdated(redigitized=false)  
deactivate MDES  
activate WS  
opt  
WS -&gt;&gt; Issuer: 17. send Payment Token event  
end  
WS -&gt; SDK: 18. deliverMessage(PAYMENT\_TOKEN\_INFO\_CHANGE(redigitized=true))  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK -&gt; SDK: 19. replenish  
... Automatic Replenishment ...  
note over SDK, MDES #1C1E3F: Just after reprovisioning transaction credentials initial replenishment is performed by SDK\\r. See Transaction Credentials Initial Replenishment diagram  
end  
@enduml

#### Wallet Server Initiated

Since important processes are asynchronous in MDES and there are many point of failures, wallet server provides additional functionalities to resolve some failure scenarios by running some operations on own side.

<div class="no-print" id="bkmrk--65"></div>##### Removing Not Provisioned Tokens

Wallet Server checks periodically DEVICE Payment Tokens and verify if provisioning is completed. These Payment Tokens which have provisioning status in progress for long period of time are deleted automatically and from User perspective process needs to be started again. By default this period is set to 1 hour but can be modified.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
WS -&gt; WS: 1. find not provisioned payment tokens for a\\r long period of time  
activate WS  
loop Not provisioned payment tokens for a long period of time  
WS -&gt; MDES: 2. Delete token  
activate MDES  
MDES -&gt; MDES: 3. Delete token mapping  
MDES --&gt; WS: 4. response  
deactivate MDES  
opt  
WS -&gt;&gt; Issuer: 5. send Payment Token event  
end  
WS -&gt; SDK: 6. deliverMessage(paymentTokenDelete)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
alt Request session if required  
SDK -&gt; MDES: 7. request session  
activate MDES  
MDES --&gt; SDK: 8. response  
MDES -&gt; WS: 9. sendRemoteNotificationMessage  
deactivate MDES  
activate WS  
WS -&gt; SDK: 10. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK -&gt; MDES: 11. delete(tokenUniqueReference)  
activate MDES  
MDES --&gt; SDK: 12. response  
deactivate MDES  
SDK -&gt; SDK: 13. Delete transaction credentials, card profile  
SDK -&gt; MPA: 14. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
end  
deactivate MPA  
@enduml

#### Wallet Server Admin API Initiated

This section describes use cases which are initiated from Wallet Server Admin Panel.

<div class="no-print" id="bkmrk--66"></div>##### Admin Card Deletion

During this process all data related to given card are deleted. Payment Tokens are deleted asynchronously.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant "Admin Panel" as AP  
participant Issuer  
AP -&gt; WS: 1. deleteCard(cardId)  
activate WS  
activate AP  
WS -&gt; WS: 2. deleteCard  
WS --&gt; AP: 3. response  
deactivate AP  
loop All Payment Tokens for card  
WS -&gt; MDES: 4. Delete token  
activate MDES  
MDES -&gt; MDES: 5. Delete token mapping  
MDES --&gt; WS: 6. response  
deactivate MDES  
opt  
WS -&gt;&gt;Issuer: 7. send Payment Token event  
end  
WS -&gt; SDK: 8. deliverMessage(paymentTokenDelete)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
alt Request session if required  
SDK -&gt; MDES: 9. request session  
activate MDES  
MDES --&gt; SDK: 10. response  
MDES -&gt; WS: 11. sendRemoteNotificationMessage  
deactivate MDES  
activate WS  
WS -&gt; SDK: 12. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK -&gt; MDES: 13. delete(tokenUniqueReference)  
activate MDES  
MDES --&gt; SDK: 14. response  
deactivate MDES  
SDK -&gt; SDK: 15. Delete transaction credentials, card profile  
SDK -&gt; MPA: 16. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
end  
deactivate MPA  
@enduml

##### Admin Device Deletion

During this process all data related to given device are deleted. Payment Tokens are deleted asynchronously.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant "Admin Panel" as AP  
AP -&gt; WS: 1. deleteDevice(deviceInstallationId)  
activate AP  
activate WS  
WS --&gt; AP: 2. response  
deactivate AP  
loop All Payment Tokens for given device  
WS -&gt; MDES: 3. delete token  
activate MDES  
MDES --&gt; WS: 4. response  
deactivate WS  
deactivate MDES  
end  
@enduml


##### Admin Token Deletion

Payment Token can be deleted via admin panel.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant "Admin Panel" as AP  
AP -&gt; WS: 1. deletePaymentToken(paymentTokenId)  
activate AP  
activate WS  
WS -&gt; MDES: 2. Delete token  
activate MDES  
MDES -&gt; MDES: 3. Delete token mapping  
MDES --&gt; WS: 4. response  
deactivate MDES  
WS --&gt; AP: 5. response  
deactivate AP  
opt  
WS -&gt;&gt; Issuer: 6. send Payment Token event  
end  
WS -&gt; SDK: 7. deliverMessage(paymentTokenDeleted)  
deactivate WS  
activate SDK  
NOTE LEFT: See: Handle Message From Server  
deactivate MDES  
alt Request session if required  
SDK -&gt; MDES: 8. request session  
activate MDES  
MDES --&gt; SDK: 9. response  
MDES -&gt; WS: 10. sendRemoteNotificationMessage  
deactivate MDES  
activate WS  
WS -&gt; SDK: 11. deliverMessage(mdesRemoteMessage)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
end  
SDK -&gt; MDES: 12. delete(tokenUniqueReference)  
activate MDES  
MDES --&gt; SDK: 13. response  
deactivate MDES  
SDK -&gt; SDK: 14. Delete transaction credentials, card profile  
SDK -&gt; MPA: 15. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
MPA --&gt; User: 16. show update view  
deactivate MPA  
@enduml


##### Admin Token Suspension

Payment Token can be suspended via admin panel.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant "Admin Panel" as AP  
participant Issuer  
AP -&gt; WS: 1. suspendToken(paymentTokenId)  
activate WS  
activate AP  
WS -&gt; MDES: 2. suspend token  
activate MDES  
MDES -&gt; MDES: 3. Suspend token  
MDES --&gt; WS: 4. response  
deactivate MDES  
WS --&gt; AP: 5. response  
deactivate AP  
opt  
WS -&gt;&gt; Issuer: 6. send Payment Token event  
end  
WS -&gt; SDK: 7. deliverMessage(paymentTokenSuspend)  
NOTE LEFT: See: Handle Message From Server  
deactivate WS  
activate SDK  
SDK -&gt; SDK: 8. suspend  
SDK -&gt; MPA: 9. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
deactivate MPA  
@enduml

##### Admin Token Unsuspension

Payment Token can be unsuspended via admin panel.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant "Admin Panel" as AP  
AP -&gt; WS: 1. unsuspendToken(paymentTokenId)  
activate WS  
activate AP  
WS -&gt; MDES: 2. unsuspend token  
activate MDES  
MDES -&gt; MDES: 3. Unsuspend token  
MDES --&gt; WS: 4. response  
deactivate MDES  
WS --&gt; AP: 5. response  
deactivate AP  
opt  
WS -&gt;&gt;Issuer: 6. send Payment Token event  
end  
WS -&gt; SDK: 7. deliverMessage(paymentTokenUnsuspend)  
deactivate WS  
activate SDK  
SDK -&gt; SDK: 8. activate  
SDK -&gt; MPA: 9. onPaymentInstrumentStatusChanged(id, status)  
deactivate SDK  
deactivate MPA  
... Replenishment ...  
note over SDK, MDES #1C1E3F: Just after token activation transaction credentials replenishment is performed by SDK\\r. See Transaction Credentials Automatic Replenishment diagram  
@enduml

##### Admin User Deletion

During this process all data related to given User are deleted. Payment Tokens are deleted asynchronously.

@startuml  
skinparam ParticipantPadding 30  
skinparam BoxPadding 30  
skinparam noteFontColor #FFFFFF  
skinparam noteBackgroundColor #1C1E3F  
skinparam noteBorderColor #1C1E3F  
skinparam noteBorderThickness 1  
skinparam sequence {  
ArrowColor #1C1E3F  
ArrowFontColor #1C1E3F  
ActorBorderColor #1C1E3F  
ActorBackgroundColor #FFFFFF  
ActorFontStyle bold  
ParticipantBorderColor #1C1E3F  
ParticipantBackgroundColor #1C1E3F  
ParticipantFontColor #FFFFFF  
ParticipantFontStyle bold  
LifeLineBackgroundColor #1C1E3F  
LifeLineBorderColor #1C1E3F  
}  
actor User  
participant MPA  
participant "Wallet SDK" as SDK  
participant "Wallet Server" as WS  
participant MDES  
participant "Admin Panel" as AP  
AP -&gt; WS: 1. deleteUser(userId)  
activate AP  
activate WS  
WS -&gt; WS: 2. delete cards, devices  
WS --&gt; AP: 3. response  
deactivate AP  
loop All Payment Tokens for given User  
WS -&gt; MDES: 4. delete token  
activate MDES  
MDES --&gt; WS: 5. response  
deactivate WS  
deactivate MDES  
end  
@enduml

#### Summary of Changes

This section describes changes introduced in next version based on time

##### Version 2.0

- Base version of the document describing VCP Solution for cards

##### Version 2.1

- Introduced *onContactlessPaymentStarted* in <span style="text-decoration: underline;">Contactless Transaction</span> use case
- Added new use case: <span style="text-decoration: underline;">Handle Message From Server</span>
- Introduced provider for *cloudMessageRegistrationToken* in <span style="text-decoration: underline;">Login On Wallet Server</span> use case
- Updated all use cases with new way of message delivery from server
- Added sending Payment Token event when token is created or updated


<div class="no-print" id="bkmrk--67"></div>