Visa Developer Community

Helper

Error in API Cybersource Payments when is payment with point sale with trackData field


Hi!
I write you because I am try the API Cybersource Payments and I need to process a payment with point sale, but when I send trackData field, the response is it is not consistent because when I send this field without the percentage symbol it indicates that it is not valid, but when I send it with the percentage symbol, the api replies that the token is not valid.

Could you please help me solve this error? Will you have an example code of payments through Visa using the Cybersource payment API?

This is resquest example with %:

{ "clientReferenceInformation": {
"code": "APIPAYMENT20190215104236"
},
"processingInformation": {
"commerceIndicator": "retail",
"capture": true
},
"orderInformation": {
"amountDetails": {
"totalAmount": "628.50",
"currency": "USD"
}
},
"pointOfSaleInformation": {
"cardPresent": "Y",
"entryMode": "swiped",
"terminalCapability": "2",
"emv": {
"fallback": "Y",
"fallbackCondition": "1"
},
"trackData": "B4111111111111111^SMITH\\/BETTY^30121200123456789012**\\nXXX******?*;4111111111111111=30121200XXXX00000000?*"
}
}
Response:
{
"status": 400,
"data": {
"submitTimeUtc": "2019-02-15T14:50:41Z",
"status": "INVALID_REQUEST",
"reason": "INVALID_DATA",
"message": "Declined - One or more fields in the request contains invalid data",
"details": [
{
"field": "pointOfSaleInformation.trackData",
"reason": "INVALID_DATA"
}
]
}
}

This is a resquest example without %:
{ "clientReferenceInformation": {
"code": "APIPAYMENT20190215104236"
},
"processingInformation": {
"commerceIndicator": "retail",
"capture": true
},
"orderInformation": {
"amountDetails": {
"totalAmount": "628.50",
"currency": "USD"
}
},
"pointOfSaleInformation": {
"cardPresent": "Y",
"entryMode": "swiped",
"terminalCapability": "2",
"emv": {
"fallback": "Y",
"fallbackCondition": "1"
},
"trackData": "%B4111111111111111^SMITH\\/BETTY^30121200123456789012**\\nXXX******?*;4111111111111111=30121200XXXX00000000?*"
}
}

Response:
{
"status": 401,
"data": {
"responseStatus": {
"status": 401,
"code": "9159",
"severity": "ERROR",
"message": "Token validation failed",
"info": ""
}
}
}

 


Thanks in advance,

regards

4 REPLIES 4
Visa Dev Moderator

Re: Error in API Cybersource Payments when is payment with point sale with trackData field

Hi,

 

For the first request, as described in the response, the data sent is invalid. You have to correct the data format as per specifications of the API and resend it. For the second request, it says token validation failed which means, the x-pay-token sent is invalid. In order to correct this error, you have to send the request within 2 minutes of generating the x-pay-token. Please check the x-pay-token generation logic and try again.

 

Thanks,

Jai

Helper

Re: Error in API Cybersource Payments when is payment with point sale with trackData field

Hi! In the first answer the sandbox respond that trackData field is not valid, that answer is correct but in the second test the visa sandbox should respond equal (just add the percentage symbol) and it is not like that, because, the sandbox respond that token is not valid. It is important to mention that I am using the example code that provides a visa and that works properly for me in the realization of payments, capture, reverse authorization, etc. So far this is failing me when I try to make a payment sending the trackdata field with a %, and for the error it seems that there was some kind of restriction. For example, this trackData "=%B4111111111111111^SMITH/BETTY^30121200123456789012**XXX * *****? *; 4111111111111111 = 30121200XXXX00000000 ? *" is valid but I can not try from api visa because said token is not valid.

Helper

Re: Error in API Cybersource Payments when is payment with point sale with trackData field

hi,

I need to know what restrictions the TrackData field has?

 

I am using the Cybersource API and I try to make a present card type payment but the api is replying token error when sending in TrackData field. Do these VISA apis have any restrictions as to special characters? I did the tests with the example code that you provide with php and python and with both gives the same error when passing that field.

 

Example of the data that I am passing:

 

%B4111111111111111^SMITH/BETTY^30121200123456789012** XXX******?*;4111111111111111=30121200XXXX00000000?*

 

 

Has someone made a Cybersource payment with present card and TrackData?

 

Thank You

Helper

Re: Error in API Cybersource Payments when is payment with point sale with trackData field

Hi!

 

I attach another test that I made from postman where it also gives an error when sending the% character in the trackData field.

 

Test done on postman 

Text Script

 

Please someone will know what I'm missing? or if it is not possible to make payments with the trackData field?

 

regards