Remove duplicated error message in _getTCReply method. dave-review
authorDavid Thompson <davet@gnu.org>
Mon, 14 Jul 2014 20:25:31 +0000 (16:25 -0400)
committerDavid Thompson <davet@gnu.org>
Mon, 14 Jul 2014 20:25:31 +0000 (16:25 -0400)
trustcommerce.php

index 554acb864f9c7b421c8a8e9eb1dbcab35e359874..9b3f1c2dd615ceee161e427f6f6162961247170c 100644 (file)
@@ -247,14 +247,13 @@ class org_fsf_payment_trustcommerce extends CRM_Core_Payment {
    * @return mixed self::error() if transaction failed, otherwise returns 0.
    */
   function _getTCReply($reply) {
+    $this->_logger($reply);
 
-    /* DUPLIATE CODE, please refactor. ~lisa */
-    if (!$reply) {
-      return self::error(9002, 'Could not initiate connection to payment gateway');
+    /* Default to AUTH_ERROR if status isn't explicitly given. */
+    if(!$reply) {
+      $reply = array('status' => self::AUTH_ERROR);
     }
 
-    $this->_logger($reply);
-
     switch($reply['status']) {
     case self::AUTH_BLACKLIST:
       return self::error(9001, "Your transaction was declined: error #90210");