📄 checkout_process.inc.php
字号:
<?php/* $Id: checkout_process.inc.php,v 1.2 2005/03/13 22:00:34 devosc Exp $ 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 Released under the GNU General Public License*/ global $payment_modules, $shipping_modules, $order, $currencies, $cart, $PayPal_osC, $customer_id, $ip, $isp, $sendto, $billto, $shipping, $payment, $language, $currency, $languages_id, $order_total_modules, $order_totals; require_once(DIR_WS_INCLUDES . 'modules/payment/paypal/database_tables.inc.php'); if(!class_exists('order_total')) { include_once(DIR_WS_CLASSES . 'order_total.php'); } if ( !is_object($order_total_modules) ) $order_total_modules = new order_total; if ( !is_array($order_totals) ) $order_totals = $order_total_modules->process(); $sql_data_array = array('customers_id' => $customer_id, 'customers_name' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'customers_company' => $order->customer['company'], 'customers_street_address' => $order->customer['street_address'], 'customers_suburb' => $order->customer['suburb'], 'customers_city' => $order->customer['city'], 'customers_postcode' => $order->customer['postcode'], 'customers_state' => $order->customer['state'], 'customers_country' => $order->customer['country']['title'], 'customers_telephone' => $order->customer['telephone'], 'customers_email_address' => $order->customer['email_address'], 'customers_address_format_id' => $order->customer['format_id'], 'delivery_name' => $order->delivery['firstname'] . ' ' . $order->delivery['lastname'], 'delivery_company' => $order->delivery['company'], 'delivery_street_address' => $order->delivery['street_address'], 'delivery_suburb' => $order->delivery['suburb'], 'delivery_city' => $order->delivery['city'], 'delivery_postcode' => $order->delivery['postcode'], 'delivery_state' => $order->delivery['state'], 'delivery_country' => $order->delivery['country']['title'], 'delivery_address_format_id' => $order->delivery['format_id'], 'billing_name' => $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'billing_company' => $order->billing['company'], 'billing_street_address' => $order->billing['street_address'], 'billing_suburb' => $order->billing['suburb'], 'billing_city' => $order->billing['city'], 'billing_postcode' => $order->billing['postcode'], 'billing_state' => $order->billing['state'], 'billing_country' => $order->billing['country']['title'], 'billing_address_format_id' => $order->billing['format_id'], 'payment_method' => $this->codeTitle, 'cc_type' => $order->info['cc_type'], 'cc_owner' => $order->info['cc_owner'], 'cc_number' => $order->info['cc_number'], 'cc_expires' => $order->info['cc_expires'], 'orders_status' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID, 'last_modified' => 'now()', 'currency' => $order->info['currency'], 'currency_value' => $order->info['currency_value'], 'ipaddy' => $ip, 'ipisp' => $isp); $session_exists = false; if(tep_session_is_registered('PayPal_osC')) { $orders_session_query = tep_db_query("select osi.orders_id, o.payment_id from " . TABLE_ORDERS_SESSION_INFO . " osi left join " . TABLE_ORDERS . " o on osi.orders_id = o.orders_id where osi.txn_signature ='" . tep_db_input($PayPal_osC->txn_signature) . "'"); $orders_check = tep_db_fetch_array($orders_session_query); //Now check to see whether order session info exists AND that this order //does not currently have an IPN. if ($orders_check['orders_id'] > 0 && $orders_check['payment_id'] == '0' ) { $session_exists = true; $this->orders_id = $orders_check['orders_id']; } } if($session_exists) { tep_db_perform(TABLE_ORDERS, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'"); } else { $sql_data_array['date_purchased'] = 'now()'; tep_db_perform(TABLE_ORDERS, $sql_data_array); $this->orders_id = tep_db_insert_id(); } if($session_exists) { tep_db_query("delete from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int)$this->orders_id . "'"); } for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) { $sql_data_array = array('orders_id' => (int)$this->orders_id, 'title' => $order_totals[$i]['title'], 'text' => $order_totals[$i]['text'], 'value' => $order_totals[$i]['value'], 'class' => $order_totals[$i]['code'], 'sort_order' => $order_totals[$i]['sort_order']); tep_db_perform(TABLE_ORDERS_TOTAL, $sql_data_array); } $sql_data_array = array('orders_status_id' => MODULE_PAYMENT_PAYPAL_PROCESSING_STATUS_ID, 'date_added' => 'now()', 'customer_notified' => 0, 'comments' => $order->info['comments']); if($session_exists) { tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array, 'update', "orders_id = '" . (int)$this->orders_id . "'"); tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$this->orders_id . "'"); tep_db_query("delete from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int)$this->orders_id . "'"); } else { $sql_data_array['orders_id'] = $this->orders_id; tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array); } for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {/*// this same code is extracting inventory on return from PP in paypal_notify.php - code here is not needed.// Eversun mod for stock does not decrement when using paypal if (STOCK_LIMITED == 'true') { $downloadable_product = false; if (DOWNLOAD_ENABLED == 'true') { // see if this product actually has a downloadable file in the attributes $download_check_query_raw = "SELECT products_quantity, pad.products_attributes_filename
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -