]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates-bootstrap/opac/myopac/generic_payment_form.tt2
LP1895679: Add Stripe v3 support to Bootstrap OPAC
[Evergreen.git] / Open-ILS / src / templates-bootstrap / opac / myopac / generic_payment_form.tt2
1     <form method="post" id="payment_form" action='#payment'>
2         <input type="hidden" name="last_chance" value="1" />
3         [% FOR xact IN CGI.param('xact') %]
4         <input type="hidden" name="xact" value="[% xact | html %]" />
5         [% END %]
6         [% FOR xact IN CGI.param('xact_misc') %]
7         <input type="hidden" name="xact_misc" value="[% xact | html %]" />
8         [% END %]
9         [% IF ctx.use_stripe %]
10         <input type="hidden" name="stripe_token" id="stripe_token" />
11         [% END %]
12
13          <table id="billing_info_table" class="table table-hover">
14          <thead>
15           <th colspan='2'><strong>[% l('Billing Information') %]</strong></th>
16          </thead>
17           <tbody>
18
19                <tr>
20                 <td><label for="payment-first-name">[% l('First Name') %]</label></td>
21                     <td><input name="given-name" type="text"  name="billing_first" id="payment-first-name"
22                         value="[% ctx.user.first_given_name | html %]" class="form-control"/></td>
23                 </tr>
24                 <tr>
25                     <td><label for="payment-last-name">[% l('Last Name') %]</label></td>
26                     <td><input name="family-name" type="text" name="billing_last" id="payment-last-name"
27                         value="[% ctx.user.family_name | html %]" class="form-control"/></td>
28                 </tr>
29
30                 <tr>
31                     <td><label for="payment-email-addr">[% l('Email Address') %]</label></td>
32                     <td>
33
34                         <input id="payment-email-addr" type="text"
35                              value="[% ctx.user.email | html %]" disabled="disabled"
36                             readonly="readonly" class="form-control" name="email"/>
37                         <a title="[% l('Update Email Address') %]"
38                             href="[% ctx.opac_root %]/myopac/update_email?return_to_referer=1">[% l("Update") %]</a>
39                     </td>
40                 </tr>
41                 <tr>
42                     <td><label for="payment-billing-address">[% l('Street Address') %]</label></td>
43                     <td><input type="text" name="billing_address" id="payment-billing-address"
44                         value="[% ctx.user.billing_address.street1 _ ctx.user.billing_address.street2 | html %]" class="form-control"/></td>
45                 </tr>
46                 <tr>
47                     <td><label for="payment-billing-city">[% l('City' )%]</label></td>
48                     <td><input type="text" name="billing_city" id="payment-billing-city"
49                         value="[% ctx.user.billing_address.city | html %]" class="form-control"/></td>
50                 </tr>
51                 <tr>
52                     <td><label for="payment-billing-state">[% l('State or Province') %]</label></td>
53                     <td><input type="text" name="billing_state" id="payment-billing-state"
54                         value="[% ctx.user.billing_address.state | html %]" class="form-control" /></td>
55                 </tr>
56                 <tr>
57                     <td><label for="paymenet-billing-zip">[% l('Postal Code') %]</label></td>
58                     [% USE zip=String(ctx.user.billing_address.post_code) %]
59                     <td><input type="tel" pattern="[/^[a-zA-Z0-9 _-]{7}$/]*" maxlength="7" size="7" name="billing_zip" id="paymenet-billing-zip"
60                         value="[% zip.truncate(5)  %]" class="form-control"/></td>
61                 </tr>
62                </tbody>
63                </table>
64
65                <table id="credit_card_info_table" class="table">
66                <thead>
67                    <th colspan='2'><strong>[% l('Credit Card Information') %]</strong></th>
68                </thead>
69                <tbody>
70
71                 <tr>
72                     <td><label for="payment-credit-card">[% l('Credit Card #') %]</label></td>
73
74                      <!-- Make type tel, which prompts for numbers in mobile -->
75                     <td><input class="form-control" type="tel" pattern="[0-9]*" maxlength="16" id="payment-credit-card" required name="number" /></td>
76                 </tr>
77                 <tr>
78                     <td><label for="payment-security-code">[% l('Security Code') %]</label></td>
79                     <td>
80                          <!-- Make type tel, which prompts for numbers in mobile -->
81                         <input class="form-control" type="tel" pattern="[0-9]*" size="4" maxlength="5" id="payment-security-code" name="cvv2" /></td>
82                 </tr>
83                 <tr>
84                     <td><label for="payment-expire-month">[% l('Expiration Month') %]</label></td>
85                     <td>
86                         <select class="form-control" id="payment-expire-month" required
87                         [% IF ctx.use_stripe %]
88                         data-stripe="exp_month"
89                         [% ELSE %]
90                         name="expire_month"
91                         [% END %]
92                         >
93                             <option value="-1"></option>
94                             <option value="01">[% l("January (1)") %]</option>
95                             <option value="02">[% l("February (2)") %]</option>
96                             <option value="03">[% l("March (3)") %]</option>
97                             <option value="04">[% l("April (4)") %]</option>
98                             <option value="05">[% l("May (5)") %]</option>
99                             <option value="06">[% l("June (6)") %]</option>
100                             <option value="07">[% l("July (7)") %]</option>
101                             <option value="08">[% l("August (8)") %]</option>
102                             <option value="09">[% l("September (9)") %]</option>
103                             <option value="10">[% l("October (10)") %]</option>
104                             <option value="11">[% l("November (11)") %]</option>
105                             <option value="12">[% l("December (12)") %]</option>
106                         </select>
107                     </td>
108                 </tr>
109                 <tr>
110                     <td><label for="payment-expire-year">[% l('Expiration Year') %]</label></td>
111                     <td>
112                         <select class="form-control" id="payment-expire-year" name="expire_year" >
113                         [% year = date.format(date.now, '%Y');
114                         y = year;
115                         WHILE y < year + 10; # show ten years starting now %]
116                             <option value="[% y %]">[% y %]</option>
117                         [% y = y + 1; END %]
118                         </select>
119                     </td>
120                 </tr>
121                 <tr>
122                    <td colspan='2'>
123                        <div id="payment_actions">
124                           [% l('Total amount:') %]
125                            <strong>[% money(ctx.fines.balance_owed) %]</strong><br />
126
127                          <button type="submit" id="payment_submit" class="btn btn-confirm"><i class="fas fa-arrow-circle-right"></i> [% l('Next') %]</button>
128                          <a href="[% mkurl(ctx.opac_root _ '/myopac/main', {}, 1) %]" class="btn btn-deny"><i class="fas fa-ban"></i> [% l('Cancel') %]</a>
129                          <br/>
130                          </div>
131                    </td>
132                 </tr>
133
134           </tbody>
135         </table>
136          [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %]
137     </form>
138