it-ony / payment-request

Feedback for the W3C Web Payments Browser API https://www.w3.org/TR/payment-request/
1 stars 0 forks source link

Preselecting a shipping option #13

Open it-ony opened 7 years ago

it-ony commented 7 years ago

As pointed out by @rsolomakhin in #3 you can preselect a shipping address by setting selected: true for that option in the constructor.

Preselecting the shipping option is not related to the shipping address that the vendor implementation will choose. Also no shippingaddresschange event is dispatched.

This might lead to a problem, when the shipping options depend on the shipping address, as this is the case for Spreadshirt. So the list of available shipping options is at time constructing the payment request object a guess, based on the default shipping country (based on the top level domain).

If address the browser implementor chooses, differs in the country, the prices and also the available shipping options might not be valid anymore.

rsolomakhin commented 7 years ago

If the shipping options depend on the shipping address, then please do not pre-select a shipping option. Pre-selection is only useful if your shipping options are static, e.g., "Free shipping world wide."