-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
101 lines (89 loc) · 2.68 KB
/
index.html
File metadata and controls
101 lines (89 loc) · 2.68 KB
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
<html>
<head>
<title>MERCHANT PAGE</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body {
background: lightgray;
width: 100%;
justify-content: center;
align-items: center;
display: flex;
}
p {
color: gray;
}
.payment-form-wrapper {
padding: 12px;
background: white;
border-radius: 12px;
overflow-y: auto;
}
iframe {
outline: none;
border: none;
width: 100%;
}
.applepay-button {
height: 52px;
}
.divider {
border-bottom: 1px solid lightgray;
margin-bottom: 16px;
}
.card-form {
height: 600px;
padding: 21px 16px 25px;
}
.bank-card-widget {
border: 1px solid #5671ff;
border-radius: 6px;
height: 450px;
}
</style>
<script>
(function main() {
window.addEventListener('message', (event) => {
if (event?.data?.id === 'TRUEGATE_WIDGET') {
console.log('DEMO EVENT', event?.data);
if (event.data.type === 'APPLEPAY_IS_NOT_AVAILABLE') {
window.document.querySelector('.applepay-divider').style.display = 'none'
window.document.querySelector('.applepay-button').style.display = 'none'
}
}
});
const param = new URLSearchParams(document.location.search)
const transactionId = param.get('transactionId');
if (!transactionId) {
alert('Please proivde transactionId GET parameter')
return;
}
document.addEventListener('DOMContentLoaded', () => {
const host = 'https://payment-widget.asapcashier-dev.com'
const applePayButton = document.querySelector('.applepay-button')
applePayButton.src = `${host}?transactionId=${transactionId}&paymentMethod=applepay`
const bankCardWidget = document.querySelector('.bank-card-widget')
bankCardWidget.src = `${host}?transactionId=${transactionId}&paymentMethod=card`
})
})()
</script>
</head>
<body>
<div class="payment-form-wrapper">
<p>Your Palm Reading report...</p>
<div class="divider"></div>
<p>Item price...</p>
<div class="divider"></div>
<p>Email...</p>
<div class="divider"></div>
<iframe class="applepay-button" src="https://payment-widget.asapcashier-dev.com?transactionId=none" title="payment" allow="payment"></iframe>
<div class="divider applepay-divider"></div>
<div class="card-form">
<div>[icon] Pay with card</div>
<div>[visa][master][amex]</div>
<br/>
<iframe class="bank-card-widget" src="https://payment-widget.asapcashier-dev.com?transactionId=none" title="payment" allow="payment"/><iframe>
</div>
</div>
</body>
</html>