From 8f498b8b7e7c6e3bed1cba7d3867dd042e572c5a Mon Sep 17 00:00:00 2001 From: Ade Bateman Date: Thu, 15 Sep 2016 21:52:34 -0700 Subject: [PATCH] Add error message that can be provided as part of updateWith We have had lots of feedback that merchants need to explain errors to customers during the payment request. For example, if a shipping address is not acceptable then the site must be able to indicate why. This change adds an `error` string to the `PaymentDetails`, which may only be used as part of `updateWith`. --- index.html | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/index.html b/index.html index 37f160fe..e06dcc85 100644 --- a/index.html +++ b/index.html @@ -386,6 +386,10 @@

PaymentRequest constructor

If details does not contain a value for total, then throw a TypeError. +
  • + If details contains a value for error, then throw a + TypeError. +
  • If the first character of details.total.amount.value is U+002D HYPHEN-MINUS, then throw a TypeError. total MUST be a non-negative amount. @@ -675,6 +679,7 @@

    PaymentDetails dictionary

    sequence<PaymentItem> displayItems; sequence<PaymentShippingOption> shippingOptions; sequence<PaymentDetailsModifier> modifiers; + DOMString error; }; @@ -731,6 +736,15 @@

    PaymentDetails dictionary

    for particular payment method identifiers. For example, it allows you to adjust the total amount based on payment method. +
    error
    +
    + When the payment request is updated using updateWith, the PaymentDetails + can contain a message in the error field that will be displayed to the user. For example, + this might commonly be used to explain why good cannot be shipped to the chosen shipping address. +

    + The error field cannot be passed to the PaymentRequest constructor. + Doing so will cause a TypeError to be thrown. +

    @@ -1219,6 +1233,10 @@

    updateWith()

  • +
  • + If details contains an error value, then the user agent should + update the user interface to display the error message contained in error. +
  • Set [[\waitForUpdate]] to false.