--- payment.module	2006-02-08 12:00:40.000000000 -0800
+++ payment_2.module	2006-02-17 11:58:41.000000000 -0800
@@ -80,7 +80,8 @@
 
     case 'review':
       $box['subject'] = t('Payment details');
-      $box['content'] = module_invoke($txn->payment_method, 'paymentapi', $txn, 'display name');
+      //wrap the payment_method around the payment_get_modulename to invoke the name hook
+      $box['content'] = module_invoke(payment_get_modulename($txn->payment_method), 'paymentapi', $txn, 'display name');
       return $box;
   }
 }
@@ -474,6 +475,25 @@
   return $methods;
 }
 
+/**
+ * Retrieves the real name of the module based on a user set module title.
+ *
+ * @return string
+ */
+function payment_get_modulename($name) {  
+    //get the list of modules. It'd be really cool if I could confine it only
+    //to payment modules.
+    foreach (module_list() as $pm) {
+      if (function_exists($pm. '_name')) {
+         if($modulename = module_invoke($pm, 'name', $name))
+            return $modulename;
+      }
+    }  
+  //if a legacy payment_method module doesn't invoke name, return its name. As
+  //long as the name is the same as the module, (like COD and Paypal) it'll work.
+  return $name;   
+}
+
 /*
  * 
  */ 
