-
Notifications
You must be signed in to change notification settings - Fork 0
/
return3ds.html
69 lines (64 loc) · 4.59 KB
/
return3ds.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Return 3ds</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
<style>
html,body{height: 100%;padding:0;margin:0;}
body {font-family: 'Poppins', sans-serif;}
.hide {display: none;}
</style>
</head>
<body style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
<div style="height: 80px;">
<svg id="iconSuccess" class="icon hide" viewBox="0 0 1025 1024" xmlns="http://www.w3.org/2000/svg" width="80" height="80">
<path d="M511.85139 1024c-69.098781 0-136.100634-13.580107-199.308045-40.241053-61.010629-25.762262-115.730473-62.708142-162.76158-109.739249-47.031107-47.031107-83.877133-101.750951-109.739249-162.76158C13.481424 648.150561 0.00117 581.148708 0.00117 512.049927s13.580107-136.100634 40.241053-199.308045c25.762262-61.010629 62.708142-115.730473 109.739249-162.76158s101.750951-83.877133 162.76158-109.739249C375.750756 13.679961 442.752608 0.099854 511.85139 0.099854c69.098781 0 136.100634 13.580107 199.308044 40.241053 61.010629 25.762262 115.730473 62.708142 162.76158 109.739249 47.031107 47.031107 83.877133 101.750951 109.739249 162.76158 26.660946 63.107557 40.241053 130.209264 40.241053 199.308045s-13.580107 136.100634-40.241053 199.308044c-25.762262 61.010629-62.708142 115.730473-109.739249 162.76158-47.031107 47.031107-101.750951 83.877133-162.76158 109.739249-63.107557 26.461238-130.209264 40.041346-199.308044 40.041346z m0-983.958654c-260.21882 0-472.008581 211.689907-472.008582 472.008581 0 260.21882 211.689907 472.008581 472.008582 472.008581 260.21882 0 472.008581-211.689907 472.008581-472.008581 0-260.21882-211.689907-472.008581-472.008581-472.008581z m-70.796295 676.50902c-5.192394 0-10.484642-0.998537-15.277621-3.19532-8.487567-0.79883-16.475865-4.29371-22.167528-9.885519L235.256558 544.102974l-0.199708-0.199707c-13.779815-13.779815-13.779815-38.044271 0-51.824086 13.779815-13.779815 37.74471-13.779815 51.624379-0.199708l148.881911 140.993467 301.058996-317.634715 0.199707-0.199707c6.490492-6.490492 15.976597-10.284934 25.96197-10.284934s19.371624 3.794442 25.96197 10.284934c13.779815 13.779815 13.779815 37.74471 0.199707 51.624378l-321.728718 339.502682-0.199707 0.199707c-6.889907 6.6902-16.376012 10.18508-25.96197 10.185081z" fill="#11c139"></path>
</svg>
<svg id="iconFailed" class="icon hide" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="80" height="80">
<path d="M512 992C246.912 992 32 777.088 32 512 32 246.912 246.912 32 512 32c265.088 0 480 214.912 480 480 0 265.088-214.912 480-480 480z m0-64c229.76 0 416-186.24 416-416S741.76 96 512 96 96 282.24 96 512s186.24 416 416 416z" fill="#e81725"></path>
<path d="M572.512 512l161.696 161.664-60.544 60.544L512 572.48l-161.664 161.696-60.544-60.544L451.52 512 288 348.512 348.512 288 512 451.488 675.488 288 736 348.512 572.512 512z" fill="#e81725"></path>
</svg>
</div>
<div id="statusWrap" style="width: 200px; margin: 32px auto; text-align: center; font-size: 24px; font-weight: 600;">
Payment successful!
</div>
<button id="actionBtn"
style="color:#fff;height:45px;width:200px;border:none;background-color:#41c7b7;margin:20px;border-radius:5px;font-size: 16px;font-weight: 600;cursor: pointer;"
onclick="returnApp()">OK</button>
</div>
<script>
function parseQueryString(url) {
const obj = {}
const reg = /([^?&=]+)=([^?&=]*)/g
url.replace(reg, (m, $1, $2) => {
obj[$1] = $2
})
return obj
}
const queryParams = parseQueryString(location.href);
const iconSuccess = document.getElementById('iconSuccess');
const iconFailed = document.getElementById('iconFailed');
if (queryParams?.source_type) {
const statusEle = document.getElementById('statusWrap');
statusEle.innerHTML = 'Payment failed!';
iconFailed.classList.remove('hide');
} else {
iconSuccess.classList.remove('hide');
}
function returnApp() {
const tempInfo = {
status: queryParams?.source_type ? 'failed' : 'success',
};
if (window.ReactNativeWebView) {
window.ReactNativeWebView.postMessage(JSON.stringify(tempInfo));
} else {
window.parent.postMessage({type: 'return3d', status: tempInfo.status},'*');
}
}
</script>
</body>
</html>