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 <h3 class="sr-only">[% l('Pay Fines') %]</h3>
10 [% IF ctx.fines.balance_owed <= 0 %]
12 [% l("You either have no fines to pay or you have selected fines whose " _
13 "total is non-positive. We cannot process non-positive amounts.") %]
16 <div id="pay_fines_now">
18 <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
19 <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="post">
22 FOR val IN CGI.param(k) %]
23 <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
25 <input type="submit" value="[% l('Submit Payment') %]" />
26 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
28 <form method="post" id="payment_form"
30 onsubmit="return stripe_onsubmit();"
33 <input type="hidden" name="last_chance" value="1" />
34 [% FOR xact IN CGI.param('xact') %]
35 <input type="hidden" name="xact" value="[% xact | html %]" />
37 [% FOR xact IN CGI.param('xact_misc') %]
38 <input type="hidden" name="xact_misc" value="[% xact | html %]" />
41 <input type="hidden" name="stripe_token" id="stripe_token" />
44 <table title="[% l('Billing Information') %]">
47 <td colspan='2'><strong>[% l('Billing Information') %]</strong></td>
48 <td rowspan='13' valign='top'>
49 <p>[% l('Selected fines you are paying for:') %]</p>
50 <table title="[% l('List of Transactions') %]"
51 class="table_no_border_space table_no_cell_pad myopac_payments_table">
54 <th>[% l('Name') %]</th>
55 <th>[% l('Amount') %]</th>
60 FOR f IN ctx.fines.circulation;
61 NEXT IF CGI.param('xact').size &&
62 !CGI.param('xact').grep(f.xact.id).size;
63 attrs = {marc_xml => f.marc_xml};
65 PROCESS get_marc_attrs args=attrs;
66 ELSIF f.xact.reservation;
67 attrs.title = f.xact.reservation.target_resource_type.name;
70 <td>[% attrs.title | html %]</td>
71 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
75 FOR f IN ctx.fines.grocery;
76 NEXT IF CGI.param('xact_misc').size &&
77 !CGI.param('xact_misc').grep(f.xact.id).size %]
79 <td>[% f.xact.last_billing_type | html %]</td>
80 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
87 [% l('Total amount to pay:') %]
88 <strong>[% money(ctx.fines.balance_owed) %]</strong>
91 [% | l('<strong>', '</strong>') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %]
95 <td><label for="payment-first-name">[% l('First Name') %]</label></td>
96 <td><input type="text" name="billing_first" id="payment-first-name"
97 value="[% ctx.user.first_given_name | html %]" /></td>
100 <td><label for="payment-last-name">[% l('Last Name') %]</label></td>
101 <td><input type="text" name="billing_last" id="payment-last-name"
102 value="[% ctx.user.family_name | html %]" /></td>
105 <td><label for="payment-email-addr">[% l('Email Address') %]</label></td>
107 <input id="payment-email-addr" type="text" disabled="disabled"
108 readonly="readonly" value="[% ctx.user.email | html %]" />
109 <a title="[% l('Update Email Address') %]"
110 href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
114 <td><label for="payment-billing-address">[% l('Street Address') %]</label></td>
115 <td><input type="text" name="billing_address" id="payment-billing-address"
116 value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" /></td>
119 <td><label for="payment-billing-city">[% l('City' )%]</label></td>
120 <td><input type="text" name="billing_city" id="payment-billing-city"
121 value="[% ctx.user.billing_address.city | html %]" /></td>
124 <td><label for="payment-billing-state">[% l('State or Province') %]</label></td>
125 <td><input type="text" name="billing_state" id="payment-billing-state"
126 value="[% ctx.user.billing_address.state | html %]" /></td>
129 <td><label for="paymenet-billing-zip">[% l('ZIP or Postal Code') %]</label></td>
130 <td><input type="text" name="billing_zip" id="paymenet-billing-zip"
131 value="[% ctx.user.billing_address.post_code | html %]" /></td>
134 <td colspan='2'><strong>[% l('Credit Card Information') %]</strong></td>
137 <td><label for="payment-credit-card">[% l('Credit Card #') %]</label></td>
138 <td><input type="number" maxlength="16" id="payment-credit-card"
147 <td><label for="payment-security-code">[% l('Security Code') %]</label></td>
149 <input type="number" size="4" maxlength="5" id="payment-security-code"
158 <td><label for="payment-expire-month">[% l('Expiration Month') %]</label></td>
160 <select id="payment-expire-month"
162 data-stripe="exp_month"
167 <option value="01">[% l("January") %]</option>
168 <option value="02">[% l("February") %]</option>
169 <option value="03">[% l("March") %]</option>
170 <option value="04">[% l("April") %]</option>
171 <option value="05">[% l("May") %]</option>
172 <option value="06">[% l("June") %]</option>
173 <option value="07">[% l("July") %]</option>
174 <option value="08">[% l("August") %]</option>
175 <option value="09">[% l("September") %]</option>
176 <option value="10">[% l("October") %]</option>
177 <option value="11">[% l("November") %]</option>
178 <option value="12">[% l("December") %]</option>
183 <td><label for="payment-expire-year">[% l('Expiration Year') %]</label></td>
185 <select id="payment-expire-year"
187 data-stripe="exp_year"
192 [% year = date.format(date.now, '%Y');
194 WHILE y < year + 10; # show ten years starting now %]
195 <option value="[% y %]">[% y %]</option>
201 <td colspan='2' align="center">
202 <input type="submit" id="payment_submit" value="[% l('Next') %]" />
203 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
206 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]