All classes in the resource folder should implement this interface so that they can be instantiated in the main barrel.

Hierarchy (view full)

Constructors

Properties

email: string

The contact's email address

externalId: undefined | null | string

The optional external ID of the payment recipient from the payment cycle. This ID represents the user in an external system.

id: string

The ID of the contact. This can be used to retrieve a contact.

name: string

The known name of the contact. This is the name that you have given the contact when you created it.

rawObject: ContactInfo

The raw ContactInfo object that was returned from the API

status: string

The contact's status.

Methods

  • A helper function to ensure that API calls are successful and return a valid status code.

    Type Parameters

    • T

    Parameters

    • call: (() => Promise<AxiosResponse<T, any>>)

      The API call to guard for exceptions and bad return codes.

        • (): Promise<AxiosResponse<T, any>>
        • Returns Promise<AxiosResponse<T, any>>

    Returns Promise<T>

    A promise of the type returned by Axios in the data field.

  • Returns a list of payments that have been sent to this contact. From these payments, you can see the payment cycle that the payment was sent from. Note that only payments that have been sent to this contact will be returned. Payments that have been sent from a payment cycle that is still in Draft status will not be returned because they have not been created yet.

    Parameters

    • limit: number

      An integer number between 1 and 100.

    • page: number

      An integer number of the page starting at 1.

    Returns Promise<PaymentList>

  • A helper function that will either return the variable's value or throw an exception if the value is null or undefined. Unit testing is simplified by avoiding ??

    Type Parameters

    • T

    Parameters

    • name: string

      The name of the variable being checked

    • value: undefined | null | T

      The value of the variable being checked

    Returns T

    The value of the variable if it is available, otherwise an exception is thrown.