gecko-dev/dom/payments/test/simple_payment_request.html

36 строки
810 B
HTML

<!DOCTYPE html>
<html>
<head>
<title>Payment Request Testing</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
</head>
<body>
<script type="text/javascript">
const supportedInstruments = [{
supportedMethods: "basic-card",
}];
const details = {
id: "simple details",
total: {
label: "Donation",
amount: { currency: "USD", value: "55.00" }
},
};
try {
const payRequest = new PaymentRequest(supportedInstruments, details);
if(window.parent) {
window.parent.postMessage("successful", '*');
}
} catch(err) {
if(window.parent) {
window.parent.postMessage(err.name, '*');
}
}
</script>
</body>
</html>