Re: How to run the Hello World Project

shameem
Visa Employee

How to run the Hello World Project

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:

 

  • 2-Way (Mutual SSL) with Basic Authentication
  • X-Pay-Token (API Key and Shared Secret) Authentication

 

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.

 

2020-11-23_10-40-01.png

 

Once downloaded, extract the visa_helloworld_api_1.0.0.zip to a folder.

 

The extracted folder will have the following directory structure.

 

2020-11-23_10-46-40.png

 

 

Important links:

 

Please refer to the articles below which explain step by step how to run "Hello World" sample code:

 

  • Java 

Mutual SSL:

https://community.developer.visa.com/t5/Developer-Tools/HelloWorld-java-How-to-run-Java-Sample-Code-...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/HelloWorld-java-How-to-run-Java-Samp...

 

  • C#

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/HelloWorld-cs-How-to-run-CSharp-Samp...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/HelloWorld-cs-How-to-run-CSharp-Samp...

 

  • Python

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-py-How-to-run-Python-Samp...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-py-How-to-run-Python-Samp...

 

  • PHP 

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-php-How-to-run-PHP-Sample...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-php-How-to-run-PHP-Sample...

 

  • GoLang

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-go-How-to-run-GoLang-Samp...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-go-How-to-run-GoLang-Samp...

 

  • Ruby:

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-rb-How-to-run-Ruby-Sample...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-rb-How-to-run-Ruby-Sample...

 

 

  • Node JS

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-js-How-to-run-Node-JS-Sam...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/helloworld-js-How-to-run-Node-JS-Sam...

 

  • Postman

Mutual SSL:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/How-to-run-the-Hello-World-API-with-...

 

X-Pay-Token:

https://community.developer.visa.com/t5/Two-way-SSL-X-Pay-Token/How-to-run-the-Hello-World-API-with-...

 

  • SOAP UI

Mutual SSL:

https://developer.visa.com/pages/working-with-visa-apis/two-way-ssl#section3

 

X-Pay-Token:

https://developer.visa.com/pages/working-with-visa-apis/x-pay-token#testing_xpaytoken_connectivity_u...

2 REPLIES 2
raba64577
Regular Visitor

Re: How to run the Hello World Project

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).

API_Products
Visa Developer Support Specialist

Re: How to run the Hello World Project

Hi @raba64577,

 

Good to hear that you got the code to work. Let us know if you need help with anything. 




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.