-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
218 lines (212 loc) · 7.7 KB
/
index.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
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
<title>Check Rek - Cek Nama Rekening</title>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://syawal.dev/demo/checkrek/"/>
<meta property="og:title" content="Check Rek - Cek Nama Rekening"/>
<meta property="og:description" content="Check Rek memudahkan kita untuk mengecek dan validasi nama dari nomor rekening seseorang."/>
<meta property="og:image" content="https://syawal.dev/demo/checkrek/assets/fe4e64bf-b671-48ff-b141-9947bf08b2ca.jpg">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image"/>
<meta property="twitter:url" content="https://syawal.dev/demo/checkrek"/>
<meta property="twitter:title" content="Check Rek - Cek Nama Rekening">
<meta property="twitter:description" content="Check Rek memudahkan kita untuk mengecek dan validasi nama dari nomor rekening seseorang."/>
<meta property="twitter:image" content="https://syawal.dev/demo/checkrek/assets/fe4e64bf-b671-48ff-b141-9947bf08b2ca.jpg">
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<link rel="preconnect" href="https://cdn.jsdelivr.net/" crossorigin />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css"/>
<style>
.section {
margin-top: 2em;
}
</style>
</head>
<body>
<div class="wrapper">
<div id="app" class="container-fluid" style="padding-top: 2em">
<div class="justify-content-center">
<h3 class="h3 font-weight-bold text-center mt-5 mb-3">
Cek Nama Rekening
</h3>
<div class="form-row">
<div class="col col-md-6">
<label for="bank" class="col-form-group">Account Bank</label>
<select
id="bank"
class="form-control"
v-model="account.bank"
aria-describedby="emptyBank"
>
<option
v-for="(bank, index) in bankList"
:key="index"
:value="bank.value"
:selected="index === 0"
>
{{ bank.placeholder }}
</option>
</select>
<small
id="emptyBank"
class="form-text text-muted"
v-if="!account.bank"
>
Account Bank is required
</small>
</div>
<div class="col col-md-6">
<label for="number" class="col-form-group">Account Number</label>
<input
type="number"
id="number"
class="form-control"
v-model="account.number"
required
/>
<div
class="mt-1 text-danger"
v-if="!account.number || account.number.length < 10"
>
<small>
{{
!account.number
? '*Account Number is required'
: (account.number.length < 10 ? '*Please input above 10 characters' : '')
}}
</small>
</div>
</div>
</div>
<div class="table-responsive mb-2 mt-2" v-if="result">
<table class="table align-items-center">
<thead>
<tr>
<th>Account Bank</th>
<th>Account Number</th>
<th>Account Name</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ getBankName(account.bank) }}</td>
<td>{{ account.number }}</td>
<td>{{ result }}</td>
</tr>
</tbody>
</table>
</div>
<div class="form-row">
<div class="col col-md-12">
<button
class="btn btn-sm btn-success btn-block mt-2"
@click="check"
:disabled="loading || (!account.number || account.number.length < 10)"
>
<i class="fas fa-sync fa-spin" v-if="loading"></i>
Check
</button>
</div>
</div>
</div>
</div>
<footer
style="
background-color: rgb(236, 236, 236);
position: fixed;
width: 100%;
font-size: 80%;
margin-top: 5em;
padding-top: 5px;
padding-bottom: 5px;
bottom: 0;
"
>
<div class="container">
<i>
Copyright ©
<script>
document.write(new Date().getFullYear());
</script>
<a href="https://syawal.dev">Ibnusyawall<a>/ <a href="https://chat.whatsapp.com/HmspQSl10lRLblKtIOrPF1" target="_blank">Kodingkeun Community</a>
</i>
</div>
</footer>
</div>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
var app = new Vue({
el: "#app",
data() {
return {
url: "https://cekrek.heirro.dev/api/check",
result: null,
bankList: [
{ value: "bca", placeholder: "BCA" },
{ value: "royal", placeholder: "Blue By BCA" },
{ value: "bni", placeholder: "BNI" },
{ value: "bri", placeholder: "BRI" },
{ value: "mandiri", placeholder: "Mandiri" },
{ value: "cimb", placeholder: "CIMB Niaga" },
{ value: "Permata", placeholder: "Permata" },
{ value: "danamon", placeholder: "Danamon" },
{ value: "dki", placeholder: "Bank DKI" },
{
value: "tabungan_pensiunan_nasional",
placeholder: "BTPN/ Jenius",
},
{ value: "national_nobu", placeholder: "Bank Nobu" },
{ value: "artos", placeholder: "Bank Jago" },
{ value: "hana", placeholder: "Hana Bank/ Line" },
{ value: "linkaja", placeholder: "LinkAja!" },
{ value: "gopay", placeholder: "GoPay" },
{ value: "ovo", placeholder: "OVO" },
{ value: "dana", placeholder: "DANA" },
],
account: {
bank: "bca",
number: null,
},
loading: false,
validationError: false,
};
},
methods: {
async check() {
this.result = null;
this.loading = true;
try {
var { data } = await axios.post(
this.url,
{
accountBank: this.account.bank,
accountNumber: this.account.number,
},
{
headers: {
"Content-Type": "application/x-www-form-urlencoded",
},
}
);
if (data.status === 200) {
this.result = data.data[0]["accountName"];
} else {
this.result = data.message;
}
} catch (e) {
console.error('something went wrong : ', e);
} finally {
this.loading = false;
}
},
getBankName(name) {
return this.bankList.filter(({ value }) => value === name)[0]["placeholder"];
},
},
});
</script>
</body>
</html>