PaymentItem
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The PaymentItem
dictionary is used by the Payment Request 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.
Properties
-
amount
Secure context -
An object describing the monetary value of the item. This object includes the following fields:
-
currency
: A string containing a valid 3-letter ISO 4217 currency identifier (ISO 4217) indicating the currency used for the paymentvalue
. -
value
: A string containing a valid decimal value representing the mount of currency constituting the payment amount. This string must only contain an optional leading "-" to indicate a negative value, then one or more digits from 0 to 9, and an optional decimal point (".", regardless of locale) followed by at least one more digit. No whitespace is permitted.
-
-
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 specifiedamount
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.
Specifications
Specification |
---|
Payment Request API # dom-paymentitem |
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
PaymentItem |
61 |
≤18 |
55
Available only in nightly builds.
|
No |
No |
11.1 |
No |
53 |
55
Available only in nightly builds.
|
No |
11.3 |
No |
amount |
61 |
≤18 |
55 |
No |
No |
11.1 |
No |
53 |
55 |
No |
11.3 |
No |
label |
61 |
≤18 |
55 |
No |
No |
11.1 |
No |
53 |
55 |
No |
11.3 |
No |
pending |
61 |
≤18 |
55 |
No |
No |
11.1 |
No |
53 |
55 |
No |
11.3 |
No |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PaymentItem