/* ===================================== * PayPal Express Checkout Call * ===================================== */ require_once "paypalfunctions.php"; require_once 'fulfillorder.php'; $PaymentOption = "PayPal"; if ($PaymentOption == "PayPal") { /* '------------------------------------ ' this step is required to get parameters to make DoExpressCheckout API call, ' this step is required only if you are not storing the SetExpressCheckout API call's request values in you database. ' ------------------------------------ */ $res = GetExpressCheckoutDetails($_REQUEST['token']); /* '------------------------------------ ' The paymentAmount is the total value of ' the purchase. '------------------------------------ */ $finalPaymentAmount = $res["AMT"]; /* '------------------------------------ ' Calls the DoExpressCheckoutPayment API call ' ' The ConfirmPayment function is defined in the file PayPalFunctions.php, ' that is included at the top of this file. '------------------------------------------------- */
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"> <link rel="stylesheet" type="text/css" href="style.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script> <title>ExpressCheckOut</title> </head> </html> <?php $token = $_SESSION["TOKEN"]; if ($token != "") { /* * Calls the GetExpressCheckoutDetails API call */ $resArray = GetExpressCheckoutDetails($token); $ackGetExpressCheckout = strtoupper($resArray["ACK"]); if ($ackGetExpressCheckout == "SUCCESS" || $ackGetExpressCheckout == "SUCESSWITHWARNING") { //person info $email = $resArray["EMAIL"]; $payerId = $resArray["PAYERID"]; $firstName = $resArray["FIRSTNAME"]; $lastName = $resArray["LASTNAME"]; //shipping info $cntryCode = $resArray["COUNTRYCODE"]; $shipToName = $resArray["PAYMENTREQUEST_0_SHIPTONAME"]; $shipToStreet = $resArray["PAYMENTREQUEST_0_SHIPTOSTREET"]; $shipToCity = $resArray["PAYMENTREQUEST_0_SHIPTOCITY"]; $shipToState = $resArray["PAYMENTREQUEST_0_SHIPTOSTATE"]; $shipToCntryCode = $resArray["PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE"]; $shipToZip = $resArray["PAYMENTREQUEST_0_SHIPTOZIP"];