Index: uc_pma.install
===================================================================
RCS file: uc_pma.install
diff -N uc_pma.install
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ uc_pma.install	14 Sep 2010 20:38:28 -0000
@@ -0,0 +1,16 @@
+<?php
+// $Id$
+
+/**
+ * Implementation of hook_install().
+ */
+function uc_pma_install() {
+  // Ensure the module weight is lower than uc_taxes.
+  db_query("UPDATE {system} SET weight = -1 WHERE name = 'uc_pma'");
+}
+
+function uc_pma_update_1() {
+  $ret = array();
+  $ret[] = update_sql("UPDATE {system} SET weight = -1 WHERE name = 'uc_pma'");
+  return $ret;
+}
Index: uc_pma.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_pma/uc_pma.module,v
retrieving revision 1.2.2.1
diff -u -p -r1.2.2.1 uc_pma.module
--- uc_pma.module	6 Oct 2009 14:39:51 -0000	1.2.2.1
+++ uc_pma.module	14 Sep 2010 20:38:29 -0000
@@ -98,11 +98,24 @@ function uc_pma_line_item() {
 function uc_pma_order($op, &$arg1) {
   switch ($op) {
     case 'save':
+      foreach ($arg1->line_items as $i => $line) {
+        if ($line['type'] == 'payment_method') {
+          uc_order_delete_line_item($line['line_item_id']);
+          unset($arg1->line_items[$i]);
+        }
+      }
+
       $adjustment = _payment_method_adjustment($arg1);
-      db_query("DELETE FROM {uc_order_line_items} WHERE order_id = %d AND type = 'payment_method'", $arg1->order_id);
       $min_adjust = .01;
       if ($adjustment['value'] && ($adjustment['value'] >= $min_adjust || $adjustment['value'] <= -$min_adjust)) {
         uc_order_line_item_add($arg1->order_id, 'payment_method', $adjustment['description'], $adjustment['value'], 1);
+        $arg1->line_items[] = array(
+          'id' => 'payment_method',
+          'type' => 'payment_method',
+          'title' => $adjustment['description'],
+          'amount' => $adjustment['value'],
+          'weight' => 1,
+        );
       }
       break;
   }
