From: Chuck Scott Date: Tue, 7 Aug 2018 15:50:57 +0000 (-0400) Subject: Fixed problem with not detecting certain credit card payment failures. X-Git-Tag: v1.0.13^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fhotfix%2F1.0.13;p=WP-Plugins%2Fglm-member-db-registrations.git Fixed problem with not detecting certain credit card payment failures. --- diff --git a/index.php b/index.php index deae6ad..fd825b9 100644 --- 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 * @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. diff --git a/models/front/registrations/checkoutProcess.php b/models/front/registrations/checkoutProcess.php index 4321096..5e21183 100644 --- a/models/front/registrations/checkoutProcess.php +++ b/models/front/registrations/checkoutProcess.php @@ -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, diff --git a/readme.txt b/readme.txt index dfe1b77..d6209b1 100644 --- a/readme.txt +++ b/readme.txt @@ -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