--- uc_moneris.module	Mon Jul 13 22:17:13 2009
+++ uc_moneris.module.new	Tue Aug 18 18:37:34 2009
@@ -42,7 +42,7 @@
     unset($_SESSION['uc_moneris']);
   }
   // Only alter the form if VBV is enabled
-  if (variable_get('moneris_vbv_enable', 'disabled') == 'enabled') {
+  if (variable_get('uc_moneris_vbv_enable', 'disabled') == 'enabled') {
     if ($form_id == 'uc_cart_checkout_review_form') {
       $order = uc_order_load($_SESSION['cart_order']);
       // Only add the override to the review form if it is a Visa and we haven't got any uc_moneris data in the session.
@@ -58,12 +58,12 @@
  * Return the currently configured site-wide transaction type (purchase or preauth) taking into account the API country/version.
  */
 function uc_moneris_transaction_type() {
-  return variable_get('moneris_api_version', '') . variable_get('moneris_transaction_type', 'purchase'); 
+  return variable_get('uc_moneris_api_version', '') . variable_get('uc_moneris_transaction_type', 'purchase'); 
 }
 
 
 function uc_moneris_preauth_string() {
-  return variable_get('moneris_api_version', '') .'preauth';
+  return variable_get('uc_moneris_api_version', '') .'preauth';
 }
 /**
 * @desc Initial check for all Visa cards so that we can determine if they are enrolled or not in VBV
@@ -81,13 +81,13 @@
   if ($order->payment_details['cc_type'] == 'Visa') {
     require_once(drupal_get_path('module', 'uc_moneris') .'/api/mpiClasses.php');
     // Determine if the VISA is enrolled
-    $store_id   = variable_get('moneris_store_id', '');
-    $api_token  = variable_get('moneris_api_token', '');
+    $store_id   = variable_get('uc_moneris_store_id', '');
+    $api_token  = variable_get('uc_moneris_api_token', '');
 
     $merchant_url = url('cart/checkout/mpi/complete', NULL, NULL, TRUE); // Where to collect
 
     // If we are not in test mode, we have to craft the return url so that it remains secure
-    if (variable_get('moneris_transaction_mode', 'test') != 'test') {
+    if (variable_get('uc_moneris_transaction_mode', 'test') != 'test') {
       $merchant_url = str_replace('http://', 'https://', $merchant_url);
     }
 
@@ -122,7 +122,7 @@
     }
     else {
       // Strict mode
-      if (variable_get('moneris_vbv_strict', 'disabled') == 'enabled') {
+      if (variable_get('uc_moneris_vbv_strict', 'disabled') == 'enabled') {
         drupal_set_message('All VISA Purchases must be enrolled in the VBV (Verified by VISA) protection system.');
         drupal_goto('cart/checkout');
         exit;
@@ -240,7 +240,7 @@
     '#type' => 'select',
     '#title' => t('API Version'),
     '#description'=> t('The Moneris API differs slightly between the US and Canadian versions.'),
-    '#default_value' => variable_get('moneris_api_version', ''),
+    '#default_value' => variable_get('uc_moneris_api_version', ''),
     '#options' => array(
       '' => t('Canada'),
       'us_' => t('United States'),
@@ -249,13 +249,13 @@
   $form['moneris_settings']['moneris_store_id'] = array(
     '#type' => 'textfield',
     '#title' => t('Store ID'),
-    '#default_value' => variable_get('moneris_store_id', ''),
+    '#default_value' => variable_get('uc_moneris_store_id', ''),
     '#description' => t('The Store ID used for the Moneris.com service.'),
   );
   $form['moneris_settings']['moneris_api_token'] = array(
     '#type' => 'textfield',
     '#title' => t('API Token'),
-    '#default_value' => variable_get('moneris_api_token', ''),
+    '#default_value' => variable_get('uc_moneris_api_token', ''),
     '#description' => t('Your API Token key for sending data.'),
   );
   $form['moneris_settings']['moneris_transaction_type'] = array(
@@ -265,7 +265,7 @@
       'purchase' => 'Purchase (PreAuth if Necessary)',
       'preauth' => 'PreAuth Only'
     ),
-    '#default_value' => variable_get('moneris_transaction_type', 'purchase'),
+    '#default_value' => variable_get('uc_moneris_transaction_type', 'purchase'),
     '#description' => t('Use purchase to charge the card immediately after authentication. When CVV/CVD or Address Verification is enabled, a PreAuth will be perofrmed automatically. Use PreAuth Only to lock the funds at authentication time and then Capture the funds at a later time.'),
   );
 
@@ -273,7 +273,7 @@
     '#type' => 'select',
     '#title' => t('CVV/CVD Required'),
     '#options' => array('disabled' => 'Not Required', 'enabled' => 'Required'),
-    '#default_value' => variable_get('moneris_cvv_enable', 'disabled'),
+    '#default_value' => variable_get('uc_moneris_cvv_enable', 'disabled'),
     '#description' => t('eFraud must be enabled on your Moneris account.'),
   );
   
@@ -284,7 +284,7 @@
       'disabled' => t('Disabled'),
       'enabled' => t('Enabled'),
     ),
-    '#default_value' => variable_get('moneris_avs_enable', 'disabled'),
+    '#default_value' => variable_get('uc_moneris_avs_enable', 'disabled'),
     '#description' => t('eFraud must be enabled on your Moneris account.'),
   );
 
@@ -292,14 +292,14 @@
     '#type' => 'select',
     '#title' => t('Enable VBV (Verified by VISA)'),
     '#options' => array('disabled' => 'Disabled', 'enabled' => 'Enabled'),
-    '#default_value' => variable_get('moneris_vbv_enable', 'disabled'),
+    '#default_value' => variable_get('uc_moneris_vbv_enable', 'disabled'),
     '#description' => t('Allow transactions to authenticate through the Moneris VBV system.'),
   );
   $form['moneris_settings']['moneris_vbv_strict'] = array(
     '#type' => 'select',
     '#title' => t('Enable VBV Strict Mode (Not-recommended)'),
     '#options' => array('disabled' => 'Disabled', 'enabled' => 'Enabled'),
-    '#default_value' => variable_get('moneris_vbv_strict', 'disabled'),
+    '#default_value' => variable_get('uc_moneris_vbv_strict', 'disabled'),
     '#description' => t('Strict mode only allows VISA cards that are enrolled to complete payment, Standard mode allows no-enrolled cards to proceed as a normal purchase.'),
   );
 
@@ -311,7 +311,7 @@
       'production' => t('Production'),
       'test' => t('Test'),
     ),
-    '#default_value' => variable_get('moneris_transaction_mode', 'test'),
+    '#default_value' => variable_get('uc_moneris_transaction_mode', 'test'),
   );
 
   return $form;
@@ -330,10 +330,10 @@
   require_once(drupal_get_path('module', 'uc_moneris') .'/api/mpiClasses.php');
   require_once(drupal_get_path('module', 'uc_moneris') .'/api/mpgClasses.php');
   /**************************** Request Variables *******************************/
-  $store_id   = variable_get('moneris_store_id', '');
-  $api_token  = variable_get('moneris_api_token', '');
-  $use_cvv    = variable_get('moneris_cvv_enable', 'disabled');
-  $use_avs    = variable_get('moneris_avs_enable', 'disabled');
+  $store_id   = variable_get('uc_moneris_store_id', '');
+  $api_token  = variable_get('uc_moneris_api_token', '');
+  $use_cvv    = variable_get('uc_moneris_cvv_enable', 'disabled');
+  $use_avs    = variable_get('uc_moneris_avs_enable', 'disabled');
   $txn_type    = uc_moneris_transaction_type();
   // Use the MonthDayHoursMinutesSeconds as the unique prefix
   $xid = 'cs'. date("mdHis", time()) . str_pad($order->order_id, 8, '0', STR_PAD_LEFT);    // Must be 20 Alpha/Numeric Chars exactly
@@ -504,7 +504,7 @@
     if (($this_trans_type == uc_moneris_preauth_string() && $txnType == uc_moneris_transaction_type()) && intval($response_code) < 49 || $completed == 'TRUE') {
       //The previous transaction was a preauth before a capture. Run the transaction again in Capture mode.
       $txnArray = array(
-        'type'        =>  variable_get('moneris_api_version', '') .'completion',
+        'type'        =>  variable_get('uc_moneris_api_version', '') .'completion',
         'txn_number'  => $txn_number, 
         'order_id'    => $xid, 
         'comp_amount' => number_format($amount, 2, '.', ''), 
