1 [% PROCESS "opac/parts/header.tt2";
2 PROCESS "opac/parts/misc_util.tt2";
3 WRAPPER "opac/parts/myopac/main_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 id="pay_fines_now"[% IF ctx.use_stripe %] class="hide_me"[% END %]>
31 <p><big>[% l("Are you sure you are ready to charge ") %]
32 <strong> [% l("[_1] ", money(ctx.fines.balance_owed))%]</strong>
33 [% l("to your credit card?") %]</big></p>
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 <input type="submit" value="[% l('Submit') %]" class="opac-button"/>
42 <a href="[% mkurl(ctx.opac_root _ '/myopac/main#selected_fines', {}, 1) %]" class="opac-button">[% l('Cancel') %]</a>
44 <table title="[% l('List of Transactions') %]" id="acct_fines_confirm_header"
45 class="table_no_border_space table_no_cell_pad" style="padding-top:1em;">
48 <th>[% l('Charge/Fee') %]</th>
49 <th>[% l('Amount') %]</th>
54 FOR f IN ctx.fines.circulation;
55 NEXT IF CGI.param('xact').size &&
56 !CGI.param('xact').grep(f.xact.id).size;
57 attrs = {marc_xml => f.marc_xml};
59 PROCESS get_marc_attrs args=attrs;
60 ELSIF f.xact.reservation;
61 attrs.title = f.xact.reservation.target_resource_type.name;
64 <td>[% attrs.title | html %]</td>
65 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
69 FOR f IN ctx.fines.grocery;
70 NEXT IF CGI.param('xact_misc').size &&
71 !CGI.param('xact_misc').grep(f.xact.id).size %]
73 <td>[% f.xact.last_billing_type | html %]</td>
74 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
80 <p style="padding-top: 2em;">
81 <big>[% l("Are you sure you are ready to charge ") %]
82 <strong> [% l("[_1] ", money(ctx.fines.balance_owed))%]</strong>
83 [% l("to your credit card?") %]</big></p>
84 <input type="submit" value="[% l('Submit') %]" class="opac-button"/>
85 <a href="[% mkurl(ctx.opac_root _ '/myopac/main#selected_fines', {}, 1) %]" class="opac-button">[% l('Cancel') %]</a>
88 <form method="post" id="payment_form" action='#payment'
89 [% IF ctx.use_stripe %]
90 onsubmit="return stripe_onsubmit();"
93 <input type="hidden" name="last_chance" value="1" />
94 [% FOR xact IN CGI.param('xact') %]
95 <input type="hidden" name="xact" value="[% xact | html %]" />
97 [% FOR xact IN CGI.param('xact_misc') %]
98 <input type="hidden" name="xact_misc" value="[% xact | html %]" />
100 [% IF ctx.use_stripe %]
101 <input type="hidden" name="stripe_token" id="stripe_token" />
104 <table id="billing_info_table">
107 <td colspan='2' class="cc_header"><strong>[% l('Billing Information') %]</strong></td>
110 <td><label for="payment-first-name">[% l('First Name') %]</label></td>
111 <td><input type="text" name="billing_first" id="payment-first-name"
112 value="[% ctx.user.first_given_name | html %]" /></td>
115 <td><label for="payment-last-name">[% l('Last Name') %]</label></td>
116 <td><input type="text" name="billing_last" id="payment-last-name"
117 value="[% ctx.user.family_name | html %]" /></td>
121 <td><label for="payment-email-addr">[% l('Email Address') %]</label></td>
124 <input id="payment-email-addr" type="text"
125 value="[% ctx.user.email | html %]" disabled="disabled"
126 readonly="readonly" />
127 <a title="[% l('Update Email Address') %]"
128 href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
132 <td><label for="payment-billing-address">[% l('Street Address') %]</label></td>
133 <td><input type="text" name="billing_address" id="payment-billing-address"
134 value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" /></td>
137 <td><label for="payment-billing-city">[% l('City' )%]</label></td>
138 <td><input type="text" name="billing_city" id="payment-billing-city"
139 value="[% ctx.user.billing_address.city | html %]" /></td>
142 <td><label for="payment-billing-state">[% l('State or Province') %]</label></td>
143 <td><input type="text" name="billing_state" id="payment-billing-state"
144 value="[% ctx.user.billing_address.state | html %]" /></td>
147 <td><label for="paymenet-billing-zip">[% l('ZIP or Postal Code') %]</label></td>
148 [% USE zip=String(ctx.user.billing_address.post_code) %]
149 <td><input type="tel" pattern="[0-9]*" maxlength="5" size="5" name="billing_zip" id="paymenet-billing-zip"
150 value="[% zip.truncate(5) %]" /></td>
155 <table id="credit_card_info_table">
158 <td colspan='2' class="cc_header"><strong>[% l('Credit Card Information') %]</strong></td>
161 <td><label for="payment-credit-card">[% l('Credit Card #') %]</label></td>
163 <!-- Make type tel, which prompts for numbers in mobile -->
164 <td><input type="tel" pattern="[0-9]*" maxlength="16" id="payment-credit-card" required
165 [% IF ctx.use_stripe %]
173 <td><label for="payment-security-code">[% l('Security Code') %]</label></td>
175 <!-- Make type tel, which prompts for numbers in mobile -->
176 <input type="tel" pattern="[0-9]*" size="4" maxlength="5" id="payment-security-code"
177 [% IF ctx.use_stripe %]
185 <td><label for="payment-expire-month">[% l('Expiration Month') %]</label></td>
187 <select id="payment-expire-month" required
188 [% IF ctx.use_stripe %]
189 data-stripe="exp_month"
194 <option value="-1"></option>
195 <option value="01">[% l("January (1)") %]</option>
196 <option value="02">[% l("February (2)") %]</option>
197 <option value="03">[% l("March (3)") %]</option>
198 <option value="04">[% l("April (4)") %]</option>
199 <option value="05">[% l("May (5)") %]</option>
200 <option value="06">[% l("June (6)") %]</option>
201 <option value="07">[% l("July (7)") %]</option>
202 <option value="08">[% l("August (8)") %]</option>
203 <option value="09">[% l("September (9)") %]</option>
204 <option value="10">[% l("October (10)") %]</option>
205 <option value="11">[% l("November (11)") %]</option>
206 <option value="12">[% l("December (12)") %]</option>
211 <td><label for="payment-expire-year">[% l('Expiration Year') %]</label></td>
213 <select id="payment-expire-year"
214 [%- IF ctx.use_stripe %]
215 data-stripe="exp_year"
220 [% year = date.format(date.now, '%Y');
222 WHILE y < year + 10; # show ten years starting now %]
223 <option value="[% y %]">[% y %]</option>
230 <div id="payment_actions">
231 [% l('Total amount:') %]
232 <strong>[% money(ctx.fines.balance_owed) %]</strong><br />
234 <input type="submit" id="payment_submit" value="[% l('Next') %]" class="opac-button" />
235 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]" class="opac-button">[% l('Cancel') %]</a>
245 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]