Fixed problem with not detecting certain credit card payment failures. hotfix/1.0.13
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 7 Aug 2018 15:50:57 +0000 (11:50 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 7 Aug 2018 15:50:57 +0000 (11:50 -0400)
index.php
models/front/registrations/checkoutProcess.php
readme.txt

index deae6ad..fd825b9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Database Event Registrations
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: Add-on to integrate registrations into Events add-on.
- * Version: 1.0.12
+ * Version: 1.0.13
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -19,7 +19,7 @@
  * @package glmMembersRegistrationsAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.12
+ * @version 1.0.13
  */
 
 // Check that we're being called by WordPress.
@@ -43,7 +43,7 @@ if (!defined('ABSPATH')) {
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '1.0.12');
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '1.0.13');
 define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '1.0.1');
 
 // This is the minimum version of the GLM Members DB plugin require for this plugin.
index 4321096..5e21183 100644 (file)
@@ -86,7 +86,8 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
     public function modelAction($actionData = false)
     {
 
-        $messages       = array();
+        $messages       = array();      // Fatal Messages
+        $noticeMessages = array();      // Non-fatal messages
         $cartStatus     = 0;            // Default to CART
         $requestId      = false;
         $accountId      = 0;
@@ -582,11 +583,24 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
                                 );
 
                             } else {
-                                $messages[] = "Sorry, we were unable to store your credit card data for future use, but we did try.";
+                                $noticeMessages[] = "Sorry, we were unable to store your credit card data for future use, but we did try.";
                             }
 
                         }
 
+                    // Otherwwise Card Failure
+                    } else {
+
+                        // Get any short status text that might be available
+                        $statusText = '';
+                        if (is_array($ccResult) && isset($ccResult['statusText']) ) {
+                            $statusText = ' ('.$ccResult['statusText'].')';
+                        }
+
+                        $messages[] = "Your card was not approved$statusText. Please check the message below and try again.";
+                        if (is_array($ccResult) && isset($ccResult['description']) ) {
+                            $messages[] = $ccResult['description'];
+                        }
                     }
 
                 }
@@ -856,6 +870,8 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
         $templateData = array(
             'haveMessages'   => count($messages),
             'messages'       => $messages,
+            'haveNoticeMessages' => count($noticeMessages),
+            'noticeMessages' => $noticeMessages,
             'guestAccount'   => $guestAccount,
             'requestId'      => $requestId,
             'summaryCheck'   => $summaryCheck,
index dfe1b77..d6209b1 100644 (file)
@@ -26,6 +26,9 @@ e.g.
 
 == Changelog ==
 
+= 1.0.13 =
+* Hotfix to correct potential problem with not detecting certain credit card payment failures
+
 = 1.0.11 =
 * Added pagination and more filtering to resistration attendee and request lists