[ Index ]
 

Code source de eZ Publish 3.9.0

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

title

Body

[fermer]

/extension/ezpaypal/modules/paypal/ -> notify_url.php (source)

   1  <?php
   2  //
   3  // Processing of paypal's callback.
   4  //
   5  // Created on: <26-Apr-2004 14:18:58 dl>
   6  //
   7  // SOFTWARE NAME: eZ Paypal Payment Gateway
   8  // SOFTWARE RELEASE: 1.0
   9  // COPYRIGHT NOTICE: Copyright (C) 1999-2006 eZ systems AS
  10  // SOFTWARE LICENSE: GNU General Public License v2.0
  11  // NOTICE: >
  12  //   This program is free software; you can redistribute it and/or
  13  //   modify it under the terms of version 2.0  of the GNU General
  14  //   Public License as published by the Free Software Foundation.
  15  //
  16  //   This program is distributed in the hope that it will be useful,
  17  //   but WITHOUT ANY WARRANTY; without even the implied warranty of
  18  //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19  //   GNU General Public License for more details.
  20  //
  21  //   You should have received a copy of version 2.0 of the GNU General
  22  //   Public License along with this program; if not, write to the Free
  23  //   Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  24  //   MA 02110-1301, USA.
  25  //
  26  //
  27  //
  28  
  29  /*! \file notify_url.php
  30  */
  31  
  32  ext_activate( 'ezpaypal', 'classes/ezpaypalchecker.php' );
  33  
  34  $logger  =& eZPaymentLogger::CreateForAdd('var/log/eZPaypal_notify_url.log');
  35  $checker =& new eZPaypalChecker( 'paypal.ini' );
  36  
  37  if( $checker->createDataFromPOST() )
  38  {
  39    unset ($_POST);
  40    if( $checker->requestValidation() && $checker->checkPaymentStatus() )
  41    {
  42        $orderID = $checker->getFieldValue( 'custom' );
  43        if( $checker->setupOrderAndPaymentObject( $orderID ) )
  44        {
  45            $amount   = $checker->getFieldValue( 'mc_gross' );
  46            $currency = $checker->getFieldValue( 'mc_currency' );
  47            if( $checker->checkAmount( $amount ) && $checker->checkCurrency( $currency ) )
  48            {
  49                $checker->approvePayment();
  50            }
  51        }
  52    }
  53  }
  54  
  55  $logger->writeTimedString( 'notify_url.php was propertly ended' );
  56  
  57  ?>


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