Re: Facing Token Validation Failed in Helloworld api

saisandeep
New Contributor

Facing Token Validation Failed in Helloworld api

Facing an issue in helloworld api only
{
"responseStatus": {
"status": 401,
"code": "9159",
"severity": "ERROR",
"message": "Token Validation Failed",
"info": ""
}
}

Here i am trying to create a x-pay token 

var resourcePath = 'helloworld';
var queryParams = 'apiKey=QM6BVPJH6XNA7RMZGLJG21iNon2ZUrYEA5CDL3sTmKb_-7Xzk';
var sharedSecret = 'UJ8qGPUcz{H2gL1YPUMnaXUIJaMbVp2asi0U6w$3';
var postBody = '';

var timestamp = Math.floor(Date.now() / 1000);  
var preHashString = timestamp + resourcePath + queryParams + postBody;  
var hashString = CryptoJS.enc.Hex.stringify(CryptoJS.HmacSHA256(preHashString, sharedSecret));
var xPayToken = 'xv2:' + timestamp + ':' + hashString;

postman.setEnvironmentVariable('x-pay-token', xPayToken);

Please let me know the issue 
4 REPLIES 4
jenn_kh
Community Moderator

Re: Facing Token Validation Failed in Helloworld api

Hi @saisandeepThank you for reaching out. One of our agents will look into this and get back to you soon. If any community member knows a solution, please feel free to reply to this thread.

saisandeep
New Contributor

Re: Facing Token Validation Failed in Helloworld api

Hi, No Agent is assigned. Its been almost two weeks now and none of the support team has reached out to us.

saisandeep
New Contributor

Re: Facing Token Validation Failed in Helloworld api

Still i am getting the same error. 

API_Products
Visa Developer Support Specialist

Re: Facing Token Validation Failed in Helloworld api

Hi @diana658,

 

Please visit the Visa Developer Error Codes page for cause/resolution. 




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.