-
Notifications
You must be signed in to change notification settings - Fork 0
/
html.html
315 lines (293 loc) · 10.3 KB
/
html.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
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nodejs - JavaScript - PAYU - Integration - Checkout - HTML</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
</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">
<div>
<img src="/images/logo.png" />
</div>
<div>
<h3>PAYU in PLAIN HTML</h3>
</div>
<!--// Form with required parameters to be posted to Payment Gateway. For details of each required
parameters refer Integration PDF. //-->
<form
action="https://test.payu.in/_payment"
id="payment_form"
method="Post"
>
<!-- <form
action="https://secure.payu.in/_payment"
id="payment_form"
method="Post"
> -->
<!-- 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="false" /> -->
<!--
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="https://payu-nodejs-demo.herokuapp.com/response.html"
/>
<input
type="hidden"
id="furl"
name="furl"
value="https://payu-nodejs-demo.herokuapp.com/response.html"
/>
<input
type="hidden"
id="curl"
name="curl"
value="https://payu-nodejs-demo.herokuapp.com/response.html?page=html"
/>
<input type="hidden" id="key" name="key" value="gtKFFx" />
<!-- <input type="hidden" id="key" name="key" value="aBquoOpp" /> -->
<div class="dv">
<span class="text"><label>Transaction/Order ID:</label></span>
<span>
<!-- 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=""
readonly
/></span>
</div>
<div class="dv">
<span class="text"><label>Amount:</label></span>
<span>
<!-- Required - Transaction amount of float type. //-->
<input
type="number"
id="amount"
name="amount"
placeholder="Amount"
value="10.00"
/></span>
</div>
<div class="dv">
<span class="text"><label>Product Info:</label></span>
<span>
<!-- 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"
/></span>
</div>
<div class="dv">
<span class="text"><label>First Name:</label></span>
<span>
<!-- 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="Ravi"
/></span>
</div>
<div class="dv">
<span class="text"><label>Last Name:</label></span>
<span>
<!-- 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="Ch"
/></span>
</div>
<div class="dv">
<span class="text"><label>Email ID:</label></span>
<span>
<!-- 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="test@example.com"
/></span>
</div>
<div class="dv">
<span class="text"><label>Mobile/Cell Number:</label></span>
<span>
<!-- 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="9848012345"
/></span>
</div>
<div class="dv">
<span class="text"><label>Address1:</label></span>
<span
><input
type="text"
id="address1"
name="address1"
placeholder="Address1"
value="456"
/></span>
</div>
<div class="dv">
<span class="text"><label>Address2:</label></span>
<span
><input
type="text"
id="address2"
name="address2"
placeholder="Address2"
value="123"
/></span>
</div>
<div class="dv">
<span class="text"><label>City:</label></span>
<span
><input
type="text"
id="city"
name="city"
placeholder="City"
value="Hyderabad"
/></span>
</div>
<div class="dv">
<span class="text"><label>State:</label></span>
<span
><input
type="text"
id="state"
name="state"
placeholder="State"
value="Telangana"
/></span>
</div>
<div class="dv">
<span class="text"><label>Country:</label></span>
<span
><input
type="text"
id="country"
name="country"
placeholder="Country"
value="India"
/></span>
</div>
<div class="dv">
<span class="text"><label>Zip Code:</label></span>
<span>
<!-- Datatype is Varchar with 20 char limit only 0-9. //-->
<input
type="text"
id="Zipcode"
name="Zipcode"
placeholder="Zip Code"
value="541236"
/></span>
</div>
<!-- <div class="dv">
<span class="text"><label>PG:</label></span>
<span>
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"
/></span>
</div> -->
<div class="dv">
<span class="text"><label>Hash:</label></span>
<span>
<!-- 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=""
readonly
/></span>
</div>
<div id="alertinfo" class="dv"></div>
<div><input type="submit" value="Pay" /></div>
</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">
var curDate = "REF" + new Date().getTime();
function loadHashValue() {
$.ajax({
url: "https://payu-nodejs-demo.herokuapp.com",
type: "post",
data: JSON.stringify({
txnid: curDate,
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);
},
});
}
window.addEventListener("load", (event) => {
document.getElementById("txnid").value = curDate;
loadHashValue();
});
$("#payment_form").bind("keyup blur", function () {
loadHashValue();
});
</script>
</body>
</html>