PaymentMethodChangeEvent
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
paymentMethodChangeEvent = new PaymentMethodChangeEvent(type, options);
Parameters
type-
A
DOMStringwhich must contain the stringpaymentmethodchange, the name of the only type of event which uses thePaymentMethodChangeEventinterface. -
optionsOptional -
An optional
PaymentMethodChangeEventInitdictionary which may contain zero or more of the following properties:-
methodNameOptional -
A
DOMStringcontaining the payment method identifier for the payment handler being used. This is an empty string by default. -
methodDetailsOptional -
An object providing payment method-specific information describing the changes made to the payment, or
nullif there is no additional information available or required. This isnullby default.
-
Return value
A newly-created 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
Browser compatibility
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
PaymentMethodChangeEvent |
76 |
79 |
No |
No |
63 |
12.1 |
No |
76 |
No |
54 |
12.2 |
Yes |
See also
© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PaymentMethodChangeEvent/PaymentMethodChangeEvent