In-App Provisioning Internal Server Error 500

We are implementing In-App Provisioning functionality for our Bank but there is always 500 Internal Server Error respond by Apple server once we tried to add card to apple wallet.

Our code

let request = PKAddPaymentPassRequest()
        request.activationData = try decodeBase64(payload.activationDataText, field: "activationDataText")
        request.encryptedPassData = try decodeBase64(payload.encryptedDataText, field: "encryptedDataText")
        request.ephemeralPublicKey = try decodeBase64(payload.ephemeralPublicKeyText, field: "ephemeralPublicKeyText")
        return request

Because of fPanId is not required so we are not pass it to Apple server and that field generated once the card already added to wallet.

Please help us investigate the issue, thanks!

FeedbackId 24065847 (In-App Provisioning 500 Internel Error)

Hi, please help us to check, our development was blocked by this, thanks a lot!

Hi, can someone please give some help on this?

Today we are got another error from Apple server. { statusCode = 500; statusMessages = "CryptoServices HTTP call failed"; }

Can someone please take a look at this issue?

Thanks for the post and for your patience on this. I’m not a PKAddPaymentPassRequest expert, going to try to give you some pointers and see why are you getting that error 500. I would recommend to provide the sysdiagnose to your bug as well to get the team see the errors on the device.

I believe if you are passing an empty PKAddPaymentPassRequest() will immediately fail the provisioning process. However, if you are passing populated data and still getting a 500 error, it means servers attempted to use the public key to decrypt the encryptedPassData and failed. This almost always points to an issue where your backend/payment network did not encrypt the data using the exact certificateChain that was generated on the device?

I would recommend to print the values you are passing with base64Encoded. I personally use the Data class and then add a print statement to make sure the data is correct, you can check manually if the data is been encoded using a third party tool.

Data(base64Encoded: payload.activationDataText),

From the documentation you do not create this request in isolation; it must be created inside the PKAddPaymentPassViewControllerDelegate method called generateRequestWithCertificateChain. Apple Wallet generates a certificateChain on the device. The system passes these to your app via the delegate method, your app uses this payload to create the PKAddPaymentPassRequest and passes it back to Apple via the completionHandler.

https://developer.apple.com/documentation/passkit/pkaddpaymentpassrequest

https://developer.apple.com/documentation/passkit/pkaddpaymentpassviewcontrollerdelegate

Hope this helps, I'll keep an eye out for the sysdiagnose on your bug to be routed to the correct team.

Albert  WWDR

Hi @DTS Engineer , yes we are using this method Data(base64Encoded: payload.activationDataText) and below is the implementation of decodeBase64. And we are according to the Apple guide to compose the PKAddPaymentPassRequest, can you please check the payload I shared in the FeedbackId and can you please help us check if our app on allowlist?

func decodeBase64(_ value: String, field: String) throws -> Data {
    guard let data = Data(base64Encoded: value) else {
        throw ProvisioningCompletionError.invalidBase64(field: field)
    }

    return data
}

Hi @DTS Engineer , I attached sysdiagnose in this FeedbackId, please check, thanks! https://feedbackassistant.apple.com/feedback/24065847

@Jacobs9608 I have checked the FB number and looks like you didn't attached a focus sample project to run the code you have provided.

I would recommend to upload that with your code, thanks for letting me know how decodeBase64 was implemented.

Once the focused sample project is uploaded I'm sure will be routed to the correct team to review and answer you.

Albert  WWDR

Hi @DTS Engineer , can you please check again, I attached the sample code.

@Jacobs9608 Thanks for the post, you've pasted the code in text at the body on the message.

A focused Xcode project that builds and demonstrates the issue. Ideally this will be a new Xcode project created specifically to demonstrate this issue, and which includes only the minimal code and API necessary to reproduce the issue.

Explicit steps to reproduce the issue. These steps should be everything we need to do to see the issue.

You can provide a link to download the project, or archive into a .zip file and attach to the FB number on the app.

Thanks

Albert  WWDR

@DTS Engineer I can not provide the link or our project due to security limitation, and I already attached the log and request payload if you take look at my feedbackId, not sure why you guys can not figure out the issue, I provide the detailes apple required, you need to see what happens in that log exactly.

In-App Provisioning Internal Server Error 500
 
 
Q