-
Notifications
You must be signed in to change notification settings - Fork 9
/
example-persistent.html
318 lines (295 loc) · 14.8 KB
/
example-persistent.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="shortcut icon" type="image/icon" href="favicon.ico" />
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css"
integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" type="text/css" media="screen,print" href="modal.loader2.css3.css">
<title>SGD demo Checkout</title>
<style type="text/css">
h2,
p.lead {
text-align: left;
}
#payframe {
border: 1px solid #eee;
width: 100%;
height: 68em;
}
h2,
p.lead {
text-align: left;
}
#paymentRef {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
background: none;
padding: 0;
margin: 0;
border: 0;
}
#config {
text-align: left;
}
</style>
</head>
<body>
<div class="container">
<img class="d-block mx-auto mb-4" src="lorem-logo.png" alt="" height="72">
<div class="pb-2" style="text-align: right">
<span>
<a class="btn btn-light" data-toggle="collapse" href="#config" role="button" aria-expanded="false"
aria-controls="config">Configure</a>
</span>
<span>
<a class="btn btn-light" data-toggle="collapse" href="#testCards" role="button" aria-expanded="false"
aria-controls="testCards">Test Cards</a>
</span>
</div>
<br>
<div>
<div class="collapse multi-collapse pb-2" id="config">
<div class="card">
<div class="card-body">
<h6 class="card-subtitle mb-2 text-muted">Prerequisites:</h6>
<p class="card-text">
<ul>
<li>The domain (<span id="domainName"></span>) should be added as part of your
merchant's CSP (Content Security Policy).</li>
<li>The hosted page should be set to "Browser to server"</li>
<li>The hosted page should be launched</li>
</ul>
</p>
<form id="configForm">
<div class="form-row">
<div class="col-lg">
<div class="form-group">
<input type="text" class="form-control" placeholder="Client Key" id="clientKey">
</div>
</div>
<div class="col-lg">
<div class="form-group">
<input type="text" class="form-control" placeholder="Client Secret"
id="clientSercret">
</div>
</div>
</div>
<div class="form-row">
<div class="col-md">
<input type="text" class="form-control" placeholder="Merchant" id="merchant">
</div>
<div class="col-md">
<div class="form-row align-items-center">
<div class="col-md">
<input type="text" class="form-control" placeholder="Currency"
id="currency">
</div>
<div class="col-md">
<input type="text" class="form-control" placeholder="Amount" id="amount">
</div>
<div class="col-md">
<div class="custom-control custom-checkbox mr-sm-2">
<input class="custom-control-input" type="checkbox" value=""
id="isProduction">
<label class="custom-control-label"
for="isProduction">Production</label>
</div>
</div>
</div>
</div>
</div>
<div class="form-row"><button type="submit">Save</button></div>
</form>
</div>
</div>
</div>
<div class="collapse multi-collapse" id="testCards">
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="visa-tab" data-toggle="tab" href="#visa" role="tab"
aria-controls="visa" aria-selected="true">Visa</a>
</li>
<li class="nav-item">
<a class="nav-link" id="mastercard-tab" data-toggle="tab" href="#mastercard" role="tab"
aria-controls="mastercard" aria-selected="false">Mastercard</a>
</li>
<li class="nav-item">
<a class="nav-link" id="alipay-tab" data-toggle="tab" href="#alipay" role="tab"
aria-controls="alipay" aria-selected="false">Alipay</a>
</li>
</ul>
<div class="tab-content text-center" id="myTabContent">
<div class="tab-pane fade show active" id="visa" role="tabpanel" aria-labelledby="visa-tab">
<table class="table table-striped">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Success</th>
<th scope="col">Fail</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Card Numbers:</th>
<td id="visa-success">4111 1111 1111 1111</td>
<td id="visa-fail">4532 0818 6469 8195</td>
</tr>
<tr>
<th scope="row">Expiry Date:</th>
<td colspan="2">Any future date <br>Eg:"<span class="futureDates"></span>"</td>
</tr>
<tr>
<th scope="row">CVV:</th>
<td colspan="2">Any 3 digits <br> Eg:"111"</td>
</tr>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="mastercard" role="tabpanel" aria-labelledby="mastercard-tab">
<table class="table table-striped">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Success</th>
<th scope="col">Fail</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Card Numbers:</th>
<td id="mastercard-success">5123 4567 8901
2346
</td>
<td id="mastercard-fail">5460 1798 6185 4077</td>
</tr>
<tr>
<th scope="row">Expiry Date:</th>
<td colspan="2">Any future date <br>Eg:"<span class="futureDates"></span>"</td>
</tr>
<tr>
<th scope="row">CVV:</th>
<td colspan="2">Any 3 digits <br> Eg:"111"</td>
</tr>
</tbody>
</table>
</div>
<div class="tab-pane fade" id="alipay" role="tabpanel" aria-labelledby="alipay-tab">
<table class="table table-striped">
<thead>
<tr>
<th scope="col"></th>
<th scope="col">Account Information</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Email:</th>
<td id="alipay-email">[email protected]</td>
</tr>
<tr>
<th scope="row">Login Passcode:</th>
<td colspan="2">111 111</td>
</tr>
<tr>
<th scope="row">Payment Passcode</th>
<td colspan="2">111 111</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<h2>Checkout</h2>
<p class="lead">The price and availability of items at Demo Shopping Cart are subject to change.
The Cart is a temporary place to store a list of your items and reflects each item's most recent price.
Do you have a gift card or promotional code? We'll ask you to enter your claim code when it's time to pay.</p>
<div class="container">
<div class="row py-5">
<div class="col-lg-8">
<div class="alert alert-info" role="alert" id="loading">
Calculating payment... Please wait...
</div>
<iframe id="payframe" class="d-none"></iframe>
</div>
<div class="col-lg-4">
<ul class="list-group mb-3">
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Total Cost</h6>
<small class="text-muted">Brief description</small>
</div>
<span class="text-muted">$2.01</span>
</li>
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Tax</h6>
<small class="text-muted">Brief description</small>
</div>
<span class="text-muted">$0.00</span>
</li>
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Shipping</h6>
<small class="text-muted">Brief description</small>
</div>
<span class="text-muted">$0</span>
</li>
<li class="list-group-item d-flex justify-content-between bg-light">
<div class="text-success">
<h6 class="my-0">Promo code</h6>
<small>EXAMPLECODE</small>
</div>
<span class="text-success">
<span>-$2</span>
</span>
</li>
<li class="list-group-item d-flex justify-content-between lh-condensed">
<div>
<h6 class="my-0">Payment Reference</h6>
<small class="text-muted"></small>
</div>
<span class="text-muted" id="paymentRef"></span>
</li>
<li class="list-group-item d-flex justify-content-between">
<span>Total (<em id="totalCcy">SGD</em>)</span>
<strong id="totalAmount">0.01</strong>
</li>
</ul>
<form class="card p-2">
<div class="input-group">
<input type="text" class="form-control" id="promoCode" placeholder="Promo code">
<div class="input-group-append">
<button type="submit" class="btn btn-secondary">Redeem</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous">
</script>
<script src="src/jspay.js"></script>
<script src="demo/extra.js"></script>
<script src="demo/persistent.js"></script>
</script>
</body>
</html>