非标
此特征是非标准的,且不在标准轨道中。不要在面向 Web 的生产站点中使用它:它不适用于每个用户。实现之间可能存在大的不兼容性,且行为将来可能改变。

PaymentRequestEvent 构造函数创建新 PaymentRequestEvent object which is a constructor for a PaymentRequestEvent which is the object passed to a payment handler when a PaymentRequest is made..

句法

var paymentRequestEvent = new PaymentRequestEventy(type, options)
					

参数

type
Must always be 'PaymentRequest' .
选项 可选
Options are as follows:
  • instrumentKey : A PaymentInstrument object reflecting the payment instrument selected by the user or an empty string if the user has not registered or chosen a payment instrument.
  • methodData : An array of PaymentMethodData objects containing payment method identifers for the payment methods that the web site accepts and any associated payment method specific data.
  • modifiers : An array of objects containing changes to payment details.
  • paymentRequestId : The ID of the PaymentRequest 对象。
  • paymentRequestOrigin : The origin where the PaymentRequest object was initialized.
  • topLeveOrigin : The top-level origin where the PaymentRequest object was initialized.
  • total : The total amount being requested for payment.

浏览器兼容性

The compatibility table in 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
PaymentRequestEvent() 构造函数 Chrome 57 Disabled
57 Disabled
Disabled ). To change preferences in Chrome, visit
Edge ≤79 Disabled
≤79 Disabled
Disabled From version ≤79: this feature is behind the #service-worker-payment-apps preference (needs to be set to 启用 ).
Firefox No IE ? Opera No Safari ? WebView Android No Chrome Android 57 Disabled
57 Disabled
Disabled ). To change preferences in Chrome, visit
Firefox Android No Opera Android No Safari iOS ? Samsung Internet Android No

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

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

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

元数据

  • 最后修改:
  1. 支付请求 API
  2. PaymentRequestEvent
  3. 构造函数
    1. PaymentRequestEvent()
  4. 特性
    1. paymentRequestId
    2. paymentRequestOrigin
    3. topOrigin
    4. total
  5. 方法
    1. openWindow()
    2. respondWith()
  6. Related pages for Payment Request API
    1. HTMLIFrameElement.allowPaymentRequest
    2. MerchantValidationEvent
    3. PaymentAddress
    4. PaymentMethodChangeEvent
    5. PaymentRequest
    6. PaymentRequestUpdateEvent
    7. PaymentResponse

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

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