{* Only if payments types are setup *}
{include file='common/billing/paymentForm.html'}
- <input class="button button-primary" type="submit" value="Make Payment" {if $billing_settings.proc_methods == 4} onclick="onGetCardNonce(event)"{/if}>
+ <input id="billing-payment-button" class="button button-primary" type="submit" value="Make Payment" {if $billing_settings.proc_methods == 4} onclick="onGetCardNonce(event)"{/if}>
{else}
You don't have any unpaid invoices!
$('.payment_option').change(function(){
var payment_option = $('.payment_option:checked').val();
- console.log( 'payment_option: ', payment_option );
+ // console.log( 'payment_option: ', payment_option );
if ( payment_option == 'pay_by_check' ) {
{if $billing_settings.proc_methods == 4}
$('.sq-payment-form').hide();
+ paymentForm.destroy();
{else}
$('.glm-billing-credit').hide();
$('.ccard').prop('disabled', true);
+ $('#billing-payment-button').prop( 'onclick', null );
{/if}
} else if ( payment_option == 'mark_paid' ) {
{if $billing_settings.proc_methods == 4}
$('.sq-payment-form').hide();
+ paymentForm.destroy();
+ $('#billing-payment-button').prop( 'onclick', null );
{else}
$('.glm-billing-credit').hide();
$('.ccard').prop('disabled', true);
{/if}
} else {
{if $billing_settings.proc_methods == 4}
- $('.sq-payment-form').show();
+ if ( confirm( 'This will reload the page' ) ) {
+ $('.sq-payment-form').show();
+ window.location.reload();
+ } else {
+ $('.payment_option[value=mark_paid]').prop( 'checked', true );
+ }
{else}
$('.glm-billing-credit').show();
$('.ccard').prop('disabled', false);