Skip to content

Commit ec3331e

Browse files
committed
update inline docs
1 parent bc9d49a commit ec3331e

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

lib/InvoicePaymentGateway.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ export class InvoicePaymentGateway {
1313
this.config = gateway.config;
1414
}
1515

16+
/**
17+
* Create a new invoice payment
18+
* @param invoicePayment Body of the invoice payment
19+
* @returns InvoicePayment
20+
*/
1621
async create(invoicePayment: InvoicePaymentInput) {
1722
const endPoint = buildURL('invoices/payment/create');
1823

@@ -24,6 +29,11 @@ export class InvoicePaymentGateway {
2429
return Object.assign(new InvoicePayment(), result.invoicePayment);
2530
}
2631

32+
/**
33+
* Update an existing invoice payment
34+
* @param invoicePayment Body of the invoice payment
35+
* @returns InvoicePayment
36+
*/
2737
async update(payload: any) {
2838
const endPoint = buildURL('invoices/payment/update');
2939

@@ -35,6 +45,11 @@ export class InvoicePaymentGateway {
3545
return result.ok;
3646
}
3747

48+
/**
49+
* Delete an existing invoice payment
50+
* @param invoicePayment Body of the invoice payment
51+
* @returns boolean
52+
*/
3853
async delete(payload: any) {
3954
const endPoint = buildURL('invoices/payment/delete');
4055

@@ -46,6 +61,11 @@ export class InvoicePaymentGateway {
4661
return result.ok;
4762
}
4863

64+
/**
65+
* Search for invoice payments
66+
* @param payload Search parameters
67+
* @returns InvoicePayment[]
68+
*/
4969
async search(payload?: any) {
5070
const endPoint = buildURL('invoices/payment/search');
5171

lib/RecipientGateway.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ export class RecipientGateway {
132132
return true;
133133
}
134134

135+
/**
136+
* Find acitivity logs for a given recipient
137+
* @param recipientId The Trolley recipient ID (e.g. R-xyzzy)
138+
* @returns An array of logs
139+
*/
135140
async findLogs(recipientId: string) {
136141
const endPoint = buildURL('recipients', recipientId, 'logs');
137142

@@ -140,6 +145,11 @@ export class RecipientGateway {
140145
return result.recipientLogs.map((r: Log) => Object.assign(new Log(), r));
141146
}
142147

148+
/**
149+
* Find payments for a given recipient
150+
* @param recipientId The Trolley recipient ID (e.g. R-xyzzy)
151+
* @returns An array of payments
152+
*/
143153
async findPayments(recipientId: string) {
144154
const endPoint = buildURL('recipients', recipientId, 'payments');
145155

@@ -148,6 +158,11 @@ export class RecipientGateway {
148158
return result.payments.map((r: Payment) => Object.assign(new Payment(), r));
149159
}
150160

161+
/**
162+
* Find offline payments for a given recipient
163+
* @param recipientId The Trolley recipient ID (e.g. R-xyzzy)
164+
* @returns An array of offline payments
165+
*/
151166
async findOfflinePayments(recipientId: string) {
152167
const endPoint = buildURL('recipients', recipientId, 'offlinePayments');
153168

0 commit comments

Comments
 (0)