<?php
//
// +----------------------------------------------------------------------+
// |zen-cart Open Source E-commerce                                       |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004 The zen-cart developers                           |
// |                                                                      |   
// | http://www.zen-cart.com/index.php                                    |   
// |                                                                      |   
// | Portions Copyright (c) 2003 osCommerce                               |
// +----------------------------------------------------------------------+
// | This source file is subject to version 2.0 of the GPL license,       |
// | that is bundled with this package in the file LICENSE, and is        |
// | available through the world-wide-web at the following url:           |
// | http://www.zen-cart.com/license/2_0.txt.                             |
// | If you did not receive a copy of the zen-cart license and are unable |
// | to obtain it through the world-wide-web, please send a note to       |
// | license@zen-cart.com so we can mail you a copy immediately.          |
// +----------------------------------------------------------------------+
// $Id: cart.class.php,v 1.1.1.1 2004/09/01 04:47:52 shidairiki Exp $
//

class paypal_ipn_cart {
  function valid_payment(&$ipn,&$cart,$currency) {
    //check that there are the correct number of items in the transaction
    /*
    if ( $ipn->key['num_cart_items'] != $cart->count_contents() && $ipn->txn_type() == 'cart' ) {
      if ( $ipn->_debug > 1 ) $ipn->send_email(CHECK_NUM_CART_CONTENTS,sprintf(CHECK_NUM_CART_CONTENTS_MSG,$ipn->key['num_cart_items'],$cart->count_contents()));
      return false;
    }
    //check the payment_currency
    if( $ipn->key['mc_currency'] != $currency) {
      if ( $ipn->_debug > 1 ) $ipn->send_email(CHECK_CURRENCY,sprintf(CHECK_CURRENCY,$ipn->key['mc_currency'],$currency));
      return false;
    }
    //check the payment_amount
    if ( $ipn->key['mc_gross'] != $cart->show_total() ) {
      if ( $ipn->_debug > 1 ) $ipn->send_email(CHECK_TOTAL,sprintf(CHECK_TOTAL_MSG,$ipn->key['mc_gross'],$cart->show_total()));
      return false;
    }
    */
    return true;
  }
}//end class
?>
