@raisenow/tamaro-core
    Preparing search index...

    Handles communication with the "pgw-proxy-iframe". Holds the instance of parent "ChannelMessenger" to communicate with iframe. Orchestrates the communication between the iframe and the parent window. Holds the state:

    • Whether AWS WAF captcha overlay is shown.
    • Whether AWS WAF captcha is ready (rendered).
    • Whether AWS WAF token is required.
    • How many form submissions / retries have been attempted.
    Index

    Constructors

    Properties

    iframe?: HTMLIFrameElement
    isAwsWafCaptchaOverlayShown: boolean = false
    isAwsWafCaptchaReady: boolean = false
    isAwsWafTokenRequired: boolean = false
    retryCount: number = 0

    Accessors

    • get configureOptions(): {
          awsWafCaptchaApiKey: string;
          awsWafCaptchaScriptUrl: string;
          pgwProxyIframeUrl: string;
      }

      Returns the configuration options for the iframe. Once it's changed, the messenger instance is re-initialized - see reaction above.

      Returns {
          awsWafCaptchaApiKey: string;
          awsWafCaptchaScriptUrl: string;
          pgwProxyIframeUrl: string;
      }

    • get isRetryAllowed(): boolean

      Allows only one retry.

      Returns boolean

    Methods

    • Returns void

    • Makes a request to the iframe to get the AWS WAF token.

      Returns Promise<string | undefined>

    • Returns void

    • Retries sending the payment request after increasing the retry count.

      Returns Promise<void>

    • Sends the message to the iframe to make a request to PGW. Awaits the response from the iframe. All PGW request/response related handling is done within the iframe. Once the promise is resolved, returns the result.

      Parameters

      • requestConfig: PgwRequestConfig

      Returns Promise<PgwRequestResult>

    • Depending on action either:

      • Shows the captcha overlay and retries sending the payment request after captcha is resolved in onSuccess callback.
      • Retries sending the payment request right away without showing the captcha overlay - token is retrieved with getAwsWafToken() method.

      Parameters

      • Optionalaction: AwsWafAction

      Returns void