安全上下文
此特征只可用于 安全上下文 (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 可选
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 用户代理 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 可选
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.

返回值

undefined .

规范

规范 状态 注释
支付请求 API
The definition of 'PaymentRequestUpdateEvent.updateWith()' in that specification.
候选推荐 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
updateWith() Chrome 61 Edge 15 Firefox 56 注意事项 Disabled
56 注意事项 Disabled
Available only in nightly builds.
Disabled ). To change preferences in Firefox, visit about:config.
IE 不支持 No Opera 不支持 No Safari Yes WebView Android 不支持 No Chrome Android 56 Firefox Android 56 注意事项 Disabled
56 注意事项 Disabled
Available only in nightly builds.
Disabled ). To change preferences in Firefox, visit about:config.
Opera Android 不支持 No Safari iOS Yes Samsung Internet Android 6.0

图例

完整支持

完整支持

不支持

不支持

见实现注意事项。

用户必须明确启用此特征。

用户必须明确启用此特征。

元数据

  • 最后修改:
  1. 支付请求 API
  2. PaymentRequestUpdateEvent
  3. 构造函数
    1. PaymentRequestUpdateEvent()
  4. 方法
    1. updateWith()
  5. 继承:
    1. 事件
  6. Related pages for Payment Request API
    1. HTMLIFrameElement.allowPaymentRequest
    2. MerchantValidationEvent
    3. PaymentAddress
    4. PaymentMethodChangeEvent
    5. PaymentRequest
    6. PaymentResponse

版权所有  © 2014-2026 乐数软件    

工业和信息化部: 粤ICP备14079481号-1