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");
8 use_stripe = ctx.get_org_setting(ctx.user.home_ou.id, 'opac.processor.stripe.enabled');
10 <h3 class="sr-only">[% l('Pay Fines') %]</h3>
11 [% IF ctx.fines.balance_owed <= 0 %]
13 [% l("You either have no fines to pay or you have selected fines whose " _
14 "total is non-positive. We cannot process non-positive amounts.") %]
17 <div id="pay_fines_now">
19 <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
20 <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="post">
23 FOR val IN CGI.param(k) %]
24 <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
26 <input type="submit" value="[% l('Submit Payment') %]" />
27 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
29 <form method="post" id="payment_form"
31 onsubmit="return stripe_onsubmit();"
34 <input type="hidden" name="last_chance" value="1" />
35 [% FOR xact IN CGI.param('xact') %]
36 <input type="hidden" name="xact" value="[% xact | html %]" />
38 [% FOR xact IN CGI.param('xact_misc') %]
39 <input type="hidden" name="xact_misc" value="[% xact | html %]" />
42 <input type="hidden" name="stripe_token" id="stripe_token" />
45 <table title="[% l('Billing Information') %]">
48 <td colspan='2'><strong>[% l('Billing Information') %]</strong></td>
49 <td rowspan='13' valign='top'>
50 <p>[% l('Selected fines you are paying for:') %]</p>
51 <table title="[% l('List of Transactions') %]"
52 class="table_no_border_space table_no_cell_pad myopac_payments_table">
55 <th>[% l('Name') %]</th>
56 <th>[% l('Amount') %]</th>
61 FOR f IN ctx.fines.circulation;
62 NEXT IF CGI.param('xact').size &&
63 !CGI.param('xact').grep(f.xact.id).size;
64 attrs = {marc_xml => f.marc_xml};
66 PROCESS get_marc_attrs args=attrs;
67 ELSIF f.xact.reservation;
68 attrs.title = f.xact.reservation.target_resource_type.name;
71 <td>[% attrs.title | html %]</td>
72 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
76 FOR f IN ctx.fines.grocery;
77 NEXT IF CGI.param('xact_misc').size &&
78 !CGI.param('xact_misc').grep(f.xact.id).size %]
80 <td>[% f.xact.last_billing_type | html %]</td>
81 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
88 [% l('Total amount to pay:') %]
89 <strong>[% money(ctx.fines.balance_owed) %]</strong>
92 [% | l('<strong>', '</strong>') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %]
96 <td><label for="payment-first-name">[% l('First Name') %]</label></td>
97 <td><input type="text" name="billing_first" id="payment-first-name"
98 value="[% ctx.user.first_given_name | html %]" /></td>
101 <td><label for="payment-last-name">[% l('Last Name') %]</label></td>
102 <td><input type="text" name="billing_last" id="payment-last-name"
103 value="[% ctx.user.family_name | html %]" /></td>
106 <td><label for="payment-email-addr">[% l('Email Address') %]</label></td>
108 <input id="payment-email-addr" type="text" disabled="disabled"
109 readonly="readonly" value="[% ctx.user.email | html %]" />
110 <a title="[% l('Update Email Address') %]"
111 href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
115 <td><label for="payment-billing-address">[% l('Street Address') %]</label></td>
116 <td><input type="text" name="billing_address" id="payment-billing-address"
117 value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" /></td>
120 <td><label for="payment-billing-city">[% l('City' )%]</label></td>
121 <td><input type="text" name="billing_city" id="payment-billing-city"
122 value="[% ctx.user.billing_address.city | html %]" /></td>
125 <td><label for="payment-billing-state">[% l('State or Province') %]</label></td>
126 <td><input type="text" name="billing_state" id="payment-billing-state"
127 value="[% ctx.user.billing_address.state | html %]" /></td>
130 <td><label for="paymenet-billing-zip">[% l('ZIP or Postal Code') %]</label></td>
131 <td><input type="text" name="billing_zip" id="paymenet-billing-zip"
132 value="[% ctx.user.billing_address.post_code | html %]" /></td>
135 <td colspan='2'><strong>[% l('Credit Card Information') %]</strong></td>
138 <td><label for="payment-credit-card">[% l('Credit Card #') %]</label></td>
139 <td><input type="number" maxlength="16" id="payment-credit-card"
148 <td><label for="payment-security-code">[% l('Security Code') %]</label></td>
150 <input type="number" size="4" maxlength="5" id="payment-security-code"
159 <td><label for="payment-expire-month">[% l('Expiration Month') %]</label></td>
161 <select id="payment-expire-month"
163 data-stripe="exp_month"
168 <option value="01">[% l("January") %]</option>
169 <option value="02">[% l("February") %]</option>
170 <option value="03">[% l("March") %]</option>
171 <option value="04">[% l("April") %]</option>
172 <option value="05">[% l("May") %]</option>
173 <option value="06">[% l("June") %]</option>
174 <option value="07">[% l("July") %]</option>
175 <option value="08">[% l("August") %]</option>
176 <option value="09">[% l("September") %]</option>
177 <option value="10">[% l("October") %]</option>
178 <option value="11">[% l("November") %]</option>
179 <option value="12">[% l("December") %]</option>
184 <td><label for="payment-expire-year">[% l('Expiration Year') %]</label></td>
186 <select id="payment-expire-year"
188 data-stripe="exp_year"
193 [% year = date.format(date.now, '%Y');
195 WHILE y < year + 10; # show ten years starting now %]
196 <option value="[% y %]">[% y %]</option>
202 <td colspan='2' align="center">
203 <input type="submit" id="payment_submit" value="[% l('Next') %]" />
204 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
207 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]