I am trying to use the new ApplePayJS functionality to submit a payment through Safari.
I AM NOT USING AN APP. I AM DOING THIS IN SAFARI
(This is a brand new feature as of iOS10 - it was not previously possible to use ApplePay in Safari but now it is).
I used the sample code from here https://github.com/AuthorizeNet/sample-code-csharp/blob/master/MobileInappTransactions/CreateAnApple...
All my certificates work fine and I get a token from Apple that I try to send in the opaqueData field in this sample code file. I am taking the data from token.paymentData.data .
However whatever I do I get a frustratingly useless Error 153 : There was an error processing the payment data.
So don't know if I have an issue or Authorize.NET is not set up for ApplePayJS payments yet. Maybe they need to turn a switch on.
I have tried in both the sandbox and the production environments (for Apple sandbox you need to log out of iCloud and log into a dummy account). I get this same error whatever I do.
I am wondering if the dataDescriptor parameter needs to be different for ApplePayJS compared to ApplePay for apps. For instance is there something like "COMMON.APPLE.WEB.PAYMENT" instead of "COMMON.APPLE.INAPP.PAYMENT"?
I have been very careful in configuring everything as needed, and now I'm completely stuck and frustrated.
<createTransactionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<messages>
<resultCode>Error</resultCode>
<message>
<code>E00027</code>
<text>The transaction was unsuccessful.</text>
</message>
</messages>
<transactionResponse>
<responseCode>3</responseCode>
<authCode />
<avsResultCode>P</avsResultCode>
<cvvResultCode />
<cavvResultCode />
<transId>0</transId>
<refTransID />
<transHash>0F9A49F3737ACDD39985D027C40D9C63</transHash>
<testRequest>0</testRequest>
<accountNumber />
<accountType />
<errors>
<error>
<errorCode>153</errorCode>
<errorText>There was an error processing the payment data.</errorText>
</error>
</errors>
<transHashSha2 />
</transactionResponse>
</createTransactionResponse>
Token I get back from Apple (this one is NOT sandbox). I try to use the paymentData.data as my opaqueData:
{"paymentData":{"data":"IIybAsjcfZeh3rBdiDw89HOaV0fl7+G2341C36bvivhAeFOMNtjZ4DnzOx5VhIT3H3ihXdofnz6MgRDDCBWRGXjeHzJoxqVzKjRQn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b3EYKL0xcIqcRDD5tlIPAaVPj5tHYN5qYlyX0BC30=","ephemeralPublicKey":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqbtW8gS4qY1SYqgEf55+Q0guxiBbuo6POFtDc+Fmr96dXfdzPruu8P8iKibg2ZYDoXFWXpSVEMdCiZoMz0X66g==","transactionId":"4a90cba9a8c169cfa610ed5be96be28b82e40b70e8a69fc104816f7f494901f0"},"version":"EC_v1"},"transactionIdentifier":"4A90CBA9A8C169CFA610ED5BE96BE28B82E40B70E8A69FC104816F7F494901F0","paymentMethod":{"network":"AmEx","type":"credit","displayName":"AmEx 3002"}}
09-15-2016 07:06 PM
Hi @simeyla,
Thanks for trying this out. We're hoping to release an update to our Accept Sample App (https://github.com/AuthorizeNet/accept-sample-app) very soon which demonstrates the ApplePay on the Web integration.
For now, can you check that the Apple Merchant ID in your Apple Developer account matches that configured in your Authorize.Net sandbox account?
Also have you registered your domain to your Apple Developer account?
Thanks,
Brian
PS Feel free to email developer.authorize.net and mention my name, that way we can connect over email and troubleshoot this thing together.
09-16-2016 10:32 AM
I just deleted my post from this afternoon, as I have solved this, at least for me. The problem was the
opaqueData field should NOT be just token.paymentData.data . Rather, it shoud be a Base64-encoded JSON string representing the entire token.paymentData object. (This kind of makes sense to me now, as Authorize.net would need the signing certificate to decrypt.) I hope this helps!
09-27-2016 08:43 PM
Thanks for posting back that tip @gaspesla!
09-27-2016 08:57 PM
We've updated our Accept Sample App to support Apple Pay Web.
10-11-2016 09:56 AM
We seem to be having the same issue with the 153 error when using Apple Pay on the Web. We checked the javascript code in the example and it looks like its Base64 encoding the whole object.
Anyone have any thoughts or a working example of interacting with Auth.net / Apple Pay Web?
Cheers
10-31-2016 06:41 AM
Can you please mention what is base 64 encode, as I am seeing it is jwt toke not the base 64 string
02-08-2018 10:30 AM
I'm getting the following error:
Failed Transaction. Error Code: 153 Error message: There was an error processing the payment data. Required fields are missing from decrypted data.
Any help is much appreciated.
02-19-2018 07:01 PM
Have you tried some of the troubleshooting tips here? https://developer.authorize.net/api/reference/responseCodes.html?code=153
Brian
02-19-2018 08:58 PM
Thank you brianac for the reply.
Yes, I tried all the listed tips.
I'm sending the following data as Base64 encoded string:
{
"version": "EC_v1",
"data": "WNVtFqlinW5jrVycU9DyBg3GU8DPRvtEYKrwMLslDemXfPHsAb9c8nKNZDrCUXGW9nriNH7iSWebqBUri2aHQPd3iXY3qaQLedrZCWEC/wx0STV2fuw4phuEZ8HEWf5j7RhKMpUNdQc0f6GRjl7MrHHFMGQsyIe6OLamlt8Vz8e0TIjmFtYd05icGGbvX1jWVvRBHbNbwor070ouQDGKV2xPPM3vgIpauuWlrY9PWWRg8H/wA0bYhwPLFv0yFv9PagYVJDuFwmYabpOLW1gp5McI8BJVk6X8pWYtVnHzQ8VCzaf4tIqnkbnb3fCVxGm9eP678KFHKXfTYzC38tVG1o4N/fe2TavKFvQPimR74Re74Kb7nC1x09iYlJ0KKeBjr5UqRS+ads4mg0gG+rAL7ZvrxM5vH4ZKH79s5aNXFvhhEtS+9xIR+pDDcpMrkiJapx7fAQZ7Vi/d+8Qiyqo2ClpCdFfcBiBvUUExXEuFohkPGWmL1uycok9wws5r3J+uFbQGU5fhlH7Smhx3EtJbp9cBcrLg+XIWfd+WNY1OaJEFxzdeHSaJipUuGQ==",
"signature": "MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID4jCCA4igAwIBAgIIJEPyqAad9XcwCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE0MDkyNTIyMDYxMVoXDTE5MDkyNDIyMDYxMVowXzElMCMGA1UEAwwcZWNjLXNtcC1icm9rZXItc2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AYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMCCCRD8qgGnfV3MA0GCWCGSAFlAwQCAQUAoIGVMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTE4MDIyMDE3NDE1NlowKgYJKoZIhvcNAQk0MR0wGzANBglghkgBZQMEAgEFAKEKBggqhkjOPQQDAjAvBgkqhkiG9w0BCQQxIgQgDPwR2tpjr9vlQfb8yT5IrBxmRIszYNSHq8IEXq8UZ5cwCgYIKoZIzj0EAwIERjBEAiAsRC5Enw38l1RoaxUITxvXJbZ2ldCFaeAUXJpYeQ7ulgIgPivARy1NILujt1nOTjwxGeUpJPtmwqyhjRiTkqFuXwUAAAAAAAA=",
"header": {
"ephemeralPublicKey": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAETCY6vWzJc0Qm6bz4FAWEZ1M9em7Wtt3/p2/qopwNOEQP8HiwXN+qDBnIJwPBT7tTapHx0rzTsPRTije44ARY2A==",
"publicKeyHash": "lFX8QaJ7V3zmnpfd6kIe+lZSBlsIxGkC/kAPSMOuay8=",
"transactionId": "76aaec1e00120ef8504da43848b3e54e5633bc6e05f659d388a6b532de1bcae4"
}
}
I hope this is correct.
But as the error message says
Error message: There was an error processing the payment data. Required fields are missing from decrypted data.
My hunch is the encrypted data is missing some fields?
I'm really stuck. Debugging this issue for more than four days.
Also,
I'm not sure which fields are missing the encrypted data.
Can you provide the required fields that are expected in the encrypted data?
Your help is much appreciated.
02-20-2018 11:42 AM