Dear Apple Pay team,
We are having issues with adding some cards with the extension. Everything seems to go well, we can choose the credit card, and then it is failing, and we have absolutely no idea what could be wrong.
Debit card provisioning with the wallet works, provisioning with the app works, but provisioning some credit cards (some users can, some users cannot) doesnt work, and on the console the only thing we can observe is:
error Passbook PKAddPaymentPassRequest (0x123456): encryptedPassData missing
error Passbook [<private>] ProvisioningOperationComposer: Step 'generateCryptographicMaterial' failed with error Error Domain=PKProvisioningErrorDomain Code=4 UserInfo={NSLocalizedRecoverySuggestion=<private>, NSLocalizedDescription=<private>, NSLocalizedFailureReason=<private>}
Could this be some issue with base64 encoding? In app we just do Data(base64Encoding: , options: []) but in the wallet we saw there is a difference where we replace occurrences of _ with / and - with + (for urlSafe) and we add padding to the base64 string :
while (newBase64String.count %4 != 0 { newBase64String.append("=") }
for some obscure reason, this code was not implemented by me and I dont see the need to do this...
If that is prob not the case for our error, what could it be? how to debug it?