'payments' => $payments,
);
+ // echo '<pre>$templateData: ' . print_r( $templateData, true ) . '</pre>';
+
$invoiceHtml = $this->generateInvoiceHtml( $templateData, 'admin/billing/invoiceStore.html' );
return $invoiceHtml;
}
'ccResult' => $ccResult,
);
+ } else {
+ $result = array(
+ 'status' => 0,
+ 'errors' => $ccResult['description']
+ );
}
} else {
{
$payment_id = implode( '-', $invoices );
$result = $this->processPayment( $account_id, $payment_id, $amount );
+ // echo '<pre>$result: ' . print_r( $result, true ) . '</pre>';
if ( $result['status'] === 1 ) {
// Need to record the payment.
// Record the payment.
$this->recordPayment( $payment_id, $account_id, $amount, $invoices );
- $errors = $result['errors'];
+ return false;
} else {
- $errors = $result['errors'];
+ return $result['errors'];
}
}
// Make the Payment using Billing Support Class
$errors = $BillingSupport->makePayment( $account_id, $invoices, $amount );
+ // echo '<pre>$errors: ' . print_r( $errors, true ) . '</pre>';
+
if ( $errors ) {
$paymentError = true;
+ $messages[] = $errors;
// Load DataClass for Management.
require_once GLM_MEMBERS_BILLING_PLUGIN_CLASS_PATH . '/data/dataManagement.php';
$Management = new GlmDataBillingManagement( $this->wpdb, $this->config );
}
- $view = 'statements';
+ if ( !$errors ) {
+ $view = 'statements';
+ }
break;