-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminOrder.html
148 lines (132 loc) · 7.3 KB
/
adminOrder.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Indy</title>
<!--<link rel="shortcut icon" type="image/png" href="https://developer.paytm.com/demo//static/images/icon.png?v=1.9" />
<script type="application/javascript" src="https://developer.paytm.com/demo//static/js/jquery.min.js"></script> -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link href="./assets/files/indy.css" rel="stylesheet">
</head>
<script>
async function fetchOrders(){
const token = document.getElementById("indyToken").value;
console.log({token});
const rowBody = document.getElementById("indy-table-body");
rowBody.innerHTML = "";
await fetch('https://app.indy-app.com:8080/admin/api', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${token}`
}
}).then(response =>{
return response.json();
}).then(result =>{
if(!result.error){
result.data.map(el =>{
const row = document.createElement("tr");
const cell0 = document.createElement("td");
const cell1 = document.createElement("td");
const cell2 = document.createElement("td");
const cell3 = document.createElement("td");
const cell4 = document.createElement("td");
const cell5 = document.createElement("td");
const cell6 = document.createElement("td");
const cell7 = document.createElement("td");
const cell8 = document.createElement("td");
const cell9 = document.createElement("td");
const cell10 = document.createElement("td");
cell0.innerHTML = el.orderId;
cell1.innerHTML = el.transactionId;
cell2.innerHTML = el.seller[0].productName;
cell3.innerHTML = el.amount;
cell4.innerHTML = el.seller[0].bank[0].accountName;
cell5.innerHTML = el.seller[0].bank[0].accountNumber;
cell6.innerHTML = el.seller[0].bank[0].bankName;
cell7.innerHTML = el.seller[0].bank[0].bankCode;
cell8.innerHTML = el.seller[0].bank[0].upiId;
cell9.innerHTML = el.paymentMethod;
const date = el.orderDate;
var dt = new Date(date);
cell10.innerHTML = dt.toLocaleString();
row.append(cell0);
row.append(cell1);
row.append(cell2);
row.append(cell3);
row.append(cell4);
row.append(cell5);
row.append(cell6);
row.append(cell7);
row.append(cell8);
row.append(cell9);
row.append(cell10);
rowBody.append(row);
});
}else{
alert(result.message);
}
});
}
</script>
<body>
<main class="indy-page indy-payment-page">
<section class="indy-payment-form indy-dark">
<div class="indy-container">
<card>
<div class="indy-products">
<div class="container">
<div class="row">
<div class="col-lg-12">
<img id="product-image" src="./assets/assets/images/Indy_icon.jpg" class="img-responsive center-block d-block mx-auto" alt="Sample Image" width="150">
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h3 class="indy-primary text-center pt-2" style="font-family: Open Sans; font-weight: bold;color: #f57e42">Settlement Panel!</h3>
</div>
</div>
<div class="row">
<label for="indyToken" class="col-sm-1 col-form-label indy-primary" style="font-family: Open Sans; font-weight: bold;color: #f57e42">Token:</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="indyToken" placeholder="Token">
</div>
<div class="col-sm-3">
<button class="btn btn-primary" onclick="fetchOrders()">Fetch</button>
</div>
</div>
<div class="row pt-2">
<div class="col-lg-12">
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">Order#</th>
<th scope="col">Transaction#</th>
<th scope="col">Product name</th>
<th scope="col">Price</th>
<th scope="col">Seller Account Name</th>
<th scope="col">Seller Account Number</th>
<th scope="col">Seller Bank Name</th>
<th scope="col">Seller Bank IFSC</th>
<th scope="col">Seller UPI</th>
<th scope="col">Payment type</th>
<th scope="col">Order Date</th>
</tr>
</thead>
<tbody id="indy-table-body">
</tbody>
</table>
</div>
</div>
</div>
</div>
</card>
</div>
</section>
</main>
</body>
</html>