-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkout.html
338 lines (320 loc) · 12.3 KB
/
checkout.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nodejs - JavaScript - PAYU - Integration - Checkout</title>
<link
href="https://cdnjs.cloudflare.com/ajax/libs/simple-line-icons/2.4.1/css/simple-line-icons.min.css"
rel="stylesheet"
/>
<link
rel="stylesheet"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
/>
<link rel="stylesheet" href="assets/css/style.css" />
</head>
<style type="text/css">
.main {
margin-left: 30px;
font-family: Verdana, Geneva, sans-serif, serif;
}
.text {
float: left;
width: 180px;
}
.dv {
margin-bottom: 5px;
}
</style>
<body>
<div class="main registration-form">
<!--// Form with required parameters to be posted to Payment Gateway. For details of each required
parameters refer Integration PDF. //-->
<form action="<%= checkoutUrl %>" id="payment_form" method="Post">
<div class="row">
<div class="col-md-12">
<div class="form-icon">
<h3>PAYU NODEJS INTEGRATION <%= mode %></h3>
<span><img src="/images/logo.png" /></span>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="dv">
<span class="text"><label>Order ID:</label></span>
<div class="form-group">
<!-- Required - Unique transaction id or order id to identify and match
payment with local invoicing. Datatype is Varchar with a limit of 25 char. //-->
<input
type="text"
id="txnid"
name="txnid"
placeholder="Transaction ID"
value="<%= orderid %>"
class="form-control item"
readonly
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Amount:</label></span>
<div class="form-group">
<!-- Required - Transaction amount of float type. //-->
<input
type="text"
id="amount"
name="amount"
placeholder="Amount"
value="6.00"
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Product Info:</label></span>
<div class="form-group">
<!-- Required - Purchased product/item description or SKUs for future reference.
Datatype is Varchar with 100 char limit. //-->
<input
type="text"
id="productinfo"
name="productinfo"
placeholder="Product Info"
value="P01,P02"
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>First Name:</label></span>
<div class="form-group">
<!-- Required - Should contain first name of the consumer. Datatype is Varchar with 60 char limit. //-->
<input
type="text"
id="firstname"
name="firstname"
placeholder="First Name"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Last Name:</label></span>
<div class="form-group">
<!-- Should contain last name of the consumer. Datatype is Varchar with 50 char limit. //-->
<input
type="text"
id="Lastname"
name="Lastname"
placeholder="Last Name"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Email ID:</label></span>
<div class="form-group">
<!-- Required - An email id in valid email format has to be posted. Datatype is Varchar with 50 char limit. //-->
<input
type="text"
id="email"
name="email"
placeholder="Email ID"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Mobile/Cell Number:</label></span>
<div class="form-group">
<!-- Required - Datatype is Varchar with 50 char limit and must contain chars 0 to 9 only.
This parameter may be used for land line or mobile number as per requirement of the application. //-->
<input
type="text"
id="phone"
name="phone"
placeholder="Mobile/Cell Number"
value=""
class="form-control item"
/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="dv">
<span class="text"><label>Address1:</label></span>
<div class="form-group">
<input
type="text"
id="address1"
name="address1"
placeholder="Address1"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Address2:</label></span>
<div class="form-group">
<input
type="text"
id="address2"
name="address2"
placeholder="Address2"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>City:</label></span>
<div class="form-group">
<input
type="text"
id="city"
name="city"
placeholder="City"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>State:</label></span>
<div class="form-group">
<input
type="text"
id="state"
name="state"
placeholder="State"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Country:</label></span>
<div class="form-group">
<input
type="text"
id="country"
name="country"
placeholder="Country"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<span class="text"><label>Zip Code:</label></span>
<div class="form-group">
<!-- Datatype is Varchar with 20 char limit only 0-9. //-->
<input
type="text"
id="Zipcode"
name="Zipcode"
placeholder="Zip Code"
value=""
class="form-control item"
/>
</div>
</div>
<div class="dv">
<!-- <span class="text"><label>PG:</label></span> -->
<div class="form-group">
<!-- Not mandatory but fixed code can be passed to Payment Gateway to show default payment
option tab. e.g. NB, CC, DC, CASH, EMI. Refer PDF for more details. //-->
<!-- <input type="text" id="Pg" name="Pg" placeholder="PG" value="CC" class="form-control item"/> -->
</div>
</div>
<div class="dv">
<span class="text"><label>Hash:</label></span>
<div class="form-group">
<!-- Required - Hash signature generated based on mandatory
parameter values. Refer kit's code for more details. //-->
<input
type="text"
id="hash"
name="hash"
placeholder="Hash"
value=""
class="form-control item"
readonly
/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input
type="submit"
class="btn btn-block create-account"
value="Proceed for Payment"
/>
</div>
</div>
</div>
<!-- Contains information of integration type. Consult to PayU for more details.//-->
<input type="hidden" id="udf5" name="udf5" value="Donation Request" />
<!--
https://devguide.payu.in/merchant-integration/payu-hosted-checkout/payu-hosted-checkout-integration/
This parameter signifies the payment category (tab) that you want the customer to see by default on the PayU page. Hence, if pg=’NB’, after redirection to PayU’s payment page, the Net Banking option would be opened by default.
(pg parameter may take different values like: NB for Net Banking tab, CC for Credit Card tab, DC for Debit Card tab, and EMI for EMI tab)
Note: pg = CC, that is, Credit Card tab is recommended. If pg is left empty, CC will be taken as default. //-->
<!-- <input type="hidden" id="pg" name="pg" value="NB" /> -->
<!--
https://devguide.payu.in/merchant-integration/payu-hosted-checkout/checkout-customisations/#Hiding_Spec_Pymt_Modes
The drop_category parameter can be used if you want to hide one or multiple payment options. For example, if you consider the payment options such as credit card, debit card, and net banking, you can hide the credit card mode of payment. //-->
<!-- <input
type="hidden"
id="drop_category"
name="drop_category"
value="DC|CC|CASH|NB"
/> -->
<!-- Required - Response callback url to be used by Payment Gateway to post back payment status.
surl - for success tranction, furl - for failure transaction, curl - for cancel transaction. //-->
<input type="hidden" id="surl" name="surl" value="<%= surl %>" />
<input type="hidden" id="furl" name="furl" value="<%= furl %>" />
<input type="hidden" id="curl" name="curl" value="<%= curl %>" />
<input type="hidden" id="key" name="key" value="<%= key %>" />
</form>
</div>
<!-- Below script is just for using Hash calculation routine. In live integrations different workflows may be used
to access Hash calculation routine. //-->
<script
type="text/javascript"
src="https://code.jquery.com/jquery-3.2.1.min.js"
></script>
<script type="text/javascript">
$("#payment_form").bind("keyup blur", function () {
$.ajax({
url: "<%= getHashUrl %>",
type: "post",
data: JSON.stringify({
txnid: $("#txnid").val(),
amount: $("#amount").val(),
productinfo: $("#productinfo").val(),
firstname: $("#firstname").val(),
email: $("#email").val(),
udf5: $("#udf5").val(),
}),
contentType: "application/json",
dataType: "json",
success: function (json) {
$("#hash").val(json);
},
});
});
</script>
</body>
</html>