Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Draft
This page is not complete.
The PaymentDetailsUpdate
dictionary is used to provide updated information to the payment user interface after it has been instantiated. This can be done either by calling the PaymentRequestUpdateEvent.updateWith()
method or by using the PaymentRequest.show()
method's detailsPromise
parameter to provide a Promise
that returns a PaymentDetailsUpdate
that updates the payment information before the user interface is even enabled for the first time.
The PaymentDetailsUpdate
dictionary is based on the PaymentDetailsBase
dictionary, and inherits its properties, which are included in the list below.
displayItems
Optional
PaymentItem
objects, each describing one line item for the payment request. These represent the line items on a receipt or invoice.error
Optional
DOMString
specifying an error message to present to the user. When calling updateWith()
, including error
in the updated data causes the user agent to display the text as a general error message. For address field specific errors, use shippingAddressErrors
.modifiers
Optional
PaymentDetailsModifier
objects, each describing a modifier for particular payment method identifiers. For example, you can use one to adjust the total payment amount based on the selected payment method ("5% cash discount!").shippingAddressErrors
Optional
AddressErrors
object which includes an error message for each property of the shipping address that could not be validated.shippingOptions
Optional
PaymentShippingOption
objects, each describing one available shipping option from which the user may choose.total
Optional
PaymentItem
providing an updated total for the payment. Make sure this equals the sum of all of the items in displayItems
.Specification | Status | Comment |
---|---|---|
Payment Request API The definition of 'PaymentDetailsUpdate' in that specification. | Candidate Recommendation | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 61 | Yes | 55
|
No | No | ? |
error
|
61 | Yes | 55
|
No | No | ? |
shippingAddressErrors
|
61 | Yes | 55
|
No | No | ? |
total
|
61 | Yes | 55
|
No | No | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | No | 53 | Yes | 55
|
No | ? | 6.0 |
error
|
No | 60 | Yes | 55
|
No | ? | No |
shippingAddressErrors
|
No | 60 | Yes | 55
|
No | ? | No |
total
|
No | 60 | Yes | 55
|
No | ? | No |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PaymentDetailsUpdate