• ------------------------------
  • JS API Reference

    Class: AgreementPaymentProcess

    payment/agreement_payment_process.AgreementPaymentProcess

    Process manager that controls the logic behind processing payments for an agreement (debit notes and invoices). The process is started automatically and ends when the final invoice is received. You can stop the process earlier by calling the stop method. You cannot restart the process after stopping it.

    Table of contents

    Constructors

    Properties

    Methods

    Constructors

    constructor

    new AgreementPaymentProcess(agreement, allocation, paymentModule, options?, logger?): AgreementPaymentProcess

    Parameters

    NameType
    agreementAgreement
    allocationAllocation
    paymentModulePaymentModule
    options?Partial<PaymentProcessOptions>
    logger?Logger

    Returns

    AgreementPaymentProcess

    Defined in

    src/payment/agreement_payment_process.ts:59

    Properties

    logger

    Readonly logger: Logger

    Defined in

    src/payment/agreement_payment_process.ts:55


    agreement

    Readonly agreement: Agreement

    Defined in

    src/payment/agreement_payment_process.ts:60


    allocation

    Readonly allocation: Allocation

    Defined in

    src/payment/agreement_payment_process.ts:61


    paymentModule

    Readonly paymentModule: PaymentModule

    Defined in

    src/payment/agreement_payment_process.ts:62

    Methods

    addDebitNote

    addDebitNote(debitNote): Promise<boolean>

    Adds the debit note to the process avoiding race conditions

    Parameters

    NameType
    debitNoteDebitNote

    Returns

    Promise<boolean>

    Defined in

    src/payment/agreement_payment_process.ts:91


    addInvoice

    addInvoice(invoice): Promise<boolean>

    Adds the invoice to the process avoiding race conditions

    Parameters

    NameType
    invoiceInvoice

    Returns

    Promise<boolean>

    Defined in

    src/payment/agreement_payment_process.ts:98


    isFinished

    isFinished(): boolean

    Tells if the process reached a point in which we can consider it as "finished"

    Returns

    boolean

    Defined in

    src/payment/agreement_payment_process.ts:105


    isStarted

    isStarted(): boolean

    Returns

    boolean

    Defined in

    src/payment/agreement_payment_process.ts:293


    stop

    stop(): void

    Returns

    void

    Defined in

    src/payment/agreement_payment_process.ts:297