Пример #1
0
        } else {
            echo "Fehler beim Abschließen Ihrer Bestellung! (Update failed)";
        }
    } else {
        echo "Fehler beim Abschließen Ihrer Bestellung!";
    }
    // // // // // // // // // // // // // // // // // // // //
    // // // // // // // // // // // // // // // // // // // //
    // // // // // // // // // // // // // // // // // // // //
} else {
    if (isset($_GET["token"], $_GET["PayerID"])) {
        // 		get information about payment and payer
        //  	show button to confirm payment and reload page
        $token = $_GET["token"];
        $payerid = $_GET["PayerID"];
        $PC = new PaypalCredentials("GetExpressCheckoutDetails");
        $PC->setToken($token);
        $PC->setUser($paypal_user);
        $PC->setPw($paypal_pw);
        $PC->setSignature($paypal_signature);
        $parameter = array();
        $curl = curl_init();
        curl_setopt_array($curl, array(CURLOPT_RETURNTRANSFER => 1, CURLOPT_URL => 'https://api-3t.sandbox.paypal.com/nvp/?' . $PC->getRequestString(), CURLOPT_USERAGENT => 'Codular Sample cURL Request'));
        foreach (explode('&', curl_exec($curl)) as $chunk) {
            $param = explode("=", $chunk);
            if ($param) {
                $parameter = array_merge($parameter, array(urldecode($param[0]) => urldecode($param[1])));
            }
        }
        curl_close($curl);
        if ($parameter["ACK"] == "Success") {
Пример #2
0
// // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // //
// 		Parameters get from mobile device
if (isset($_POST["AMOUNT"], $_POST["EMAIL"], $_POST["DESC"])) {
    $paypal_amount = floatval($_POST["AMOUNT"]);
    $paypal_email = $_POST["EMAIL"];
    $paypal_desc = $_POST["DESC"];
} else {
    die("Missing parameters.");
}
// // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // //
// 		store and format GET parameter for paypal request
// 		use getRequestString() to get the parameters for the URL
$PC = new PaypalCredentials("SetExpressCheckout");
$PC->setCancelUrl($paypalcancel);
$PC->setReturnUrl($paypalreturn);
$PC->setUser($paypal_user);
$PC->setPw($paypal_pw);
$PC->setSignature($paypal_signature);
$PC->setCurrency($paypal_currencycode);
$PC->setReturnUrl($paypal_returnurl);
$PC->setCancelUrl($paypal_cancelurl);
$PC->setAmount($paypal_amount);
$PC->setPayerMail($paypal_email);
$PC->setDesc($paypal_desc);
// // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // //
// // // // // // // // // // // // // // // // // // // //
// 		Make cURL request to get TOKEN of transaction