PayPal\Service\PayPalAPIInterfaceServiceService::CreateBillingAgreement PHP Method

CreateBillingAgreement() public method

Service Call: CreateBillingAgreement
public CreateBillingAgreement ( CreateBillingAgreementReq $createBillingAgreementReq, mixed $apiCredential = null ) : CreateBillingAgreementResponseType
$createBillingAgreementReq PayPal\PayPalAPI\CreateBillingAgreementReq
$apiCredential mixed - Optional API credential - can either be a username configured in sdk_config.ini or a ICredential object created dynamically
return PayPal\PayPalAPI\CreateBillingAgreementResponseType
    public function CreateBillingAgreement($createBillingAgreementReq, $apiCredential = null)
    {
        $apiContext = new PPApiContext($this->config);
        $handlers = array(new PPMerchantServiceHandler($apiCredential, self::$SDK_NAME, self::$SDK_VERSION));
        $this->setStandardParams($createBillingAgreementReq->CreateBillingAgreementRequest);
        $ret = new CreateBillingAgreementResponseType();
        $resp = $this->call('PayPalAPIAA', 'CreateBillingAgreement', $createBillingAgreementReq, $apiContext, $handlers);
        $ret->init(PPUtils::xmlToArray($resp));
        return $ret;
    }