diff --git a/uc_migs.install b/uc_migs.install
index 72d1179..2363f2e 100644
--- a/uc_migs.install
+++ b/uc_migs.install
@@ -11,3 +11,17 @@ function uc_migs_update_6000() {
   drupal_theme_rebuild();
   return $ret;
 }
+
+/**
+ * Add variable for enabled cards.
+ */
+function uc_migs_update_7000() {
+  $ret = array();
+  module_load_include('inc', 'uc_migs', 'uc_migs.lib');
+  $logos = variable_get('uc_migs_method_title_display_icons', array());
+  foreach (array_keys(_uc_migs_card_types()) as $type) {
+    $enabled[$type] = empty($logos) ? $type : $logos[$type];
+  }
+  variable_set('uc_migs_card_types_enabled', $enabled);
+  return t('Please review the enabled card types for MIGS in your Ubercart payment method settings.');
+}
diff --git a/uc_migs.lib.inc b/uc_migs.lib.inc
index 0a8336a..8e72437 100644
--- a/uc_migs.lib.inc
+++ b/uc_migs.lib.inc
@@ -7,18 +7,16 @@
  * @return string URL for redirect
  */
 function _uc_migs_migs_do_url($args) {
-  $md5HashData = $args['secure_secret'] . $args['vpc_AccessCode'] . $args['vpc_Amount'] . 'pay' . $args['vpc_Locale'] . $args['vpc_MerchTxnRef'] . $args['vpc_Merchant'] . $args['vpc_OrderInfo'] . $args['vpc_ReturnURL'] . $args['vpc_Version'];
-  $url = variable_get('uc_migs_base_url', UC_MIGS_BASE_URL) . '?' .
-    'vpc_AccessCode='   . urlencode($args['vpc_AccessCode']) .
-    '&vpc_Amount='      . urlencode($args['vpc_Amount']) .
-    '&vpc_Command='     . urlencode('pay') .
-    '&vpc_Locale='      . urlencode($args['vpc_Locale']) .
-    '&vpc_MerchTxnRef=' . urlencode($args['vpc_MerchTxnRef']) .
-    '&vpc_Merchant='    . urlencode($args['vpc_Merchant']) .
-    '&vpc_OrderInfo='   . urlencode($args['vpc_OrderInfo']) .
-    '&vpc_ReturnURL='   . urlencode($args['vpc_ReturnURL']) .
-    '&vpc_Version='     . urlencode($args['vpc_Version']) .
-    '&vpc_SecureHash='  . strtoupper(md5($md5HashData));
+  // new method
+  foreach ($args as $k => $v) {
+    if (preg_match('/^vpc_/', $k)) {
+      $hashArray[$k] = $v;
+    }
+  }
+  ksort($hashArray);
+  $query = $hashArray;
+  $query['vpc_SecureHash'] = strtoupper(md5(variable_get('uc_migs_secure_hash_secret', '') . implode('', $hashArray)));
+  $url = url(variable_get('uc_migs_base_url', UC_MIGS_BASE_URL), array('absolute' => TRUE, 'query' => $query));
   return $url;
 }
 
@@ -34,7 +32,7 @@ function _uc_migs_validate_transaction($secure_secret) {
   $locale          = (isset($_GET['vpc_Locale'])) ? $_GET['vpc_Locale'] : NULL;
   $batchNo         = (isset($_GET['vpc_BatchNo'])) ? $_GET['vpc_BatchNo'] : NULL;
   $command         = (isset($_GET['vpc_Command'])) ? $_GET['vpc_Command'] : NULL;
-  $message         = (isset($_GET['vpc_Message'])) ? $_GET['vpc_Message'] : NULL; 
+  $message         = (isset($_GET['vpc_Message'])) ? $_GET['vpc_Message'] : NULL;
   $version         = (isset($_GET['vpc_Version'])) ? $_GET['vpc_Version'] : NULL;
   $cardType        = (isset($_GET['vpc_Card'])) ? $_GET['vpc_Card'] : NULL;
   $orderInfo       = (isset($_GET['vpc_OrderInfo'])) ? $_GET['vpc_OrderInfo'] : NULL;
@@ -57,7 +55,7 @@ function _uc_migs_validate_transaction($secure_secret) {
   $acqECI          = array_key_exists('vpc_3DSECI', $_GET)           ? $_GET['vpc_3DSECI']           : "No Value Returned";
   $authStatus      = array_key_exists('vpc_3DSstatus', $_GET)        ? $_GET['vpc_3DSstatus']        : "No Value Returned";
 
-  $vpc_Txn_Secure_Hash = $_GET['vpc_SecureHash'];
+  $vpc_Txn_Secure_Hash = isset($_GET['vpc_SecureHash']) ? $_GET['vpc_SecureHash'] : '';
   $errorExists = FALSE ;
 
   if ( $txnResponseCode != 7 && $txnResponseCode != '' ) {
@@ -74,7 +72,7 @@ function _uc_migs_validate_transaction($secure_secret) {
       return UC_MIGS_TRANSACTION_BADHASH;
     }
     else {
-      // validation success; fall thru to next phase 
+      // validation success; fall thru to next phase
     }
   } else {
     // Secure Hash was not validated, none there to validate
@@ -100,7 +98,7 @@ function _uc_migs_validate_transaction($secure_secret) {
       }
       return UC_MIGS_TRANSACTION_ORDERNOTYETINCHECKOUT;
   }
-  
+
   if ( $txnResponseCode != "0") {
     return UC_MIGS_TRANSACTION_PAYMENTERROR;
   } else {
@@ -119,12 +117,12 @@ function _uc_migs_validate_transaction($secure_secret) {
 function _uc_migs_get_response_description($responseCode) {
   switch ($responseCode) {
     case '0' :
-      $result = "Transaction Successful"; 
+      $result = "Transaction Successful";
       break;
-    case '?' : 
-      $result = "Transaction status is unknown"; 
+    case '?' :
+      $result = "Transaction status is unknown";
       break;
-    case '1' : 
+    case '1' :
       $result = "Transaction could not be processed";
       break;
     case '2' :
@@ -191,7 +189,7 @@ function _uc_migs_get_response_description($responseCode) {
       $result = "Address Verification and Card Security Code Failed";
       break ;
     default  :
-      $result = "Unable to be determined"; 
+      $result = "Unable to be determined";
   }
   return $result;
 }
@@ -209,7 +207,7 @@ function _uc_migs_get_status_description($statusResponse) {
     $result = "3DS not supported or there was no 3DS data provided";
   } else {
     switch ($statusResponse) {
-      case 'Y' : 
+      case 'Y' :
         $result = "The cardholder was successfully authenticated.";
         break;
       case 'E' :
@@ -237,13 +235,13 @@ function _uc_migs_get_status_description($statusResponse) {
         $result = "The signature on the response received from the Issuer could not be validated.";
         break;
       case 'P' :
-        $result = "Error parsing input from Issuer."; 
+        $result = "Error parsing input from Issuer.";
         break;
       case 'I' :
-        $result = "Internal Payment Server system error."; 
+        $result = "Internal Payment Server system error.";
         break;
       default  :
-        $result = "Unable to be determined"; 
+        $result = "Unable to be determined";
         break;
     }
   }
@@ -270,6 +268,10 @@ function _uc_migs_select_transaction_results(&$element) {
 /**
  * Helper function to return a structured array of supported card
  * types MIGS offers.
+ *
+ * @TODO Sometimes we need to look up using the method name (which is
+ * namespaced, eg migs_mastercard) and sometimes by id (eg mastercard).
+ * Would be nice to clean that up so it's consistent.
  */
 function _uc_migs_card_types() {
   $card_types = array(
@@ -277,30 +279,64 @@ function _uc_migs_card_types() {
       'name' => 'MasterCard',
       'logo_remote' => 'https://migs.mastercard.com.au/res/svr/default/images/cards/card_sm_masterc.gif',
       'logo_local' => variable_get('uc_migs_logo_mastercard', variable_get('file_public_path', conf_path() . '/files') . '/uc_migs/mastercard.gif'),
+      'code' => 'Mastercard',
+      'method' => 'migs_mastercard',
     ),
     'visa' => array(
       'name' => 'VISA',
       'logo_remote' => 'https://migs.mastercard.com.au/res/svr/default/images/cards/card_sm_visa.gif',
       'logo_local' => variable_get('uc_migs_logo_visa', variable_get('file_public_path', conf_path() . '/files') . '/uc_migs/visa.gif'),
+      'code' => 'Visa',
+      'method' => 'migs_visa',
     ),
     'amex' => array(
       'name' => 'American Express',
       'logo_remote' => 'https://migs.mastercard.com.au/res/svr/default/images/cards/card_sm_amex.gif',
       'logo_local' => variable_get('uc_migs_logo_amex', variable_get('file_public_path', conf_path() . '/files') . '/uc_migs/amex.gif'),
+      'code' => 'Amex',
+      'method' => 'migs_amex',
     ),
     'jcb' => array(
       'name' => 'JCB',
       'logo_remote' => 'https://migs.mastercard.com.au/res/svr/default/images/cards/card_sm_jcb.gif',
       'logo_local' => variable_get('uc_migs_logo_jcb', variable_get('file_public_path', conf_path() . '/files') . '/uc_migs/jcb.gif'),
+      'code' => 'JCB',
+      'method' => 'migs_jcb',
     ),
     'diners' => array(
       'name' => 'Diners Club',
       'logo_remote' => 'https://migs.mastercard.com.au/res/svr/default/images/cards/card_sm_dinersclub.gif',
       'logo_local' => variable_get('uc_migs_logo_diners', variable_get('file_public_path', conf_path() . '/files') . '/uc_migs/diners.gif'),
+      'code' => 'Dinersclub',
+      'method' => 'migs_diners',
     ),
   );
   foreach ($card_types as &$card_type) {
     $card_type['logo'] = (file_exists($card_type['logo_local'])) ? $card_type['logo_local'] : $card_type['logo_remote'];
   }
   return $card_types;
-}   
+}
+
+/**
+ * Return an array of enabled payment method IDs.
+ *
+ * We check both uc_migs_eps_enabled AND the methods enabled in UC.
+ * This is double-handling to a degree; if EPS is disabled, UC won't
+ * be seeing those methods.
+ *
+ * We cannot call uc_migs_uc_payment_method
+ */
+function _uc_migs_enabled_methods() {
+  $uc_enabled_methods = array_keys(_uc_payment_method_list());
+  if (in_array('migs', $uc_enabled_methods)) {
+    $methods[] = 'migs';
+  }
+  if (variable_get('uc_migs_eps_enabled',0)) {
+    foreach (_uc_migs_card_types() as $id => $card_type) {
+      if (in_array($card_type['method'], $uc_enabled_methods)) {
+        $methods[] = $card_type['method'];
+      }
+    }
+  }
+  return $methods;
+}
diff --git a/uc_migs.module b/uc_migs.module
index c04377b..09e7b96 100644
--- a/uc_migs.module
+++ b/uc_migs.module
@@ -24,9 +24,11 @@ define('UC_MIGS_TRANSACTION_PAYMENTERROR', 64);
 define('UC_MIGS_SELECT_RETURN_CODES', 'Allow selection of return codes at checkout.');
 define('UC_MIGS_PERMIT_REPEAT_CONFIRMATION', 'Permit repeated checkouts by reloading order confirmation page.');
 
+define('UC_MIGS_EPS_WARNING_REQUIRES_ENABLING', 'You must arrange for your payment gateway enable this facility on your merchant account.');
+
 define('UC_MIGS_BASE_URL', 'https://migs.mastercard.com.au/vpcpay');
 
-/** 
+/**
  * Implementation of hook_theme()
  */
 function uc_migs_theme() {
@@ -86,7 +88,7 @@ function uc_migs_form_alter(&$form, &$form_state, $form_id) {
   if ($form_id == 'uc_cart_checkout_review_form' && ($order_id = intval($_SESSION['cart_order'])) > 0) {
     $order = uc_order_load($order_id);
 
-    if ($order->payment_method == 'migs') {
+    if (in_array($order->payment_method, _uc_migs_enabled_methods())) {
       unset($form['actions']['submit']);
       $form['actions']['migs_submit'] = drupal_get_form('uc_migs_form', $order);
     }
@@ -107,27 +109,48 @@ function uc_migs_form_alter(&$form, &$form_state, $form_id) {
  */
 function uc_migs_uc_payment_method() {
   module_load_include('inc', 'uc_migs', 'uc_migs.lib');
-  $title = theme('uc_migs_method_title', array('title' => variable_get('uc_migs_method_title', t('Credit card on a secure server.'))));
+  $eps_enabled = variable_get('uc_migs_eps_enabled',0);
+  $targs = array(
+    'title'      => variable_get('uc_migs_method_title', t('Credit card on a secure server')),
+    'card_types' => variable_get('uc_migs_method_title_display_icons', array()),
+    'method'     => 'migs',
+  );
   $methods[] = array(
     'id' => 'migs',
     'name' => t('MIGS 3rd party'),
-    'title' => $title,
+    'title' => theme('uc_migs_method_title', $targs),
     'review' => variable_get('uc_migs_check', FALSE) ? t('Credit card/eCheck') : t('Credit card'),
     'desc' => t('Redirect to MIGS to pay by credit card or eCheck.'),
     'callback' => 'uc_payment_method_migs',
     'weight' => 3,
-    'checkout' => TRUE,
+    'checkout' => !$eps_enabled,
     'backend' => TRUE,
   );
-
+  if ($eps_enabled) {
+    foreach (_uc_migs_card_types() as $id => $type) {
+      $method_id = 'migs_'.$id;
+      $targs = array(
+        'title'      => variable_get('uc_migs_method_title_'.$id, t('!eps_name on a secure server', array('!eps_name' => $type['name']))),
+        'card_types' => array($id),
+        'method'     => $method_id,
+        'card'       => $id,
+      );
+      $methods[] = array(
+        'id'       => $method_id,
+        'name'     => t('MIGS 3rd party EPS - !name', array('!name' => $type['name'])),
+        'title'    => theme('uc_migs_method_title', $targs),
+        'review'   => variable_get('uc_migs_check', FALSE) ? t('Credit card/eCheck') : t('Credit card'),
+        'desc'     => t('Redirect to MIGS to pay by !cardtype.', array('!cardtype' => $type['name'])),
+        'callback' => 'uc_payment_method_migs',
+        'weight'   => 10,
+        'checkout' => TRUE,
+        'backend'  => TRUE,
+      );
+    }
+  }
   return $methods;
 }
 
-
-/*******************************************************************************
- * Callback Functions, Forms, and Tables
- ******************************************************************************/
-
 /**
  * Callback for MIGS payment method settings.
  */
@@ -135,121 +158,171 @@ function uc_payment_method_migs($op, &$arg1) {
   module_load_include('inc', 'uc_migs', 'uc_migs.lib');
   switch ($op) {
     case 'settings':
-      $form['merchant'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Merchant Credentials'),
-        '#collapsible' => TRUE,
-        '#collapsed' => variable_get('uc_migs_mid', FALSE),
-      );
-      $form['merchant']['uc_migs_mid'] = array(
-        '#type' => 'textfield',
-        '#title' => t('Merchant Id'),
-        '#description' => t('Your MIGS merchant id.'),
-        '#default_value' => variable_get('uc_migs_mid', ''),
-        '#size' => 16,
-      );
-      $form['merchant']['uc_migs_access_code'] = array(
-        '#type' => 'textfield',
-        '#title' => t('Access code'),
-        '#description' => t('The access code is provided to you when you registered your merchant profile.'),
-        '#default_value' => variable_get('uc_migs_access_code', ''),
-        '#size' => 16,
-      );
-      $form['merchant']['uc_migs_secure_hash_secret'] = array(
-        '#type' => 'textfield',
-        '#title' => t('Secure hash secret'),
-        '#description' => t('The secure hash secret is used to check the integrity of the transaction request.'),
-        '#default_value' => variable_get('uc_migs_secure_hash_secret', ''),
-        '#size' => 32,
-      );
-      $form['interface'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Interface'),
-      );
-      $form['interface']['uc_migs_method_title'] = array(
-        '#type' => 'textfield',
-        '#title' => t('Payment method title'),
-        '#default_value' => variable_get('uc_migs_method_title', t('Credit card on a secure server:')),
-        '#description' => t('Label on !checkout_link when selecting payment method.', array('!checkout_link' => l('checkout screen', 'cart/checkout'))),
-      );
-      $form['interface']['uc_migs_checkout_button'] = array(
-        '#type' => 'textfield',
-        '#title' => t('Button text on transaction review page'),
-        '#description' => t('Button text on !review_link which redirects to MIGS for payment.', array('!review_link' => l('review screen', 'cart/checkout/review'))),
-        '#default_value' => variable_get('uc_migs_checkout_button', t('Submit Order')),
-      );
-      $form['interface']['uc_migs_locale'] = array(
-        '#type' => 'select',
-        '#title' => t('MIGS Locale'),
-        '#description' => t('Preferred language to display MIGS interface in.'),
-        '#options' => array(
-          'en' => t('English'),
-        ),
-        '#default_value' => variable_get('uc_migs_locale', 'en'),
-      );
-
-      $form['interface']['icons'] = array(
-        '#type' => 'fieldset',
-        '#title' => t('Credit card logos'),
-        '#collapsible' => TRUE,
-        '#collapsed' => !variable_get('uc_migs_method_title_icons', TRUE),
-      );
-
-      foreach (_uc_migs_card_types() as $k => $card) {
-        $options[$k] = $card['name'];
-        if (file_exists($card['logo_local'])) {
-          $logos[] = theme('uc_migs_cc_logo', array('path' => $card['logo_local'], 'alt' => $card['name']));
+      $id = arg(5);
+      switch ($id) {
+      case NULL:
+        $form = array();
+        break;
+      case 'migs':
+        // Merchant creds are collapsed if they have been set.
+        $form['merchant'] = array(
+          '#type' => 'fieldset',
+          '#title' => t('Merchant Credentials'),
+          '#collapsible' => TRUE,
+          '#collapsed' => variable_get('uc_migs_mid', FALSE),
+        );
+        $form['merchant']['uc_migs_mid'] = array(
+          '#type' => 'textfield',
+          '#title' => t('Merchant Id'),
+          '#description' => t('Your MIGS merchant id.'),
+          '#default_value' => variable_get('uc_migs_mid', ''),
+          '#size' => 16,
+        );
+        $form['merchant']['uc_migs_access_code'] = array(
+          '#type' => 'textfield',
+          '#title' => t('Access code'),
+          '#description' => t('The access code is provided to you when you registered your merchant profile.'),
+          '#default_value' => variable_get('uc_migs_access_code', ''),
+          '#size' => 16,
+        );
+        $form['merchant']['uc_migs_secure_hash_secret'] = array(
+          '#type' => 'textfield',
+          '#title' => t('Secure hash secret'),
+          '#description' => t('The secure hash secret is used to check the integrity of the transaction request.'),
+          '#default_value' => variable_get('uc_migs_secure_hash_secret', ''),
+          '#size' => 32,
+        );
+
+        $form['interface'] = array(
+          '#type' => 'fieldset',
+          '#title' => t('User Interface'),
+        );
+
+        $form['interface']['uc_migs_eps_enabled'] = array(
+          '#type' => 'select',
+          '#title' => t('Extended Payment Selection (EPS) mode.'),
+          '#default_value' => variable_get('uc_migs_method_title_icons', TRUE),
+          '#description' => '<strong>' . t(UC_MIGS_EPS_WARNING_REQUIRES_ENABLING) . '</strong><br>' . t('With EPS enabled, users may select their card type on the checkout form.') . '<br>' . t('This can improve checkout workflow by removing the card selection page from the MIGS interface.'),
+          '#options' => array(
+            0 => 'Disabled',
+            1 => 'Enabled',
+          ),
+          '#default_value' => variable_get('uc_migs_eps_enabled', 0),
+        );
+
+        $form['interface']['uc_migs_method_title'] = array(
+          '#type' => 'textfield',
+          '#title' => t('Payment method title'),
+          '#default_value' => variable_get('uc_migs_method_title', t('Credit card on a secure server:')),
+          '#description' => t('Label on !checkout_link when selecting payment method.', array('!checkout_link' => l('checkout screen', 'cart/checkout'))),
+        );
+        $form['interface']['uc_migs_checkout_button'] = array(
+          '#type' => 'textfield',
+          '#title' => t('Button text on transaction review page'),
+          '#description' => t('Button text on !review_link which redirects to MIGS for payment.', array('!review_link' => l('review screen', 'cart/checkout/review'))),
+          '#default_value' => variable_get('uc_migs_checkout_button', t('Submit Order')),
+        );
+        $form['interface']['uc_migs_locale'] = array(
+          '#type' => 'select',
+          '#title' => t('MIGS Locale'),
+          '#description' => t('Preferred language to display MIGS interface in.'),
+          '#options' => array(
+            'en' => t('English'),
+          ),
+          '#default_value' => variable_get('uc_migs_locale', 'en'),
+        );
+
+        // Supported & enabled cards
+        $form['cards'] = array(
+          '#type' => 'fieldset',
+          '#title' => t('Card types'),
+          '#collapsible' => TRUE,
+          '#collapsed' => !variable_get('uc_migs_method_title_icons', TRUE),
+        );
+
+        foreach (_uc_migs_card_types() as $k => $card) {
+          $options[$k] = $card['name'];
+          if (file_exists($card['logo_local'])) {
+            $logos[] = theme('uc_migs_cc_logo', array('path' => $card['logo_local'], 'alt' => $card['name']));
+          }
+          else {
+            /* This is clever, but I don't know if it's smart. */
+            // $logos[] = theme('uc_migs_cc_logo', array('path' => $card['logo_remote'], 'alt' => $card['name']));
+            $missing_logos[] = t('!name (upload !this_image to !this_location)', array('!name' => $card['name'], '!this_image' => l('this image', $card['logo_remote']), '!this_location' => $card['logo_local']));
+          }
         }
-        else {
-          /* This is clever, but I don't know if it's smart. */
-          // $logos[] = theme('uc_migs_cc_logo', array('path' => $card['logo_remote'], 'alt' => $card['name']));
-          $missing_logos[] = t('!name (upload !this_image to !this_location)', array('!name' => $card['name'], '!this_image' => l('this image', $card['logo_remote']), '!this_location' => $card['logo_local']));
+
+        if (isset($logos)) {
+          $icon_description[] = theme('uc_migs_cc_logos', array('logos' => $logos));
         }
-      }
 
-      if (isset($logos)) {
-        $icon_description[] = theme('uc_migs_cc_logos', array('logos' => $logos));
-      }
+        if (isset($missing_logos)) {
+          $icon_description[] = '<p><strong>' .
+            t('Missing card logos detected') .
+            '</strong><br>' .
+            t('You may want to copy these icons to your site for display or themeing: !list',
+              array('!list' => theme('item_list', array('items' => $missing_logos)))) . '</p>';
+        }
 
-      if (isset($missing_logos)) {
-        $icon_description[] = '<div style="clear:both;">You may want to copy these icons to your site for display or themeing:' .
-          theme('item_list', array('items' => $missing_logos)) . '</div>';
+        $form['cards']['#description'] = implode('', $icon_description);
+
+        $form['cards']['uc_migs_method_title_icons'] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Show credit card logos beside the payment method title.'),
+          '#default_value' => variable_get('uc_migs_method_title_icons', TRUE),
+          '#description' => '',
+        );
+
+        $form['cards']['icons']['uc_migs_method_title_display_icons'] = array(
+          '#type' => 'checkboxes',
+          '#title' => 'Card logos to display',
+          '#options' => $options,
+          '#default_value' => variable_get('uc_migs_method_title_display_icons', array()),
+          '#description' => t('Which card type logos should be displayed using standard (non-EPS) payment method.'),
+        );
+
+        // Debug settings are collapsed if neither are enabled
+        $form['debug'] = array(
+          '#type' => 'fieldset',
+          '#title' => 'Debug settings',
+          '#description' => 'These settings are for development purposes. Not recommended if accepting live transactions.',
+          '#collapsible' => TRUE,
+          '#collapsed' => !variable_get('uc_migs_repeat_checkouts', FALSE) && !variable_get('uc_migs_select_transaction_results', FALSE),
+        );
+        $form['debug']['uc_migs_repeat_checkouts'] = array(
+          '#type' => 'checkbox',
+          '#title' => t(UC_MIGS_PERMIT_REPEAT_CONFIRMATION),
+          '#default_value' => variable_get('uc_migs_repeat_checkouts', FALSE),
+          '#description' => 'Permits reloading of the VPC Return URL. Useful for testing post-sale conditional actions.',
+        );
+        $form['debug']['uc_migs_select_transaction_results'] = array(
+          '#type' => 'checkbox',
+          '#title' => t(UC_MIGS_SELECT_RETURN_CODES),
+          '#default_value' => variable_get('uc_migs_select_transaction_results', FALSE),
+          '#description' => 'Modifies the payment amount to trigger transaction return codes on VPC test gateway, eg $0.33 for "Expired Card".',
+        );
+        break;
+      default:
+        $types = _uc_migs_card_types();
+        $type_id = preg_replace('/^migs_/', '', $id);
+        $type  = $types[$type_id];
+        $form['uc_migs_method_title_'.$type_id] = array(
+          '#type' => 'textfield',
+          '#title' => t('Payment method title'),
+          '#default_value' => variable_get('uc_migs_method_title_'.$type_id, t('!type on a secure server:', array('!type' => $type['name']))),
+        );
+        $form['uc_migs_method_title_icon_'.$type_id] = array(
+          '#type' => 'checkbox',
+          '#title' => t('Show !name logo beside the payment method title.', array('!name' => $type['name'])),
+          '#description' => theme('uc_migs_cc_logo', array('path' => $type['logo'], 'type' => $type_id, 'alt' => $type['name'])),
+          '#default_value' => variable_get('uc_migs_method_title_icon_'.$type_id, TRUE),
+        );
+        $form['see_also'] = array(
+          '#type' => 'markup',
+          '#markup' => t('See also !link for settings not specific to !name.', array('!name' => $type['name'], '!link' => l('MIGS gateway settings', 'admin/store/settings/payment/method/migs'))),
+        );
       }
 
-      $form['interface']['icons']['#description'] = implode('', $icon_description);
-
-      $form['interface']['icons']['uc_migs_method_title_icons'] = array(
-        '#type' => 'checkbox',
-        '#title' => t('Show credit card icons beside the payment method title.'),
-        '#default_value' => variable_get('uc_migs_method_title_icons', TRUE),
-        '#description' => '',
-      );
-      
-      $form['interface']['icons']['uc_migs_method_title_display_icons'] = array(
-        '#type' => 'checkboxes',
-        '#title' => 'Icons to display',
-        '#options' => $options,
-        '#default_value' => variable_get('uc_migs_method_title_display_icons', array()),
-      );
-      $form['debug'] = array(
-        '#type' => 'fieldset',
-        '#title' => 'Debug settings',
-        '#description' => 'These settings are for development purposes. Not recommended if accepting live transactions.',
-        '#collapsible' => TRUE,
-        '#collapsed' => !variable_get('uc_migs_repeat_checkouts', FALSE) && !variable_get('uc_migs_select_transaction_results', FALSE),
-      );
-      $form['debug']['uc_migs_repeat_checkouts'] = array(
-        '#type' => 'checkbox',
-        '#title' => t(UC_MIGS_PERMIT_REPEAT_CONFIRMATION),
-        '#default_value' => variable_get('uc_migs_repeat_checkouts', FALSE),
-        '#description' => 'Permits reloading of the VPC Return URL. Useful for testing post-sale conditional actions.',
-      );
-      $form['debug']['uc_migs_select_transaction_results'] = array(
-        '#type' => 'checkbox',
-        '#title' => t(UC_MIGS_SELECT_RETURN_CODES),
-        '#default_value' => variable_get('uc_migs_select_transaction_results', FALSE),
-        '#description' => 'Modifies the payment amount to trigger transaction return codes on VPC test gateway, eg $0.33 for "Expired Card".',
-      );
       return $form;
   }
 }
@@ -268,12 +341,12 @@ function uc_migs_form($form, &$form_state, $order) {
   );
   $data = array(
     'vpc_MerchTxnRef' => $vpc_MerchTxnRef,
-    'vpc_OrderInfo' => $vpc_OrderInfo,
-    'vpc_Amount' => $vpc_Amount,
+    'vpc_OrderInfo'   => $vpc_OrderInfo,
+    'vpc_Amount'      => $vpc_Amount,
   );
   foreach ($data as $name => $value) {
     $form[$name] = array(
-      '#type' => 'value', 
+      '#type' => 'value',
       '#value' => $value
     );
   }
@@ -291,14 +364,22 @@ function uc_migs_form_submit($form, &$form_state) {
   $args = array(
     'vpc_AccessCode'  => variable_get('uc_migs_access_code', ''),
     'vpc_Amount'      => $form_state['values']['vpc_Amount'],
+    'vpc_Command'     => 'pay',
     'vpc_Locale'      => variable_get('uc_migs_locale', 'en'),
     'vpc_Merchant'    => variable_get('uc_migs_mid', ''),
     'vpc_OrderInfo'   => $form_state['values']['vpc_OrderInfo'],
     'vpc_ReturnURL'   => url('cart/migs/complete/'. uc_cart_get_id(), array('absolute' => TRUE)),
     'vpc_Version'     => variable_get('uc_migs_version', '1'),
     'vpc_MerchTxnRef' => $form_state['values']['vpc_MerchTxnRef'],
-    'secure_secret'   => variable_get('uc_migs_secure_hash_secret', ''),
   );
+  if (isset($form_state['build_info']['args'][0]->payment_method) && $form_state['build_info']['args'][0]->payment_method != 'migs') {
+    $method = preg_replace('/^migs_/', '', $form_state['build_info']['args'][0]->payment_method);
+    $card_types = _uc_migs_card_types();
+    if ($card_type = $card_types[$method]) {
+      $args['vpc_Card'] = $card_type['code'];
+      $args['vpc_Gateway'] = 'ssl';
+    }
+  }
   $form_state['redirect'] = _uc_migs_migs_do_url($args);
 }
 
@@ -310,18 +391,23 @@ function uc_migs_complete($cart_id = 0) {
   module_load_include('inc', 'uc_migs', 'uc_migs.lib');
 
   // ensure that MIGS is configured before processing
-  $secure_secret   = variable_get('uc_migs_secure_hash_secret', '');  
+  $secure_secret   = variable_get('uc_migs_secure_hash_secret', '');
   if ( empty($secure_secret) ) {
     // Secure Hash was not validated, none there to validate
     drupal_set_title(UC_MIGS_ERROR_NOT_PROCESSED);
     watchdog( 'uc_migs', 'Unable to process response from MIGS gateway, as MIGS Secure Hash Secret is not configured. Please correct your !settings.', array('!settings' => l('payment method settings', 'admin/store/settings/payment/edit/methods')), WATCHDOG_WARNING);
     return theme('uc_migs_order_incomplete', array('response_message' => UC_MIGS_ERROR_SITE_CONFIG, 'response_receiptno' => $receiptNo, 'order_info' => $orderInfo, 'order' => $order));
   }
-  
+
   $result = _uc_migs_validate_transaction($secure_secret);
   $order = uc_order_load(check_plain($_GET['vpc_OrderInfo']));
   $orderInfo = check_plain($_GET['vpc_OrderInfo']);
-  $receiptNo = check_plain($_GET['vpc_ReceiptNo']);
+  if (isset($_GET['vpc_ReceiptNo'])) {
+    $receiptNo = check_plain($_GET['vpc_ReceiptNo']);
+  }
+  else {
+    $receiptNo = '';
+  }
   $txnResponseCode = check_plain($_GET['vpc_TxnResponseCode']);
   $amount = check_plain($_GET['vpc_Amount']);
 
@@ -331,12 +417,12 @@ function uc_migs_complete($cart_id = 0) {
       drupal_set_title(UC_MIGS_ERROR_NOT_PROCESSED);
       watchdog( 'uc_migs', 'MIGS gateway rejected payment due to validation failure. $_GET was: <pre>@get</pre>', array('@get' => print_r($_GET,1)), WATCHDOG_WARNING );
       return theme('uc_migs_order_incomplete', array('response_message' => UC_MIGS_ERROR_VALIDATION, 'response_receiptno' => $receiptNo, 'order_info' => $orderInfo, 'order' => $order));
-      
+
     case UC_MIGS_TRANSACTION_NOHASH:
       drupal_set_title(UC_MIGS_ERROR_NOT_PROCESSED);
       watchdog( 'uc_migs', 'MIGS gateway rejected payment, and returned data did not contain a secure hash. $_GET was: <pre>@get</pre>', array('@get' => print_r($_GET,1)), WATCHDOG_WARNING );
       return theme('uc_migs_order_incomplete', array('response_message' => UC_MIGS_ERROR_VALIDATION, 'response_receiptno' => $receiptNo, 'order_info' => $orderInfo, 'order' => $order));
-   
+
     case UC_MIGS_TRANSACTION_NOORDER:
       drupal_set_title(UC_MIGS_ERROR_NOT_PROCESSED);
       watchdog('uc_migs', 'MIGS gateway unable to find order to process. The Order ID returned from MIGS was @order_id, and $_GET was <pre>@get</pre>', array('@order_id' => $orderInfo, '@get' => print_r($_GET,1)), WATCHDOG_WARNING);
@@ -353,7 +439,7 @@ function uc_migs_complete($cart_id = 0) {
       drupal_set_title('Order Error');
       watchdog('uc_migs', 'MIGS payment notification received for order @order_id which is not yet in checkout status.', array('@order_id'=>$orderInfo));
       return theme('uc_migs_order_incomplete', array('response_message' => 'Order not in checkout', 'response_receiptno' => $receiptNo, 'order_info' => $orderInfo, 'order' =>$order));
-        
+
     case UC_MIGS_TRANSACTION_PAYMENTERROR:
       // validation success, payment fail
       drupal_set_title(t('Order Error'));
@@ -366,7 +452,7 @@ function uc_migs_complete($cart_id = 0) {
       // success
       $targs = array(
         '@order'   => $_GET['vpc_OrderInfo'],
-        '@receipt' => $_GET['vpc_ReceiptNo'], 
+        '@receipt' => $_GET['vpc_ReceiptNo'],
         '@trans'   => $_GET['vpc_TransactionNo'],
         '@amount'  => uc_currency_format($amount/100),
       ) ;
@@ -379,16 +465,16 @@ function uc_migs_complete($cart_id = 0) {
       uc_order_save($order);
       // uc_order_save() saves order_status so it needs to happen before uc_payment_enter()
       uc_payment_enter($order->order_id, 'migs', $amount/100, 0, array(), $comment);
-      
+
       // Empty the cart...
       uc_cart_empty($cart_id);
-      
+
       $do_login = variable_get('uc_new_customer_login', FALSE );
       $output = uc_cart_complete_sale($order, $do_login);
       $output = str_replace('[site-url]', url(), $output);
-      
+
       // Add a comment to let sales team know this came in through the site.
-      uc_order_comment_save($order->order_id, 0, t('A payment has been accepted.'), 'admin');    
+      uc_order_comment_save($order->order_id, 0, t('A payment has been accepted.'), 'admin');
       return $output;
   }
 }
@@ -435,7 +521,7 @@ function template_preprocess_uc_migs_order_incomplete(&$variables) {
     $variables['receipt_no'] = t('Receipt #@receipt_no', array('@receipt_no' => $variables['response_receiptno']));
   }
   // by doing this, we make it possible for sites to reveal more
-  // detailed error messages via themeing, and still conceal them 
+  // detailed error messages via themeing, and still conceal them
   // by default which keeps MIGS happy (by default)
   switch ( $variables['response_message'] ) {
     // these variables indicate a site config issue or other
@@ -446,7 +532,7 @@ function template_preprocess_uc_migs_order_incomplete(&$variables) {
     case UC_MIGS_ERROR_NOT_FOUND :
       $variables['error_message'] = 'Transaction error.' ;
       break ;
-      
+
     // however, if the problem is with the buyer's CC, we want to tell them what's wrong
     default :
       $variables['error_message'] = $variables['response_message'] ;
@@ -454,7 +540,7 @@ function template_preprocess_uc_migs_order_incomplete(&$variables) {
 }
 
 /**
- * Implementation of hook_ucga_display from UC Google Analytics module
+ * Implementation of hook_ucga_display (uc_google_analytics.module)
  */
 function uc_migs_ucga_display() {
   if (arg(0) == 'cart' && arg(1) == 'migs' && arg(2) == 'complete') {
diff --git a/uc_migs.theme.inc b/uc_migs.theme.inc
index 6f46295..cf031b2 100644
--- a/uc_migs.theme.inc
+++ b/uc_migs.theme.inc
@@ -3,7 +3,7 @@
 /**
  * Allow override of logo display. Eg:
  *
- *   return theme('imagecache', 'cc_logo', $filename, $alttext) ; // imagecache resize 
+ *   return theme('imagecache', 'cc_logo', $filename, $alttext) ; // imagecache resize
  * or
  *   return theme('image', $filename, $alttext, $alttext, array('height' => '24'), FALSE) ; // browser resize, permit use of remote logos
  */
@@ -19,17 +19,24 @@ function theme_uc_migs_cc_logo($vars) {
 function theme_uc_migs_method_title($vars) {
   module_load_include('inc', 'uc_migs', 'uc_migs.lib');
   $cards = _uc_migs_card_types();
-  $vars['title'] = '<strong>' . $vars['title'] . '</strong>';
-  if (variable_get('uc_migs_method_title_icons', FALSE)) {
-    foreach (variable_get('uc_migs_method_title_display_icons', array()) as $card) {
-      if ($card && $cards[$card]['logo']) {
-        $logos[] = theme('uc_migs_cc_logo', array('path' => $cards[$card]['logo'], 'alt' => $cards[$card]['name']));
+  switch($vars['method']) {
+  case 'migs':
+    if (variable_get('uc_migs_method_title_icons', FALSE)) {
+      foreach (variable_get('uc_migs_method_title_display_icons', array()) as $card) {
+        if ($card && $cards[$card]['logo']) {
+          $logos[] = theme('uc_migs_cc_logo', array('path' => $cards[$card]['logo'], 'alt' => $cards[$card]['name']));
+        }
       }
     }
-    if (!empty($logos)) {
-      $vars['title'] .= '<br>' . theme('uc_migs_cc_logos', array('logos' => $logos));
+    break;
+  default:
+    if (variable_get('uc_migs_method_title_icon_'.$vars['card'], TRUE)) {
+      $logos[] = theme('uc_migs_cc_logo', array('path' => $cards[$vars['card']]['logo'], 'alt' => $cards[$vars['card']]['name']));
     }
   }
+  if (!empty($logos)) {
+    $vars['title'] .= '<br>' . theme('uc_migs_cc_logos', array('logos' => $logos));
+  }
   return $vars['title'];
 }
 
@@ -37,4 +44,4 @@ function theme_uc_migs_cc_logos($vars) {
   drupal_add_css(drupal_get_path('module', 'uc_migs') . '/css/uc_migs.css');
   return implode(' ', $vars['logos']);
   // return theme('item_list', $vars['logos'], NULL, 'ul', array('class' => 'uc-migs-cc-logos'));
-}
\ No newline at end of file
+}
