case 'verifyInvoiceNumber':
if ( isset( $_REQUEST['invoice_number'] ) && $invoiceNumber = filter_var( $_REQUEST['invoice_number'], FILTER_VALIDATE_INT ) ) {
// Get the invoice
- $Invoices = new GlmDataInvoices( $this->wpdb, $this->config );
+ $Invoices = new GlmDataInvoices( $this->wpdb, $this->config );
$Invoices->line_items_post = true;
- $invoice = $Invoices->getEntry( $invoiceNumber );
+ $invoice = $Invoices->getEntry( $invoiceNumber );
$Invoices->line_items_post = false;
// trigger_error( print_r( $invoice, true ), E_USER_NOTICE );
if ( !$invoice ) {
- $return = array( 'status' => false, 'message' => 'no invoice' );
+ $return = array( 'status' => false, 'message' => 'no invoice' );
}
// trigger_error( print_r( $invoice, true ), E_USER_NOTICE );
$accountId = $invoice['account']['value'];
// trigger_error( print_r( $accountId, true ), E_USER_NOTICE );
if ( !$accountId ) {
- $return = array( 'status' => false, 'message' => 'no accountId' );
+ $return = array( 'status' => false, 'message' => 'no accountId' );
}
$invoiceTypeId = false;
// Get the invoice id for the renewal line item
),
ARRAY_A
);
- // trigger_error( print_r( $account, true ), E_USER_NOTICE );
// Returning the invoice_type of the account
- // TODO: This maybe should be the actual invoice type_id
if ( $account ) {
$return = array(
'status' => true,
case 'pay_by_credit_card':
// Do the Payment Processing.
$processErrors = $BillingSupport->processOnlinePayment( $accountId, $invoiceId, $_REQUEST['total_renew_amount'] );
+ // echo '<pre>$processErrors: ' . print_r( $processErrors, true ) . '</pre>';
if ( $processErrors ) {
if ( isset( $processErrors ) && is_array( $processErrors ) && count( $processErrors ) > 0 ) {
$error = true;
foreach ( $processErrors as $error ) {
- $messages[] = '<span style="color: red;">'.$error.'</span>';
+ $messages[] = $error;
}
} else if ( isset( $processErrors ) && $processErrors ) {
$error = true;
- $messages[] = '<span style="color: red;">'.$processErrors.'</span>';
+ $messages[] = $processErrors;
} else {
$paymentSuccess = true;
}
{if $paymentSuccess}<span class="glm-notice glm-flash-updated">Payment Completed</span>{/if}
{if $paymentError}<span class="glm-notice glm-flash-updated">Error With Payment</span>{/if}
+ <div id="billing-error">
{if $messages}
{foreach $messages as $message}
- <div class="">{$message}</div>
+ <li>{$message}</li>
{/foreach}
{/if}
+ </div>
<form action="{$thisUrl}" method="post"{if $billing_settings.proc_methods == 4} id="nonce-form"{/if}>
<input type="hidden" name="option" value="paymentProcess" />
<input type="hidden" id="account_id" name="account_id" value="{$accountId}" />
<input type="hidden" id="total_renew_amount" name="total_renew_amount" value="" />
- <span id="membername"></span>
-
- <div id="billing-error"></div>
+ <div><p id="billing-msg-center">Start by entering your invoice number. We will look up your account.</p></div>
<div class="glm-billing-field">
<div class="glm-billing-label glm-required">
Invoice #
</div>
<div class="glm-billing-input">
- <input id="invoice_number" name="invoice_number" value="{if isset($invoiceId)}{$invoiceId}{/if}" required />
+ <input id="invoice_number" name="invoice_number" value="" required />
</div>
</div>
- <div class="glm-billing-field">
+ <div id="billing-membership-class" class="glm-billing-field glm-hidden">
<div class="glm-billing-label glm-required">
Membership Class
</div>
</div>
</div>
- <div class="glm-billing-field">
+ <div id="billing-member-name" class="glm-hidden">
+ Found invoice for:
+ <strong id="membername"></strong>
+ </div>
+ <div id="billing-total-due" class="glm-billing-field glm-hidden">
<div class="glm-billing-label">
Total Due
</div>
console.log( 'invoice_type', msg.invoice_type );
{if $settings.allow_membership_choice}
$('#invoice_type_id_' + msg.invoice_type ).attr('checked', true);
+ $('#billing-msg-center').hide();
$('#membername').html(msg.invoice.member_name);
+ $('#billing-total-due').show();
+ $('#billing-member-name').show();
getPageTotal();
{else}
$('#member_renewing').data( 'amount', msg.invoice.amount_total );
});
} );
+ {if $messages}
+ $('#billing-error').show();
+ $('#billing-msg-center').hide();
+ // $('#billing-total-due').show();
+ // $('#billing-member-name').show();
+ {if $invoiceId}
+ $('#invoice_number').val( {$invoiceId} ).trigger('change');
+ {/if}
+
+ {/if}
// Generate the total for the renewal.
function getPageTotal(){