paystack-sdk 1.0.18 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +9 -6
  2. package/dist/charge/charge.d.ts +8 -18
  3. package/dist/charge/charge.js +7 -14
  4. package/dist/charge/interface.d.ts +108 -79
  5. package/dist/customer/customer.d.ts +3 -3
  6. package/dist/customer/customer.js +7 -13
  7. package/dist/customer/index.d.ts +2 -0
  8. package/dist/customer/index.js +14 -0
  9. package/dist/customer/interface.d.ts +79 -41
  10. package/dist/dedicated/dedicated.d.ts +18 -0
  11. package/dist/dedicated/dedicated.js +53 -0
  12. package/dist/dedicated/index.d.ts +0 -0
  13. package/dist/dedicated/index.js +1 -0
  14. package/dist/dedicated/interface.d.ts +157 -0
  15. package/dist/dedicated/interface.js +2 -0
  16. package/dist/interface.d.ts +7 -0
  17. package/dist/interface.js +2 -0
  18. package/dist/paystack.d.ts +12 -4
  19. package/dist/paystack.js +14 -4
  20. package/dist/plan/interface.d.ts +26 -28
  21. package/dist/product/index.d.ts +0 -0
  22. package/dist/product/index.js +1 -0
  23. package/dist/product/interface.d.ts +87 -0
  24. package/dist/product/interface.js +2 -0
  25. package/dist/product/product.d.ts +21 -0
  26. package/dist/product/product.js +46 -0
  27. package/dist/subscription/index.d.ts +1 -0
  28. package/dist/subscription/index.js +13 -0
  29. package/dist/subscription/interface.d.ts +118 -0
  30. package/dist/subscription/interface.js +2 -0
  31. package/dist/subscription/subscription.d.ts +18 -0
  32. package/dist/subscription/subscription.js +54 -0
  33. package/dist/transaction/interface.d.ts +74 -62
  34. package/dist/transaction/interface.js +0 -1
  35. package/dist/transaction/transaction.d.ts +12 -11
  36. package/dist/transaction/transaction.js +10 -13
  37. package/dist/transfer/interface.d.ts +105 -0
  38. package/dist/transfer/interface.js +2 -0
  39. package/dist/transfer/transfer.d.ts +26 -0
  40. package/dist/transfer/transfer.js +59 -0
  41. package/package.json +15 -12
package/README.md CHANGED
@@ -17,7 +17,7 @@ For NPM
17
17
  For Typescript
18
18
 
19
19
  ```
20
- import Paystack from 'paystack-sdk';
20
+ import {Paystack} from 'paystack-sdk';
21
21
 
22
22
  const paystack = new Paystack("secret_key);
23
23
  ```
@@ -25,7 +25,7 @@ const paystack = new Paystack("secret_key);
25
25
  For Javscript
26
26
 
27
27
  ```
28
- const Paystack = require('paystack-sdk');
28
+ const Paystack = require('paystack-sdk').Paystack;
29
29
  const paystack = new Paystack("secret_key");
30
30
  ```
31
31
 
@@ -33,7 +33,10 @@ All methods use promise meaning you can either use the `async...await` or `then.
33
33
 
34
34
  ### Available Functions
35
35
 
36
- - [Charge](https://github.com/en1tan/paystack-node/blob/main/src/charge/README.md)
37
- - [Transaction](https://github.com/en1tan/paystack-node/blob/main/src/transaction/README.md)
38
- - [Plan](https://github.com/en1tan/paystack-node/blob/main/src/plan/README.md)
39
- - [Customer](https://github.com/en1tan/paystack-node/blob/main/src/customer/README.md)
36
+ - Charge
37
+ - Customer
38
+ - Plan
39
+ - Product
40
+ - Subscription
41
+ - Transaction
42
+ - Transfer
@@ -1,28 +1,18 @@
1
1
  import { Axios } from 'axios';
2
- import { ChargeCreated, CreateCharge, SubmitAddress, SubmitBirthday, SubmitOTP, SubmitPhone, SubmitPIN } from '.';
2
+ import { ChargeCreated, ChargeCreatedResponse, CreateCharge, SubmitAddress, SubmitBirthday, SubmitOTP, SubmitPhone, SubmitPIN } from './interface';
3
3
  interface BadRequest {
4
4
  status: boolean;
5
5
  message: string;
6
- data: null;
7
6
  }
8
- export interface ICharge {
9
- create(data: CreateCharge): Promise<ChargeCreated | BadRequest>;
10
- submitPIN(data: SubmitPIN): Promise<ChargeCreated | BadRequest>;
11
- submitOTP(data: SubmitOTP): Promise<ChargeCreated | BadRequest>;
12
- submitPhone(data: SubmitPhone): Promise<ChargeCreated | BadRequest>;
13
- submitBirthday(data: SubmitBirthday): Promise<ChargeCreated | BadRequest>;
14
- submitAddress(data: SubmitAddress): Promise<ChargeCreated | BadRequest>;
15
- checkPending(reference: string): Promise<ChargeCreated | BadRequest>;
16
- }
17
- export declare class Charge implements ICharge {
7
+ export declare class Charge {
18
8
  private http;
19
9
  constructor(http: Axios);
20
- create(data: CreateCharge): Promise<ChargeCreated | BadRequest>;
10
+ create(data: CreateCharge): Promise<ChargeCreatedResponse | BadRequest>;
21
11
  submitPIN(data: SubmitPIN): Promise<ChargeCreated | BadRequest>;
22
- submitOTP(data: SubmitOTP): Promise<ChargeCreated | BadRequest>;
23
- submitPhone(data: SubmitPhone): Promise<ChargeCreated | BadRequest>;
24
- submitBirthday(data: SubmitBirthday): Promise<ChargeCreated | BadRequest>;
25
- submitAddress(data: SubmitAddress): Promise<ChargeCreated | BadRequest>;
26
- checkPending(reference: string): Promise<ChargeCreated | BadRequest>;
12
+ submitOTP(data: SubmitOTP): Promise<ChargeCreatedResponse | BadRequest>;
13
+ submitPhone(data: SubmitPhone): Promise<ChargeCreatedResponse | BadRequest>;
14
+ submitBirthday(data: SubmitBirthday): Promise<ChargeCreatedResponse | BadRequest>;
15
+ submitAddress(data: SubmitAddress): Promise<ChargeCreatedResponse | BadRequest>;
16
+ checkPending(reference: string): Promise<ChargeCreatedResponse | BadRequest>;
27
17
  }
28
18
  export {};
@@ -16,46 +16,39 @@ class Charge {
16
16
  }
17
17
  create(data) {
18
18
  return __awaiter(this, void 0, void 0, function* () {
19
- const response = yield this.http.post('/charge', JSON.stringify(data));
20
- return JSON.parse(response.data);
19
+ return yield this.http.post('/charge', JSON.stringify(data));
21
20
  });
22
21
  }
23
22
  submitPIN(data) {
24
23
  return __awaiter(this, void 0, void 0, function* () {
25
- const response = yield this.http.post('/charge/submit_pin', JSON.stringify(data));
26
- return JSON.parse(response.data);
24
+ return yield this.http.post('/charge/submit_pin', JSON.stringify(data));
27
25
  });
28
26
  }
29
27
  submitOTP(data) {
30
28
  return __awaiter(this, void 0, void 0, function* () {
31
- const response = yield this.http.post('/charge/submit_otp', JSON.stringify(data));
32
- return JSON.parse(response.data);
29
+ return yield this.http.post('/charge/submit_otp', JSON.stringify(data));
33
30
  });
34
31
  }
35
32
  submitPhone(data) {
36
33
  return __awaiter(this, void 0, void 0, function* () {
37
- const response = yield this.http.post('/charge/submit_phone', JSON.stringify(data));
38
- return JSON.parse(response.data);
34
+ return yield this.http.post('/charge/submit_phone', JSON.stringify(data));
39
35
  });
40
36
  }
41
37
  submitBirthday(data) {
42
38
  return __awaiter(this, void 0, void 0, function* () {
43
- const response = yield this.http.post('/charge/submit_birthday', JSON.stringify(data));
44
- return JSON.parse(response.data);
39
+ return yield this.http.post('/charge/submit_birthday', JSON.stringify(data));
45
40
  });
46
41
  }
47
42
  submitAddress(data) {
48
43
  return __awaiter(this, void 0, void 0, function* () {
49
- const response = yield this.http.post('/charge/submit_address', JSON.stringify(data));
50
- return JSON.parse(response.data);
44
+ return yield this.http.post('/charge/submit_address', JSON.stringify(data));
51
45
  });
52
46
  }
53
47
  checkPending(reference) {
54
48
  return __awaiter(this, void 0, void 0, function* () {
55
- const response = yield this.http.get('/charge/submit_address', {
49
+ return yield this.http.get('/charge/submit_address', {
56
50
  params: { reference },
57
51
  });
58
- return JSON.parse(response.data);
59
52
  });
60
53
  }
61
54
  }
@@ -1,3 +1,5 @@
1
+ import { Response } from '../transaction';
2
+ export declare type ChargeCreatedResponse = ChargeCreated | ChargeCreatedWithOTP | ChargeCreatedWithPending | ChargeCreatedWithAddress | ChargeCreatedWithBankAuth | ChargeCreatedWithPin | ChargeCreatedWithPhone | ChargeCreatedWithBirthday | ChargeCreatedWithUSSD | ChargeCreatedWithMobileMoney | ChargeFailed;
1
3
  export interface CreateCharge {
2
4
  email: string;
3
5
  amount: string;
@@ -14,106 +16,132 @@ export interface CreateCharge {
14
16
  device_id?: string;
15
17
  birthday?: string;
16
18
  }
17
- export interface Submit {
19
+ export interface SubmitPIN {
18
20
  reference: string;
19
- }
20
- export interface SubmitPIN extends Submit {
21
21
  pin: string;
22
22
  }
23
- export interface SubmitOTP extends Submit {
23
+ export interface SubmitOTP {
24
+ reference: string;
24
25
  otp: string;
25
26
  }
26
- export interface SubmitPhone extends Submit {
27
+ export interface SubmitPhone {
28
+ reference: string;
27
29
  phone: string;
28
30
  }
29
- export interface SubmitBirthday extends Submit {
31
+ export interface SubmitBirthday {
32
+ reference: string;
30
33
  birthday: Date;
31
34
  }
32
- export interface SubmitAddress extends Submit {
35
+ export interface SubmitAddress {
36
+ reference: string;
33
37
  address: string;
34
38
  city: string;
35
39
  state: string;
36
40
  zip_code: string;
37
41
  }
38
- export interface ChargeCreated {
39
- status: boolean;
40
- message: string;
41
- data: ChargeCreatedOk | ChargeCreatedResponseWithAddress | ChargeCreatedResponseWithPending | ChargeCreatedResponseWithBankAuth | ChargeCreatedResponseWithMobileMoney | ChargeCreatedResponseWithUSSD | ChargeCreatedResponseWithOTP | ChargeCreatedResponseWithPin | ChargeCreatedResponseWithPhone | ChargeFailed;
42
+ export interface ChargeCreated extends Response {
43
+ data: {
44
+ amount: number;
45
+ currency: string;
46
+ transaction_date: string;
47
+ status: string;
48
+ reference: string;
49
+ domain: string;
50
+ metadata: Record<string, unknown>;
51
+ gateway_response: string;
52
+ message: string;
53
+ channel: string;
54
+ ip_address: string;
55
+ log: unknown;
56
+ fees: number;
57
+ authorization: Authorization;
58
+ customer: Customer;
59
+ display_text: string;
60
+ plan: unknown;
61
+ };
42
62
  }
43
- interface ChargeCreatedOk {
44
- amount: number;
45
- currency: string;
46
- transaction_date: string;
47
- status: string;
48
- reference: string;
49
- domain: string;
50
- metadata: Record<string, unknown>;
51
- gateway_response: string;
52
- message: string;
53
- channel: string;
54
- ip_address: string;
55
- log: any | null;
56
- fees: number;
57
- authorization: Authorization;
58
- customer: Customer;
59
- display_text: string;
60
- plan: string | null;
61
- }
62
- interface ChargeCreatedResponseWithPending {
63
- reference: string;
64
- status: string;
63
+ interface ChargeCreatedWithPending extends Response {
64
+ data: {
65
+ reference: string;
66
+ status: string;
67
+ };
65
68
  }
66
- interface ChargeCreatedResponseWithAddress {
67
- display_text: string;
68
- reference: string;
69
- status: string;
70
- country_code: string;
69
+ interface ChargeCreatedWithAddress extends Response {
70
+ data: {
71
+ display_text: string;
72
+ reference: string;
73
+ status: string;
74
+ country_code: string;
75
+ };
71
76
  }
72
- interface ChargeCreatedResponseWithMobileMoney {
73
- amount: number;
74
- channel: string;
75
- created_at: Date;
76
- currency: string;
77
- domain: string;
78
- fees: number;
79
- gateway_response: string;
80
- id: number;
81
- ip_address: string;
82
- message: string;
83
- paid_at: Date;
84
- reference: string;
85
- status: string;
86
- transaction_date: Date;
87
- authorization: Authorization;
88
- customer: Customer;
77
+ interface ChargeCreatedWithMobileMoney extends Response {
78
+ data: {
79
+ amount: number;
80
+ channel: string;
81
+ created_at: Date;
82
+ currency: string;
83
+ domain: string;
84
+ fees: number;
85
+ gateway_response: string;
86
+ id: number;
87
+ ip_address: string;
88
+ message: string;
89
+ paid_at: Date;
90
+ reference: string;
91
+ status: string;
92
+ transaction_date: Date;
93
+ authorization: Authorization;
94
+ customer: Customer;
95
+ };
89
96
  }
90
- interface ChargeCreatedResponseWithUSSD {
91
- reference: string;
92
- status: string;
93
- display_text: string;
94
- ussd_code: string;
97
+ interface ChargeCreatedWithUSSD extends Response {
98
+ data: {
99
+ reference: string;
100
+ status: string;
101
+ display_text: string;
102
+ ussd_code: string;
103
+ };
95
104
  }
96
- interface ChargeCreatedResponseWithBirthday {
97
- reference: string;
98
- status: string;
99
- display_text: string;
105
+ interface ChargeCreatedWithBirthday extends Response {
106
+ data: {
107
+ reference: string;
108
+ status: string;
109
+ display_text: string;
110
+ };
100
111
  }
101
- interface ChargeCreatedResponseWithPhone extends ChargeCreatedResponseWithBirthday {
112
+ interface ChargeCreatedWithBankAuth extends Response {
113
+ data: {
114
+ refernce: string;
115
+ uri: string;
116
+ status: string;
117
+ };
102
118
  }
103
- interface ChargeCreatedResponseWithBankAuth {
104
- refernce: string;
105
- uri: string;
106
- status: string;
119
+ interface ChargeCreatedWithOTP extends Response {
120
+ data: {
121
+ refernce: string;
122
+ status: string;
123
+ display_text: string;
124
+ };
107
125
  }
108
- interface ChargeCreatedResponseWithPin extends ChargeCreatedResponseWithPending {
126
+ interface ChargeCreatedWithPin extends Response {
127
+ data: {
128
+ refernce: string;
129
+ status: string;
130
+ };
109
131
  }
110
- interface ChargeCreatedResponseWithOTP extends ChargeCreatedResponseWithPending {
111
- display_text: string;
132
+ interface ChargeCreatedWithPhone extends Response {
133
+ data: {
134
+ refernce: string;
135
+ status: string;
136
+ display_text: string;
137
+ };
112
138
  }
113
- interface ChargeFailed {
114
- refernce: string;
115
- message: string;
116
- status: string;
139
+ interface ChargeFailed extends Response {
140
+ data: {
141
+ refernce: string;
142
+ message: string;
143
+ status: string;
144
+ };
117
145
  }
118
146
  export interface Authorization {
119
147
  authorization_code: string;
@@ -131,13 +159,14 @@ export interface Authorization {
131
159
  account_name: string;
132
160
  }
133
161
  export interface Customer {
134
- customer_code: string;
135
- email: string;
136
162
  id: number;
137
- risk_action: string;
138
163
  first_name?: string;
139
164
  last_name?: string;
165
+ email: string;
166
+ customer_code: string;
167
+ risk_action: string;
140
168
  phone?: string | null;
141
169
  metadata?: Record<string, unknown> | null;
170
+ international_format_phone?: string | null;
142
171
  }
143
172
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Axios } from 'axios';
2
- import { Meta } from '../transaction';
3
- import { CreateCustomer, CustomerCreated, CustomerData, ListCustomerQueryParams, ListCustomers, Response, SetRiskAction, UpdateCustomer, ValidateCustomer } from './interface';
2
+ import { ListCustomersResponse } from '.';
3
+ import { CreateCustomer, CustomerCreated, CustomerData, ListCustomerQueryParams, SetRiskAction, UpdateCustomer, ValidateCustomer } from './interface';
4
4
  interface BadRequest {
5
5
  status: boolean;
6
6
  message: string;
@@ -25,7 +25,7 @@ export declare class Customer {
25
25
  * List customers available on your integration
26
26
  * @param {ListCustomerQueryParams} queryParams
27
27
  */
28
- list(queryParams?: ListCustomerQueryParams): Promise<(Response & ListCustomers[] & Meta) | BadRequest>;
28
+ list(queryParams?: ListCustomerQueryParams): Promise<ListCustomersResponse | BadRequest>;
29
29
  /**
30
30
  * ## Fetch Customer
31
31
  * Get details of a customer on your integration
@@ -26,8 +26,7 @@ class Customer {
26
26
  */
27
27
  create(data) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- const response = yield this.http.post('/customer', JSON.stringify(data));
30
- return JSON.parse(response.data);
29
+ return yield this.http.post('/customer', JSON.stringify(data));
31
30
  });
32
31
  }
33
32
  /**
@@ -37,10 +36,9 @@ class Customer {
37
36
  */
38
37
  list(queryParams) {
39
38
  return __awaiter(this, void 0, void 0, function* () {
40
- const response = yield this.http.get('/customer', {
39
+ return yield this.http.get('/customer', {
41
40
  params: Object.assign({}, queryParams),
42
41
  });
43
- return JSON.parse(response.data);
44
42
  });
45
43
  }
46
44
  /**
@@ -50,8 +48,7 @@ class Customer {
50
48
  */
51
49
  fetch(emailCode) {
52
50
  return __awaiter(this, void 0, void 0, function* () {
53
- const response = yield this.http.get(`/customer/${emailCode}`);
54
- return JSON.parse(response.data);
51
+ return yield this.http.get(`/customer/${emailCode}`);
55
52
  });
56
53
  }
57
54
  /**
@@ -60,8 +57,7 @@ class Customer {
60
57
  */
61
58
  update(code, data) {
62
59
  return __awaiter(this, void 0, void 0, function* () {
63
- const response = yield this.http.put(`/customer/${code}`, JSON.stringify(data));
64
- return JSON.parse(response.data);
60
+ return yield this.http.put(`/customer/${code}`, JSON.stringify(data));
65
61
  });
66
62
  }
67
63
  /**
@@ -72,8 +68,7 @@ class Customer {
72
68
  */
73
69
  validate(customerCode, data) {
74
70
  return __awaiter(this, void 0, void 0, function* () {
75
- const response = yield this.http.post(`/customer/${customerCode}/identification`, JSON.stringify(data));
76
- return JSON.parse(response.data);
71
+ return yield this.http.post(`/customer/${customerCode}/identification`, JSON.stringify(data));
77
72
  });
78
73
  }
79
74
  /**
@@ -83,8 +78,7 @@ class Customer {
83
78
  */
84
79
  setRiskAction(data) {
85
80
  return __awaiter(this, void 0, void 0, function* () {
86
- const response = yield this.http.post('/customer/set_risk_action', JSON.stringify(data));
87
- return JSON.parse(response.data);
81
+ return yield this.http.post('/customer/set_risk_action', JSON.stringify(data));
88
82
  });
89
83
  }
90
84
  /**
@@ -95,7 +89,7 @@ class Customer {
95
89
  deactivateAutorization(authorizationCode) {
96
90
  return __awaiter(this, void 0, void 0, function* () {
97
91
  const response = yield this.http.post('/customer/deactivate_authorization', JSON.stringify({ authorizaion_code: authorizationCode }));
98
- return JSON.parse(response.data);
92
+ return response;
99
93
  });
100
94
  }
101
95
  }
@@ -0,0 +1,2 @@
1
+ export * from './interface';
2
+ export * from './customer';
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./interface"), exports);
14
+ __exportStar(require("./customer"), exports);
@@ -1,58 +1,77 @@
1
1
  import { Authorization } from '../charge';
2
- import { Subscription, TransactionData } from '../transaction';
2
+ import { Meta } from '../interface';
3
+ import { Subscription } from '../subscription/interface';
4
+ import { TransactionData } from '../transaction';
3
5
  export interface CreateCustomer {
4
6
  email: string;
5
7
  first_name: string;
6
8
  last_name: string;
7
- phone: string;
8
- metadata: Record<string, any>;
9
+ phone?: string;
10
+ metadata?: Record<string, any>;
9
11
  }
10
12
  export interface Response {
11
13
  status: boolean;
12
14
  message: string;
13
15
  }
14
16
  export interface CustomerCreated extends Response {
15
- email: string;
16
- integration: number;
17
- domain: string;
18
- customer_code: string;
19
- id: number;
20
- identified: boolean;
21
- identifications: null;
22
- createdAt: Date;
23
- updatedAt: Date;
17
+ data: {
18
+ transactions: TransactionData[];
19
+ subscriptions: Subscription[];
20
+ authorizations: Authorization[];
21
+ first_name: string;
22
+ last_name: string;
23
+ email: string;
24
+ phone: string | null;
25
+ metadata: Record<string, any> | null;
26
+ domain: string;
27
+ customer_code: string;
28
+ risk_action: string;
29
+ id: number;
30
+ integration: number;
31
+ createdAt: Date;
32
+ updatedAt: Date;
33
+ identified: boolean;
34
+ identifications: null;
35
+ };
24
36
  }
25
37
  export interface CustomerData extends Response {
26
- integration: number;
27
- first_name: string;
28
- last_name: string;
29
- email: string;
30
- phone: string | null;
31
- dedicated_account: DedicatedAccount | null;
32
- identified: boolean;
33
- identifications: CustomerIdentification[] | null;
34
- metadata: Record<string, any> | null;
35
- domain: string;
36
- customer_code: string;
37
- id: string;
38
- transactions: TransactionData[];
39
- subscriptions: Subscription[];
40
- authorizations: Authorization[];
41
- createdAt: Date;
42
- updatedAt: Date;
38
+ data: {
39
+ integration: number;
40
+ first_name: string;
41
+ last_name: string;
42
+ email: string;
43
+ phone: string | null;
44
+ dedicated_account: DedicatedAccount | null;
45
+ identified: boolean;
46
+ identifications: CustomerIdentification[] | null;
47
+ metadata: Record<string, any> | null;
48
+ domain: string;
49
+ customer_code: string;
50
+ id: string;
51
+ transactions: TransactionData[];
52
+ subscriptions: Subscription[];
53
+ authorizations: Authorization[];
54
+ createdAt: Date;
55
+ updatedAt: Date;
56
+ };
43
57
  }
44
- export interface ListCustomers {
45
- integration: number;
46
- first_name: string;
47
- last_name: string;
48
- email: string;
49
- phone: string | null;
50
- metadata: Record<string, any> | null;
51
- domain: string;
52
- customer_code: string;
53
- id: number;
54
- createdAt: Date;
55
- updatedAt: Date;
58
+ export interface ListCustomersResponse extends Response {
59
+ data: [
60
+ {
61
+ integration: number;
62
+ first_name: string;
63
+ last_name: string;
64
+ email: string;
65
+ phone: string | null;
66
+ metadata: Record<string, any> | null;
67
+ domain: string;
68
+ customer_code: string;
69
+ id: number;
70
+ createdAt: Date;
71
+ updatedAt: Date;
72
+ }
73
+ ];
74
+ meta: Meta;
56
75
  }
57
76
  export interface ListCustomerQueryParams {
58
77
  /**
@@ -174,4 +193,23 @@ declare enum ValidationType {
174
193
  bvn = 0,
175
194
  bank_account = 1
176
195
  }
196
+ export interface ICustomer {
197
+ integration: number;
198
+ first_name: string;
199
+ last_name: string;
200
+ email: string;
201
+ phone: string | null;
202
+ dedicated_account: DedicatedAccount | null;
203
+ identified: boolean;
204
+ identifications: CustomerIdentification[] | null;
205
+ metadata: Record<string, unknown> | null;
206
+ domain: string;
207
+ customer_code: string;
208
+ id: string;
209
+ transactions: TransactionData[];
210
+ subscriptions: Subscription[];
211
+ authorizations: Authorization[];
212
+ createdAt: Date;
213
+ updatedAt: Date;
214
+ }
177
215
  export {};
@@ -0,0 +1,18 @@
1
+ import { Axios } from 'axios';
2
+ import { CreateDedicatedVirtualAccount, DeactivateDedicatedAccountResponse, DedicatedAccountCreatedResponse, FetchBankProvidersResponse, FetchDedicatedVirtualAccountResponse, ListDedicatedVirtualAccountsQueryParams, ListDedicatedVirtualAccountsResponse, RemoveSplitDedicatedAccountResponse, SplitDedicatedAccountTransaction, SplitDedicatedAccountTransactionResponse } from './interface';
3
+ interface BadRequest {
4
+ status: boolean;
5
+ message: string;
6
+ }
7
+ export declare class DedicatedAccount {
8
+ http: Axios;
9
+ constructor(http: Axios);
10
+ create(data: CreateDedicatedVirtualAccount): Promise<DedicatedAccountCreatedResponse | BadRequest>;
11
+ list(queryParams: ListDedicatedVirtualAccountsQueryParams): Promise<ListDedicatedVirtualAccountsResponse | BadRequest>;
12
+ fetch(dedicatedAccountId: string): Promise<FetchDedicatedVirtualAccountResponse | BadRequest>;
13
+ deactivate(dedicatedAccountId: string): Promise<DeactivateDedicatedAccountResponse | BadRequest>;
14
+ splitTransaction(data: SplitDedicatedAccountTransaction): Promise<SplitDedicatedAccountTransactionResponse | BadRequest>;
15
+ removeSplit(accountNumber: string): Promise<RemoveSplitDedicatedAccountResponse | BadRequest>;
16
+ providers(): Promise<FetchBankProvidersResponse | BadRequest>;
17
+ }
18
+ export {};