Index: includes/ideal.payment.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ideal/includes/Attic/ideal.payment.inc,v
retrieving revision 1.1.2.18
diff -u -p -r1.1.2.18 ideal.payment.inc
--- includes/ideal.payment.inc	27 Aug 2010 11:20:46 -0000	1.1.2.18
+++ includes/ideal.payment.inc	27 Aug 2010 11:27:13 -0000
@@ -198,7 +198,7 @@ abstract class iDEALAcquirer {
     if (!$this->entrance_code) {
       $this->entrance_code = md5(mt_rand());
     }
-    
+
     return $this->entrance_code;
   }
 
@@ -235,7 +235,7 @@ abstract class iDEALAcquirer {
       'createDateTimeStamp' => $this->dateTimeStamp,
       'Merchant' => array(
         'merchantID' => $merchant_id,
-        'subID' => variable_get('ideal_subid', NULL),
+        'subID' => variable_get('ideal_subid', 0),
         'authentication' => 'SHA1_RSA',
         'token' => $this->token(),
         'tokenCode' => $this->tokenCode($token_code_values),
@@ -253,13 +253,20 @@ abstract class iDEALAcquirer {
     // The HTTP request went wrong.
     if (isset($response->error)) {
       // TODO: throw a watchdog error.
+      drupal_set_message(t('Betalen met iDEAL is nu niet mogelijk. Probeer het later nogmaals of betaal op een andere manier.'), 'error');
       return FALSE;
     }
     $dom = simplexml_load_string($response->data);
     // The iDEAL server encountered an error.
     if (isset($dom->Error)) {
       // TODO: throw a watchdog error.
-      return FALSE;
+      if (isset($dom->Error->consumerMessage)) {
+        drupal_set_message(t((string)$dom->Error->consumerMessage), 'error');
+      }
+
+      $watchdog_message = (string)$dom->Error->errorMessage . "<br/>\n" . (string)$dom->Error->errorDetail;
+      watchdog('ideal', $watchdog_message, array(), WATCHDOG_ERROR);
+       return FALSE;
     }
     // Everything went allright.
     return $response->data;
@@ -300,7 +307,9 @@ abstract class iDEALAcquirer {
     }
     else {
       $issuers = $this->directoryRequest();
-      cache_set('ideal_issuers', $issuers, 'cache', time() + 86400);
+      if ($issuers) {
+        cache_set('ideal_issuers', $issuers, 'cache', time() + 86400);
+      }
       return $issuers;
     }
   }
@@ -365,7 +374,7 @@ class iDEALAcquirerDefault extends iDEAL
   }
 
   function statusRequest() {
-    
+
   }
 }

