Fix the payment methods
authorSteve Sutton <steve@gaslightmedia.com>
Mon, 6 May 2019 17:11:24 +0000 (13:11 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Mon, 6 May 2019 17:11:24 +0000 (13:11 -0400)
Setting this up as new config name so it is not confused with the one
from registrations.

classes/data/dataManagement.php
config/plugin.ini
models/admin/member/billing.php
views/common/billing/paymentForm.html

index 0fe6be6..673b503 100644 (file)
@@ -119,7 +119,7 @@ class GlmDataBillingManagement extends GlmDataAbstract
             'payment_methods' => array (
                 'field'   => 'payment_methods',
                 'type'    => 'bitmap',
-                'bitmap'  => $this->config['payment_method'],
+                'bitmap'  => $this->config['billing_payment_method'],
                 'default' => 0, // none selected
                 'use'     => 'a'
             ),
index 82e728d..f3e0ca8 100644 (file)
@@ -21,23 +21,13 @@ transaction_numb['Comment']    = 40;
 ;
 ; Payment Method - Use as Bitmap Index or List
 ;
-payment_method[1]                               = 'No Charge'
-payment_method[2]                               = 'Pay On Arrival'
-payment_method[3]                               = 'Cash'
-payment_method[4]                               = 'Check'
-; payment_method[5]                               = 'Call from Merchant'
-payment_method[6]                               = 'Credit Card'
-payment_method[7]                               = 'PayPal'
-payment_method [10]                             = 'Payment Pending'
-
-payment_method_numb['NoCharge']                 = 1
-payment_method_numb['OnArrival']                = 2
-payment_method_numb['Cash']                     = 3
-payment_method_numb['Check']                    = 4
-; payment_method_numb['CallFromMerchant']         = 5
-payment_method_numb['CreditCard']               = 6
-payment_method_numb['PayPal']                   = 7
-payment_method_numb['Pending']                  = 10
+billing_payment_method[1]                               = 'Check'
+billing_payment_method[2]                               = 'Credit Card'
+billing_payment_method[3]                               = 'Mark Paid'
+
+billing_payment_method_numb['Check']                    = 1
+billing_payment_method_numb['CreditCard']               = 2
+billing_payment_method_numb['MarkPaid']                 = 3
 
 ; Default payment method is Credit Card
 default_payment_method                          = 6
index 4b4cfda..ba53e49 100644 (file)
@@ -1008,7 +1008,7 @@ class GlmMembersAdmin_member_billing // extends GlmDataBilling
             'account_status'     => $account_status,
             'accounts'           => $accounts,
             'invoiceTypes'       => $invoiceTypes,
-            'paymentMethods'     => $this->config['alt_payment_method'],
+            'paymentMethods'     => $this->config['billing_payment_method'],
             'renewalFormSession' => $renewalFormSession,
             'nextInvoiceDate'    => $nextInvoiceDate,
             'pluginJsUrl'        => GLM_MEMBERS_BILLING_PLUGIN_URL . '/js',
index bce7184..93f5ea5 100644 (file)
             Select Payment Option
         </div>
         <div class="glm-billing-input">
+            {if in_array( 'Credit Card', $management.payment_methods.names)}
             <label> <input class="payment_option" type="radio" name="payment_option" value="pay_by_credit_card" checked> Pay by Credit Card </label>
+            {/if}
+            {if in_array( 'Check', $management.payment_methods.names)}
             <label> <input class="payment_option" type="radio" name="payment_option" value="pay_by_check"> Pay by Check </label>
+            {/if}
+            {if in_array( 'Mark Paid', $management.payment_methods.names)}
             <label> <input class="payment_option" type="radio" name="payment_option" value="mark_paid"> Mark Paid </label>
+            {/if}
         </div>
     </div>
     {/if}