Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MonetizationHandler

Fetch this class from your WmpClient object, instead of instantiating it yourself!

myWmpClient.getMonetizationHandler()

Hierarchy

  • MonetizationHandler

Index

Constructors

Properties

monetizationId: string = null
paymentPointer: string = null
wm: Monetization

Methods

  • firePaymentProgress(evt: MessageEvent<any>): void
  • Payment busy, report progress. Fires proper events.

    Parameters

    • evt: MessageEvent<any>

      The event to parse the data property from

    Returns void

  • firePaymentStarted(): void
  • firePaymentStopped(finalized: boolean): void
  • Payment stream stopped. Fires proper events.

    Parameters

    • finalized: boolean

      True when meta tag was removed or payment pointer changed

    Returns void

  • isMonetizationSupported(): boolean
  • isPending(): boolean
  • Returns wether the document.monetization.state equals 'pending'

    Returns boolean

    True if state equals 'pending'

  • isReadyForPayment(): boolean
  • Checks the document.monetization.state property for a 'pending' or 'stopped' state.

    throws

    If state is not one of 'pending', 'stopped' or 'started'

    Returns boolean

    True if state property is defined and not 'started'

  • isStarted(): boolean
  • Returns wether the document.monetization.state equals 'started'

    Returns boolean

    True if state equals 'started'

  • isStopped(): boolean
  • Returns wether the document.monetization.state equals 'stopped'

    Returns boolean

    True if state equals 'stopped'

  • listenForMetaTagChanges(): void
  • resetPaymentPointer(): void
  • searchStaticMetaTag(): boolean
  • sendProgressEvent(detail: MonetizationProgressEventDetail): void
  • Sends a monetizationprogress event from the monetization event source.

    Parameters

    • detail: MonetizationProgressEventDetail

      The details to be sent with the event.

    Returns void

  • setMonetizationState(state: MonetizationState, detail?: BaseMonetizationEventDetail | MonetizationStopEventDetail): void
  • Sets the monetization state. And optionally sends a matching event from the monetization event source.

    Parameters

    • state: MonetizationState

      New state to set

    • Optional detail: BaseMonetizationEventDetail | MonetizationStopEventDetail

    Returns void

  • setPaymentPointer(pointer: string): void
  • Sets a new payment pointer string and generates a unique (uuid v4) monetizationId.

    Parameters

    • pointer: string

      The new payment pointer string

    Returns void

  • startDetection(): void
  • wmPending(): void

Generated using TypeDoc