1. Go to this page and download the library: Download brightcweb/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/ */
brightcweb / paypal example snippets
use Brightcweb\Paypal\Myclass\BrightCWebPaypalClass;
class YourController extends Controller
{
protected $BrightCwebPaypalClass;
public function __construct(BrightCWebPaypalClass $BrightCWebPaypalClass)
{
$this->BrightCwebPaypalClass = $BrightCWebPaypalClass;
}
}
public function checkout(Request $req)
{
$amount = $req->amount; // Get order or donation amount
$paymentData = $this->BrightCwebPaypalClass->createPaypalOrder($amount);
return redirect($paymentData['links'][1]['href']);
}