--- ../../../drupal/modules/ecommerce/payment/payment.module	2006-02-17 18:10:57.000000000 -0600
+++ payment/payment.module	2006-02-28 13:34:59.000000000 -0600
@@ -481,14 +481,15 @@
  * @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;
-      }
-    }  
+  //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($name == ($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;   
