In-App Provisioning process failure (error 500)

Hello,

We are implementing in-app provisioning in our banking app but are having trouble getting to the Terms & Conditions screen.

User taps on “Add to Apple Wallet” > PKAddPaymentPassViewController > Next > the flow fails quickly with "Could Not Add Card -> Set Up Later" alert.

The only notable thing in the logs, as far as I can see is the

https://nc-pod12-smp-device.apple.com:443/broker/v4/devices/{SEID}/cards 

fails with:

<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>Apple</center>
</body>
</html>

and maybe

ProvisioningOperationComposer: Step 'eligibility' failed with error <PKProvisioningError: severity: 'terminal'; internalDebugDescriptions: '(
    "eligibility request failure",
    "Received HTTP 500"
)'; underlyingError: 'Error Domain=PKPaymentWebServiceErrorDomain Code=0 "Unexpected error." UserInfo={PKErrorHTTPResponseStatusCodeKey=500, NSLocalizedDescription=Unexpected error.}'; userInfo: '{
    PKErrorHTTPResponseStatusCodeKey = 500;
}'; >

Feedback Assistant ID: FB22932141 (Error during In-App Provisioning)

Answered by DTS Engineer in 893633022

Hi @stupid_apple_username,

You wrote:

User taps on “Add to Apple Wallet” > PKAddPaymentPassViewController > Next > the flow fails quickly with "Could Not Add Card -> Set Up Later" alert. [...] Feedback Assistant ID: FB22932141 (Error during In-App Provisioning) [...]

Thanks for the Feedback ID. There are some issues with your in-app provisioning attempts:

  • PKAddPaymentPassRequestConfiguration isn't populated correctly
  • Issuer app isn't allowlisted

PKAddPaymentPassRequestConfiguration isn't populated correctly

Ensure all required fields are set before presenting the view controller:

let config = PKAddPaymentPassRequestConfiguration(encryptionScheme: .ECC_V2)!

config.cardholderName      = "Jane Smith"
config.primaryAccountSuffix = "3673"                    // last 4 of FPAN
config.primaryAccountIdentifier = "<your-stable-card-id>" 
config.paymentNetwork      = .masterCard
config.style               = .payment

let vc = PKAddPaymentPassViewController(requestConfiguration: config, delegate: self)!
present(vc, animated: true)

Note: If primaryAccountIdentifier is invalid, server-side validations can't be performed and provisioning is blocked.

Issuer app isn't allowlisted

Even with a valid primaryAccountIdentifier, the provisioning request can still be blocked due to a failed allowlist check. To request for your issuer's Adam ID to be allow listed, please see the following:

Apple Pay on the Web demo: In-App Provisioning

https://applepaydemo.apple.com/in-app-provisioning#5

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Hello, is there any potential news regarding this?

Hi @stupid_apple_username,

You wrote:

User taps on “Add to Apple Wallet” > PKAddPaymentPassViewController > Next > the flow fails quickly with "Could Not Add Card -> Set Up Later" alert. [...] Feedback Assistant ID: FB22932141 (Error during In-App Provisioning) [...]

Thanks for the Feedback ID. There are some issues with your in-app provisioning attempts:

  • PKAddPaymentPassRequestConfiguration isn't populated correctly
  • Issuer app isn't allowlisted

PKAddPaymentPassRequestConfiguration isn't populated correctly

Ensure all required fields are set before presenting the view controller:

let config = PKAddPaymentPassRequestConfiguration(encryptionScheme: .ECC_V2)!

config.cardholderName      = "Jane Smith"
config.primaryAccountSuffix = "3673"                    // last 4 of FPAN
config.primaryAccountIdentifier = "<your-stable-card-id>" 
config.paymentNetwork      = .masterCard
config.style               = .payment

let vc = PKAddPaymentPassViewController(requestConfiguration: config, delegate: self)!
present(vc, animated: true)

Note: If primaryAccountIdentifier is invalid, server-side validations can't be performed and provisioning is blocked.

Issuer app isn't allowlisted

Even with a valid primaryAccountIdentifier, the provisioning request can still be blocked due to a failed allowlist check. To request for your issuer's Adam ID to be allow listed, please see the following:

Apple Pay on the Web demo: In-App Provisioning

https://applepaydemo.apple.com/in-app-provisioning#5

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

Hmm, tried it but still the same error.

Regarding the primaryAccountIDentifier I thought that was only available after the card is added in the wallet? Isn't that something on which the device can decide on what provisioning options to present to the user e.g: iPhone / Apple Watch? Even in the linked documentation above, there's:

For an iPhone and paired Apple Watch, this method returns true or false using the parameter primaryAccountIdentifier. The PNO provides this parameter, which is only available after the first provisioning of a card. When using this method, the issuer needs to initialize the PKAddPaymentPassRequestConfiguration with the primaryAccountIdentifier for each card after provisioning for the first time in the app.

One more question, does the fact that we can manually add the card to the wallet and the app is able to read those passes correctly, mean that the app has been allow listed? Because currently we can manually add the card, and a "Already added to the Wallet" label is presented to the user.

Should we open the new case, or do we attach a new Feedback logs on this thread?

Hi @stupid_apple_username,

You wrote:

[...] Regarding the primaryAccountIDentifier I thought that was only available after the card is added in the wallet? [...]

Yes, this is correct.

Then, you wrote:

[...] One more question, does the fact that we can manually add the card to the wallet and the app is able to read those passes correctly, mean that the app has been allow listed? Because currently we can manually add the card, and a "Already added to the Wallet" label is presented to the user. [...]

Were you able to review the Demo site and sample code project below?

Implementing Wallet Extensions

https://developer.apple.com/documentation/PassKit/implementing-wallet-extensions

If the same issue occurs with the sample app, then your PNO pass metadata configuration may be invalid, or your passes aren't associated to your issuer app ID.

Lastly, you wrote:

[...] Should we open the new case, or do we attach a new Feedback logs on this thread?

The same Feedback is okay for these issues.

Cheers,

Paris X Pinkney |  WWDR | DTS Engineer

In-App Provisioning process failure (error 500)
 
 
Q