[w3c/payment-request] Empty shippingOptions (ab)used as error (#595)

Related to #594.
 
Consider the following situation, where no `shippingOptions` are given, but `requestShipping: true`:

```JS
const methods = [{ supportedMethods: ["basic-card"] }];
const details = {
  total: {
    label: "Total due",
    amount: { currency: "USD", value: "1.0" },
  },
};
const options = {
  requestShipping: true,
};

const request = new PaymentRequest(methods, details, options);
```

Given the fix in #591, it should be perfectly ok to await a `PaymentResponse` without needing the user to pick a (non-existent) shipping option:

```
const response = await request.show();
```

Right now, the above ends in user frustration, because they are told: 

![screenshot 2017-08-25 15 18 56](https://user-images.githubusercontent.com/870154/29700695-3821a6a6-89aa-11e7-9173-5b36589bc426.png)

But technically, the `.shippingAddress` could be provided to the site, and they could then resolve the shippingOption locally and would be a solution to #537 "Shipping Address Validation - Suggest Alternate Address"). 

-- 
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-request/issues/595

Received on Friday, 25 August 2017 05:32:39 UTC