Problems to validate the x-pay-token "Token Validation Failed" code 9159

Solved! Go to solution
alivier
Helper

Problems to validate the x-pay-token "Token Validation Failed" code 9159

WhatsApp Image 2023-08-28 at 6.42.40 PM.jpeg

 

This is the way I have formatted it and I still have problems, What could be wrong?

9 REPLIES 9
API_Products
Visa Developer Support Specialist

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

Hi @alivier,

 

Please see my successful sample request/response payload below. Try your test again and share your result with us. 

 

End Point https://sandbox.api.visa.com/visadirect/fundstransfer/v1/pushfundstransactions
Method POST
Request
{
"amount": "124.05",
"localTransactionDateTime": "2023-08-29T20:23:33",
"senderAddress": "901 Metro Center Blvd",
"pointOfServiceData": {
"panEntryMode": "90",
"posConditionCode": "00",
"motoECIIndicator": "0"
},
"recipientPrimaryAccountNumber": "4957030420210496",
"colombiaNationalServiceData": {
"addValueTaxReturn": "10.00",
"taxAmountConsumption": "10.00",
"nationalNetReimbursementFeeBaseAmount": "20.00",
"addValueTaxAmount": "10.00",
"nationalNetMiscAmount": "10.00",
"countryCodeNationalService": "170",
"nationalChargebackReason": "11",
"emvTransactionIndicator": "1",
"nationalNetMiscAmountType": "A",
"nationalReimbursementFee": "20.00",
"costTransactionIndicator": "0"
},
"cardAcceptor": {
"address": {
"country": "USA",
"zipCode": "94404",
"county": "San Mateo",
"state": "CA"
},
"idCode": "CA-IDCode-77765",
"name": "Visa Inc. USA-Foster City",
"terminalId": "TID-9999"
},
"senderReference": "",
"transactionIdentifier": "381228649430015",
"acquirerCountryCode": "840",
"acquiringBin": "408999",
"retrievalReferenceNumber": "412770451018",
"senderCity": "Foster City",
"senderStateCode": "CA",
"systemsTraceAuditNumber": "451018",
"senderName": "Mohammed Qasim",
"businessApplicationId": "AA",
"settlementServiceIndicator": "9",
"merchantCategoryCode": "6012",
"transactionCurrencyCode": "USD",
"recipientName": "rohan",
"senderCountryCode": "124",
"sourceOfFundsCode": "05",
"senderAccountNumber": "4653459515756154"
}
Response
{
"transmissionDateTime": "2023-08-29T20:26:25.000Z",
"settlementFlags": {
"settlementServiceFlag": "9",
"givUpdatedFlag": "false",
"settlementResponsibilityFlag": "true",
"givPreviouslyUpdatedFlag": "true"
},
"transactionIdentifier": 381228649430015,
"actionCode": "65",
"responseCode": "5"
}
Response Header
Status Code: 200
Server : nginx
Date : Tue, 29 Aug 2023 20:26:25 GMT
Content-Type : application/json;charset=UTF-8
Content-Length : 273
Connection : keep-alive
X-SERVED-BY : -8675d7f8-9m8
X-CORRELATION-ID : 1693340785_247_914830345_-8675d7f8-9m8_VDP_WS
X-APP-STATUS : 200
Content-Language : en-US
Cache-Control : no-cache, no-store, must-revalidate
X-Frame-Options : SAMEORIGIN
X-XSS-Protection : 0
X-Content-Type-Options : nosniff
Strict-Transport-Security : max-age=31536000;includeSubdomains
Pragma : no-cache
Expires : -1
Content-Security-Policy-Report-Only : default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport;
X-Content-Security-Policy-Report-Only : default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport;
X-WebKit-CSP-Report-Only : default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport;
X-XSS-Protection : 1; mode=block
X-Content-Type-Options : nosniff
Strict-Transport-Security : max-age=31536000;includeSubdomains;always

 

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

alivier
Helper

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

I tried your test body, but my problem seems to be due to the way the validation token is.


This is the path I use https://sandbox.api.visa.com/visadirect/fundstransfer/v1/pushfundstransactions

 

WhatsApp Image 2023-08-29 at 4.35.46 PM.jpeg

API_Products
Visa Developer Support Specialist

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

Hi @alivier,

 

The 401 Token Validation Failed error will be seen when the x-pay-token sent in the header is invalid.
A couple of things I'd like you to note while generating the token:
1. For starters, please follow the Quick Start Guide for Developers to generate a valid token. https://developer.visa.com/vdpguide#get-started-overview
2. APIkey in the url query param should be the same as the one used to generate xpayToken
3. “resourcePath” sent in the xpaytoken has to be as per the documentation (eg: v2/payments?apikey={apikey}).
4. Payload sent in the request payload should exactly match along with spaces to the “requestBody” value used in xpaytoken.
 https://developer.visa.com/pages/working-with-visa-apis/visa-developer-quick-start-guide

 

Also, check if you're passing a correct value for URI. For example, make sure it’s defined correctly in the beginning of your code, and use the same value for the URI in the middle of your code. In general, for cases like this (i.e. “helloworld works, but the API XX doesn’t”).

 

If you're still getting an error, provide the information below for investigation.

1. End Point
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.




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

alivier
Helper

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

I really still have the same impediment and I think I have all the correct data to generate the xpaytoken

alivier
Helper

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

I already managed to make it work, but the response is returning 65 instead of 00, why is this happening?

Additionally, I would like to know what would be the field for the CVV collected in this endpoint?

image.png

alivier
Helper

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

{
  amount: "124.05",
  localTransactionDateTime: "DATE",
  senderAddress: "901 Metro Center Blvd",
  pointOfServiceData: {
    panEntryMode: "90",
    posConditionCode: "0",
    motoECIIndicator: "0",
  },
  recipientPrimaryAccountNumber: "4957030420210496",
  cardAcceptor: {
   
    address: {
      country: "USA",
      zipCode: "94404",
      county: "San Mateo",
      state: "CA",
    },
    idCode: "VMT200911026070",
    name: "Visa Inc. USA-Foster City",
    terminalId: "365539",
  },
  // "senderReference": "",
  acquirerCountryCode: "840",
  acquiringBin: "408999",
  retrievalReferenceNumber: "330000550000",
  senderCity: "Foster City",
  senderStateCode: "CA",
  systemsTraceAuditNumber: "451000",
  senderName: "Mohammed Qasim",
  businessApplicationId: "AA",
  settlementServiceIndicator: "9",
  merchantCategoryCode: "6012",
  transactionCurrencyCode: "USD",
  recipientName: "tienda",
  senderCountryCode: "124",
  sourceOfFundsCode: "05",
  senderAccountNumber: "4653459515756154",
}

este es el cuerpo de la solicitud
API_Products
Visa Developer Support Specialist

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

Hi @alivier,

 

Please provide the details below for further investigation. 

1. End Point
2. Request Header
3. Request Body
4. Response Header (include the x-correlation-id)
5. Response Body

You can find the x-correlation-id in the Raw Tab of the response header.

 




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

Hi @alivier,

 

I've logged incident INC16760260 for our engineering/product team to investigate. I'll get back soon.




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.

API_Products
Visa Developer Support Specialist

Re: Problems to validate the x-pay-token "Token Validation Failed" code 9159

Hi @alivier,

 

We get action code 65 when we hit the withdraw button frequency limit per the day. This is a decline coming from VIP on this specific transaction.




Thanks,

Diana



Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.