From: Steve Sutton Date: Wed, 11 Apr 2018 19:07:55 +0000 (-0400) Subject: Update billing support class X-Git-Tag: v1.0.0^2~58 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a06013157779530ebbf2d0d1943aaeb76f13a79a;p=WP-Plugins%2Fglm-member-db-billing.git Update billing support class Adding docs to class. --- diff --git a/classes/billingSupport.php b/classes/billingSupport.php index 7256ea9..4b76a4b 100644 --- a/classes/billingSupport.php +++ b/classes/billingSupport.php @@ -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(