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
Name | Type |
---|---|
agreement | Agreement |
allocation | Allocation |
paymentModule | PaymentModule |
options? | Partial <PaymentProcessOptions > |
logger? | Logger |
Returns
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
Name | Type |
---|---|
debitNote | DebitNote |
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
Name | Type |
---|---|
invoice | Invoice |
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