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.
Sequence diagram
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:
Initialized the NFC Wallet SDK. See Initialize the NFC Wallet SDK.
Configured push notifications and retrieved a push token. See Push notifications.
Received the
activationCodefrom digitization. See Digitize a card.
Device enrollment
Device enrollment requires these inputs:
activationCode(byte[]): Returned by digitization.walletId: Retrieve usingMGCardEnrollmentService.getWalletId(). Pass this value as theuserIdparameter toEnrollingBusinessService.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: CallEnrollingBusinessService.enroll(...).ENROLLMENT_IN_PROGRESS: CallEnrollingBusinessService.continueEnrollment(...).ENROLLMENT_COMPLETE: CallProvisioningBusinessService.sendActivationCode(...).
Implement EnrollingServiceListener
Implement EnrollingServiceListener to drive the enrollment flow:
onCodeRequired: Provide theactivationCode.onComplete: Device enrollment completes successfully.onError: Handle errors usingProvisioningServiceError.
Device enrollment code implementation
Last updated
Was this helpful?