*/ $createButtonRequest->ButtonType = $_REQUEST['buttonType']; $createButtonRequest->ButtonVar = $buttonVar; if ($_REQUEST['buttonType'] == "PAYMENTPLAN") { $createButtonRequest->OptionDetails = array($optionDetails); } $createButtonReq = new BMCreateButtonReq(); $createButtonReq->BMCreateButtonRequest = $createButtonRequest; /* * ## Creating service wrapper object Creating service wrapper object to make API call and loading Configuration::getAcctAndConfig() returns array that contains credential and config parameters */ $paypalService = new PayPalAPIInterfaceServiceService(Configuration::getAcctAndConfig()); try { $createButtonResponse = $paypalService->BMCreateButton($createButtonReq); } catch (Exception $ex) { require '../Error.php'; exit; } if (isset($createButtonResponse)) { echo "<table>"; echo "<tr><td>Ack :</td><td><div id='Ack'>{$createButtonResponse->Ack}</div> </td></tr>"; echo "<tr><td>HostedButtonID :</td><td><div id='HostedButtonID'>" . $createButtonResponse->HostedButtonID . "</div> </td></tr>"; echo "<tr><td>Email :</td><td><div id='Email'>" . $createButtonResponse->Email . "</div> </td></tr>"; echo "</table>"; echo "<pre>"; print_r($createButtonResponse); echo "</pre>"; } require_once '../Response.php';