Hi,
We are trying to enroll a card using Universal Card Enrollment API (https://developer.visa.com/capabilities/visa-in-app-provisioning/reference#tag/Universal-Card-Enroll...)
All done in the sandbox.
The payload before encryption is :
{ "accountNumber": "************7807", "nameOnCard": "Full Name", "expirationDate": { "month": "01", "year": "2025" } }
On the first call the API returns 500 Internal Server Error. We have spent several hours trying to find what was wrong, then realised that when we actually call the api again using exactly same date the api returns 201 CREATED (so all ok).
The curlpit seems to be adding "nameOnCard" field to the payload. When the field is not set, the response is 201 Created on the first call.
Is there anything we are doing wrong or is this a problem with the Sandbox API ?
Best Regards,
Rafal
Solved! Go to Solution
Thank you for reaching out, @rafal1984! An agent is looking into this and will get back to you with more information shortly. In the meantime, if anyone has any ideas that you feel may help, please share them here. - Jenn
Hi @rafal1984,
As a first step, you need to enroll the card using the Universal Card enrollment API for getting the vCardId. You should be encrypting the card object using JWE Asymmetric encryption. Please refer to the attached Encryption Certificate and KID for encrypting the card object. Card Object details can be retrieved from the API Reference page.
Please find below the test data, along with the certificate that is attached to this post.
Encryption Key
VisaPublicKey_ForEncryption_Sbx_Cert.pem |
Visa Public Key used in JWE Asymmetric Encryption. |
Q2AY3V5E3ICNBUU66D8K11hBmzqdXSvTiNzZ-YnpozWRXTo50 |
KID – To be used in JWE Header |
Test Data – VDP Sandbox (sandbox.api.visa.com)
Google Pay
PAN
|
X51X23XX20053999 – Replace X with 4 X51X231XX7208143 |
deviceID |
uztEQocBRFrbK5hCgcDbxqw_ |
Apple Pay
PAN
|
45X42344X3926268 – Replace X with 1 45X4236833852412 |
deviceCert |
MIID/TCCA6OgAwIBAgIIMq/qUa9Z2nMwCgYIKoZIzj0EAwIwgYAxNDAyBgNVBAMMK0FwcGxlIFdvcmxkd2lkZSBEZXZlbG9wZXIgUmVsYXRpb25zIENBIC0gRzIxJjAkBgNVBAsMHUFwcGxlIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRMwEQYDVQQKDApBcHBsZSBJbmMuMQswCQYDVQQGEwJVUzAeFw0xOD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bcrvAVO3UvswA805EHujfL7iVDrbEuJfOSJoAIgBPKehtuILl9x/SJ5kxReiml1zkJqUB8nTy0UOfUNIIQ= |
nonceSignature |
QHuLYArUCO2OZevP0rHc99g9RJp4O1dgsZuVpUdlA7zPWqCDhVQo9Mxr1uPS6GVyjZYo3YElIhHRV4Mv3wEJ3hGOaxK1gResup88QWDK1fL0 |
nonce |
kauVuA== |
Sample Card Object
Card Object
{
"accountNumber": "451X23441392xxxx", replace xxxx with 6268
"nameOnCard": "Google",
"expirationDate": {
"month": "12",
"year": "2022"
},
"cvv2": "533",
"billingAddress": {
"name": "shankar",
"line1": "12301 Research Boulevard",
"line2": "Research Boulevard",
"line3": "Visa USA",
"city": "Austin",
"state": "TX",
"countryCode": "US",
"postalCode": "78759"
}
}
Hi Diana,
As mentioned in my previous post we are encrypting the payload.
The problem is that we are getting 500 error with an encrypted payload when we call the API for the first time for a given card. The second time we call the API (with the same encrypted payload) it works fine. What could be causing that ?
Thanks,
Rafal
Hi @rafal1984,
The 500 internal server error is usually a backend issue with one of the servers. For further investigation, please provide the following information:
1. Endpoint
2. Request Header
3. Request Body
4. Response Header (include the x-correlation-id)
5. Response Body
Using SoapUI, you can find the x-correlation-id in the Raw Tab of the response header.
Hi @rafal1984,
Are you still experiencing an error? If the issue persists, please provide me with the information I requested of you and the x-correlation-id. Once you provide me with this information, I'll send it to our engineering team to investigate.
Hi Diana,
Sorry for not replying earlier but our Visa Project Manager just thrown a spanner in our gears saying that we are not supposed to use Visa In App Provisioning API as it is not yet available in Europe. Could you please confirm availability of these APIs in Europe (https://developer.visa.com/capabilities/visa-in-app-provisioning/reference#tag/In-App-Provisioning-f...)?
Thanks,
Rafal
Hi @rafal1984,
VIAP is currently not available for use in Europe, hence, I'll close your query as resolved since you won't be able to use it in your region. To view API availability in your region, please go to our Availability Matrix and select Europe here: https://developer.visa.com/availability