Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for all products including account, paymentRequests, remittances and disbursements

property

{ 'Content-Type': string, 'Ocp-Apim-Subscription-Key': string, 'Authorization': string, 'X-Target-Environment': string,} commonHeaders

property

{IApiToken | undefined} apiToken

method

authenticate()

method

shouldAuthenticate()

method

secondsSince()

Hierarchy

Index

Constructors

constructor

  • new BaseProduct(__namedParameters: object): BaseProduct
  • Parameters

    • __namedParameters: object
      • apiKey: string
      • apiuserId: string
      • authBaseURL: string
      • authUrl: string
      • subscriptionKey: string
      • targetEnvironment: string

    Returns BaseProduct

Properties

Protected apiToken

apiToken: IApiToken | undefined

Private authResource

authResource: IResource

commonHeaders

commonHeaders: object

Type declaration

  • Authorization: string
  • Content-Type: string
  • Ocp-Apim-Subscription-Key: string
  • X-Target-Environment: string

Methods

Protected authenticate

  • authenticate(): Promise<void>
  • Authenticates with remote api if the apiToken is expired or non-existent

    Returns Promise<void>

Protected secondsSince

  • secondsSince(startingTime: Date): number
  • Returns the number of seconds between now and the given startingTime

    Parameters

    • startingTime: Date

    Returns number

Protected shouldAuthenticate

  • shouldAuthenticate(): boolean
  • Checks whether the apiToken has expired or not; or whether it is exists or not

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc