Paypal

Paypal is one of the largest international payment websites. Using Paypal, money can be transferred in different currencies over the world. To use Paypal, legal credentials should be used to sign-up and link a bank account to start making payment.

Several market giants and international companies such as Walmart, etc are using Paypal as their payment method. Signing up in Paypal is easy and free. Paypal helps in several ways to connect vendors and buyers. Of course, we shall not discuss the service of Paypal. Lets, get into the developer Services.

Paypal has a developer page, through which you can create a Paypal developer account and use all the resources to carry out different virtual tests including Rest APIs and simulate different operations which are almost similar to the real operations, calls, and functions of Paypal.

Paypal is one of the best websites where you can get almost all the facilities of using the application and carry out all the simulations in a very easier way.

Creating a Developer Account in Paypal

To create a developer account in Paypal(which is free) you need to sign up with your valid and legal credentials.

Valid and legal credentials mean, done use nicknames or unused emails or invalid phone numbers. If you do so, later you may face a problem to sign in again, and all the applications you create or the tests may be suspended.

Visit the link to get into the Paypal developer Account directly: https://developer.paypal.com/ as you navigate into the page, you will get an option to Sign-in into Dashboard.

postman-paypal-page

Click into the Log into Dashboard, and you will be navigated into the Sign-up page:

postman-create-developer-account

Click on the Sign-Up button and you will be navigated to select Bussiness or Personal account.

postman-paypal-select-account

Select Perso

nal Account and click on the Continue button.

Sometimes Paypal acknowledges that, from which country you are trying to sign up and accordingly, it will prompt you to enter the best combination of credentials which is good for your country standards. I am from India, so automatically it has notified me, you can see at the top of the below image.

postman-paypal-sign-up-page

In the above image, I have not shown my entire email, but you just make sure that you are entering a valid and active email. Then click on Next.

postman-payment-fill-details

I have not shown all the fields, just fill all the fields, and then click Agree and Create Account.

postman-paypal-create-account-final

Now, you may get a page that asks you to link your bank account. But you may simply ignore it and close the page. You are done with your developer Account creation now.

PayPal API Testing using POSTMAN

Once you get into the developer's account of PayPal there are different API which can be used to simulate the actual call by the PayPal Web Application and also the similar responses can be retrieved from the server.

To be more clear, just think that when we want to make a payment using Paypal, a token is generated and using that token the payment is made possible. We shall discuss it in detail in the latter part of this article.

Visit the link to go to the PayPal API Page : https://developer.paypal.com/docs/api/overview/

postman-paypal-get-credential

The steps to be followed are :

  • Create An APP to get the Credentials- Client ID And Secret
  • Generate a Token.
  • Configure POSTMAN.
  • Select the API from the PayPal page you want to simulate.
  • Send Request in POSTMAN to get the response.

Create APP

Once in the above page shown, you click on Get Credentials, you will be navigated to a page prompting for creating APP.

postman-paypal-create-app

Just click the Create App button and fill the details:

postman-name-paypal-app

App Name : myapp (you can use name of your choice). And keep the email in the Sandbox Bussiness Account as it is.

After fillings the App Name, when you click Create App, you must see the below page, which shows you the:

  • App Name
  • SandBox Account
  • Client ID
  • Secret.
The Client ID and the Secret are the two most important credentials, which will need to proceed to any API testing or integrating Paypal's API with third-party software. (Such as POSTMAN, etc)

postman-paypal-sandbox-account-credentials

As shown in the above image, the sandbox account will be automatically created and the email is also generated. Then you can see the Client ID, and you can get the Secret while you click on the show button. When proceeding into the next step, you should not create close this window.

Visit the link and follow the instructions :

https://developer.paypal.com/docs/api/get-an-access-token-postman/

postman-paypal-integration-with-postman

For your convenience, I am writing steps below :

  • I assume that the native POSTMAN native software is already installed in your system.
  • Then Create any Collection and create a new request inside it. Select the method type as: POST.
  • Then in the Request URL bar, enter the URL: https://api.sandbox.paypal.com/v1/oauth2/token
  • Then enter the Client ID in the username and enter the Secret in the Password box.
  • In the body tab of the Request, select x-www-form-urlenclosed.
  • In the Key box, add a variable called grant-type and then put the value as client-credentials.
  • Then click the Send button.

First, open the POSTMAN go to the Authorization Tab, and then select the basic OAuth 2.0 from the drop-down box.

postman-authorization-tab

Then click in the Get New Access Token button and will you will be asked to fill all the details.

postman-get-token-button

Now, fill the credentials :

postman-access-token-credentials

After filling all the credentials, when you click the Request Token button, you will get a response from the server within some seconds. It will appear as a pop-up window:

postman-paypal-access-token

And in the same Access Token window, scroll down to get a button called Use Token. Click into the button to use the token for your current Request.

postman-use-token-button

Now, you are done with configuring the token into POSTMAN. Now, select an API from the PayPal developer's account and start testing your API.

Visit this link to view all the APIs :

https://developer.paypal.com/docs/api/overview/#make-rest-api-calls

Scroll down the left side navigation list to see the APIs. There are several options, such as Payment, Orders, etc. You can choose anyone.

postman-paypal-api-list

I have selected the Payments, so click into the Payments and then all the APIs will be there along with the Request as well as the responses from the server.

postman-paypal-payment-authorization-api-request

Now, copy the highlighted URL from the API Request and paste it into the URL Request bar of POSTMAN. And then hit the Send button, select the method type as: GET.

If everything thing goes well, then the server will send a response:

The Response :

{
  "id": "0VF52814937998046",
  "status": "AUTHORIZED",
  "amount": {
    "total": "10.99",
    "currency": "USD"
  },
  "invoice_id": "INVOICE-123",
  "seller_protection": {
    "status": "ELIGIBLE",
    "dispute_categories": [
      "ITEM_NOT_RECEIVED",
      "UNAUTHORIZED_TRANSACTION"
    ]
  },
  "expiration_time": "2017-10-10T23:23:45Z",
  "create_time": "2017-09-11T23:23:45Z",
  "update_time": "2017-09-11T23:23:45Z",
  "links": [
    {
      "rel": "self",
      "method": "GET",
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046"
    },
    {
      "rel": "capture",
      "method": "POST",
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046/capture"
    },
    {
      "rel": "void",
      "method": "POST",
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046/void"
    },
    {
      "rel": "reauthorize",
      "method": "POST",
      "href": "https://api.paypal.com/v2/payments/authorizations/0VF52814937998046/reauthorize"
    }
  ]
}

Now, you can check other APIs too with the same procedure.

All the time the PayPal server will not send the response, sometimes the token generated also may not get authorized for requests sent by you.

Trouble in Logging into the PayPay Developer's Account?

Sometimes when trying to log in into the PayPal's Developer account, you may face some error like- Page Not Found, or Proxy error. In such cases, you need to use a native application, which will create a virtual proxy and then it will be easier to log in to the Developer's Dashboard of PayPal.

A good example of such an Application is Psiphon. It is a free software easily available and downloadable from the internet. Just download it and then start it, to use Proxy.

Download Here : https://www.psiphon3.com/en/download.html

postman-psiphon-for-paypal

After it gets connected to the network, try loading the PayPal login page, it should work now.

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions