Class: PaymentErrorListener

PaymentErrorListener(errorHandler)

Listens for payment failure errors and sends them to the dataLayer. Uses a `PaymentErrorHandler` object to determine the error type, payment form element, and error element.

Constructor

new PaymentErrorListener(errorHandler)

Parameters:
Name Type Description
errorHandler PaymentErrorHandler An object that contains the errorType, paymentForm, and errorElement
Source:

Extends

Classes

PaymentErrorListener

Methods

handleError()

Trigger the event if an error is displayed
Source:

watchForErrors(form) → {void}

Watch for errors in the payment form This is necessary because errors may be displayed after the page loads
Parameters:
Name Type Description
form HTMLElement | null | undefined The payment form element
Source:
Returns:
Type
void