[ Index ]
 

Code source de eZ Publish 3.9.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/kernel/shop/classes/ -> ezpaymentgateway.php (source)

   1  <?php
   2  //
   3  // Definition of eZPaymentGateway class
   4  //
   5  // Created on: <18-May-2004 14:18:58 dl>
   6  //
   7  // SOFTWARE NAME: eZ publish
   8  // SOFTWARE RELEASE: 3.9.0
   9  // BUILD VERSION: 17785
  10  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  11  // SOFTWARE LICENSE: GNU General Public License v2.0
  12  // NOTICE: >
  13  //   This program is free software; you can redistribute it and/or
  14  //   modify it under the terms of version 2.0  of the GNU General
  15  //   Public License as published by the Free Software Foundation.
  16  //
  17  //   This program is distributed in the hope that it will be useful,
  18  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  19  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  20  //   GNU General Public License for more details.
  21  //
  22  //   You should have received a copy of version 2.0 of the GNU General
  23  //   Public License along with this program; if not, write to the Free
  24  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  25  //   MA 02110-1301, USA.
  26  //
  27  //
  28  
  29  /*! \file ezpaymentgateway.php
  30  */
  31  
  32  /*!
  33    \class eZPaymentGateway ezpaymentgateway.php
  34    \brief Abstract class for all payment gateways.
  35  */
  36  
  37  include_once ( 'kernel/classes/workflowtypes/event/ezpaymentgateway/ezpaymentlogger.php' );
  38  
  39  class eZPaymentGateway
  40  {
  41      /*!
  42          Constructor.
  43      */
  44      function eZPaymentGateway()
  45      {                     
  46          $this->logger = eZPaymentLogger::CreateForAdd( "var/log/eZPaymentGateway.log" );
  47      }
  48  
  49      function execute( &$process, &$event )
  50      {
  51          $this->logger->writeTimedString( 'You must override this function.', 'execute' );
  52          return EZ_WORKFLOW_TYPE_STATUS_REJECTED;
  53      }
  54  
  55      function needCleanup()
  56      {
  57          return false;
  58      }
  59      
  60      function cleanup( &$process, &$event )
  61      {
  62      }
  63  
  64      /*!
  65          Creates short description of order. Usually this string is
  66          passed to payment site as describtion of payment.
  67      */
  68      function &createShortDescription( &$order, $maxDescLen )
  69      {
  70          //__DEBUG__
  71              $this->logger->writeTimedString("createShortDescription");
  72          //___end____
  73              
  74          $descText       = '';
  75          $productItems   = $order->productItems();
  76  
  77          foreach( $productItems as $item )
  78          {
  79              $descText .= $item['object_name'] . ',';
  80          }
  81          $descText   = rtrim( $descText, "," );
  82          
  83          $descLen    = strlen( $descText );
  84          if( ($maxDescLen > 0) && ($descLen > $maxDescLen) )
  85          {
  86              $descText = substr($descText, 0, $maxDescLen - 3) ;
  87              $descText .= '...';
  88          }
  89  
  90          //__DEBUG__
  91              $this->logger->writeTimedString("descText=$descText");
  92          //___end____
  93  
  94          return $descText;
  95      }
  96  
  97      var $logger;
  98  }
  99  ?>


Généré le : Sat Feb 24 10:30:04 2007 par Balluche grâce à PHPXref 0.7