1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 WRAPPER "opac/parts/myopac/base.tt2";
5 myopac_main_page = "payment_form";
7 last_chance = CGI.param("last_chance");
9 IF myopac_main_page == "payment_form" AND
10 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';
14 <a name="payment"> </a>
15 <h3 class="sr-only">[% l('Pay Charges') %]</h3>
16 [% IF ctx.fines.balance_owed <= 0 %]
18 [% l("The minimum amount you can pay is \$0.01.") %]
21 [% IF ctx.use_stripe %]
23 [% l("Your browser does not have Javascript enabled, and we cannot " _
24 "process credit card payments without it. Please change your " _
25 "browser settings and try again.") %]
28 <div class="container">
30 <div id="pay_fines_now"[% IF ctx.use_stripe %] class="hide_me"[% END %]>
32 <h3>[% l("Confirm Payment") %]</h3>
34 <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="post">
37 FOR val IN CGI.param(k) %]
38 <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
41 <button type="submit" class="btn btn-confirm"><i class="fas fa-check"></i> [% l('Confirm') %]</button>
42 <a href="[% mkurl(ctx.opac_root _ '/myopac/main#selected_fines', {}, 1) %]" class="btn btn-deny"><i class="fas fa-ban"></i> [% l('Cancel') %]</a>
43 <p class="my-2"><big>[% l("Are you sure you are ready to charge ") %]
44 <strong> [% l("[_1] ", money(ctx.fines.balance_owed))%]</strong>
45 [% l("to your credit card?") %]</big></p>
46 <table title="[% l('List of Transactions') %]" id="acct_fines_confirm_header"
50 <th>[% l('Charge/Fee') %]</th>
51 <th class="text-right"><span>[% l('Amount') %]</th>
56 FOR f IN ctx.fines.circulation;
57 NEXT IF CGI.param('xact').size &&
58 !CGI.param('xact').grep(f.xact.id).size;
59 attrs = {marc_xml => f.marc_xml};
61 PROCESS get_marc_attrs args=attrs;
62 ELSIF f.xact.reservation;
63 attrs.title = f.xact.reservation.target_resource_type.name;
66 <td>[% attrs.title | html %]</td>
67 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
71 FOR f IN ctx.fines.grocery;
72 NEXT IF CGI.param('xact_misc').size &&
73 !CGI.param('xact_misc').grep(f.xact.id).size %]
75 <td>[% f.xact.last_billing_type | html %]</td>
76 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
84 <form method="post" id="payment_form" action='#payment'
85 [% IF ctx.use_stripe %]
86 onsubmit="return stripe_onsubmit();"
89 <input type="hidden" name="last_chance" value="1" />
90 [% FOR xact IN CGI.param('xact') %]
91 <input type="hidden" name="xact" value="[% xact | html %]" />
93 [% FOR xact IN CGI.param('xact_misc') %]
94 <input type="hidden" name="xact_misc" value="[% xact | html %]" />
96 [% IF ctx.use_stripe %]
97 <input type="hidden" name="stripe_token" id="stripe_token" />
100 <table id="billing_info_table" class="table table-hover">
102 <th colspan='2'><strong>[% l('Billing Information') %]</strong></th>
107 <td><label for="payment-first-name">[% l('First Name') %]</label></td>
108 <td><input name="given-name" type="text" name="billing_first" id="payment-first-name"
109 value="[% ctx.user.first_given_name | html %]" class="form-control"/></td>
112 <td><label for="payment-last-name">[% l('Last Name') %]</label></td>
113 <td><input name="family-name" type="text" name="billing_last" id="payment-last-name"
114 value="[% ctx.user.family_name | html %]" class="form-control"/></td>
118 <td><label for="payment-email-addr">[% l('Email Address') %]</label></td>
121 <input id="payment-email-addr" type="text"
122 value="[% ctx.user.email | html %]" disabled="disabled"
123 readonly="readonly" class="form-control" name="email"/>
124 <a title="[% l('Update Email Address') %]"
125 href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
129 <td><label for="payment-billing-address">[% l('Street Address') %]</label></td>
130 <td><input type="text" name="billing_address" id="payment-billing-address"
131 value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" class="form-control"/></td>
134 <td><label for="payment-billing-city">[% l('City' )%]</label></td>
135 <td><input type="text" name="billing_city" id="payment-billing-city"
136 value="[% ctx.user.billing_address.city | html %]" class="form-control"/></td>
139 <td><label for="payment-billing-state">[% l('State or Province') %]</label></td>
140 <td><input type="text" name="billing_state" id="payment-billing-state"
141 value="[% ctx.user.billing_address.state | html %]" class="form-control" /></td>
144 <td><label for="paymenet-billing-zip">[% l('Postal Code') %]</label></td>
145 [% USE zip=String(ctx.user.billing_address.post_code) %]
146 <td><input type="tel" pattern="[/^[a-zA-Z0-9 _-]{7}$/]*" maxlength="7" size="7" name="billing_zip" id="paymenet-billing-zip"
147 value="[% zip.truncate(5) %]" class="form-control"/></td>
152 <table id="credit_card_info_table" class="table">
154 <th colspan='2'><strong>[% l('Credit Card Information') %]</strong></th>
159 <td><label for="payment-credit-card">[% l('Credit Card #') %]</label></td>
161 <!-- Make type tel, which prompts for numbers in mobile -->
162 <td><input class="form-control" type="tel" pattern="[0-9]*" maxlength="16" id="payment-credit-card" required
163 [% IF ctx.use_stripe %]
171 <td><label for="payment-security-code">[% l('Security Code') %]</label></td>
173 <!-- Make type tel, which prompts for numbers in mobile -->
174 <input class="form-control" type="tel" pattern="[0-9]*" size="4" maxlength="5" id="payment-security-code"
175 [% IF ctx.use_stripe %]
183 <td><label for="payment-expire-month">[% l('Expiration Month') %]</label></td>
185 <select class="form-control" id="payment-expire-month" required
186 [% IF ctx.use_stripe %]
187 data-stripe="exp_month"
192 <option value="-1"></option>
193 <option value="01">[% l("January (1)") %]</option>
194 <option value="02">[% l("February (2)") %]</option>
195 <option value="03">[% l("March (3)") %]</option>
196 <option value="04">[% l("April (4)") %]</option>
197 <option value="05">[% l("May (5)") %]</option>
198 <option value="06">[% l("June (6)") %]</option>
199 <option value="07">[% l("July (7)") %]</option>
200 <option value="08">[% l("August (8)") %]</option>
201 <option value="09">[% l("September (9)") %]</option>
202 <option value="10">[% l("October (10)") %]</option>
203 <option value="11">[% l("November (11)") %]</option>
204 <option value="12">[% l("December (12)") %]</option>
209 <td><label for="payment-expire-year">[% l('Expiration Year') %]</label></td>
211 <select class="form-control" id="payment-expire-year"
212 [%- IF ctx.use_stripe %]
213 data-stripe="exp_year"
218 [% year = date.format(date.now, '%Y');
220 WHILE y < year + 10; # show ten years starting now %]
221 <option value="[% y %]">[% y %]</option>
228 <div id="payment_actions">
229 [% l('Total amount:') %]
230 <strong>[% money(ctx.fines.balance_owed) %]</strong><br />
232 <button type="submit" id="payment_submit" class="btn btn-confirm"><i class="fas fa-arrow-circle-right"></i> [% l('Next') %]</button>
233 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]" class="btn btn-deny"><i class="fas fa-ban"></i> [% l('Cancel') %]</a>
241 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]