$PayPal = new angelleye\PayPal\PayPal($PayPalConfig); /** * Now we pass the PayPal token that we saved to a session variable * in the SetExpressCheckout.php file into the GetExpressCheckoutDetails * request. */ $PayPalResult = $PayPal->GetExpressCheckoutDetails($_SESSION['paypal_token']); /** * Now we'll check for any errors returned by PayPal, and if we get an error, * we'll save the error details to a session and redirect the user to an * error page to display it accordingly. * * If the call is successful, we'll save some data we might want to use * later into session variables. */ if ($PayPal->APICallSuccessful($PayPalResult['ACK'])) { /** * Here we'll pull out data from the PayPal response. * Refer to the PayPal API Reference for all of the variables available * in $PayPalResult['variablename'] * * https://developer.paypal.com/docs/classic/api/merchant/GetExpressCheckoutDetails_API_Operation_NVP/ * * Again, Express Checkout allows for parallel payments, so what we're doing here * is usually the library to parse out the individual payments using the GetPayments() * method so that we can easily access the data. * * We only have a single payment here, which will be the case with most checkouts, * but we will still loop through the $Payments array returned by the library * to grab our data accordingly. */