Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trigger provisioning

Overview

After you digitize a card, start a provisioning session to provision the digital card.

During the provisioning session, the NFC Wallet provisions securly the digital card profile and payment keys in your digital wallet application.

Start the provisioning session right after you receive the activationCode from MGDigitizationListener.onCPSActivationCodeAcquired. See Digitize a card.

This callback also returns digitalCardId. Store it for later operations (for example, access tokens, transaction history, and LCM). You do not need it to start secure provisioning.

This step also sets up the secure channel between the NFC Wallet SDK and the NFC Wallet backend.

This setup is called device enrollment (also known as CPS enrollment).

Sequence diagram

Secure provisioning flow (device enrollment and provisioning session).

SDK integration

Secure provisioning requires device enrollment.

Device enrollment is typically required once per wallet instance on a device. When enrollment is required, the enrollment flow triggers the provisioning session automatically.

If device enrollment is already complete, start the provisioning session by calling ProvisioningBusinessService.sendActivationCode(...).

The SDK requests the activationCode through EnrollingServiceListener.onCodeRequired(...). Provide the value at that time.

Prerequisites

Before you start, make sure you have:

Device enrollment

Device enrollment requires these inputs:

  • activationCode (byte[]): Returned by digitization.

  • walletId: Retrieve using MGCardEnrollmentService.getWalletId(). Pass this value as the userId parameter to EnrollingBusinessService.enroll(...). See Retrieve the wallet ID.

  • pushToken: The push token for FCM or HMS Push Kit.

Check device enrollment status

Check the device enrollment status using EnrollingBusinessService.isEnrolled().

This status indicates whether the secure channel is already established for the current wallet instance on this device.

It returns an EnrollmentStatus:

  • ENROLLMENT_NEEDED: Call EnrollingBusinessService.enroll(...).

  • ENROLLMENT_IN_PROGRESS: Call EnrollingBusinessService.continueEnrollment(...).

  • ENROLLMENT_COMPLETE: Call ProvisioningBusinessService.sendActivationCode(...).

Implement EnrollingServiceListener

Implement EnrollingServiceListener to drive the enrollment flow:

  • onCodeRequired: Provide the activationCode.

  • onComplete: Device enrollment completes successfully.

  • onError: Handle errors using ProvisioningServiceError.

Device enrollment code implementation

Last updated

Was this helpful?