In this tutorial we will show you how to run the “Hello World” Project using Hello World API using the 2 methods of authentication, namely:
The Hello World API is a simple API for testing the connectivity with the Visa Network.
The endpoint for the Hello World API is https://sandbox.api.visa.com/vdp/helloworld
The sample code of the “Hello World” project can be downloaded from the Visa Developer Portal Dashboard under General Assets and are available in the following programming languages: Java, Python, PHP, Ruby, C#, Node JS, Go and testing tools such as Postman and Soap UI.
Once downloaded, extract the visa_helloworld_api_1.0.0.zip to a folder.
The extracted folder will have the following directory structure.
Important links:
Please refer to the articles below which explain step by step how to run "Hello World" sample code:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
X-Pay-Token:
Mutual SSL:
https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl#section3
X-Pay-Token:
For the Nodejs folder, the helloworld.js file reads:
var key = '<YOUR CLIENT CERTIFICATE PATH>';
var cert = '<YOUR PRIVATE KEY PATH>';
It looks like the strings are incorrect & they need to be swapped from one to the other so as to place the correct string file path for the proper variable. Doing this allowed me to run the file successfully & get this:
Example app listening on port 3050.
Status: 200
{ timestamp: '2022-07-06T16:07:19', message: 'helloworld' }
Whereas, before it was just giving
Example app listening on port 3050.
and after a little bit there might be an error in the terminal (if I have the cert & key variables mixed up as they are originally when downloading the folder):
Error: error:0909006C:PEM routines:get_name:no start line
...
{
library: 'PEM routines',
function: 'get_name',
reason: 'no start line',
code: 'ERR_OSSL_PEM_NO_START_LINE'
}
Thus, I think the Nodejs helloworld.js file needs to be modified for these two variable names being mixed up. Might also be worth checking the other programming language folders to see if they run correctly. Other than this, everything worked fine (granted I had to create a package.json file for the imports).
Hi @raba64577,
Good to hear that you got the code to work. Let us know if you need help with anything.