In-App Provisioning

Simple explanation of how to use the SDK methods.

Check the presence of the card in the wallet

  1. If you don't have a cached primaryAccountIdentifier, call MeaPushProvisioning.initializeOemTokenization to get it.
  2. Check the primaryAccountIdentifier value:
    • primaryAccountIdentifier doesn't exist: The card hasn't been added to Wallet.
    • primaryAccountIdentifier exists:
      • Use MeaPushProvisioning.canAddSecureElementPass(withPrimaryAccountIdentifier: primaryAccountIdentifier)/MeaPushProvisioning.canAddPaymentPass(withPrimaryAccountIdentifier: primaryAccountIdentifier) to check if the card can be added to iPhone Wallet.
      • If a watch is paired, use MeaPushProvisioning.remoteSecureElementPassExists(withPrimaryAccountIdentifier: primaryAccountIdentifier)/MeaPushProvisioning.remotePaymentPassExists(withPrimaryAccountIdentifier: primaryAccountIdentifier) to check if the card can be added to Apple Watch.
  3. Show the button if:
    • There's no primaryAccountIdentifier.
    • primaryAccountIdentifier exists but the card can be added to at least one device (iPhone or Watch).

Add card to wallet

  1. Use addPaymentPassRequestConfiguration from the MeaPushProvisioning.initializeOemTokenization result.
  2. Set addPaymentPassRequestConfiguration.cardholderName
  3. Set addPaymentPassRequestConfiguration.primaryAccountIdentifier from cache or from the MeaPushProvisioning.initializeOemTokenization result (if not already set).
  4. Get the paymentPassController:
let paymentPassController = PKAddPaymentPassViewController.init(requestConfiguration: addPaymentPassRequestConfiguration!, delegate: self)
  1. Present the paymentPassController using the current controller's .present(...) method. Read more
  2. Your delegate should implement the PKAddPaymentPassViewControllerDelegate protocol to call the completeOemTokenization:completionHandler: method. Once the data is exchanged, PKAddPaymentPassRequest gets passed to the handler to add the payment card to Apple Wallet. Finally, a delegate method tells you whether the request succeeded or failed. Read more

Extension

Read here for general implementation details

Notes

  • IssuerExtensionHandler.status(...) can always return requiresAuthentication = false, enabling you to create a basic implementation of IssuerAuthorizationExtensionHandler. However, you'll need to transfer your access/refresh token (required to fetch card data from your backend) to the extension using an app group combined with UserDefaults or alternative methods.