Update billing support class
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 11 Apr 2018 19:07:55 +0000 (15:07 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 11 Apr 2018 19:07:55 +0000 (15:07 -0400)
Adding docs to class.

classes/billingSupport.php

index 7256ea9..4b76a4b 100644 (file)
@@ -134,6 +134,7 @@ class GlmBillingSupport
 
         }
 
+        // Handle the rest of $payment
         if ( $payment ) {
 
             // Get the unpaid invoices
@@ -943,6 +944,16 @@ class GlmBillingSupport
     /**
      * createMemberInvoiceWithEmployees
      *
+     * Expects to have $invoice_data array with following keys:
+     * account_id
+     * renew_type_id
+     * amount
+     * due_date
+     * member_invoice
+     * employee_data
+     *
+     * @param mixed $invoice_data Array of invoice data
+     *
      * @access public
      * @return int
      */
@@ -1087,6 +1098,19 @@ class GlmBillingSupport
         );
     }
 
+    /**
+     * processPayment
+     *
+     * Manages the payment processing for billing.
+     * This has been updated to use the new payment gateways.
+     *
+     * @param int   $account_id Account id
+     * @param int   $payment_id Payment id
+     * @param float $amount     Amount of payment
+     *
+     * @access public
+     * @return mixed
+     */
     public function processPayment( $account_id, $payment_id, $amount )
     {
         $errors = array();
@@ -1359,6 +1383,18 @@ class GlmBillingSupport
 
     }
 
+    /**
+     * makePayment
+     *
+     * Calls the processPayment method, creates payment and records it.
+     *
+     * @param int   $account_id Account id
+     * @param mixed $invoices   Array of invoices
+     * @param float $amount     Amount of payment
+     *
+     * @access public
+     * @return void
+     */
     public function makePayment( $account_id, $invoices, $amount )
     {
         $payment_id = implode( '-', $invoices );
@@ -1408,6 +1444,16 @@ class GlmBillingSupport
         );
     }
 
+    /**
+     * updateAccountRenewalDate
+     *
+     * Update the renewal date for the given account.
+     *
+     * @param int $account Account number
+     *
+     * @access public
+     * @return void
+     */
     public function updateAccountRenewalDate( $account )
     {
         $this->wpdb->update(