W3cubDocs

/DOM

PaymentRequestEvent

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The PaymentRequestEvent interface of the the Payment Request API is the ojbect passed to a payment handler when a PaymentRequest is made.

Constructor

PaymentRequestEvent()
Creates a new PaymentRequestEvent object.

Properties

PaymentRequestEvent.instrumentKeyRead 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.
PaymentRequestEvent.methodDataRead 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.
PaymentRequestEvent.modifiersRead only
Returns an array of objects containing changes to payment details.
PaymentRequestEvent.paymentRequestIdRead only
Returns the ID of the PaymentRequest object.
PaymentRequestEvent.paymentRequestOriginRead only
Returns the origin where the PaymentRequest object was initialized.
PaymentRequestEvent.topLevelOriginRead only
Returns the top-level origin where the PaymentRequest object was initialized.
PaymentRequestEvent.totalRead only
Returns the total amount being requested for payment.

Methods

PaymentRequestEvent.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 a WindowClient.
PaymentRequestEvent.respondWith()
Prevents the default event handling and allows you to provide a Promise for a PaymentResponse object yourself.

Specifications

Specification Status Comment
Payment Handler API
The definition of 'PaymentRequestEvent' in that specification.
Working Draft Initial definition.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 57
Disabled
57
Disabled
Disabled From version 57: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
PaymentRequestEvent() constructor 57
Disabled
57
Disabled
Disabled From version 57: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
instrumentKey 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
methodData 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
modifiers 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
openWindow 61
Disabled
61
Disabled
Disabled From version 61: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
paymentRequestId 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
paymentRequestOrigin 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
respondWith 59
Disabled
59
Disabled
Disabled From version 59: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
topOrigin 68
Disabled
68
Disabled
Disabled From version 68: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
61 — 67
Uses the non-standard name: topLevelOrigin
? ? ? No ?
total 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? ? No ?
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support No 57
Disabled
57
Disabled
Disabled From version 57: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? 7.0
PaymentRequestEvent() constructor No 57
Disabled
57
Disabled
Disabled From version 57: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
instrumentKey No 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
methodData No 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
modifiers No 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
openWindow No 61
Disabled
61
Disabled
Disabled From version 61: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
paymentRequestId No 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
paymentRequestOrigin No 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No
respondWith No 59
Disabled
59
Disabled
Disabled From version 59: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? 7.0
topOrigin No 68
Disabled
68
Disabled
Disabled From version 68: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
61 — 67
Uses the non-standard name: topLevelOrigin
? ? No ? No
total No 60
Disabled
60
Disabled
Disabled From version 60: this feature is behind the #service-worker-payment-apps preference (needs to be set to Enabled). To change preferences in Chrome, visit chrome://flags.
? ? No ? No

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PaymentRequestEvent