> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/digitize-a-card/yellow-flow-digitization.md).

# Yellow flow digitization

## Overview

Yellow flow is a **Tokenization** flow where the **issuer backend** approves Tokenization with step-up authentication (**ID\&V**).

This flow is common when the NFC Wallet SDK is integrated into a **digital wallet application** that supports cards from multiple issuers.

In this flow, the **end user** completes ID\&V before Tokenization can complete.

## User experience

See [Yellow flow user experience](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card.md#yellow-flow).

## Sequence diagram

<figure><img src="/files/EH8oJD3StrEArBgGng1F" alt=""><figcaption><p>Yellow flow digitization sequence.</p></figcaption></figure>

## Integrate SDK

After you [Check card eligibility](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/check-card-eligibility.md), implement `MGDigitizationListener` to track digitization progress. Then:

1. Call `MGCardEnrollmentService.digitizeCard(...)`.

   Provide a reference to your `MGDigitizationListener`.
2. If the issuer backend approves Tokenization with step-up authentication (yellow flow), the SDK triggers these callbacks:
   1. `onCPSActivationCodeAcquired`

      You receive the `activationCode` to start the secure provisioning.

      See [Trigger provisioning](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/trigger-provisioning.md).
   2. `onSelectIDVMethod`: Receive the ID\&V methods to display to the end user. See [List and select an ID\&V method](/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/digitize-a-card/yellow-flow-digitization.md#list-and-select-an-id-and-v-method).
   3. `onActivationRequired`: Triggered only if the selected ID\&V method requires activation (for example, OTP).
   4. `onComplete`: Digitization steps is completed successfully.

      if ID\&V methods are:

      1. **cell\_phone**, **email** or **app\_to\_app with cryptogram**: Tokenization is completed
      2. **website**, **customer\_service**, or **app\_to\_app without cryptogram**: Tokenization is completed after your [process CPS notifications](/nfc-wallet-sdk-android/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

{% hint style="info" %}
For the **website**, **customer\_service**, or **app\_to\_app without cryptogram** ID\&V methods, the issuer activates the token using the TSP issuer API.

In this case, provisioning completes only after you [process CPS notifications](/nfc-wallet-sdk-android/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).
{% endhint %}

### List and select an ID\&V method

In `MGDigitizationListener.onSelectIDVMethod`, use `IDVMethodSelector` to list the available ID\&V methods.

`IDVMethodSelector.getIdvMethodList()` returns an array of `IDVMethod` with these fields:

* `id`: Use this value when selecting the method.
* `type`: The ID\&V type (for example, OTP by SMS, OTP by email, or verification by **issuer application**).
* `value`: The display value. The content depends on `type`.
* `isOTPRequired`: Indicates whether the SDK will trigger `onActivationRequired`.

NFC Wallet supports these ID\&V `type` values:

* **cell\_phone**

  ID\&V using an OTP sent by SMS.

  Use `value` to display the masked phone number where the OTP will be sent.
* **email**

  ID\&V using an OTP sent by email.

  Use `value` to display the masked email address where the OTP will be sent.
* **customer\_service**

  ID\&V using a call to issuer customer care.

  Use `value` to display the phone number the end user must call.
* **website**

  The end user completes ID\&V on the issuer website.

  Use `value` to get the website URL.
* **app\_to\_app**

  The **digital wallet application** redirects the end user to the **issuer application**.

  Use `value` to display the issuer application name.

When the end user selects a method, capture its `id` and call `IDVMethodSelector.select(...)` to notify the NFC Wallet backend.

<pre class="language-java" data-expandable="true"><code class="lang-java">// Reference of the idvMethodSelector
IDVMethodSelector idvMethodSelector = null;

<strong>// Methods from interface MGDigitizationListener 
</strong><strong>@Override
</strong>public void onSelectIDVMethod(final IDVMethodSelector idvMethodSelector) {
    if (idvMethodSelector.getIdvMethodList().length == 0) {
        // Log error
    }
    
    this.idvMethodSelector = idvMethodSelector;
    
    displayIdvMethods();
}

// Method to build Dialog UI to display possible ID&#x26;V...
<strong>public void displayIdvMethods() {
</strong>    // ... so list of possible ID&#x26;V using idvMethodSelector
    for (int i = 0; i &#x3C; idvMethodSelector.getIdvMethodList().length; i++) {
        IDVMethod idvMethod = idvMethodSelector.getIdvMethodList()[i];
        String id = idvMethod.getId();
        String type = idvMethod.getType();
        String value = idvMethod.getValue();
        boolean isOtpRequired = idvMethod.isOtpRequired();
        ...
    }
    ...
}

// Method to be called from UI, when the ID&#x26;V method is selected by end user
// Provide the id of the selected idvMethod
public void selectIdvMethod( int idvSelectedMethodId) {
    idvMethodSelector.select( idvSelectedMethodId );
}
</code></pre>

### ID\&V with OTP

If the end user selects **cell\_phone** or **email**, the TSP generates an OTP. Then the TSP requests the issuer to send the OTP by SMS or email.

The NFC Wallet SDK triggers `MGDigitizationListener.onActivationRequired` with `PendingCardActivation.getState()` set to `OTP_NEEDED`.

Your **digital wallet application** must display an OTP entry UI.

After the end user enters the OTP, call `PendingCardActivation.activate(...)` and provide the OTP.

If the OTP is valid, the SDK triggers `MGDigitizationListener.onComplete` callback.

{% hint style="info" %}
**Implement the OTP entry UI**

The NFC Wallet SDK does not provide an OTP entry UI. Implement and customize the UI in your **digital wallet application**.
{% endhint %}

<pre class="language-java" data-expandable="true"><code class="lang-java">// reference to your Card Digitization listener
MyDigitizationListener digitizationListener = new MyDigitizationListener();

// Reference of the pending card activation
PendingCardActivation pendingCardActivation = null;

<strong>// Methods from interface MGDigitizationListener 
</strong><strong>@Override
</strong>public void onActivationRequired (PendingCardActivation pendingCardActivation) {
    this.pendingCardActivation = pendingCardActivation;
    
    PendingCardActivation activationState = pendingCardActivation.getState();
    switch( activationState ) {
        case OTP_NEEDED:
            // display a UI to enter an OTP
            ...
    }
    ...
}

// Method to be called from UI, when the OTP has been provided by end user
public void idvActivationWithOtp( String otp) {
    pendingCardActivation.activate( otp.getBytes(), digitizationListener );
}
</code></pre>

### Customer service or web service ID\&V

If the end user selects **customer\_service** or **website**, the issuer manages ID\&V directly (for example, via an issuer web portal or issuer customer care).

Use `value` to get the web portal URL or the issuer customer care phone number.

After the issuer successfully authenticates the end user, the issuer activates the token using the TSP issuer API.

Then the NFC Wallet backend sends a `CPS` push notification to the digital wallet application.

Process the push as described in [Process CPS notifications](/nfc-wallet-sdk-android/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

### App-to-app ID\&V

In this ID\&V method, the digital wallet application redirects the end user to the issuer application.

The NFC Wallet SDK triggers `MGDigitizationListener.onActivationRequired` with `PendingCardActivation.getState()` set to `APP2APP_NEEDED`.

Use `PendingCardActivation.getAppToAppData()` to retrieve an `AppToAppData` object.

Use `AppToAppData.getPayLoad()`, `AppToAppData.getScheme()`, and `AppToAppData.getSource()` to redirect the end user to the issuer application.

```java
MGCardEnrollmentService enrollmentService = MobileGatewayManager.INSTANCE.getCardEnrollmentService();
PendingCardActivation pendingCardActivation = enrollmentService.getPendingCardActivation(digitalCardId);
PendingCardActivationState state = pendingCardActivation.getState();
if (PendingCardActivationState.APP2APP_NEEDED == state) {
  AppToAppData appToAppData = pendingCardActivation.getAppToAppData();
  if(appToAppData != null) {
    String scheme = appToAppData.getScheme();
    String source = appToAppData.getSource();
    String payload = appToAppData.getPayload();
  // use source to get packageId and intent action to launch issuer application
  }
}
```

After the issuer application completes authentication, it redirects the end user back to the digital wallet application.

There are two variants:

* `AppToApp with cryptogram`: The issuer application generates an issuer cryptogram.
* `AppToApp without cryptogram`: The issuer activates the token using the TSP issuer API.

For `AppToApp with cryptogram`,&#x20;

* call `PendingCardActivation.resumeAppToAppActivation(...)` and provide the issuer cryptogram.
* If the cryptogram is valid,&#x20;
  * The NFC Wallet SDK provisions the digital card profile in the background.
  * and the SDK triggers `MGDigitizationListener.onComplete` callback.

For `AppToApp without cryptogram`,&#x20;

* call `PendingCardActivation.resumeAppToAppActivation()`.&#x20;
* Process the push as described in [Process CPS notifications](/nfc-wallet-sdk-android/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/implement-nfc-wallet/tokenize-a-card/digitize-a-card/yellow-flow-digitization.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
