GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

PaymentMethodChangeEvent: PaymentMethodChangeEvent() constructor

Payment Request API

Payment Request API

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

## Syntax

```js-nolint
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`
- : An object that, _in addition of the properties defined in Event()_,
can have the following properties:
- `methodName`
- : A string containing the payment method identifier for the
payment handler being used. This is an empty string by default.
- `methodDetails`
- : 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

## Browser compatibility

## See also

- [Payment Request API](/docs/Web/API/Payment_Request_API)
- [Using the Payment Request API](/docs/Web/API/Payment_Request_API/Using_the_Payment_Request_API)
- [Payment processing concepts](/docs/Web/API/Payment_Request_API/Concepts)

source: MDN Web Docs mirror · page

Cite this

"PaymentMethodChangeEvent: PaymentMethodChangeEvent() constructor". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/PaymentMethodChangeEvent/PaymentMethodChangeEvent

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·