In-App Provisioning

Simple explanation how to use methods of the SDK.

Check the presence of the card in the wallet

  1. If you do not have cached primaryAccountIdentifier, then you need to call MeaPushProvisioning.initializeOemTokenization to get it.

  2. Check value of primaryAccountIdentifier:

    • primaryAccountIdentifier does not exist: Card was not added to Wallet.

    • primaryAccountIdentifier is obtained:

      • Try to use MeaPushProvisioning.canAddSecureElementPass(withPrimaryAccountIdentifier: primaryAccountIdentifier)/MeaPushProvisioning.canAddPaymentPass(withPrimaryAccountIdentifier: primaryAccountIdentifier) method to check ability to add to iPhone Wallet.

      • if watch is paired, try to use MeaPushProvisioning.remoteSecureElementPassExists(withPrimaryAccountIdentifier: primaryAccountIdentifier)/MeaPushProvisioning.remoteSecureElementPassExists(withPrimaryAccountIdentifier: primaryAccountIdentifier) method to check ability to add to iPhone Wallet.

  3. Show button if:

    • there is no primaryAccountIdentifier.

    • primaryAccountIdentifier exists but card can be added to one of devices (iphone or watch).

Add card to wallet

  1. Use addPaymentPassRequestConfiguration from MeaPushProvisioning.initializeOemTokenization result.

  2. Set addPaymentPassRequestConfiguration.cardholderName

  3. Set addPaymentPassRequestConfiguration.primaryAccountIdentifier from cache or from MeaPushProvisioning.initializeOemTokenization result (if it is not set yet).

  4. Get paymentPassController:

let paymentPassController = PKAddPaymentPassViewController.init(requestConfiguration: addPaymentPassRequestConfiguration!, delegate: self)
  1. Present paymentPassController with .present(...) method of current controller. Read more

  2. Delegate should implement PKAddPaymentPassViewControllerDelegate protocol to call completeOemTokenization:completionHandler: method, once the data is exchanged PKAddPaymentPassRequest is passed to the handler to add the payment card to Apple Wallet. In the end and delegate method is invoked to inform you if request has succeeded or failed. Read more

Extension

Read here what to do in general

Notes

  • IssuerExtensionHandler.status(...) may return requiresAuthentication = false all the time, then you may have base implementation of IssuerAuthorizationExtensionHandler. But in this case you need to transfer access/refresh token (need it to load cards data from your BE) to extension via app group and user defaults or with other methods