PaymentRequestEvent - Web APIs 编辑
Experimental
This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The PaymentRequestEvent
interface of the Payment Request API is the object passed to a payment handler when a PaymentRequest
is made.
Constructor
PaymentRequestEvent()
- Creates a new
PaymentRequestEvent
object.
Properties
instrumentKey
Read only- Returns 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
Read only- Returns 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
Read only- Returns an array of objects containing changes to payment details.
paymentRequestId
Read only- Returns the ID of the
PaymentRequest
object. paymentRequestOrigin
Read only- Returns the origin where the
PaymentRequest
object was initialized. topOrigin
Read only- Returns the top-level origin where the
PaymentRequest
object was initialized. total
Read only- Returns the total amount being requested for payment.
Methods
openWindow()
- Opens the specified URL in a new window, if and only if the given URL is on the same origin as the calling page. It returns a
Promise
that resolves with a reference to aWindowClient
. respondWith()
- Prevents the default event handling and allows you to provide a
Promise
for aPaymentResponse
object yourself.
Specifications
Specification | Status | Comment |
---|---|---|
Payment Handler API The definition of 'PaymentRequestEvent' in that specification. | Working Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论