PayPal Payment API Using CURL PHP

Paypal

PayPal is hottest payment gateway now a days, 60% of site owner using PayPal for exchange money. we can send money to PayPal using two method one is using PayPal form and another is using PayPal API CURL.

Developer can’t get PayPal payment API using CURL code easily in google or the other program so i just express my idea the way to make payment using API in PHP.

Before we start you will need a PayPal merchant account credential to proceed. So let’s create it first, here are the steps for this.

PayPal Developer Account

1. You must login with developer.paypal.com using your live PayPal account credential, define merchant credential.

2. Define client test payment detail.

3. Make your first API call for access token.

4. When you call above API, it returns an access token for payoff API call. So here we are storing access token into a variable for further usage or in exchange for those credentials, PayPal authorization server returns your access token within the access_token field.

5. Final API call for payment.

See above is our final API call base on access token. You can check your payment is gone success or not base on $state variable ($state=$json->state;).

Is return “Success” string once payment is completed other wise “Fail”. If you your payment is success you can insert data in database. Hope you learn some thing new from this post.

For more updates, subscribe to our newsletter service.

10 Comments, RSS

Your email address will not be published. Required fields are marked *

*

four + 7 =