forked from tekpriest/paystack-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettlement.ts
More file actions
29 lines (26 loc) · 753 Bytes
/
settlement.ts
File metadata and controls
29 lines (26 loc) · 753 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { Axios } from 'axios';
import { BadRequest, QueryParams } from '../interface';
import {
ListSettlementsResponse,
ListSettlementTransactionsResponse,
SettlementQueryParams,
} from './interface';
export class Settlement {
private http: Axios;
constructor(http: Axios) {
this.http = http;
}
async list(
queryParams?: SettlementQueryParams,
): Promise<ListSettlementsResponse | BadRequest> {
return await this.http.get('/settlement', { params: { ...queryParams } });
}
async transactions(
id: string,
queryParams: QueryParams,
): Promise<ListSettlementTransactionsResponse | BadRequest> {
return await this.http.get(`/settlement/${id}/transactions`, {
params: { ...queryParams },
});
}
}