[w3c/payment-request] If requestShipping is false, pr.shippingOption should be null (#609)

During testing, a weird case came up. 

If you have:

```JS 
const options = {
   requestShipping: false
};

const someShippingOption = {
   id: "never-selected",
  // other props 
};

const details = {
   //... things
   shippingOptions: [someShippingOption]
}

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

Then `pr.shippingOption` will be "never-selected". 

That seems bad. If no shipping was requested by the merchant, then the selected shipping option should actually be `null`, no? Even if the merchant screwed up and added shipping options that can't ever actually be selected. 

-- 
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/609

Received on Tuesday, 5 September 2017 08:10:38 UTC