forked from tekpriest/paystack-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.ts
More file actions
75 lines (71 loc) · 1.65 KB
/
interface.ts
File metadata and controls
75 lines (71 loc) · 1.65 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import { Authorization } from '../charge/interface';
import { Customer, CustomerSubAccount } from '../customer/interface';
import { Meta, QueryParams, Response } from '../interface';
import { SubAccount } from '../subaccounts/interface';
export interface SettlementQueryParams extends QueryParams {
subaccount?: string;
}
export interface Settlement {
integration: number;
settled_by?: string;
settlement_date: Date;
domain: string;
total_amount: number;
total_processed: number;
total_fees: number;
status: string;
id: number;
createdAt: Date;
updatedAt?: Date;
subaccount: CustomerSubAccount;
}
export interface ListSettlementsResponse extends Response {
data: Settlement[];
meta: Meta;
}
type CustomerType = Pick<
Customer,
| 'id'
| 'first_name'
| 'last_name'
| 'email'
| 'phone'
| 'metadata'
| 'customer_code'
| 'risk_action'
>;
type SubAccountType = Pick<
SubAccount,
| 'id'
| 'subaccount_code'
| 'business_name'
| 'description'
| 'primary_contact_name'
| 'primary_contact_email'
| 'primary_contact_phone'
| 'metadata'
| 'percentage_charge'
| 'settlement_bank'
| 'account_number'
>;
export interface SettlementTransaction {
id: number;
reference: string;
amount: number;
created_at: Date;
paidAt: Date;
currency: string;
channel: string;
domain: string;
message?: string;
gateway_response: string;
fees: number;
metadata: Record<string,unknown>;
customer: CustomerType;
authorization: Authorization
subaccount: SubAccountType;
}
export interface ListSettlementTransactionsResponse extends Response {
data: SettlementTransaction[];
meta: Meta & { total_volume: number };
}