## Available payment methods change event

`expressCheckoutElement.on(event: 'availablepaymentmethodschange', handler: function)`

Triggered when there is a change to which buttons are available in the Express Checkout Element. Also fires on initial render.

- `event`
  The name of the event. In this case, `availablepaymentmethodschange`.

- `handler`
  `handler(event) => void` is a **callback function** that you provide that will be called when the event is fired. When called it will be passed an event object with the following properties:
    - `elementType`
      The type of element the event is fired from.
    - `paymentMethods`
      Describes which buttons render in the Element. Returns `undefined` if no buttons will render. Payment methods are returned in alphabetical order. Each value is an object with an `available` boolean field.

If you configured [custom payment methods](https://docs.stripe.com/payments/payment-element/custom-payment-methods.md) with an `expressCheckout` object, their IDs (prefixed with `cpmt_`) also appear as keys in this object.
      - `amazonPay`
        - `available`
      - `applePay`
        - `available`
      - `googlePay`
        - `available`
      - `klarna`
        - `available`
      - `link`
        - `available`
      - `paypal`
        - `available`

### Example

```title
Handle an availablepaymentmethodschange event
```
