Files
firefox/dom/payments/test/simple_payment_request.html
T
Eden Chuang 11afc07a6b Bug 1389418 - Mochitest for payment method identifier validation support in PaymentRequest API. r=baku
1. Test PaymentRequest construction with valid PMIs.
2. Test PaymentRequest construction with Invalid PMIs.
3. Test PaymentRequestUpdateEvent::updateWith with a valid PMI.
4. Test PaymentRequestUpdateEvent::updateWith with a invalid PMI.

Remove unnecessary html tags in html files.
2017-09-11 11:10:10 +08:00

36 lines
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>