Skip to content

Commit ed1ec0d

Browse files
refactor: settlement transactions
1 parent 4d55b61 commit ed1ec0d

2 files changed

Lines changed: 32 additions & 3 deletions

File tree

src/settlement/interface.ts

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import { CustomerSubAccount } from '../customer/interface';
1+
import { Authorization } from '../charge/interface';
2+
import { Customer, CustomerSubAccount } from '../customer/interface';
23
import { Meta, QueryParams, Response } from '../interface';
4+
import { SubAccount } from '../subaccounts/interface';
35

46
export interface SettlementQueryParams extends QueryParams {
57
subaccount?: string;
@@ -23,7 +25,30 @@ export interface ListSettlementsResponse extends Response {
2325
data: Settlement[];
2426
meta: Meta;
2527
}
26-
28+
type CustomerResponse = Omit<Customer,
29+
'transactions' |
30+
'subscriptions' |
31+
'authorizations' |
32+
'domain' |
33+
'international_format_phone' |
34+
'integration' |
35+
'createdAt' |
36+
'updatedAt' |
37+
'identified' |
38+
'identifications' |
39+
'dedicated_account'
40+
>;
41+
type SubAccountResponse = Omit<SubAccount,
42+
'domain' |
43+
'is_verified' |
44+
'settlement_schedule' |
45+
'active' |
46+
'migrate' |
47+
'integration' |
48+
'createdAt' |
49+
'updatedAt' |
50+
'currency'
51+
>;
2752
export interface SettlementTransaction {
2853
id: number;
2954
reference: string;
@@ -36,6 +61,10 @@ export interface SettlementTransaction {
3661
message?: string;
3762
gateway_response: string;
3863
fees: number;
64+
metadata: Record<string,unknown>;
65+
customer: CustomerResponse;
66+
authorization: Authorization
67+
subaccount: SubAccountResponse;
3968
}
4069

4170
export interface ListSettlementTransactionsResponse extends Response {

src/subaccounts/interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export interface CreateUpdateSubAccount {
5656
metadata?: string;
5757
}
5858

59-
interface SubAccount {
59+
export interface SubAccount {
6060
id: number;
6161
domain: string;
6262
subaccount_code: string;

0 commit comments

Comments
 (0)