安全上下文
此特征只可用于
安全上下文
(HTTPS),在某些或所有
支持浏览器
.
updateWith()
method of the
PaymentRequestUpdateEvent
interface updates the details of an existing
PaymentRequest
.
paymentRequestUpdateEvent.updateWith(details);
details
PaymentDetailsUpdate
object specifying the changes applied to the payment request:
displayItems
可选
PaymentItem
objects, each describing one line item for the payment request. These represent the line items on a receipt or invoice.
error
可选
DOMString
specifying an error message to present to the user
.
When calling
updateWith()
,包括
error
in the updated data causes the
用户代理
to display the text as a general error message. For address field specific errors, use
shippingAddressErrors
.
modifiers
可选
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
可选
AddressErrors
object which includes an error message for each property of the shipping address that could not be validated.
shippingOptions
可选
PaymentShippingOption
objects, each describing one available shipping option from which the user may choose.
total
可选
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.
undefined
.
| 规范 | 状态 | 注释 |
|---|---|---|
|
支付请求 API
The definition of 'PaymentRequestUpdateEvent.updateWith()' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
updateWith()
|
Chrome 61 | Edge 15 |
Firefox
56
注意事项
Disabled
|
IE 不支持 No | Opera 不支持 No | Safari Yes | WebView Android 不支持 No | Chrome Android 56 |
Firefox Android
56
注意事项
Disabled
|
Opera Android 不支持 No | Safari iOS Yes | Samsung Internet Android 6.0 |
完整支持
不支持
见实现注意事项。
用户必须明确启用此特征。
PaymentRequestUpdateEvent
updateWith()