-
Notifications
You must be signed in to change notification settings - Fork 138
Closed
Labels
Description
- From what I can tell, the spec doesn't currently define which
additionalDisplayItemsshould be shown if a UA decides to show any. - More generally, handling of multiple applicable modifiers isn't clear. It looks like it's possible to have multiple
methodDataandmodifierswith the samesupportedMethodsincluding the samedata.
Consider the following example snippet:
// Credit card incurs a $3.00 processing fee.
const creditCardFee = {
label: "Credit card processing fee",
amount: { currency: "USD", value: "3.00" },
};
// Visa card incurs a $1.00 processing fee.
const visaFee = {
label: "Visa processing fee",
amount: { currency: "USD", value: "1.00" },
};
// Modifiers apply when the user chooses to pay with
// a credit card.
const modifiers = [
{
additionalDisplayItems: [creditCardFee],
supportedMethods: "basic-card",
total: {
label: "Total due",
amount: { currency: "USD", value: "53.00" },
},
data: {
supportedTypes: ["credit"],
},
},
{
additionalDisplayItems: [visaFee],
supportedMethods: "basic-card",
total: {
label: "Total due",
amount: { currency: "USD", value: "54.00" },
},
data: {
supportedNetworks: ["visa"]
},
},
];
Object.assign(details, { modifiers });If multiple modifiers match the selected payment method (e.g. if the user selects a Visa card):
- Should all applicable additional display items be shown? The first matching one? Last matching one? Most specific one (would need to be defined)
- Which modifier's
totalshould be used?
This seems like something that should be tested as well.
Reactions are currently unavailable