/** * Store transaction info to the order and process any results that come back from the payment gateway * */ function before_process() { global $order_total_modules; if (isset($_GET['referer']) && $_GET['referer'] == 'paypal') { $this->notify('NOTIFY_PAYMENT_PAYPAL_RETURN_TO_STORE'); if (MODULE_PAYMENT_PAYPAL_TESTING == 'Test') { // simulate call to ipn_handler.php here ipn_simulate_ipn_handler((int) $_GET['count']); } $_SESSION['cart']->reset(true); unset($_SESSION['sendto']); unset($_SESSION['billto']); unset($_SESSION['shipping']); unset($_SESSION['payment']); unset($_SESSION['comments']); unset($_SESSION['cot_gv']); $order_total_modules->clear_posts(); //ICW ADDED FOR CREDIT CLASS SYSTEM zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); } else { $this->notify('NOTIFY_PAYMENT_PAYPAL_CANCELLED_DURING_CHECKOUT'); zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } }
/** * Store transaction info to the order and process any results that come back from the payment gateway */ function before_process() { global $order_total_modules; list($this->transaction_amount, $this->transaction_currency) = $_SESSION['paypal_transaction_info']; unset($_SESSION['paypal_transaction_info']); if (isset($_GET['referer']) && $_GET['referer'] == 'paypal') { $this->notify('NOTIFY_PAYMENT_PAYPAL_RETURN_TO_STORE'); if (MODULE_PAYMENT_PAYPAL_TESTING == 'Test') { // simulate call to ipn_handler.php here ipn_simulate_ipn_handler((int) $_GET['count']); } if (defined('MODULE_PAYMENT_PAYPAL_PDTTOKEN') && MODULE_PAYMENT_PAYPAL_PDTTOKEN != '') { $pdtStatus = $this->_getPDTresults($this->transaction_amount, $this->transaction_currency); } else { $pdtStatus = false; } if ($pdtStatus == false) { $_SESSION['cart']->reset(true); unset($_SESSION['sendto']); unset($_SESSION['billto']); unset($_SESSION['shipping']); unset($_SESSION['payment']); unset($_SESSION['comments']); unset($_SESSION['cot_gv']); $order_total_modules->clear_posts(); //ICW ADDED FOR CREDIT CLASS SYSTEM zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); } else { // PDT was good, so delete IPN session from PayPal table -- housekeeping. global $db; $db->Execute("delete from " . TABLE_PAYPAL_SESSION . " where session_id = '" . zen_db_input($_SESSION['ppipn_key_to_remove']) . "'"); unset($_SESSION['ppipn_key_to_remove']); $_SESSION['paypal_transaction_PDT_passed'] = true; return true; } } else { $this->notify('NOTIFY_PAYMENT_PAYPAL_CANCELLED_DURING_CHECKOUT'); zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } }