summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/permissions-policy/resources/permissions-policy-payment.html
blob: 641a5e65b69aaeec082f2bb5a6c9c40ee76afc26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<script>
'use strict';

window.onload = function() {
  var supportedInstruments = [ { supportedMethods: [ 'visa' ] } ];
  var details = {
      total: { label: 'Test', amount: { currency: 'USD', value: '5.00' } }
  };
  let enabled = true;
  try {
    new PaymentRequest(supportedInstruments, details);
  } catch (e) {
    enabled = false;
  }
  parent.postMessage({ type: 'availability-result', enabled }, '*');
}
</script>