$payRequest->sender->phone->extension = $_POST["senderExtension"]; } } if ($_POST['useCredentials'] != "") { $payRequest->sender->useCredentials = $_POST["useCredentials"]; } } /* * ## Creating service wrapper object Creating service wrapper object to make API call and loading configuration file for your credentials and endpoint */ $service = new AdaptivePaymentsService(Configuration::getAcctAndConfig()); try { /* wrap API method calls on the service object with a try catch */ $response = $service->Pay($payRequest); } catch (Exception $ex) { require_once 'Common/Error.php'; exit; } /* Make the call to PayPal to get the Pay token If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment. If an error occured, show the resulting errors */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>PayPal Adaptive Payments - Pay Response</title> <link href="Common/sdk.css" rel="stylesheet" type="text/css" />