* Plugin Name: GLM Associate - Event Registrations Add-On
* Plugin URI: http://www.gaslightmedia.com/
* Description: Add-on to integrate registrations into Events add-on.
- * Version: 1.0.15
+ * Version: 1.0.16
* Author: Gaslight Media
* Author URI: http://www.gaslightmedia.com/
* License: GPL2
* @package glmMembersRegistrationsAddOn
* @author Chuck Scott <cscott@gaslightmedia.com>
* @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.15
+ * @version 1.0.16
*/
// Check that we're being called by WordPress.
* 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.15');
+define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '1.0.16');
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.
'cc_name' => filter_input(INPUT_POST, 'cc_name', FILTER_SANITIZE_STRING),
'cc_numb' => filter_input(INPUT_POST, 'cc_numb', FILTER_SANITIZE_NUMBER_INT),
'cc_exp' => filter_input(INPUT_POST, 'cc_exp', FILTER_SANITIZE_STRING),
+ // Save the Expiration date in case a processor needs it in some other format and we need to return to the form
+ 'cc_exp_orig' => filter_input(INPUT_POST, 'cc_exp', FILTER_SANITIZE_STRING),
'cc_cvv' => filter_input(INPUT_POST, 'cc_cvv', FILTER_SANITIZE_NUMBER_INT)
);
// Include the billing info same flag
$regAccount['billingSame'] = $billingSame;
+ // Build failure message text to append to request notes field.
+ $failNotes = "Checkout Failure: ".date('l F j, Y g:i a')."\n";
+ if (is_array($messages) && count($messages > 0)) {
+ foreach ($messages as $mess) {
+ $failNotes .= '* '.$mess."\n";
+ }
+ }
+ $failNotes .= '\n';
+
+ // Append failure message text to request notes field.
+ $updated = $this->wpdb->query("
+ update ".GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX."reg_request
+ set notes = concat(COALESCE(notes,''), '$failNotes')
+ where id = $requestId
+ ");
+
$view = 'checkout';
+ // Restore original card expiration date in case it was changed
+ $cardData['cc_exp'] = $cardData['cc_exp_orig'];
+
$templateData = array(
'request' => array('page' => 'checkout'),
'haveMessages' => count($messages),