com.apple.developer.payment-pass-provisioning
entitlement in order to enable adding cards to Apple Pay wallets. You can request this entitlement with Apple following this guide.
When testing this flow, ensure that you are testing with a production card in the production environment. Additionally, ensure that you are testing your app with this flow through TestFlight, as side-loading doesn’t work with in-app provisioning.
PKAddPaymentPassRequestConfiguration
to configure how the card will be displayed, using ECC_V2
as the encryption scheme. Use this to initialize a PKAddPaymentPassViewController
to display the flow for adding the card to Apple Pay. As the user interacts with the flow, the controller will handle requesting Apple Servers for the necessary certificates, which will then get passed back to the generateRequestWithCertificateChain
method.
In your implementation of the generateRequestWithCertificateChain
method, the arguments will contain a list of certificates
, a nonce
, and a nonceSignature
. From the list of certificates, you will take the leaf certificate (the first item), and a subordinate certificate (the second item). You can use the following snippet as a rough reference implementation in your PKAddPaymentPassViewControllerDelegate
for extracting the necessary details and encoding them in base64:
activation_data
, encrypted_pass_data
, and ephemeral_public_key
to create the PKAddPaymentPassRequest
to complete the provisioning.