Update for saving billing data with new account
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 14 Aug 2019 10:11:10 +0000 (06:11 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 14 Aug 2019 10:11:10 +0000 (06:11 -0400)
when $invoic_type is 0
This is for free member types

classes/billingSupport.php
index.php

index b54a77f..7fc9d7c 100644 (file)
@@ -1709,7 +1709,6 @@ class GlmBillingSupport
             $account = $this->getAccountByRefDest( $member_id );
 
             // New Billing Data If using Billing Fields
-            // echo '<pre>$billing_updated: ' . print_r( $billing_updated, true ) . '</pre>';
             // Check for required fields
             foreach ( $billing_updated as $field_name => $field_value ) {
                 $key = array_search( $field_name, $required_fields );
@@ -1753,7 +1752,7 @@ class GlmBillingSupport
                     $billing_updated['ref_name']         = $member_name; // Use members name
                     $billing_updated['ref_dest']         = $member_id;
                     $billing_updated['anniversary_date'] = date('Y-m-d H:i:s');
-                    $billing_updated['invoice_type']     = $invoice_type;
+                    $billing_updated['invoice_type']     = ( $invoice_type ) ? $invoice_type : 0;
                     $billing_updated_format[]            = '%s';
                     $billing_updated_format[]            = '%d';
                     $billing_updated_format[]            = '%s';
@@ -1768,7 +1767,6 @@ class GlmBillingSupport
                 return $errors;
             }
         }
-        // echo '<pre>$errors: ' . print_r( $errors, true ) . '</pre>';
         return true;
     }
 
index cd73b5a..d1bd2f9 100644 (file)
--- a/index.php
+++ b/index.php
@@ -3,7 +3,7 @@
  * Plugin Name: GLM Members Billing
  * Plugin URI: http://www.gaslightmedia.com/
  * Description: This is glmAssociate Billing Module
- * Version: 1.0.33
+ * Version: 1.0.34
  * Author: Gaslight Media
  * Author URI: http://www.gaslightmedia.com/
  * License: GPL2
@@ -19,7 +19,7 @@
  * @package glmMembersBillingAddOn
  * @author Chuck Scott <cscott@gaslightmedia.com>
  * @license http://www.gaslightmedia.com Gaslightmedia
- * @version 1.0.33
+ * @version 1.0.34
  */
 
 /*
@@ -37,7 +37,7 @@
  *  so that we're sure the other add-ons see an up to date
  *  version from this plugin.
  */
-define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.33');
+define('GLM_MEMBERS_BILLING_PLUGIN_VERSION', '1.0.34');
 
 // Database Version
 define('GLM_MEMBERS_BILLING_PLUGIN_DB_VERSION', '0.0.26');