Pay() public method

Service Call: Pay
public Pay ( PayRequest $payRequest, mixed $apiCredential = NULL ) : Types\AP\PayResponse
$payRequest PayRequest
$apiCredential mixed - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically
return Types\AP\PayResponse
Example #1
0
            $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" />