JS API Reference

Class: PaymentApiAdapter

shared/yagna/adapters/payment-api-adapter.PaymentApiAdapter

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PaymentApiAdapter(yagna, invoiceRepo, debitNoteRepo, logger): PaymentApiAdapter

Parameters

NameType
yagnaYagnaApi
invoiceRepoIInvoiceRepository
debitNoteRepoIDebitNoteRepository
loggerLogger

Returns

PaymentApiAdapter

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:21

Properties

receivedInvoices$

receivedInvoices$: Subject<Invoice>

Implementation of

IPaymentApi.receivedInvoices$

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:17


receivedDebitNotes$

receivedDebitNotes$: Subject<DebitNote>

Implementation of

IPaymentApi.receivedDebitNotes$

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:19

Methods

connect

connect(): Promise<void>

Starts the reader logic

Returns

Promise<void>

Implementation of

IPaymentApi.connect

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:28


getInvoice

getInvoice(id): Promise<Invoice>

Parameters

NameType
idstring

Returns

Promise<Invoice>

Implementation of

IPaymentApi.getInvoice

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:66


getDebitNote

getDebitNote(id): Promise<DebitNote>

Parameters

NameType
idstring

Returns

Promise<DebitNote>

Implementation of

IPaymentApi.getDebitNote

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:70


acceptInvoice

acceptInvoice(invoice, allocation, amount): Promise<Invoice>

Parameters

NameType
invoiceInvoice
allocationAllocation
amountstring

Returns

Promise<Invoice>

Implementation of

IPaymentApi.acceptInvoice

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:74


rejectInvoice

rejectInvoice(invoice, reason): Promise<Invoice>

Parameters

NameType
invoiceInvoice
reasonstring

Returns

Promise<Invoice>

Implementation of

IPaymentApi.rejectInvoice

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:93


acceptDebitNote

acceptDebitNote(debitNote, allocation, amount): Promise<DebitNote>

Parameters

NameType
debitNoteDebitNote
allocationAllocation
amountstring

Returns

Promise<DebitNote>

Implementation of

IPaymentApi.acceptDebitNote

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:113


rejectDebitNote

rejectDebitNote(debitNote): Promise<DebitNote>

Parameters

NameType
debitNoteDebitNote

Returns

Promise<DebitNote>

Implementation of

IPaymentApi.rejectDebitNote

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:132


getAllocation

getAllocation(id): Promise<Allocation>

Parameters

NameType
idstring

Returns

Promise<Allocation>

Implementation of

IPaymentApi.getAllocation

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:155


createAllocation

createAllocation(params): Promise<Allocation>

Parameters

NameType
paramsCreateAllocationParams

Returns

Promise<Allocation>

Implementation of

IPaymentApi.createAllocation

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:171


releaseAllocation

releaseAllocation(allocation): Promise<void>

Parameters

NameType
allocationAllocation

Returns

Promise<void>

Implementation of

IPaymentApi.releaseAllocation

Defined in

src/shared/yagna/adapters/payment-api-adapter.ts:209

Was this helpful?