Example #1
0
<?php

include "IPN.php";
$ipn = new \PayPal\IPN();
if ($ipn->verify()) {
    // Do on a successful payment
}
Example #2
0
<?php

include "ipn.php";
$ipn = new \PayPal\IPN(array("business" => "*****@*****.**", "currency_code" => "USD"));
$ipn->generateForm(array("item_name" => "Croissant au chocolat", "amount" => "0.80", "quantity" => array("type" => "number", "class" => "quantityCSS", "placeholder" => "Quantity", "required" => "required"), "custom" => json_encode(array("USER_ID" => 12, "FOOD_ID" => 3)), "notify_url" => "http://" . $_SERVER["SERVER_NAME"] . "/process_ipn.php", "return" => "http://" . $_SERVER["SERVER_NAME"] . "/success_payment.php", "cancel_return" => "http://" . $_SERVER["SERVER_NAME"] . "/cancel_payment.php"))->printForm();