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';
13 <h3 class="sr-only">[% l('Pay Charges') %]</h3>
14 [% IF ctx.fines.balance_owed <= 0 %]
16 [% l("You either have no fines to pay or you have selected fines whose " _
17 "total is non-positive. We cannot process non-positive amounts.") %]
20 [% IF ctx.use_stripe %]
22 [% l("Your browser does not have Javascript enabled, and we cannot " _
23 "process credit card payments without it. Please change your " _
24 "browser settings and try again.") %]
27 <div id="pay_fines_now"[% IF ctx.use_stripe %] class="hide_me"[% END %]>
29 <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
30 <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="post">
33 FOR val IN CGI.param(k) %]
34 <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
36 <input type="submit" value="[% l('Submit Payment') %]" />
37 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
39 <form method="post" id="payment_form"
40 [% IF ctx.use_stripe %]
41 onsubmit="return stripe_onsubmit();"
44 <input type="hidden" name="last_chance" value="1" />
45 [% FOR xact IN CGI.param('xact') %]
46 <input type="hidden" name="xact" value="[% xact | html %]" />
48 [% FOR xact IN CGI.param('xact_misc') %]
49 <input type="hidden" name="xact_misc" value="[% xact | html %]" />
51 [% IF ctx.use_stripe %]
52 <input type="hidden" name="stripe_token" id="stripe_token" />
55 <table title="[% l('Billing Information') %]">
58 <td colspan='2'><strong>[% l('Billing Information') %]</strong></td>
59 <td rowspan='13' valign='top'>
60 <p>[% l('Selected fines you are paying for:') %]</p>
61 <table title="[% l('List of Transactions') %]"
62 class="table_no_border_space table_no_cell_pad myopac_payments_table">
65 <th>[% l('Name') %]</th>
66 <th>[% l('Amount') %]</th>
71 FOR f IN ctx.fines.circulation;
72 NEXT IF CGI.param('xact').size &&
73 !CGI.param('xact').grep(f.xact.id).size;
74 attrs = {marc_xml => f.marc_xml};
76 PROCESS get_marc_attrs args=attrs;
77 ELSIF f.xact.reservation;
78 attrs.title = f.xact.reservation.target_resource_type.name;
81 <td>[% attrs.title | html %]</td>
82 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
86 FOR f IN ctx.fines.grocery;
87 NEXT IF CGI.param('xact_misc').size &&
88 !CGI.param('xact_misc').grep(f.xact.id).size %]
90 <td>[% f.xact.last_billing_type | html %]</td>
91 <td class="text-right">[% money(f.xact.balance_owed) %]</td>
98 [% l('Total amount to pay:') %]
99 <strong>[% money(ctx.fines.balance_owed) %]</strong>
102 [% | l('<strong>', '</strong>') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %]
106 <td><label for="payment-first-name">[% l('First Name') %]</label></td>
107 <td><input type="text" name="billing_first" id="payment-first-name"
108 value="[% ctx.user.first_given_name | html %]" /></td>
111 <td><label for="payment-last-name">[% l('Last Name') %]</label></td>
112 <td><input type="text" name="billing_last" id="payment-last-name"
113 value="[% ctx.user.family_name | html %]" /></td>
116 <td><label for="payment-email-addr">[% l('Email Address') %]</label></td>
118 <input id="payment-email-addr" type="text" disabled="disabled"
119 readonly="readonly" value="[% ctx.user.email | html %]" />
120 <a title="[% l('Update Email Address') %]"
121 href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
125 <td><label for="payment-billing-address">[% l('Street Address') %]</label></td>
126 <td><input type="text" name="billing_address" id="payment-billing-address"
127 value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" /></td>
130 <td><label for="payment-billing-city">[% l('City' )%]</label></td>
131 <td><input type="text" name="billing_city" id="payment-billing-city"
132 value="[% ctx.user.billing_address.city | html %]" /></td>
135 <td><label for="payment-billing-state">[% l('State or Province') %]</label></td>
136 <td><input type="text" name="billing_state" id="payment-billing-state"
137 value="[% ctx.user.billing_address.state | html %]" /></td>
140 <td><label for="paymenet-billing-zip">[% l('ZIP or Postal Code') %]</label></td>
141 <td><input type="text" name="billing_zip" id="paymenet-billing-zip"
142 value="[% ctx.user.billing_address.post_code | html %]" /></td>
145 <td colspan='2'><strong>[% l('Credit Card Information') %]</strong></td>
148 <td><label for="payment-credit-card">[% l('Credit Card #') %]</label></td>
149 <td><input type="text" maxlength="16" id="payment-credit-card"
150 [% IF ctx.use_stripe %]
158 <td><label for="payment-security-code">[% l('Security Code') %]</label></td>
160 <input type="text" size="4" maxlength="5" id="payment-security-code"
161 [% IF ctx.use_stripe %]
169 <td><label for="payment-expire-month">[% l('Expiration Month') %]</label></td>
171 <select id="payment-expire-month"
172 [% IF ctx.use_stripe %]
173 data-stripe="exp_month"
178 <option value="01">[% l("January") %]</option>
179 <option value="02">[% l("February") %]</option>
180 <option value="03">[% l("March") %]</option>
181 <option value="04">[% l("April") %]</option>
182 <option value="05">[% l("May") %]</option>
183 <option value="06">[% l("June") %]</option>
184 <option value="07">[% l("July") %]</option>
185 <option value="08">[% l("August") %]</option>
186 <option value="09">[% l("September") %]</option>
187 <option value="10">[% l("October") %]</option>
188 <option value="11">[% l("November") %]</option>
189 <option value="12">[% l("December") %]</option>
194 <td><label for="payment-expire-year">[% l('Expiration Year') %]</label></td>
196 <select id="payment-expire-year"
197 [%- IF ctx.use_stripe %]
198 data-stripe="exp_year"
203 [% year = date.format(date.now, '%Y');
205 WHILE y < year + 10; # show ten years starting now %]
206 <option value="[% y %]">[% y %]</option>
212 <td colspan='2' align="center">
213 <input type="submit" id="payment_submit" value="[% l('Next') %]" />
214 <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]">[% l('Cancel') %]</a>
217 [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]