PaymentMethodChangeEvent: PaymentMethodChangeEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The PaymentMethodChangeEvent() constructor creates a new PaymentMethodChangeEvent object providing details about a paymentmethodchange event.

Syntax

js
new PaymentMethodChangeEvent(type)
new PaymentMethodChangeEvent(type, options)

Parameters

type

A string with the name of the event. It is case-sensitive and browsers set it to paymentmethodchange.

options Optional

An object that, in addition of the properties defined in Event(), can have the following properties:

methodName Optional

A string containing the payment method identifier for the payment handler being used. This is an empty string by default.

methodDetails Optional

An object providing payment method-specific information describing the changes made to the payment, or null if there is no additional information available or required. This is null by default.

Return value

A new PaymentMethodChangeEvent object describing a change to the options specified for the payment method given in the methodName property.

The type of the methodDetails property depends on the payment method. For example, if methodName is https://example.com/pay, indicating that the Example Pay payment method is being used for validation, the shape of methodDetails is defined by the payment method.

Specifications

Specification
Payment Request API
# dom-paymentmethodchangeevent-constructor

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
PaymentMethodChangeEvent() constructor
Chrome – Full support
Chrome 76 (Release date: 2019-07-30)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – No support
Firefox 55 (Release date: 2017-08-08)
disabled
disabled From version 55 users must explicitly set the dom.payments.request.enabled preference to true. To change preferences in Firefox, visit about:config.
disabled From version 55 users must explicitly set the dom.payments.request.supportedRegions preference to A comma-delimited list of one or more 2-character ISO country codes indicating the countries in which to support payments (for example, US,CA).. To change preferences in Firefox, visit about:config.
Opera – Full support
Opera 63 (Release date: 2019-08-20)
footnote Full support
Safari – Full support
Safari 12.1 (Release date: 2019-03-25)
footnote Full support
Chrome Android – Full support
Chrome Android 76 (Release date: 2019-07-30)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 54 (Release date: 2019-10-18)
footnote Full support
Safari on iOS – Full support
Safari on iOS 12.2 (Release date: 2019-03-25)
footnote Full support
Samsung Internet – Full support
Samsung Internet 12 (Release date: 2020-06-19)
footnote Full support
WebView Android – Full support
WebView Android 136 (Release date: 2025-04-29)
footnote Full support
WebView on iOS – Full support
WebView on iOS 12.2 (Release date: 2019-03-25)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
User must explicitly enable this feature.

See also