-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpay.html
57 lines (56 loc) · 2.55 KB
/
pay.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Payment</title>
<style>
body{text-align: center;}h1{color:#88b04b;font-family:"Nunito Sans","Helvetica Neue",sans-serif;font-weight:900;font-size:40px;margin-bottom:10px}p{color:#404f5e;font-family:"Nunito Sans","Helvetica Neue",sans-serif;font-size:20px;margin:0}i{color:#9abc66;font-size:100px;line-height:200px;margin-left:-15px}.card{background:#fff;padding:60px;border-radius:4px;box-shadow:0 2px 3px #c8d0d8;display:inline-block;margin:0 auto}
</style>
</head>
<body>
<div class="card">
<div style="border-radius:200px; height:200px; width:200px; background: #F8FAF5; margin:0 auto;">
<i id="checkmark"></i>
</div>
<h1></h1>
<p></p>
</div>
<script>
// Get status Argument
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return false;
}
if (getQueryVariable('status') === 'success') {
document.getElementById('checkmark').innerHTML = '✓';
document.getElementsByTagName('h1')[0].innerHTML = 'Success';
document.getElementsByTagName('p')[0].innerHTML = 'Payment Successful and Thank you for your payment 🙏';
}else if (getQueryVariable('status') === 'fail') {
document.getElementById('checkmark').innerHTML = '✗';
document.getElementById('checkmark').style.color = '#ff0000';
document.getElementsByTagName('h1')[0].innerHTML = 'Failed';
document.getElementsByTagName('h1')[0].style.color = '#ff0000';
document.getElementsByTagName('p')[0].innerHTML = 'Payment Failed. Please try again 🙏';
}else if (getQueryVariable('status') === 'cancel') {
document.getElementById('checkmark').innerHTML = '✗';
document.getElementById('checkmark').style.color = '#ff0000';
document.getElementsByTagName('h1')[0].innerHTML = 'Cancelled';
document.getElementsByTagName('h1')[0].style.color = '#ff0000';
document.getElementsByTagName('p')[0].innerHTML = 'Payment Cancelled. Please try again 🙏';
} else {
document.getElementById('checkmark').innerHTML = '😳';
document.getElementsByTagName('h1')[0].innerHTML = 'Error';
window.location.href = '/';
}
</script>
</body>
</html>