--- uc_migs3rdparty/uc_migs3rdparty.module	2008-03-01 16:03:50.000000000 +1000
+++ uc_migs3rdparty_new/uc_migs3rdparty.module	2010-06-17 09:29:01.692456677 +1000
@@ -170,7 +170,7 @@
   );
 
   foreach ($data as $name => $value) {
-    $form[$name] = array('#type' => 'hidden', '#value' => $value);
+    $form[$name] = array('#type' => 'value', '#value' => $value);
   }
 
   $form['submit'] = array(
@@ -181,15 +181,15 @@
   return $form;
 }
 
-function uc_migs3rdparty_form_submit() {
+function uc_migs3rdparty_form_submit($form_id, $form_values) {
 	$vpc_AccessCode = variable_get('uc_migs3rdparty_access_code', '');
-	$vpc_Amount = $_POST["vpc_Amount"];
+	$vpc_Amount = $form_values["vpc_Amount"];
 	$vpc_Locale = variable_get('uc_migs3rdparty_locale', 'en');
 	$vpc_Merchant = variable_get('uc_migs3rdparty_mid', '');
-	$vpc_OrderInfo = $_POST["vpc_OrderInfo"];
+	$vpc_OrderInfo = $form_values["vpc_OrderInfo"];
 	$vpc_ReturnURL = url('cart/migs3rdparty/complete/'. uc_cart_get_id(), NULL, NULL, TRUE);
 	$vpc_Version = variable_get('uc_migs3rdparty_version', '1');
-	$vpc_MerchTxnRef = $_POST["vpc_MerchTxnRef"];
+	$vpc_MerchTxnRef = $form_values["vpc_MerchTxnRef"];
 
 	$SECURE_SECRET = variable_get('uc_migs3rdparty_secure_hash_secret', 'B4264D743B97609FD46E3FA264FBF16F');
 	
@@ -292,9 +292,10 @@
 	}
   
 	if ($txnResponseCode != "0") {
-		$output = t('An error has occurred during payment.  View the response below and either re-try your order with another method or contact us for help.');
-		$output .= t('Transaction Response Code: ' . $txnResponseCode);
-		$output .= t('Transaction Response Code Description: ' . _get_response_description($txnResponseCode));
+        drupal_set_title('An error occurred during payment');
+		$output = t('An error has occurred during payment.<br />View the response below and either re-try your order with another method or contact us for help.<br/>');
+		$output .= t('Transaction Response Code: ' . $txnResponseCode.'<br/>');
+		$output .= t('Transaction Response Code Description: ' . _get_response_description($txnResponseCode).'<br/>');
 		$output .= t('Message: ' . $message);
 	} else {
 
@@ -327,7 +328,8 @@
         case "0" : $result = "Transaction Successful"; break;
         case "?" : $result = "Transaction status is unknown"; break;
         case "1" : $result = "Unknown Error"; break;
-        case "2" : $result = "Bank Declined Transaction"; break;
+        case "2" : $result = "Bank Declined Transaction - contact issuing bank"; break;
+        case "E" : $result = "Bank Declined Transaction - contact issuing bank"; break;
         case "3" : $result = "No Reply from Bank"; break;
         case "4" : $result = "Expired Card"; break;
         case "5" : $result = "Insufficient funds"; break;
