osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com DevosC, Developing open source Code http://www.devosc.com Copyright (c) 2003 osCommerce Copyright (c) 2004 DevosC.com Copyright (c) 2006 Dipl.-Ing.(TH) Winfried Kaiser (w.kaiser@fortune.de) -- Port to OL-Commerce Released under the GNU General Public License */ require_once PAYPAL_IPN_DIR . 'Classes/TransactionDetails/TransactionDetails.class.php'; require_once PAYPAL_IPN_DIR . 'Classes/Page/Page.class.php'; require_once PAYPAL_IPN_DIR . 'Functions/general.func.php'; paypal_include_lng(PAYPAL_IPN_DIR . 'Admin/languages/', $language, 'paypal.lng.php'); require_once PAYPAL_IPN_DIR . 'database_tables.inc.php'; $paypal = new PayPal_TransactionDetails(TABLE_PAYPAL, $order->info['payment_id']); ?> <tr valign="top"> <td colspan="2" style="padding-bottom:0px;"> <?php echo olc_image(PAYPAL_IPN_DIR . 'images/paypal_logo.gif', 'PayPal'); ?> </td> </tr> <tr valign="top"> <td class="main"> <style type="text/css"> .Txns{font-family: Verdana;font-size: 10px;color: #000000;background-color: #aaaaaa;} .Txns td {padding: 2px 4px;}.TxnsTitle td {color: #000000;font-weight: bold;font-size: 13px;}
/* function debugWriteFile($str,$mode="a") { $fp = @fopen("ipn.txt",$mode); @flock($fp, LOCK_EX); @fwrite($fp,$str); @flock($fp, LOCK_UN); @fclose($fp); } $postString = ''; foreach($_POST as $key => $val) $postString .= $key.' = '.$val.NEW_LINE; if($postString != '') { debugWriteFile($postString,"w+"); } */ //require_once(PAYPAL_IPN_DIR.'application_top.inc.php'); require_once DIR_WS_INCLUDES . 'application_top.inc.php'; require_once PAYPAL_IPN_DIR . 'Classes/Ipn/IPN.class.php'; require_once PAYPAL_IPN_DIR . 'Classes/Debug/Debug.class.php'; require_once PAYPAL_IPN_DIR . 'Functions/general.func.php'; paypal_include_lng(PAYPAL_IPN_DIR . 'languages/', SESSION_LANGUAGE, 'ipn.lng.php'); $debug = new PayPal_Debug(MODULE_PAYMENT_PAYPAL_IPN_DEBUG_EMAIL, MODULE_PAYMENT_PAYPAL_IPN_DEBUG); $ipn = new PayPal_IPN($_POST); $ipn->setTestMode(MODULE_PAYMENT_PAYPAL_IPN_TEST_MODE); unset($_POST); //post back to PayPal to validate if (!$ipn->authenticate(MODULE_PAYMENT_PAYPAL_DOMAIN) && $ipn->testMode('Off')) { $ipn->dienice('500'); } //Check both the receiver_email and business id fields match if (!$ipn->validateReceiverEmail(MODULE_PAYMENT_PAYPAL_ID, MODULE_PAYMENT_PAYPAL_BUSINESS_ID)) { $ipn->dienice('500'); } if ($ipn->uniqueTxnID() && $ipn->isReversal() && strlen($ipn->key['parent_txn_id']) == 17) { //parent_txn_id is the txn_id of the original transaction $txn = $ipn->queryTxnID($ipn->key['parent_txn_id']);