-
Notifications
You must be signed in to change notification settings - Fork 23
/
popup-minimal.html
47 lines (41 loc) · 1.23 KB
/
popup-minimal.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
/>
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="./styles.css" />
<title>Paylike.io SDK examples</title>
</head>
<body>
<p>This example is the minimal implementation of the popup.</p>
<button>Try it (pay)</button>
<ul>
<li><a href="popup-custom.html">Elaborate popup example</a></li>
<li><a href="popup-donation.html">Donations popup example</a></li>
</ul>
<a href="https://github.com/paylike/sdk">SDK documentation on GitHub</a>
<script src="https://sdk.paylike.io/10.js"></script>
<script>
const key = console.error('Insert your Paylike public key')
const paylike = Paylike({key})
document.querySelector('button').addEventListener('click', pay)
function pay() {
paylike.pay(
{
amount: {currency: 'USD', exponent: 2, value: 2000},
},
(err, r) => {
if (err) return console.log(err)
console.log(r)
// location.href = '/thank-you'
}
)
}
</script>
</body>
</html>