PaymentDetailsUpdate

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers .

草案
此页面不完整。

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.

特性

PaymentDetailsUpdate dictionary is based on the PaymentDetailsBase dictionary, and inherits its properties, which are included in the list below .

displayItems 可选
An array of PaymentItem objects, each describing one line item for the payment request. These represent the line items on a receipt or invoice.
error 可选
A DOMString specifying an error message to present to the user . When calling updateWith() ,包括 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 可选
An array of 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 可选
An AddressErrors object which includes an error message for each property of the shipping address that could not be validated.
shippingOptions 可选
An array of PaymentShippingOption objects, each describing one available shipping option from which the user may choose.
total 可选
A PaymentItem providing an updated total for the payment. Make sure this equals the sum of all of the items in displayItems . This is not calculated automatically . You must update this value yourself anytime the total amount due changes. This lets you have flexibility for how to handle things like tax, discounts, and other adjustments to the total price charged.

规范

规范 状态 Comment
支付请求 API
The definition of 'PaymentDetailsUpdate' in that specification.
候选推荐 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
PaymentDetailsUpdate Chrome 61 Edge ≤18 Firefox 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ) and the dom.payments.request.supportedRegions preference (needs to be set to A comma-delineated list of one or more 2-character ISO country codes indicating the countries in which to support payments (for example, US,CA . ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 53 Firefox Android 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ) and the dom.payments.request.supportedRegions preference (needs to be set to A comma-delineated list of one or more 2-character ISO country codes indicating the countries in which to support payments (for example, US,CA . ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 6.0
error Chrome 61 Edge ≤18 Firefox 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 60 Firefox Android 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 8.0
shippingAddressErrors Chrome 61 Edge ≤18 Firefox 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 60 Firefox Android 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 8.0
total Chrome 61 Edge ≤18 Firefox 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari ? WebView Android 不支持 No Chrome Android 60 Firefox Android 55
注意事项 Disabled
55
注意事项 Disabled
Available only in nightly builds.
Disabled From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS ? Samsung Internet Android 8.0

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。