Update for form processing.
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 27 Dec 2016 20:36:57 +0000 (15:36 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 27 Dec 2016 20:36:57 +0000 (15:36 -0500)
do contact processing after the auth.net.
if the card isn't good then don't store the contact.

Toolkit/Contacts/PassPort.php

index 78048f4..2d5ec06 100755 (executable)
@@ -691,25 +691,21 @@ class Toolkit_Contacts_PassPort
     //    }}}
     public function processData($values)
     {
-        $res = parent::processData($values);
-        if ($res) {
-            $res2 = $this->processAuthNet($values);
-            if (is_array($res2) && !empty($res2)) {
-                if ($res2[0] == 1) {
-                    //    CC was Accepted.
-                    return true;
-                } elseif ($res2[0] == 2) {
-                    //    CC was Declined.
-                    return 2;
-                } else {
-                    //    There was a CC processing error.
-                    return $res2[0];
-                }
+        $res2 = $this->processAuthNet($values);
+        if (is_array($res2) && !empty($res2)) {
+            if ($res2[0] == 1) {
+                //    CC was Accepted.
+                $res = parent::processData($values);
+                return true;
+            } elseif ($res2[0] == 2) {
+                //    CC was Declined.
+                return 2;
             } else {
                 //    There was a CC processing error.
-                return false;
+                return $res2[0];
             }
         } else {
+            //    There was a CC processing error.
             return false;
         }
     }