Example #1
0
 /**
  * Executes the Operation
  *
  * Prepares the final message and the calls the Webservice operation. If it is successfull the response is registered
  * and the OperationStatus is set to true, otherwise the Operation status will be set to false and an Exception of the type
  * soapFault will be registered instead.
  *
  * @access public
  */
 public function execute()
 {
     try {
         $this->apiMessage['Version'] = API_VERSION;
         $this->apiMessage['SetExpressCheckoutRequestDetails'] = $this->apiMessage;
         $this->apiMessage = array('SetExpressCheckoutRequest' => $this->apiMessage);
         if (count($this->recurringItems)) {
             $this->apiMessage['SetExpressCheckoutRequest']['SetExpressCheckoutRequestDetails']['BillingAgreementDetails'] = array();
             foreach ($this->recurringItems as $recurringItem) {
                 $this->apiMessage['SetExpressCheckoutRequest']['SetExpressCheckoutRequestDetails']['BillingAgreementDetails'][] = PayPalTypes::BillingAgreementDetailsType($recurringItem);
             }
         }
         $this->apiMessage = array($this->apiMessage);
         parent::registerAPIResponse(PayPalBase::getSoapClient()->__soapCall('SetExpressCheckout', $this->apiMessage, null, PayPalBase::getSoapHeader()));
         PaypalBase::setOperationStatus(true);
     } catch (SoapFault $Exception) {
         parent::registerAPIException($Exception);
         PaypalBase::setOperationStatus(false);
     }
 }