Skip to content
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (38 sloc) 1.19 KB
use PayPal\Api\Amount;
use PayPal\Api\Payer;
use PayPal\Api\Payment;
use PayPal\Api\RedirectUrls;
use PayPal\Api\Transaction;
require 'bootstrap.php';
if (empty($_POST['item_number'])) {
throw new Exception('This script should not be called directly, expected post data');
$payer = new Payer();
// Set some example data for the payment.
$currency = 'GBP';
$amountPayable = 10.00;
$invoiceNumber = uniqid();
$amount = new Amount();
$transaction = new Transaction();
->setDescription('Some description about the payment being made')
$redirectUrls = new RedirectUrls();
$payment = new Payment();
try {
} catch (Exception $e) {
throw new Exception('Unable to create link for payment');
header('location:' . $payment->getApprovalLink());
You can’t perform that action at this time.