w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request/
Other
489 stars 135 forks source link

Proposal to add optional "description" string field to PaymentShippingOption dictionary #902

Open sahel-sh opened 4 years ago

sahel-sh commented 4 years ago

Payment apps supporting shipping delegation and/or use agents can use the merchant provided description field to show more details about each shipping option upon user interaction (e.g. when user hovers over the shipping option label)

marcoscaceres commented 4 years ago

@sahel-sh, sounds interesting. Could you expand a bit on what you are proposing? If possible, please provide some examples from a couple of websites or services or native apps.

sahel-sh commented 4 years ago

Thanks Marcos for reviewing this!

As an example Gpay is using this field to provide more details about each shipping option to their users, and they would like to have this field in payment request/handler APIs as well.

Since the shippingOptions in PaymentRequestEvent comes from payment details provided in PaymentRequest's constructor, changing the PaymentShippingOption dictionary in PaymentRequest spec would be enough.

dictionary PaymentShippingOption {
  required DOMString id;
  required DOMString label;
  required PaymentCurrencyAmount amount;
  DOMString description;
  boolean selected = false;
};
marcoscaceres commented 4 years ago

I don't have any objections to adding this to the spec, but we'd probably want to get some more implementer buy-in (or payment handler buy-in). It's pretty trivial to add and pass along to a payment handler... so if it's of value, then I don't see any objection.

Folks following along a home - would love to hear some more expressions of support!

marcoscaceres commented 4 years ago

Sent a PR for it https://github.com/w3c/payment-request/pull/910 - @sahel-sh, would appreciate your feedback!

ianbjacobs commented 7 months ago

This issue was raised in Payment Request, but closed once we removed addresses from that API. We anticipate adding addresses back to the specification and so are re-opening this issue proactively.

ianbjacobs commented 1 month ago

We added addresses back to the specification in the 7 August 2024 CRD