PHP code example of delmicio / php-paypal-nvp

1. Go to this page and download the library: Download delmicio/php-paypal-nvp library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

delmicio / php-paypal-nvp example snippets


use delmicio\PayPal;

$paypal = new PayPal(
    'username-facilitator_api1.site.com', // API USER
    'HTPZYVF3YXFYAXXX', // API PWD (password)
    'AFcWxV21C7fd0v3bYYYRCpSSRl31An.zpkEbPtDU3TXXXXXXXXXX', // API SIGNATURE
    true // SANDBOX API
);

$STARTDATE = date(DATE_ATOM, strtotime('-1 year'));
$fields = array(
    "STARTDATE" => $STARTDATE
);

// https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/
$result = $paypal->TransactionSearch($fields);

echo '<pre>'.var_export($result, true).'</pre>'; die();