[% PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; WRAPPER "opac/parts/myopac/main_base.tt2"; myopac_page = "main"; myopac_main_page = "payment_form"; last_chance = CGI.param("last_chance"); IF myopac_main_page == "payment_form" AND ctx.get_org_setting(ctx.user.home_ou.id, 'credit.processor.stripe.enabled') AND ctx.get_org_setting(ctx.user.home_ou.id, 'credit.processor.default') == 'Stripe'; ctx.use_stripe = 1; END %]

[% l('Pay Charges') %]

[% IF ctx.fines.balance_owed <= 0 %]
[% l("The minimum amount you can pay is \$0.01.") %]
[% ELSE %] [% IF ctx.use_stripe %] [% END %]
[% IF last_chance %]

[% l("Are you sure you are ready to charge ") %] [% l("[_1] ", money(ctx.fines.balance_owed))%] [% l("to your credit card?") %]

[% FOR k IN CGI.Vars; NEXT UNLESS k; FOR val IN CGI.param(k) %] [% END; END %] [% l('Cancel') %] [% FOR f IN ctx.fines.circulation; NEXT IF CGI.param('xact').size && !CGI.param('xact').grep(f.xact.id).size; attrs = {marc_xml => f.marc_xml}; IF f.marc_xml; PROCESS get_marc_attrs args=attrs; ELSIF f.xact.reservation; attrs.title = f.xact.reservation.target_resource_type.name; END %] [% END; FOR f IN ctx.fines.grocery; NEXT IF CGI.param('xact_misc').size && !CGI.param('xact_misc').grep(f.xact.id).size %] [% END %]
[% l('Charge/Fee') %] [% l('Amount') %]
[% attrs.title | html %] [% money(f.xact.balance_owed) %]
[% f.xact.last_billing_type | html %] [% money(f.xact.balance_owed) %]

[% l("Are you sure you are ready to charge ") %] [% l("[_1] ", money(ctx.fines.balance_owed))%] [% l("to your credit card?") %]

[% l('Cancel') %] [% ELSE %] [% FOR xact IN CGI.param('xact') %] [% END %] [% FOR xact IN CGI.param('xact_misc') %] [% END %] [% IF ctx.use_stripe %] [% END %] [% USE zip=String(ctx.user.billing_address.post_code) %]
[% l('Billing Information') %]
[% l("Update") %]
[% l('Credit Card Information') %]
[% l('Total amount:') %] [% money(ctx.fines.balance_owed) %]
[% l('Cancel') %]
[% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %] [% END %]
[% END %] [% END %]