PaymentItem

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

PaymentItem dictionary is used by the 支付请求 API to describe a single line item on a payment request. This might be an item or service being purchased or a tax or other charge.

特性

amount Secure context
A PaymentCurrencyAmount object describing the monetary value of the item.
label Secure context
A string specifying a human-readable name or description of the item or service being charged for. This may be displayed to the user by the user agent , depending on the design of the interface.
pending Secure context
A Boolean value which is true if the specified amount has not yet been finalized. This can be used to show items such as shipping or tax amounts that depend upon the selection of shipping address, shipping option, or so forth. The user agent may show this information but is not required to do so.

规范

规范 状态 Comment
支付请求 API
The definition of 'PaymentItem' 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
PaymentItem
Chrome 61
Disabled
61
Disabled
Disabled From version 61: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
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
Disabled
53
Disabled
Disabled From version 53: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
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 不支持 No
amount
Chrome 61
Disabled
61
Disabled
Disabled From version 61: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Edge ≤18 Firefox 55
Disabled
55
Disabled
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 53
Disabled
53
Disabled
Disabled From version 53: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Firefox Android 55
Disabled
55
Disabled
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 不支持 No
label
Chrome 61
Disabled
61
Disabled
Disabled From version 61: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Edge ≤18 Firefox 55
Disabled
55
Disabled
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 53
Disabled
53
Disabled
Disabled From version 53: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Firefox Android 55
Disabled
55
Disabled
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 不支持 No
pending
Chrome 61
Disabled
61
Disabled
Disabled From version 61: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Edge ≤18 Firefox 55
Disabled
55
Disabled
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 53
Disabled
53
Disabled
Disabled From version 53: this feature is behind the #web-payments preference (needs to be set to Enabled ). To change preferences in Chrome, visit chrome://flags.
Firefox Android 55
Disabled
55
Disabled
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 不支持 No

图例

完整支持
完整支持
不支持
不支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。
见实现注意事项。
用户必须明确启用此特征。
用户必须明确启用此特征。

另请参阅