Index: uc_sc_userpoints.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_store_credit/uc_sc_userpoints.info,v
retrieving revision 1.1
diff -u -p -r1.1 uc_sc_userpoints.info
--- uc_sc_userpoints.info	22 Feb 2009 07:34:04 -0000	1.1
+++ uc_sc_userpoints.info	12 May 2009 08:25:54 -0000
@@ -1,6 +1,7 @@
 ; $Id: uc_sc_userpoints.info,v 1.1 2009/02/22 07:34:04 rszrama Exp $
 name = Store Credit: User Points
 description = Allows you to use User Points as store credit for paying for orders in Ubercart.
-dependencies = uc_store_credit userpoints
-package = "Ubercart - payment"
-
+dependencies[] = uc_store_credit
+dependencies[] = userpoints
+package = Ubercart - payment
+core = 6.x
Index: uc_store_credit.info
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_store_credit/uc_store_credit.info,v
retrieving revision 1.1
diff -u -p -r1.1 uc_store_credit.info
--- uc_store_credit.info	22 Feb 2009 07:34:04 -0000	1.1
+++ uc_store_credit.info	12 May 2009 08:25:54 -0000
@@ -1,6 +1,8 @@
 ; $Id: uc_store_credit.info,v 1.1 2009/02/22 07:34:04 rszrama Exp $
 name = Store Credit
 description = Allows customers to purchase or accumulate store credit and use that credit to pay for products in the store.
-dependencies = uc_cart uc_payment uc_credit
-package = "Ubercart - payment"
-
+dependencies[] = uc_cart
+dependencies[] = uc_payment
+dependencies[] = uc_credit
+package = Ubercart - payment
+core = 6.x
Index: uc_store_credit.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_store_credit/uc_store_credit.install,v
retrieving revision 1.1
diff -u -p -r1.1 uc_store_credit.install
--- uc_store_credit.install	22 Feb 2009 07:34:04 -0000	1.1
+++ uc_store_credit.install	12 May 2009 08:25:55 -0000
@@ -6,38 +6,57 @@
  * Defines the database schema for the Store Credit module.
  */
 
-
 /**
  * Implementation of hook_install().
  */
 function uc_store_credit_install() {
-  switch ($GLOBALS['db_type']) {
-    case 'mysql':
-    case 'mysqli':
-      db_query("CREATE TABLE {uc_store_credit_values} (
-        nid mediumint(9) NOT NULL default 0,
-        store_credit_value decimal(10,2) NOT NULL default 0.00,
-        PRIMARY KEY (nid)
-      ) /*!40100 DEFAULT CHARACTER SET UTF8 */ ");
-      break;
-  }
+  drupal_install_schema('uc_store_credit');
+}
+
+/**
+ * Implementation of hook_schema().
+ */
+function uc_store_credit_schema() {
+  $schema = array();
+
+  $schema['uc_store_credit_values'] = array(
+    'fields' => array(
+      'nid' => array(
+        'type' => 'int',
+        'not null' => TRUE,
+        'default' => 0,
+        'description' => 'The {node}.nid of this product.',
+      ),
+      'store_credit_value' => array(
+        'type' => 'numeric',
+        'precision' => 15,
+        'scale' => 3,
+        'not null' => TRUE,
+        'default' => 0.0,
+        'description' => 'The price of thie product in credits.',
+      ),
+    ),
+    'primary key' => array('nid'),
+  );
+
+  return $schema;
 }
 
 /**
  * Implementation of hook_uninstall().
  */
 function uc_store_credit_uninstall() {
-  db_query("DROP TABLE {uc_store_credit_values}");
+  drupal_uninstall_schema('uc_store_credit_values');
 
   variable_del('uc_store_credit_handler');
-  variable_del('uc_store_credit_hide_method', 0);
-  variable_del('uc_store_credit_product_conversion_rate', 100);
-  variable_del('uc_store_credit_line_item_conversion_rate', 100);
-  variable_del('uc_store_credit_title', '');
-  variable_del('uc_store_credit_unit', '');
-  variable_del('uc_store_credit_error_message', '');
+  variable_del('uc_store_credit_hide_method');
+  variable_del('uc_store_credit_product_conversion_rate');
+  variable_del('uc_store_credit_line_item_conversion_rate');
+  variable_del('uc_store_credit_title');
+  variable_del('uc_store_credit_unit');
+  variable_del('uc_store_credit_error_message');
 
   foreach (module_invoke_all('product_types') as $type) {
-    variable_del('uc_store_credit_'. $type .'_value', '');
+    variable_del('uc_store_credit_'. $type .'_value');
   }
 }
Index: uc_store_credit.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_store_credit/uc_store_credit.js,v
retrieving revision 1.1
diff -u -p -r1.1 uc_store_credit.js
--- uc_store_credit.js	22 Feb 2009 07:34:04 -0000	1.1
+++ uc_store_credit.js	12 May 2009 08:25:55 -0000
@@ -12,44 +12,42 @@ var uc_store_credit_line_item_rate = 100
 var uc_store_credit_subtotal_string = 'Subtotal';
 var uc_store_credit_next_method = '';
 
-if (Drupal.jsEnabled) {
-  $(document).ready(
-    function() {
-      $('#edit-panes-payment-current-total').click(
-        function() {
-          var line_item_total = 0;
-
-          // Loop through the line items and total their value, excluding the
-          // subtotal line item since the cart total is calculated separately.
-          $.each(li_titles,
-            function(a, b) {
-              if (li_titles[a] != '' && li_titles[a] != uc_store_credit_subtotal_string && li_summed[a] == 1) {
-                line_item_total += li_values[a];
-              }
+$(document).ready(
+  function() {
+    $('#edit-panes-payment-current-total').click(
+      function() {
+        var line_item_total = 0;
+
+        // Loop through the line items and total their value, excluding the
+        // subtotal line item since the cart total is calculated separately.
+        $.each(li_titles,
+          function(a, b) {
+            if (li_titles[a] != '' && li_titles[a] != uc_store_credit_subtotal_string && li_summed[a] == 1) {
+              line_item_total += li_values[a];
             }
-          );
-
-          // Get the whole total by adding the adjusted line item total to the
-          // cart total.
-          var new_total = uc_store_credit_cart_total + line_item_total * uc_store_credit_line_item_rate;
-
-          // Update the contents of the span on the payment method line to use
-          // the new total.
-          $('#store-credit-total').html(new_total);
-
-          // Disable/hide the payment method if it is no longer available.
-          if (new_total > uc_store_credit_user_total && uc_store_credit_hide_method > 0) {
-            $("input:radio[@value=store_credit]").attr('disabled', 'disabled');
+          }
+        );
 
-            if (uc_store_credit_hide_method == 2) {
-              $("input:radio[@value=store_credit]").parent().hide(0);
-            }
+        // Get the whole total by adding the adjusted line item total to the
+        // cart total.
+        var new_total = uc_store_credit_cart_total + line_item_total * uc_store_credit_line_item_rate;
+
+        // Update the contents of the span on the payment method line to use
+        // the new total.
+        $('#store-credit-total').html(new_total);
+
+        // Disable/hide the payment method if it is no longer available.
+        if (new_total > uc_store_credit_user_total && uc_store_credit_hide_method > 0) {
+          $("input:radio[@value=store_credit]").attr('disabled', 'disabled');
 
-            // Select the first payment method.
-            $("input:radio[@value=" + uc_store_credit_next_method + "]").attr('checked', 'checked').click();
+          if (uc_store_credit_hide_method == 2) {
+            $("input:radio[@value=store_credit]").parent().hide(0);
           }
+
+          // Select the first payment method.
+          $("input:radio[@value=" + uc_store_credit_next_method + "]").attr('checked', 'checked').click();
         }
-      );
-    }
-  );
-}
+      }
+    );
+  }
+);
Index: uc_store_credit.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_store_credit/uc_store_credit.module,v
retrieving revision 1.1
diff -u -p -r1.1 uc_store_credit.module
--- uc_store_credit.module	22 Feb 2009 07:34:04 -0000	1.1
+++ uc_store_credit.module	12 May 2009 08:25:56 -0000
@@ -16,7 +16,7 @@
 /**
  * Implementation of hook_form_alter().
  */
-function uc_store_credit_form_alter($form_id, &$form) {
+function uc_store_credit_form_alter(&$form, &$form_state, $form_id) {
   // If this is some sort of product node form...
   if (substr($form_id, -10) == '_node_form' && in_array(substr($form_id, 0, strlen($form_id) - 10), module_invoke_all('product_types'))) {
     // Add a store credit value textfield that will override any global fixed
@@ -56,9 +56,9 @@ function uc_store_credit_form_alter($for
 }
 
 // Validates the checkout form when the store credit payment method is selected.
-function uc_store_credit_checkout_validate($form_id, $form_values) {
+function uc_store_credit_checkout_validate($form, &$form_state) {
   // If the customer chose store credit...
-  if ($form_values['panes']['payment']['payment_method'] == 'store_credit') {
+  if ($form_state['values']['panes']['payment']['payment_method'] == 'store_credit') {
     $order = uc_order_load($_SESSION['cart_order']);
 
     // If they don't have enough store credit for this order...
@@ -72,7 +72,7 @@ function uc_store_credit_checkout_valida
 /**
  * Implementation of hook_nodeapi().
  */
-function uc_store_credit_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
+function uc_store_credit_nodeapi(&$node, $op, $arg = 0) {
   switch ($op) {
     case 'insert':
     case 'update':
