This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
thankyou.html
60 lines (56 loc) · 2.06 KB
/
thankyou.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>My legacy shop</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-polyfills/0.1.42/polyfill.min.js"></script>
</head>
<body>
<div>
<a href="./index.html">Home</a>
</div>
<br />
<br />
<div align="center">
<h1>My legacy shop</h1>
<div id="container">
Processing...
</div>
</div>
<script src="config.js"></script>
<script src="server/constants/index.js"></script>
<script src="server/utils/index.js"></script>
<script src="server/network/index.js"></script>
<script src="server/getExpressPreset.js"></script>
<script src="server/charge.js"></script>
<script>
function setInnerHTML(status) {
var container = document.getElementById("container");
switch (status) {
case "CHARGED":
container.innerHTML = "Thank you for your order, your product will be deliver soon :)";
break;
case "EXPIRED":
container.innerHTML = "The session is expired!";
break;
case "ERROR":
container.innerHTML = "Payment Failed!";
break;
default:
container.innerHTML = "Processing...";
}
}
function successCb(data) {
if (data && data.links && data.links.charge) {
charge(data.links.charge, setInnerHTML);
} else setInnerHTML("ERROR");
}
function errorCb() {
setInnerHTML("ERROR");
}
getExpressPreset(successCb, errorCb);
</script>
</body>
</html>