diff --git includes/handlers/pay_form.inc includes/handlers/pay_form.inc
index 324e2c2..f19ee60 100644
--- includes/handlers/pay_form.inc
+++ includes/handlers/pay_form.inc
@@ -203,6 +203,7 @@ class pay_form extends pay {
     $group = $this->handler();
     $methods = $this->pay_methods();
 
+    $form[$group]['pay_method']['#theme'] = 'pay_method_form';
     $form[$group]['pay_method']['selected'] = array();
 
     foreach ($methods as $pmid => $pay_method) {
diff --git includes/handlers/pay_method_gateway.inc includes/handlers/pay_method_gateway.inc
index 5d036c2..b823150 100644
--- includes/handlers/pay_method_gateway.inc
+++ includes/handlers/pay_method_gateway.inc
@@ -488,8 +488,6 @@ class pay_method_gateway extends pay_method {
 
     // Add this method_form to the expected place on the parent form.
     $form[$group]['pay_method'][$this->pmid] = $method_form;
-    $form[$group]['pay_method'][$this->pmid]['#prefix'] = '<div class="payment-method-form">';
-    $form[$group]['pay_method'][$this->pmid]['#suffix'] = '</div>';
   }
 
   // This is called from the form_validate function in a pay_form class.
diff --git theme/pay.theme.inc theme/pay.theme.inc
index 1566ae8..eec69f6 100644
--- theme/pay.theme.inc
+++ theme/pay.theme.inc
@@ -43,6 +43,11 @@ function pay_theme_theme() {
       'file' => 'pay.theme.inc',
       'path' => $path,
     ),
+    'pay_method_form' => array(
+      'arguments' => array('element' => array()),
+      'file' => 'pay.theme.inc',
+      'path' => $path,
+    ),
     'pay_cc_form' => array(
       'arguments' => array('element' => array()),
       'template' => 'pay_cc_form',
@@ -215,3 +220,15 @@ function theme_pay_money($value, $currency) {
   }
   return $symbol . (float) $value;
 }
+
+/**
+ * Theme the payment method options.
+ */
+function theme_pay_method_form($pay_methods) {
+  drupal_add_js(drupal_get_path('module', 'pay') . '/theme/pay_method_form.js');
+  $output = drupal_render($pay_methods['selected']);
+  foreach (element_children($pay_methods) as $element) {
+    $output .= '<div id="pay-method-'. $element .'" class="payment-method-form">'. drupal_render($pay_methods[$element]) .'</div>';
+  }
+  return $output;
+}
diff --git theme/pay_cc_form.tpl.php theme/pay_cc_form.tpl.php
index 7560a6a..b04b6d1 100644
--- theme/pay_cc_form.tpl.php
+++ theme/pay_cc_form.tpl.php
@@ -83,3 +83,6 @@ if ($setup) {
   </div>
   <div class="clear"></div>
 <?php endif?>
+
+<!-- a closing div is missing somewhere??? -->
+</div>
