Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty shippingOptions (ab)used as error #595

Closed
marcoscaceres opened this issue Aug 25, 2017 · 3 comments
Closed

Empty shippingOptions (ab)used as error #595

marcoscaceres opened this issue Aug 25, 2017 · 3 comments

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented Aug 25, 2017

Related to #594.

Consider the following situation, where no shippingOptions are given, but requestShipping: true:

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

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").

@marcoscaceres
Copy link
Member Author

To be clear: my proposal is to allow .shippingOptions to be empty. Don't (ab)use that to be an error in the payment sheet.

@marcoscaceres
Copy link
Member Author

Also related #548.

@adrianba
Copy link
Contributor

Agreed not to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants