Class: PaymentApiAdapter
shared/yagna/adapters/payment-api-adapter.PaymentApiAdapter
Implements
Table of contents
Constructors
Properties
Methods
- connect
- getInvoice
- getDebitNote
- acceptInvoice
- rejectInvoice
- acceptDebitNote
- rejectDebitNote
- getAllocation
- createAllocation
- releaseAllocation
Constructors
constructor
• new PaymentApiAdapter(yagna, invoiceRepo, debitNoteRepo, logger): PaymentApiAdapter
Parameters
| Name | Type | 
|---|---|
| yagna | YagnaApi | 
| invoiceRepo | IInvoiceRepository | 
| debitNoteRepo | IDebitNoteRepository | 
| logger | Logger | 
Returns
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:21
Properties
receivedInvoices$
• receivedInvoices$: Subject<Invoice>
Implementation of
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
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:28
getInvoice
▸ getInvoice(id): Promise<Invoice>
Parameters
| Name | Type | 
|---|---|
| id | string | 
Returns
Promise<Invoice>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:66
getDebitNote
▸ getDebitNote(id): Promise<DebitNote>
Parameters
| Name | Type | 
|---|---|
| id | string | 
Returns
Promise<DebitNote>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:70
acceptInvoice
▸ acceptInvoice(invoice, allocation, amount): Promise<Invoice>
Parameters
| Name | Type | 
|---|---|
| invoice | Invoice | 
| allocation | Allocation | 
| amount | string | 
Returns
Promise<Invoice>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:74
rejectInvoice
▸ rejectInvoice(invoice, reason): Promise<Invoice>
Parameters
| Name | Type | 
|---|---|
| invoice | Invoice | 
| reason | string | 
Returns
Promise<Invoice>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:93
acceptDebitNote
▸ acceptDebitNote(debitNote, allocation, amount): Promise<DebitNote>
Parameters
| Name | Type | 
|---|---|
| debitNote | DebitNote | 
| allocation | Allocation | 
| amount | string | 
Returns
Promise<DebitNote>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:113
rejectDebitNote
▸ rejectDebitNote(debitNote): Promise<DebitNote>
Parameters
| Name | Type | 
|---|---|
| debitNote | DebitNote | 
Returns
Promise<DebitNote>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:132
getAllocation
▸ getAllocation(id): Promise<Allocation>
Parameters
| Name | Type | 
|---|---|
| id | string | 
Returns
Promise<Allocation>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:155
createAllocation
▸ createAllocation(params): Promise<Allocation>
Parameters
| Name | Type | 
|---|---|
| params | CreateAllocationParams | 
Returns
Promise<Allocation>
Implementation of
Defined in
src/shared/yagna/adapters/payment-api-adapter.ts:171
releaseAllocation
▸ releaseAllocation(allocation): Promise<void>
Parameters
| Name | Type | 
|---|---|
| allocation | Allocation | 
Returns
Promise<void>