PaymentRequestEvent
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.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. -
PaymentRequestEvent.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. -
PaymentRequestEvent.modifiers
Read only
- Returns an array of objects containing changes to payment details.
-
PaymentRequestEvent.paymentRequestId
Read only
- Returns the ID of the
PaymentRequest
object. -
PaymentRequestEvent.paymentRequestOrigin
Read only
- Returns the origin where the
PaymentRequest
object was initialized. -
PaymentRequestEvent.topLevelOrigin
Read only
- Returns the top-level origin where the
PaymentRequest
object was initialized. -
PaymentRequestEvent.total
Read 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
|
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 |