logo       


Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

[TEP-COMMIT] CVS: catalog/catalog/includes/modules/payment authorizenet.php: msg#00046

Subject: [TEP-COMMIT] CVS: catalog/catalog/includes/modules/payment authorizenet.php,1.48,1.49 cc.php,1.53,1.54 ipayment.php,1.33,1.34 nochex.php,1.12,1.13 paypal.php,1.39,1.40 pm2checkout.php,1.20,1.21 psigate.php,1.17,1.18 secpay.php,1.31,1.32
Update of /cvsroot/tep/catalog/catalog/includes/modules/payment
In directory sc8-pr-cvs1:/tmp/cvs-serv31781/modules/payment

Modified Files:
        authorizenet.php cc.php ipayment.php nochex.php paypal.php 
        pm2checkout.php psigate.php secpay.php 
Log Message:
update the payment modules to use the new classes and super global
variables


Index: authorizenet.php
===================================================================
RCS file: 
/cvsroot/tep/catalog/catalog/includes/modules/payment/authorizenet.php,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- authorizenet.php    10 Apr 2003 21:42:30 -0000      1.48
+++ authorizenet.php    17 Nov 2003 20:34:31 -0000      1.49
@@ -34,7 +34,7 @@
 
 // Authorize.net utility functions
 // DISCLAIMER:
-//     This code is distributed in the hope that it will be useful, but 
without any warranty; 
+//     This code is distributed in the hope that it will be useful, but 
without any warranty;
 //     without even the implied warranty of merchantability or fitness for a 
particular purpose.
 
 // Main Interfaces:
@@ -50,8 +50,8 @@
 
 // Thanks is lance from http://www.php.net/manual/en/function.mhash.php
 //lance_rushing at hot* spamfree *mail dot com
-//27-Nov-2002 09:36 
-// 
+//27-Nov-2002 09:36
+//
 //Want to Create a md5 HMAC, but don't have hmash installed?
 //
 //Use this:
@@ -145,7 +145,7 @@
         $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => 
strftime('%B',mktime(0,0,0,$i,1,2000)));
       }
 
-      $today = getdate(); 
+      $today = getdate();
       for ($i=$today['year']; $i < $today['year']+10; $i++) {
         $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 
'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));
       }
@@ -162,12 +162,14 @@
     }
 
     function pre_confirmation_check() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       include(DIR_WS_CLASSES . 'cc_validation.php');
 
       $cc_validation = new cc_validation();
-      $result = 
$cc_validation->validate($HTTP_POST_VARS['authorizenet_cc_number'], 
$HTTP_POST_VARS['authorizenet_cc_expires_month'], 
$HTTP_POST_VARS['authorizenet_cc_expires_year']);
+      $result = $cc_validation->validate($_POST['authorizenet_cc_number'], 
$_POST['authorizenet_cc_expires_month'], 
$_POST['authorizenet_cc_expires_year']);
       $error = '';
       switch ($result) {
         case -1:
@@ -184,7 +186,7 @@
       }
 
       if ( ($result == false) || ($result < 1) ) {
-        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&authorizenet_cc_owner=' . 
urlencode($HTTP_POST_VARS['authorizenet_cc_owner']) . 
'&authorizenet_cc_expires_month=' . 
$HTTP_POST_VARS['authorizenet_cc_expires_month'] . 
'&authorizenet_cc_expires_year=' . 
$HTTP_POST_VARS['authorizenet_cc_expires_year'];
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&authorizenet_cc_owner=' . 
urlencode($_POST['authorizenet_cc_owner']) . '&authorizenet_cc_expires_month=' 
. $_POST['authorizenet_cc_expires_month'] . '&authorizenet_cc_expires_year=' . 
$_POST['authorizenet_cc_expires_year'];
 
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$payment_error_return, 'SSL', true, false));
       }
@@ -196,21 +198,23 @@
     }
 
     function confirmation() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       $confirmation = array('title' => $this->title . ': ' . 
$this->cc_card_type,
                             'fields' => array(array('title' => 
MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_OWNER,
-                                                    'field' => 
$HTTP_POST_VARS['authorizenet_cc_owner']),
+                                                    'field' => 
$_POST['authorizenet_cc_owner']),
                                               array('title' => 
MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_NUMBER,
                                                     'field' => 
substr($this->cc_card_number, 0, 4) . str_repeat('X', 
(strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                               array('title' => 
MODULE_PAYMENT_AUTHORIZENET_TEXT_CREDIT_CARD_EXPIRES,
-                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$HTTP_POST_VARS['authorizenet_cc_expires_month'], 1, '20' . 
$HTTP_POST_VARS['authorizenet_cc_expires_year'])))));
+                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$_POST['authorizenet_cc_expires_month'], 1, '20' . 
$_POST['authorizenet_cc_expires_year'])))));
 
       return $confirmation;
     }
 
     function process_button() {
-      global $HTTP_SERVER_VARS, $order, $customer_id;
+      global $osC_Session, $osC_Customer, $order;
 
       $sequence = rand(1, 1000);
       $process_button_string = tep_draw_hidden_field('x_Login', 
MODULE_PAYMENT_AUTHORIZENET_LOGIN) .
@@ -220,7 +224,7 @@
                                tep_draw_hidden_field('x_Relay_URL', 
tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false)) .
                                tep_draw_hidden_field('x_Method', 
((MODULE_PAYMENT_AUTHORIZENET_METHOD == 'Credit Card') ? 'CC' : 'ECHECK')) .
                                tep_draw_hidden_field('x_Version', '3.0') .
-                               tep_draw_hidden_field('x_Cust_ID', 
$customer_id) .
+                               tep_draw_hidden_field('x_Cust_ID', 
$osC_Customer->id) .
                                tep_draw_hidden_field('x_Email_Customer', 
((MODULE_PAYMENT_AUTHORIZENET_EMAIL_CUSTOMER == 'True') ? 'TRUE': 'FALSE')) .
                                tep_draw_hidden_field('x_first_name', 
$order->billing['firstname']) .
                                tep_draw_hidden_field('x_last_name', 
$order->billing['lastname']) .
@@ -238,20 +242,22 @@
                                tep_draw_hidden_field('x_ship_to_state', 
$order->delivery['state']) .
                                tep_draw_hidden_field('x_ship_to_zip', 
$order->delivery['postcode']) .
                                tep_draw_hidden_field('x_ship_to_country', 
$order->delivery['country']['title']) .
-                               tep_draw_hidden_field('x_Customer_IP', 
$HTTP_SERVER_VARS['REMOTE_ADDR']) .
+                               tep_draw_hidden_field('x_Customer_IP', 
tep_get_ip_address()) .
                                
$this->InsertFP(MODULE_PAYMENT_AUTHORIZENET_LOGIN, 
MODULE_PAYMENT_AUTHORIZENET_TXNKEY, number_format($order->info['total'], 2), 
$sequence);
       if (MODULE_PAYMENT_AUTHORIZENET_TESTMODE == 'Test') 
$process_button_string .= tep_draw_hidden_field('x_Test_Request', 'TRUE');
 
-      $process_button_string .= tep_draw_hidden_field(tep_session_name(), 
tep_session_id());
+      $process_button_string .= tep_draw_hidden_field($osC_Session->name, 
$osC_Session->id);
 
       return $process_button_string;
     }
 
     function before_process() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
-      if ($HTTP_POST_VARS['x_response_code'] == '1') return;
-      if ($HTTP_POST_VARS['x_response_code'] == '2') {
+      if ($_POST['x_response_code'] == '1') return;
+      if ($_POST['x_response_code'] == '2') {
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' 
. urlencode(MODULE_PAYMENT_AUTHORIZENET_TEXT_DECLINED_MESSAGE), 'SSL', true, 
false));
       }
       // Code 3 is an error - but anything else is an error too (IMHO)
@@ -263,10 +269,12 @@
     }
 
     function get_error() {
-      global $HTTP_GET_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_GET;
+      }
 
       $error = array('title' => MODULE_PAYMENT_AUTHORIZENET_TEXT_ERROR,
-                     'error' => 
stripslashes(urldecode($HTTP_GET_VARS['error'])));
+                     'error' => stripslashes(urldecode($_GET['error'])));
 
       return $error;
     }

Index: cc.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/cc.php,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- cc.php      4 Feb 2003 09:55:01 -0000       1.53
+++ cc.php      17 Nov 2003 20:34:31 -0000      1.54
@@ -95,12 +95,14 @@
     }
 
     function pre_confirmation_check() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       include(DIR_WS_CLASSES . 'cc_validation.php');
 
       $cc_validation = new cc_validation();
-      $result = $cc_validation->validate($HTTP_POST_VARS['cc_number'], 
$HTTP_POST_VARS['cc_expires_month'], $HTTP_POST_VARS['cc_expires_year']);
+      $result = $cc_validation->validate($_POST['cc_number'], 
$_POST['cc_expires_month'], $_POST['cc_expires_year']);
 
       $error = '';
       switch ($result) {
@@ -118,7 +120,7 @@
       }
 
       if ( ($result == false) || ($result < 1) ) {
-        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&cc_owner=' . urlencode($HTTP_POST_VARS['cc_owner']) . 
'&cc_expires_month=' . $HTTP_POST_VARS['cc_expires_month'] . 
'&cc_expires_year=' . $HTTP_POST_VARS['cc_expires_year'];
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&cc_owner=' . urlencode($_POST['cc_owner']) . 
'&cc_expires_month=' . $_POST['cc_expires_month'] . '&cc_expires_year=' . 
$_POST['cc_expires_year'];
 
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$payment_error_return, 'SSL', true, false));
       }
@@ -128,24 +130,28 @@
     }
 
     function confirmation() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       $confirmation = array('title' => $this->title . ': ' . 
$this->cc_card_type,
                             'fields' => array(array('title' => 
MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_OWNER,
-                                                    'field' => 
$HTTP_POST_VARS['cc_owner']),
+                                                    'field' => 
$_POST['cc_owner']),
                                               array('title' => 
MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_NUMBER,
                                                     'field' => 
substr($this->cc_card_number, 0, 4) . str_repeat('X', 
(strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                               array('title' => 
MODULE_PAYMENT_CC_TEXT_CREDIT_CARD_EXPIRES,
-                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$HTTP_POST_VARS['cc_expires_month'], 1, '20' . 
$HTTP_POST_VARS['cc_expires_year'])))));
+                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$_POST['cc_expires_month'], 1, '20' . 
$_POST['cc_expires_year'])))));
 
       return $confirmation;
     }
 
     function process_button() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
-      $process_button_string = tep_draw_hidden_field('cc_owner', 
$HTTP_POST_VARS['cc_owner']) .
-                               tep_draw_hidden_field('cc_expires', 
$HTTP_POST_VARS['cc_expires_month'] . $HTTP_POST_VARS['cc_expires_year']) .
+      $process_button_string = tep_draw_hidden_field('cc_owner', 
$_POST['cc_owner']) .
+                               tep_draw_hidden_field('cc_expires', 
$_POST['cc_expires_month'] . $_POST['cc_expires_year']) .
                                tep_draw_hidden_field('cc_type', 
$this->cc_card_type) .
                                tep_draw_hidden_field('cc_number', 
$this->cc_card_number);
 
@@ -153,13 +159,17 @@
     }
 
     function before_process() {
-      global $HTTP_POST_VARS, $order;
+      global $order;
+
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       if ( (defined('MODULE_PAYMENT_CC_EMAIL')) && 
(tep_validate_email(MODULE_PAYMENT_CC_EMAIL)) ) {
-        $len = strlen($HTTP_POST_VARS['cc_number']);
+        $len = strlen($_POST['cc_number']);
 
-        $this->cc_middle = substr($HTTP_POST_VARS['cc_number'], 4, ($len-8));
-        $order->info['cc_number'] = substr($HTTP_POST_VARS['cc_number'], 0, 4) 
. str_repeat('X', (strlen($HTTP_POST_VARS['cc_number']) - 8)) . 
substr($HTTP_POST_VARS['cc_number'], -4);
+        $this->cc_middle = substr($_POST['cc_number'], 4, ($len-8));
+        $order->info['cc_number'] = substr($_POST['cc_number'], 0, 4) . 
str_repeat('X', (strlen($_POST['cc_number']) - 8)) . 
substr($_POST['cc_number'], -4);
       }
     }
 
@@ -174,10 +184,12 @@
     }
 
     function get_error() {
-      global $HTTP_GET_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_GET;
+      }
 
       $error = array('title' => MODULE_PAYMENT_CC_TEXT_ERROR,
-                     'error' => 
stripslashes(urldecode($HTTP_GET_VARS['error'])));
+                     'error' => stripslashes(urldecode($_GET['error'])));
 
       return $error;
     }

Index: ipayment.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/ipayment.php,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- ipayment.php        19 Jul 2003 20:27:18 -0000      1.33
+++ ipayment.php        17 Nov 2003 20:34:31 -0000      1.34
@@ -99,12 +99,14 @@
     }
 
     function pre_confirmation_check() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       include(DIR_WS_CLASSES . 'cc_validation.php');
 
       $cc_validation = new cc_validation();
-      $result = 
$cc_validation->validate($HTTP_POST_VARS['ipayment_cc_number'], 
$HTTP_POST_VARS['ipayment_cc_expires_month'], 
$HTTP_POST_VARS['ipayment_cc_expires_year']);
+      $result = $cc_validation->validate($_POST['ipayment_cc_number'], 
$_POST['ipayment_cc_expires_month'], $_POST['ipayment_cc_expires_year']);
 
       $error = '';
       switch ($result) {
@@ -122,7 +124,7 @@
       }
 
       if ( ($result == false) || ($result < 1) ) {
-        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&ipayment_cc_owner=' . 
urlencode($HTTP_POST_VARS['ipayment_cc_owner']) . '&ipayment_cc_expires_month=' 
. $HTTP_POST_VARS['ipayment_cc_expires_month'] . '&ipayment_cc_expires_year=' . 
$HTTP_POST_VARS['ipayment_cc_expires_year'] . '&ipayment_cc_checkcode=' . 
$HTTP_POST_VARS['ipayment_cc_checkcode'];
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&ipayment_cc_owner=' . 
urlencode($_POST['ipayment_cc_owner']) . '&ipayment_cc_expires_month=' . 
$_POST['ipayment_cc_expires_month'] . '&ipayment_cc_expires_year=' . 
$_POST['ipayment_cc_expires_year'] . '&ipayment_cc_checkcode=' . 
$_POST['ipayment_cc_checkcode'];
 
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$payment_error_return, 'SSL', true, false));
       }
@@ -134,26 +136,32 @@
     }
 
     function confirmation() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       $confirmation = array('title' => $this->title . ': ' . 
$this->cc_card_type,
                             'fields' => array(array('title' => 
MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_OWNER,
-                                                    'field' => 
$HTTP_POST_VARS['ipayment_cc_owner']),
+                                                    'field' => 
$_POST['ipayment_cc_owner']),
                                               array('title' => 
MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_NUMBER,
                                                     'field' => 
substr($this->cc_card_number, 0, 4) . str_repeat('X', 
(strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                               array('title' => 
MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_EXPIRES,
-                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$HTTP_POST_VARS['ipayment_cc_expires_month'], 1, '20' . 
$HTTP_POST_VARS['ipayment_cc_expires_year'])))));
+                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$_POST['ipayment_cc_expires_month'], 1, '20' . 
$_POST['ipayment_cc_expires_year'])))));
 
-      if (tep_not_null($HTTP_POST_VARS['ipayment_cc_checkcode'])) {
+      if (tep_not_null($_POST['ipayment_cc_checkcode'])) {
         $confirmation['fields'][] = array('title' => 
MODULE_PAYMENT_IPAYMENT_TEXT_CREDIT_CARD_CHECKNUMBER,
-                                          'field' => 
$HTTP_POST_VARS['ipayment_cc_checkcode']);
+                                          'field' => 
$_POST['ipayment_cc_checkcode']);
       }
 
       return $confirmation;
     }
 
     function process_button() {
-      global $HTTP_POST_VARS, $order, $currencies, $currency;
+      global $osC_Session, $order, $currencies;
+
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       switch (MODULE_PAYMENT_IPAYMENT_CURRENCY) {
         case 'Always EUR':
@@ -163,15 +171,15 @@
           $trx_currency = 'USD';
           break;
         case 'Either EUR or USD, else EUR':
-          if ( ($currency == 'EUR') || ($currency == 'USD') ) {
-            $trx_currency = $currency;
+          if ( ($osC_Session->value('currency') == 'EUR') || 
($osC_Session->value('currency') == 'USD') ) {
+            $trx_currency = $osC_Session->value('currency');
           } else {
             $trx_currency = 'EUR';
           }
           break;
         case 'Either EUR or USD, else USD':
-          if ( ($currency == 'EUR') || ($currency == 'USD') ) {
-            $trx_currency = $currency;
+          if ( ($osC_Session->value('currency') == 'EUR') || 
($osC_Session->value('currency') == 'USD') ) {
+            $trx_currency = $osC_Session->value('currency');
           } else {
             $trx_currency = 'USD';
           }
@@ -185,14 +193,14 @@
                                tep_draw_hidden_field('item_name', STORE_NAME) .
                                tep_draw_hidden_field('trx_currency', 
$trx_currency) .
                                tep_draw_hidden_field('trx_amount', 
number_format($order->info['total'] * 100 * 
$currencies->get_value($trx_currency), 0, '','')) .
-                               tep_draw_hidden_field('cc_expdate_month', 
$HTTP_POST_VARS['ipayment_cc_expires_month']) .
-                               tep_draw_hidden_field('cc_expdate_year', 
$HTTP_POST_VARS['ipayment_cc_expires_year']) .
-                               tep_draw_hidden_field('cc_number', 
$HTTP_POST_VARS['ipayment_cc_number']) .
-                               tep_draw_hidden_field('cc_checkcode', 
$HTTP_POST_VARS['ipayment_cc_checkcode']) .
-                               tep_draw_hidden_field('addr_name', 
$HTTP_POST_VARS['ipayment_cc_owner']) .
+                               tep_draw_hidden_field('cc_expdate_month', 
$_POST'ipayment_cc_expires_month']) .
+                               tep_draw_hidden_field('cc_expdate_year', 
$_POST['ipayment_cc_expires_year']) .
+                               tep_draw_hidden_field('cc_number', 
$_POST['ipayment_cc_number']) .
+                               tep_draw_hidden_field('cc_checkcode', 
$_POST['ipayment_cc_checkcode']) .
+                               tep_draw_hidden_field('addr_name', 
$_POST['ipayment_cc_owner']) .
                                tep_draw_hidden_field('addr_email', 
$order->customer['email_address']) .
                                tep_draw_hidden_field('redirect_url', 
tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', true)) .
-                               tep_draw_hidden_field('silent_error_url', 
tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . 
'&ipayment_cc_owner=' . urlencode($HTTP_POST_VARS['ipayment_cc_owner']), 'SSL', 
true));
+                               tep_draw_hidden_field('silent_error_url', 
tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . 
'&ipayment_cc_owner=' . urlencode($_POST['ipayment_cc_owner']), 'SSL', true));
 
       return $process_button_string;
     }
@@ -206,10 +214,12 @@
     }
 
     function get_error() {
-      global $HTTP_GET_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_GET;
+      }
 
       $error = array('title' => IPAYMENT_ERROR_HEADING,
-                     'error' => ((isset($HTTP_GET_VARS['error'])) ? 
stripslashes(urldecode($HTTP_GET_VARS['error'])) : IPAYMENT_ERROR_MESSAGE));
+                     'error' => ((isset($_GET['error'])) ? 
stripslashes(urldecode($_GET['error'])) : IPAYMENT_ERROR_MESSAGE));
 
       return $error;
     }

Index: nochex.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/nochex.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- nochex.php  29 Jan 2003 19:57:15 -0000      1.12
+++ nochex.php  17 Nov 2003 20:34:31 -0000      1.13
@@ -73,12 +73,12 @@
     }
 
     function process_button() {
-      global $order, $currencies, $customer_id;
+      global $order, $currencies, $osC_Customer;
 
       $process_button_string = tep_draw_hidden_field('cmd', '_xclick') .
                                tep_draw_hidden_field('email', 
MODULE_PAYMENT_NOCHEX_ID) .
                                tep_draw_hidden_field('amount', 
number_format($order->info['total'] * $currencies->currencies['GBP']['value'], 
$currencies->currencies['GBP']['decimal_places'])) .
-                               tep_draw_hidden_field('ordernumber', 
$customer_id . '-' . date('Ymdhis')) .
+                               tep_draw_hidden_field('ordernumber', 
$osC_Customer->id . '-' . date('Ymdhis')) .
                                tep_draw_hidden_field('returnurl', 
tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
                                tep_draw_hidden_field('cancel_return', 
tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 

Index: paypal.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/paypal.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- paypal.php  29 Jan 2003 19:57:15 -0000      1.39
+++ paypal.php  17 Nov 2003 20:34:31 -0000      1.40
@@ -73,10 +73,10 @@
     }
 
     function process_button() {
-      global $order, $currencies, $currency;
+      global $osC_Session, $order, $currencies;
 
       if (MODULE_PAYMENT_PAYPAL_CURRENCY == 'Selected Currency') {
-        $my_currency = $currency;
+        $my_currency = $osC_Session->value('currency');
       } else {
         $my_currency = substr(MODULE_PAYMENT_PAYPAL_CURRENCY, 5);
       }

Index: pm2checkout.php
===================================================================
RCS file: 
/cvsroot/tep/catalog/catalog/includes/modules/payment/pm2checkout.php,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- pm2checkout.php     19 Jul 2003 20:27:18 -0000      1.20
+++ pm2checkout.php     17 Nov 2003 20:34:31 -0000      1.21
@@ -96,12 +96,14 @@
     }
 
     function pre_confirmation_check() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       include(DIR_WS_CLASSES . 'cc_validation.php');
 
       $cc_validation = new cc_validation();
-      $result = 
$cc_validation->validate($HTTP_POST_VARS['pm_2checkout_cc_number'], 
$HTTP_POST_VARS['pm_2checkout_cc_expires_month'], 
$HTTP_POST_VARS['pm_2checkout_cc_expires_year']);
+      $result = $cc_validation->validate($_POST['pm_2checkout_cc_number'], 
$_POST['pm_2checkout_cc_expires_month'], 
$_POST['pm_2checkout_cc_expires_year']);
 
       $error = '';
       switch ($result) {
@@ -119,7 +121,7 @@
       }
 
       if ( ($result == false) || ($result < 1) ) {
-        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&pm_2checkout_cc_owner_firstname=' . 
urlencode($HTTP_POST_VARS['pm_2checkout_cc_owner_firstname']) . 
'&pm_2checkout_cc_owner_lastname=' . 
urlencode($HTTP_POST_VARS['pm_2checkout_cc_owner_lastname']) . 
'&pm_2checkout_cc_expires_month=' . 
$HTTP_POST_VARS['pm_2checkout_cc_expires_month'] . 
'&pm_2checkout_cc_expires_year=' . 
$HTTP_POST_VARS['pm_2checkout_cc_expires_year'];
+        $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&pm_2checkout_cc_owner_firstname=' . 
urlencode($_POST['pm_2checkout_cc_owner_firstname']) . 
'&pm_2checkout_cc_owner_lastname=' . 
urlencode($_POST['pm_2checkout_cc_owner_lastname']) . 
'&pm_2checkout_cc_expires_month=' . $_POST['pm_2checkout_cc_expires_month'] . 
'&pm_2checkout_cc_expires_year=' . $_POST['pm_2checkout_cc_expires_year'];
 
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$payment_error_return, 'SSL', true, false));
       }
@@ -131,31 +133,37 @@
     }
 
     function confirmation() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       $confirmation = array('title' => $this->title . ': ' . 
$this->cc_card_type,
                             'fields' => array(array('title' => 
MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_OWNER,
-                                                    'field' => 
$HTTP_POST_VARS['pm_2checkout_cc_owner_firstname'] . ' ' . 
$HTTP_POST_VARS['pm_2checkout_cc_owner_lastname']),
+                                                    'field' => 
$_POST['pm_2checkout_cc_owner_firstname'] . ' ' . 
$_POST['pm_2checkout_cc_owner_lastname']),
                                               array('title' => 
MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_NUMBER,
                                                     'field' => 
substr($this->cc_card_number, 0, 4) . str_repeat('X', 
(strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                               array('title' => 
MODULE_PAYMENT_2CHECKOUT_TEXT_CREDIT_CARD_EXPIRES,
-                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$HTTP_POST_VARS['pm_2checkout_cc_expires_month'], 1, '20' . 
$HTTP_POST_VARS['pm_2checkout_cc_expires_year'])))));
+                                                    'field' => strftime('%B, 
%Y', mktime(0,0,0,$_POST['pm_2checkout_cc_expires_month'], 1, '20' . 
$_POST['pm_2checkout_cc_expires_year'])))));
 
       return $confirmation;
     }
 
     function process_button() {
-      global $HTTP_POST_VARS, $order;
+      global $order;
+
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       $process_button_string = tep_draw_hidden_field('x_login', 
MODULE_PAYMENT_2CHECKOUT_LOGIN) .
                                tep_draw_hidden_field('x_amount', 
number_format($order->info['total'], 2)) .
                                tep_draw_hidden_field('x_invoice_num', 
date('YmdHis')) .
                                tep_draw_hidden_field('x_test_request', 
((MODULE_PAYMENT_2CHECKOUT_TESTMODE == 'Test') ? 'Y' : 'N')) .
                                tep_draw_hidden_field('x_card_num', 
$this->cc_card_number) .
-                               tep_draw_hidden_field('cvv', 
$HTTP_POST_VARS['pm_2checkout_cc_cvv']) .
+                               tep_draw_hidden_field('cvv', 
$_POST['pm_2checkout_cc_cvv']) .
                                tep_draw_hidden_field('x_exp_date', 
$this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .
-                               tep_draw_hidden_field('x_first_name', 
$HTTP_POST_VARS['pm_2checkout_cc_owner_firstname']) .
-                               tep_draw_hidden_field('x_last_name', 
$HTTP_POST_VARS['pm_2checkout_cc_owner_lastname']) .
+                               tep_draw_hidden_field('x_first_name', 
$_POST['pm_2checkout_cc_owner_firstname']) .
+                               tep_draw_hidden_field('x_last_name', 
$_POST['pm_2checkout_cc_owner_lastname']) .
                                tep_draw_hidden_field('x_address', 
$order->customer['street_address']) .
                                tep_draw_hidden_field('x_city', 
$order->customer['city']) .
                                tep_draw_hidden_field('x_state', 
$order->customer['state']) .
@@ -177,9 +185,11 @@
     }
 
     function before_process() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
-      if ($HTTP_POST_VARS['x_response_code'] != '1') {
+      if ($_POST['x_response_code'] != '1') {
         tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' 
. urlencode(MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR_MESSAGE), 'SSL', true, false));
       }
     }
@@ -189,10 +199,12 @@
     }
 
     function get_error() {
-      global $HTTP_GET_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_GET;
+      }
 
       $error = array('title' => MODULE_PAYMENT_2CHECKOUT_TEXT_ERROR,
-                     'error' => 
stripslashes(urldecode($HTTP_GET_VARS['error'])));
+                     'error' => stripslashes(urldecode($_GET['error'])));
 
       return $error;
     }

Index: psigate.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/psigate.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- psigate.php 30 Jun 2003 20:30:37 -0000      1.17
+++ psigate.php 17 Nov 2003 20:34:31 -0000      1.18
@@ -101,13 +101,15 @@
     }
 
     function pre_confirmation_check() {
-      global $HTTP_POST_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
         include(DIR_WS_CLASSES . 'cc_validation.php');
 
         $cc_validation = new cc_validation();
-        $result = 
$cc_validation->validate($HTTP_POST_VARS['psigate_cc_number'], 
$HTTP_POST_VARS['psigate_cc_expires_month'], 
$HTTP_POST_VARS['psigate_cc_expires_year']);
+        $result = $cc_validation->validate($_POST['psigate_cc_number'], 
$_POST['psigate_cc_expires_month'], $_POST['psigate_cc_expires_year']);
 
         $error = '';
         switch ($result) {
@@ -125,7 +127,7 @@
         }
 
         if ( ($result == false) || ($result < 1) ) {
-          $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&psigate_cc_owner=' . 
urlencode($HTTP_POST_VARS['psigate_cc_owner']) . '&psigate_cc_expires_month=' . 
$HTTP_POST_VARS['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . 
$HTTP_POST_VARS['psigate_cc_expires_year'];
+          $payment_error_return = 'payment_error=' . $this->code . '&error=' . 
urlencode($error) . '&psigate_cc_owner=' . 
urlencode($_POST['psigate_cc_owner']) . '&psigate_cc_expires_month=' . 
$_POST['psigate_cc_expires_month'] . '&psigate_cc_expires_year=' . 
$_POST['psigate_cc_expires_year'];
 
           tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$payment_error_return, 'SSL', true, false));
         }
@@ -140,7 +142,11 @@
     }
 
     function confirmation() {
-      global $HTTP_POST_VARS, $order;
+      global $order;
+
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
 
       if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
         $confirmation = array('title' => $this->title . ': ' . 
$this->cc_card_type,
@@ -149,7 +155,7 @@
                                                 array('title' => 
MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_NUMBER,
                                                       'field' => 
substr($this->cc_card_number, 0, 4) . str_repeat('X', 
(strlen($this->cc_card_number) - 8)) . substr($this->cc_card_number, -4)),
                                                 array('title' => 
MODULE_PAYMENT_PSIGATE_TEXT_CREDIT_CARD_EXPIRES,
-                                                      'field' => strftime('%B, 
%Y', mktime(0,0,0,$HTTP_POST_VARS['psigate_cc_expires_month'], 1, '20' . 
$HTTP_POST_VARS['psigate_cc_expires_year'])))));
+                                                      'field' => strftime('%B, 
%Y', mktime(0,0,0,$_POST['psigate_cc_expires_month'], 1, '20' . 
$_POST['psigate_cc_expires_year'])))));
 
         return $confirmation;
       } else {
@@ -158,7 +164,7 @@
     }
 
     function process_button() {
-      global $HTTP_SERVER_VARS, $order, $currencies;
+      global $order, $currencies;
 
       switch (MODULE_PAYMENT_PSIGATE_TRANSACTION_MODE) {
         case 'Always Good':
@@ -218,7 +224,7 @@
                                 tep_draw_hidden_field('Scountry', 
$order->delivery['country']['iso_code_2']) .
                                 tep_draw_hidden_field('ChargeType', 
$transaction_type) .
                                 tep_draw_hidden_field('Result', 
$transaction_mode) .
-                                tep_draw_hidden_field('IP', 
$HTTP_SERVER_VARS['REMOTE_ADDR']);
+                                tep_draw_hidden_field('IP', 
tep_get_ip_address());
 
       if (MODULE_PAYMENT_PSIGATE_INPUT_MODE == 'Local') {
         $process_button_string .= tep_draw_hidden_field('CardNumber', 
$this->cc_card_number) .
@@ -238,14 +244,16 @@
     }
 
     function get_error() {
-      global $HTTP_GET_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_GET;
+      }
 
-      if (isset($HTTP_GET_VARS['ErrMsg']) && 
tep_not_null($HTTP_GET_VARS['ErrMsg'])) {
-        $error = stripslashes(urldecode($HTTP_GET_VARS['ErrMsg']));
-      } elseif (isset($HTTP_GET_VARS['Err']) && 
tep_not_null($HTTP_GET_VARS['Err'])) {
-        $error = stripslashes(urldecode($HTTP_GET_VARS['Err']));
-      } elseif (isset($HTTP_GET_VARS['error']) && 
tep_not_null($HTTP_GET_VARS['error'])) {
-        $error = stripslashes(urldecode($HTTP_GET_VARS['error']));
+      if (isset($_GET['ErrMsg']) && tep_not_null($_GET['ErrMsg'])) {
+        $error = stripslashes(urldecode($_GET['ErrMsg']));
+      } elseif (isset($_GET['Err']) && tep_not_null($_GET['Err'])) {
+        $error = stripslashes(urldecode($_GET['Err']));
+      } elseif (isset($_GET['error']) && tep_not_null($_GET['error'])) {
+        $error = stripslashes(urldecode($_GET['error']));
       } else {
         $error = MODULE_PAYMENT_PSIGATE_TEXT_ERROR_MESSAGE;
       }

Index: secpay.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/includes/modules/payment/secpay.php,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- secpay.php  29 Jan 2003 19:57:15 -0000      1.31
+++ secpay.php  17 Nov 2003 20:34:31 -0000      1.32
@@ -73,7 +73,7 @@
     }
 
     function process_button() {
-      global $order, $currencies, $currency;
+      global $osC_Session, $order, $currencies;
 
       switch (MODULE_PAYMENT_SECPAY_CURRENCY) {
         case 'Default Currency':
@@ -81,7 +81,7 @@
           break;
         case 'Any Currency':
         default:
-          $sec_currency = $currency;
+          $sec_currency = $osC_Session->value('currency');
           break;
       }
 
@@ -119,25 +119,29 @@
                                tep_draw_hidden_field('ship_country', 
$order->delivery['country']['title']) .
                                tep_draw_hidden_field('currency', 
$sec_currency) .
                                tep_draw_hidden_field('callback', 
tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL', false) . ';' . 
tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code, 'SSL', 
false)) .
-                               tep_draw_hidden_field(tep_session_name(), 
tep_session_id()) .
-                               tep_draw_hidden_field('options', 'test_status=' 
. $test_status . ',dups=false,cb_post=true,cb_flds=' . tep_session_name());
+                               tep_draw_hidden_field($osC_Session->name, 
$osC_Session->id) .
+                               tep_draw_hidden_field('options', 'test_status=' 
. $test_status . ',dups=false,cb_post=true,cb_flds=' . $osC_Session->name);
 
       return $process_button_string;
     }
 
     function before_process() {
-      global $HTTP_POST_VARS;
+      global $osC_Session;
 
-      if ($HTTP_POST_VARS['valid'] == 'true') {
+      if (PHP_VERSION < 4.1) {
+        global $_POST;
+      }
+
+      if ($_POST['valid'] == 'true') {
         if ($remote_host = getenv('REMOTE_HOST')) {
           if ($remote_host != 'secpay.com') {
             $remote_host = gethostbyaddr($remote_host);
           }
           if ($remote_host != 'secpay.com') {
-            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . 
'&payment_error=' . $this->code, 'SSL', false, false));
+            tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$osC_Session->name . '=' . $_POST[$osC_Session->name] . '&payment_error=' . 
$this->code, 'SSL', false, false));
           }
         } else {
-          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
tep_session_name() . '=' . $HTTP_POST_VARS[tep_session_name()] . 
'&payment_error=' . $this->code, 'SSL', false, false));
+          tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 
$osC_Session->name . '=' . $_POST[$osC_Session->name] . '&payment_error=' . 
$this->code, 'SSL', false, false));
         }
       }
     }
@@ -147,10 +151,12 @@
     }
 
     function get_error() {
-      global $HTTP_GET_VARS;
+      if (PHP_VERSION < 4.1) {
+        global $_GET;
+      }
 
-      if (isset($HTTP_GET_VARS['message']) && 
(strlen($HTTP_GET_VARS['message']) > 0)) {
-        $error = stripslashes(urldecode($HTTP_GET_VARS['message']));
+      if (isset($_GET['message']) && (strlen($_GET['message']) > 0)) {
+        $error = stripslashes(urldecode($_GET['message']));
       } else {
         $error = MODULE_PAYMENT_SECPAY_TEXT_ERROR_MESSAGE;
       }



-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe