Back to Content

PaymentRequestEvent: methodData property

files/en-us/web/api/paymentrequestevent/methoddata/index.md

latest1.4 KB
Original Source

{{SeeCompatTable}}{{APIRef("Web-Based Payment Handler API")}}{{AvailableInWorkers("service")}}

The methodData read-only property of the {{domxref("PaymentRequestEvent")}} interface returns an array of PaymentMethodData objects containing payment method identifiers for the payment methods that the website accepts and any associated payment method-specific data.

Value

An array of PaymentMethodData objects. Each object contains the following properties:

  • supportedMethods
    • : A payment method identifier for a payment method that the merchant website accepts.
  • data
    • : An object that provides optional information that might be needed by the supported payment methods. If supplied, it will be JSON-serialized.

Examples

js
self.addEventListener("paymentrequest", (e) => {
  console.log(e.methodData);
});

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also