본문 바로가기

[Other API]

Tutorial: How to Connect to Visa APIs using Two-way SSL and Postman.

visa homepage : developer.visa.com/portal/app/4108ac6b-5a22-4b43-9f01-f90289c4ca6c

 

Visa

 

developer.visa.com

동영상 출처 : 

www.youtube.com/watch?v=jFnUqWKXMS0

 

(동영상 영어 자막 내용)

Tutorial: How to connect to visa APIs using Two-way SSL and Postman.

How to get credentials to connect to the visa developer sandbox through two-way ssl authentication then we-re going to test that connection using postman for beginners or anyone who wants to know what two-way ssl is then pause this video and start by watching our what is mutual authentication tutorial to learn about what happens during a ssl handshake and why we use it to secure a connection.

you can select the api you are hoping to use for this demo let's select the foreign exchange rate  api.
now let's go ahead at the bottom and choose the default option generate a csr for me.

prompting you to save your certificate private key we're going to download and copy the certificate private key.
you can only download this key once in other words at this very moment.
so remember to save your private key.

At that point you'll be redirected to the project you created the full list of apis under the foreign exchange rates will be listed.

Remember in order to make a connection to the visa developer sandbox environment
using two-way ssl you need.
1. a private key 
2. A client certificate
3. A certificate authority root cerificate 

We already downloaded our private key.
So now we're gonna walk through where to find the remaining two.

Let's go back to the project dashboard.
And on the left navigation there is a credentials tab let's click it.

 

You'll see we have the project certificate and credentials we also have the user id and password and here we can download the certificate.
This will be your client certificate.You'll see we have the project certificate and credentials we also have the user id and password and here we can download the certificate.
This will be your client certificate.

Let's click on the download certificate to download your project certificate.

 

Be sure to sore your project certificate and the pricate key to a folder that you can easily access byt keep confidential and stay organized.

The next section you'll see common certificates.
Let's download the first one named visa development platform certificate.

This will be your certificate authority root certificate.

 

Next let's download DigiCert certificate.
We can store all of these in the same folder so I'm going to do that right now.

 

 

Okay so now we have all three things we need to create a two-way ssl connection.
A private key, a client certificate and a client authority root certificate something to keep in mind if you are using soap UI to connect to our sandbox you will need to create a key store.

Before you test in the sandbox but since we are using Postman that is not required so we can avoid that extra step and start testing.

Postman is a free and open source api development and testing solution and can be downloaded online.

 

Once it's open let's go to settings add certificate 

 

 

 

Once it's open let's go to settings. 
Add certificate.
Under host type in sandbox.api.visa.com  for the CRT file let's add the  cert.pem we downloaded choose the file from the folder here and upload for the KEY file or your private key let's add that as well from the same folder choose the file here and upload.

Let's add this certificate to Postman settings.

 

 

 

Next we want to connect our visa api project to our local Postman.
All right let's go back to our project dashboard and check out the api reference link from that new tab I created there you'll see what request attributes are needed as well as the response attributes listed.

 

You'll also see we have an api explorer which you can use to play around it includes the request method the endpoint we need to hit the headers we need and a sample payload in the body that we can use.

developer.visa.com/capabilities/foreign_exchange/reference#foreign_exchange__fx

 

https://developer.visa.com/capabilities/foreign_exchange/reference#foreign_exchange__fx

 

developer.visa.com

 

 

 

So we're going to take this endpoint and put it into the url on Postman there you want to change it from get to post.
All right let's get to the good stuff and actually check all of this but using our own certificates in Postman.

So we're going to take this endpoint and put it into the url on Postman there you want to change it from get to post.

 

Now let's copy the payload and in Postman paste it in the body.
It's important that you change the body settings here to raw and json slash application.

 

let's double check everything.
We have the url.
We have the request method.
And we have it as application json 

 

 

Now all we need is the authorization.
We can find in our project dashboard.
Once we're there we have to go to credentials and you'll  see the username and password here.

 

 

 

 

Now Let's head Postman and to authorication and in the drop down for type make sure it says Basic Auth  copy and paste your username then copy and paste your password.

 

 

 

Now we have everything we need so let's run the endpoint.

Look at that you'll see the response which means we have successfully connected to this api using two-way ssl.

We did it we created a visa developer project and establiched a two-way ssl connection to sandbox using Postman.

 

 

 

 

'[Other API]' 카테고리의 다른 글

[Visa] API Key – Shared Secret (X-Pay-Token) [by SOAPUI ]  (0) 2021.02.02
Visa Cyber Source API  (0) 2021.02.02
visa cyber source - memo  (0) 2021.02.01
MTN MoMo Pay Youtube Link  (0) 2020.10.06
GHTK 주문(Java)  (0) 2020.09.17