Source for file setexpresscheckout.php

Documentation is available at setexpresscheckout.php

  1. <?php
  2.  
  3. /**
  4.  * SetExpressCheckout Object
  5.  *
  6.  * This class is used to perform the SetExpressCheckout operation
  7.  * 
  8.  * @author Israel Ekpo <perfectvista@users.sourceforge.net>
  9.  * @copyright Copyright 2007, Israel Ekpo
  10.  * @license http://phppaypalpro.sourceforge.net/LICENSE.txt BSD License
  11.  * @version 0.1.0
  12.  * @package ExpressCheckout
  13.  * @filesource
  14.  */
  15.  
  16.  
  17. /**
  18.  * Used to invoke the SetExpressCheckout Operation
  19.  * 
  20.  * @author Israel Ekpo <perfectvista@users.sourceforge.net>
  21.  * @copyright Copyright 2007, Israel Ekpo
  22.  * @license http://phppaypalpro.sourceforge.net/LICENSE.txt BSD License
  23.  * @package ExpressCheckout
  24.  */
  25. final class SetExpressCheckout extends PaypalAPI implements OperationsTemplate
  26. {   
  27.     /**
  28.      * Message Sent to the Webservice
  29.      *
  30.      * @var array 
  31.      * @access private
  32.      */
  33.     private $apiMessage;
  34.  
  35.     /**
  36.      * Prepares the message to be sent
  37.      *
  38.      * This method prepares the message to be sent to the
  39.      * Paypal Webservice
  40.      * 
  41.      * @access public
  42.      * 
  43.      * @param double $OrderTotal 
  44.      * @param string $ReturnURL 
  45.      * @param string $CancelURL 
  46.      * @param string $PaymentAction Sale or Order
  47.      */
  48.     public function setParams($OrderTotal$ReturnURL$CancelURL$PaymentAction)
  49.     {
  50.         $this->apiMessage PayPalTypes::SetExpressCheckoutRequestDetailsType($OrderTotal$ReturnURL$CancelURL$PaymentAction);
  51.     }
  52.     
  53.     /**
  54.      * Executes the Operation
  55.      *
  56.      * Prepares the final message and the calls the Webservice operation. If it is successfull the response is registered
  57.      * and the OperationStatus is set to true, otherwise the Operation status will be set to false and an Exception of the type
  58.      * soapFault will be registered instead.
  59.      * 
  60.      * @access public
  61.      */
  62.     public function execute()
  63.     {
  64.         try
  65.         {
  66.             $this->apiMessage['Version'API_VERSION;
  67.             
  68.             $this->apiMessage['SetExpressCheckoutRequestDetails'$this->apiMessage;
  69.         
  70.             $this->apiMessage array('SetExpressCheckoutRequest' => $this->apiMessage);
  71.             
  72.             $this->apiMessage array($this->apiMessage);
  73.             
  74.             parent::registerAPIResponse(PayPalBase::getSoapClient()->__soapCall('SetExpressCheckout'$this->apiMessagenullPayPalBase::getSoapHeader()));
  75.             
  76.             PaypalBase::setOperationStatus(true);           
  77.         }
  78.         
  79.         catch (SoapFault $Exception)
  80.         {
  81.             parent::registerAPIException($Exception);
  82.             
  83.             PaypalBase::setOperationStatus(false);
  84.         }
  85.     }
  86. }
  87. ?>

Documentation generated on Sat, 03 Feb 2007 20:59:06 -0800 by phpDocumentor 1.3.1