Update for dealing with auth errors and reshowing renewal form.
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 21 Sep 2018 14:28:44 +0000 (10:28 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 21 Sep 2018 14:28:44 +0000 (10:28 -0400)
Allows the form to work after a submit with error from auth.net.

models/admin/member/billing.php

index e245548..2395c8f 100644 (file)
@@ -267,7 +267,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling
 
             // Now that the invoice is created. Do payment Processing.
 
-            // If there's any rrors then re-show the form.
+            // If there's any errors then re-show the form.
             if ( $error ) {
                 // Remove the invoice created.
                 if ( $invoice_id ) {
@@ -294,6 +294,13 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling
 
                 // Need to see if there's an account for this member.
                 $account = $Accounts->editEntry( $accountID );
+
+                // Need to get the accounts
+                $Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
+                $accounts = $Accounts->getSimpleAccountList( "T.boss <> true AND T.boss IS NOT NULL AND T.invoice_type != 0", 'ref_name' );
+                // echo '<pre>$accounts: ' . print_r( $accounts, true ) . '</pre>';
+
+                $invoiceTypes = $BillingSupport->getAllPayableInvoiceTypes();
             } else {
                 // Look at the payment option given
                 $payment_option = filter_var( $_REQUEST['payment_option'], FILTER_SANITIZE_STRING );
@@ -337,6 +344,13 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling
 
                         // Need to see if there's an account for this member.
                         $account = $Accounts->editEntry( $accountID );
+
+                        // Need to get the accounts
+                        $Accounts = new GlmDataAccounts( $this->wpdb, $this->config );
+                        $accounts = $Accounts->getSimpleAccountList( "T.boss <> true AND T.boss IS NOT NULL AND T.invoice_type != 0", 'ref_name' );
+                        // echo '<pre>$accounts: ' . print_r( $accounts, true ) . '</pre>';
+
+                        $invoiceTypes = $BillingSupport->getAllPayableInvoiceTypes();
                     }
                     break;
                 case 'pay_by_check':