PaymentRequestUpdateEvent.updateWith() - Web APIs 编辑

Secure context

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

The updateWith() method of the PaymentRequestUpdateEvent interface updates the details of an existing PaymentRequest.

Syntax

paymentRequestUpdateEvent.updateWith(details);

Parameters

details
A PaymentDetailsUpdate object specifying the changes applied to the payment request:
displayItems Optional
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 Optional
A DOMString specifying an error message to present to the user. When calling updateWith(), including 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 Optional
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 Optional
An AddressErrors object which includes an error message for each property of the shipping address that could not be validated.
shippingOptions Optional
An array of PaymentShippingOption objects, each describing one available shipping option from which the user may choose.
total Optional
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.

Return value

undefined.

Specifications

SpecificationStatusComment
Payment Request API
The definition of 'PaymentRequestUpdateEvent.updateWith()' in that specification.
Candidate RecommendationInitial definition.

Browser compatibility

BCD tables only load in the browser

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

词条统计

浏览:50 次

字数:5523

最后编辑:8年前

编辑次数:0 次

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文