PHP code example of unetway / paypal

1. Go to this page and download the library: Download unetway/paypal 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/ */

    

unetway / paypal example snippets

`
use Unetway\Paypal\Paypal;

$params = [
   'sandbox' => true,
   'client_id' => '',
   'secret' => '',
];

$data = [];

$paypal = new Paypal($params);
$res = $paypal->createProduct($data);

`
use Unetway\Paypal\Paypal;

$params = [];
$id = '';

$paypal = new Paypal($params);
$res = $paypal->activateSubscriptions($id);

`
use Unetway\Paypal\Paypal;

$params = [];
$id = '';

$paypal = new Paypal($params);
$res = $paypal->suspendSubscriptions($id);

`
use Unetway\Paypal\Paypal;

$params = [];
$id = '';

$paypal = new Paypal($params);
$res = $paypal->cancelSubscriptions($id);

`
use Unetway\Paypal\Paypal;

$params = [];
$id = '';

$paypal = new Paypal($params);
$res = $paypal->reviseSubscriptions($id);

`
use Unetway\Paypal\Paypal;

$params = [];
$data = [];
$id = '';

$paypal = new Paypal($params);
$res = $paypal->updatePricePlan($data, $id);