Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The PaymentRequestEvent constructor creates a new PaymentRequestEvent object instance.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The PaymentRequestEvent constructor creates a new PaymentRequestEvent object instance.
js
new PaymentRequestEvent(type) new PaymentRequestEvent(type, options)
type A string with the name of the event. It is case-sensitive and browsers set it to paymentrequest.
options Optional
An object that, in addition of the properties defined in ExtendableEvent(), can have the following properties:
methodData An array of PaymentMethodData objects (see methodData > Value) containing payment method identifiers for the payment methods that the website accepts and any associated payment method-specific data.
modifiersAn array of objects containing changes to payment details.
paymentRequestIdThe ID of the PaymentRequest object.
paymentRequestOriginThe origin where the PaymentRequest object was initialized.
topOriginThe top-level origin where the PaymentRequest object was initialized.
totalThe total amount being requested for payment.
A new PaymentRequestEvent object.
A developer would not use this constructor manually. A new PaymentRequestEvent object is constructed when a handler is invoked as a result of the paymentrequest event firing.
js
self.addEventListener("paymentrequest", (e) => { // ... });
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
PaymentRequestEvent |
70 | 79 | No | No | 57 | No | No | 70 | No | 49 | No | 10.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PaymentRequestEvent/PaymentRequestEvent