Re: [w3c/payment-handler] HEAD request for supportedMethods not getting triggered (#286)

If you have a payment handler installed that is not from `https://abc-dev.test.com` origin, but claims to support for `https://abc-dev.test.com/pay3`, then this line will trigger the HEAD request for `https://abc-dev.test.com/pay3`:

> `var request = new PaymentRequest(supportedInstruments, details, options);`

The HEAD request will be used to verify that the payment handler is indeed allowed to use this payment method. Note that, if the payment handler comes from `https://abc-dev.test.com` origin, then there's nothing else to verify, so there will not be any HEAD requests.

Here's how a payment handler would claim to support `https://abc-dev.test.com/pay3`:

```javascript
await navigator.serviceWorker.register('payment-handler-service-worker.js');
const registration = await navigator.serviceWorker.ready;
// The payment handler claims to support 'https://abc-dev.test.com/pay3'
// payment method in the following statement.
await registration.paymentManager.instruments.set(
    'instrument-key', {
        name: 'Chrome uses name and icon from the web app manifest',
        enabledMethods: ['https://abc-dev.test.com/pay3'], // Legacy.
        method: 'https://abc-dev.test.com/pay3', // Modern.
    });
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-handler/issues/286#issuecomment-380548405

Received on Wednesday, 11 April 2018 18:20:31 UTC