PayPal PHP SDK Video Demo
PayPal Classic API
The Classic API is PayPal’s original platform which consists of a variety of NVP or SOAP web services. The functionality provided in the Classic API is currently well ahead of what the REST API provides, and the REST API will not currently do anything that you cannot do with the Classic API. As such, I have personally preferred to stick with the Classic API.
This PayPal PHP SDK fully supports all of the PayPal Classic API calls that are available.
The underlying class library that drives this PayPal PHP SDK is entirely object-oriented and fully extendable for advanced developers. However, you do not need to understand how to work with objects and program in that manner in order to use this SDK.
The library comes complete with fully functional samples for the majority of the PayPal API calls that are available, and it also has empty template files for every call ready to go. All you have to do is open the template file with the name of the API you would like to call, fill out the PHP array parameter values that are prepared for you with your application’s data (ie. session variables, general PHP variables, database values, etc.) and it will handle the rest.
The results of the library are provided in an easy to read PHP array that includes all of the original request data sent to PayPal, the individual response fields returned from PayPal, and a copy of the raw request and response data as well for troubleshooting purposes.
You can have any PayPal API call you need running within minutes!
PayPal GetBalance Usage Sample
// Include required library files. require_once('../includes/config.php'); require_once('../autoload.php'); // Create PayPal object. $PayPalConfig = array( 'Sandbox' => $sandbox, 'APIUsername' => $api_username, 'APIPassword' => $api_password, 'APISignature' => $api_signature, 'PrintHeaders' => $print_headers, 'LogResults' => $log_results, 'LogPath' => $log_path, ); $PayPal = new angelleye\PayPal\PayPal($PayPalConfig); // Prepare request arrays $GBFields = array('returnallcurrencies' => ''); $PayPalRequestData = array('GBFields'=>$GBFields); // Pass data into class and load the response into $PayPalResult $PayPalResult = $PayPal->GetBalance($PayPalRequestData); // Write the contents of the response array to the screen for demo purposes. echo '<pre />'; print_r($PayPalResult);