-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPaymentAPI.html
30 lines (30 loc) · 1.09 KB
/
PaymentAPI.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
<html>
<head>
<title>Payment</title>
<script src="https://storage.googleapis.com/prshim/v1/payment-shim.js"></script>
<script>
window.onload = function () {
console.log('load');
setTimeout(() => {
let req = new PaymentRequest(
[{ supportedMethods: ['visa', 'unionpay']}],
{
displayItems: [{ label: 'S7 总决赛门票', amount: { currency: 'USD', value: '40.00'}}],
total: {
label: '总计',
amount: { currency: 'USD', value: '40.00'},
},
}
);
req.show().then(res => {
console.log(res);
res.complete('success');
})
.catch(err => {
console.error(err);
})
}, 2000);
}
</script>
</head>
</html>