paystack-sdk 1.0.18 → 1.0.19
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.
- package/dist/charge/charge.d.ts +8 -18
- package/dist/charge/charge.js +7 -14
- package/dist/charge/interface.d.ts +104 -76
- package/dist/customer/customer.d.ts +3 -3
- package/dist/customer/customer.js +7 -13
- package/dist/customer/index.d.ts +2 -0
- package/dist/customer/index.js +14 -0
- package/dist/customer/interface.d.ts +79 -41
- package/dist/interface.d.ts +7 -0
- package/dist/interface.js +2 -0
- package/dist/paystack.d.ts +10 -4
- package/dist/paystack.js +12 -4
- package/dist/plan/interface.d.ts +26 -28
- package/dist/product/index.d.ts +0 -0
- package/dist/product/index.js +1 -0
- package/dist/product/interface.d.ts +87 -0
- package/dist/product/interface.js +2 -0
- package/dist/product/product.d.ts +21 -0
- package/dist/product/product.js +46 -0
- package/dist/subscription/index.d.ts +1 -0
- package/dist/subscription/index.js +13 -0
- package/dist/subscription/interface.d.ts +118 -0
- package/dist/subscription/interface.js +2 -0
- package/dist/subscription/subscription.d.ts +18 -0
- package/dist/subscription/subscription.js +54 -0
- package/dist/transaction/interface.d.ts +74 -62
- package/dist/transaction/interface.js +0 -1
- package/dist/transaction/transaction.d.ts +12 -11
- package/dist/transaction/transaction.js +10 -13
- package/dist/transfer/interface.d.ts +105 -0
- package/dist/transfer/interface.js +2 -0
- package/dist/transfer/transfer.d.ts +26 -0
- package/dist/transfer/transfer.js +59 -0
- package/package.json +15 -12
package/dist/charge/charge.d.ts
CHANGED
|
@@ -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
|
|
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<
|
|
10
|
+
create(data: CreateCharge): Promise<ChargeCreatedResponse | BadRequest>;
|
|
21
11
|
submitPIN(data: SubmitPIN): Promise<ChargeCreated | BadRequest>;
|
|
22
|
-
submitOTP(data: SubmitOTP): Promise<
|
|
23
|
-
submitPhone(data: SubmitPhone): Promise<
|
|
24
|
-
submitBirthday(data: SubmitBirthday): Promise<
|
|
25
|
-
submitAddress(data: SubmitAddress): Promise<
|
|
26
|
-
checkPending(reference: string): Promise<
|
|
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 {};
|
package/dist/charge/charge.js
CHANGED
|
@@ -16,46 +16,39 @@ class Charge {
|
|
|
16
16
|
}
|
|
17
17
|
create(data) {
|
|
18
18
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
23
|
+
export interface SubmitOTP {
|
|
24
|
+
reference: string;
|
|
24
25
|
otp: string;
|
|
25
26
|
}
|
|
26
|
-
export interface SubmitPhone
|
|
27
|
+
export interface SubmitPhone {
|
|
28
|
+
reference: string;
|
|
27
29
|
phone: string;
|
|
28
30
|
}
|
|
29
|
-
export interface SubmitBirthday
|
|
31
|
+
export interface SubmitBirthday {
|
|
32
|
+
reference: string;
|
|
30
33
|
birthday: Date;
|
|
31
34
|
}
|
|
32
|
-
export interface SubmitAddress
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
105
|
+
interface ChargeCreatedWithBirthday extends Response {
|
|
106
|
+
data: {
|
|
107
|
+
reference: string;
|
|
108
|
+
status: string;
|
|
109
|
+
display_text: string;
|
|
110
|
+
};
|
|
100
111
|
}
|
|
101
|
-
interface
|
|
112
|
+
interface ChargeCreatedWithBankAuth extends Response {
|
|
113
|
+
data: {
|
|
114
|
+
refernce: string;
|
|
115
|
+
uri: string;
|
|
116
|
+
status: string;
|
|
117
|
+
};
|
|
102
118
|
}
|
|
103
|
-
interface
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
119
|
+
interface ChargeCreatedWithOTP extends Response {
|
|
120
|
+
data: {
|
|
121
|
+
refernce: string;
|
|
122
|
+
status: string;
|
|
123
|
+
display_text: string;
|
|
124
|
+
};
|
|
107
125
|
}
|
|
108
|
-
interface
|
|
126
|
+
interface ChargeCreatedWithPin extends Response {
|
|
127
|
+
data: {
|
|
128
|
+
refernce: string;
|
|
129
|
+
status: string;
|
|
130
|
+
};
|
|
109
131
|
}
|
|
110
|
-
interface
|
|
111
|
-
|
|
132
|
+
interface ChargeCreatedWithPhone extends Response {
|
|
133
|
+
data: {
|
|
134
|
+
refernce: string;
|
|
135
|
+
status: string;
|
|
136
|
+
display_text: string;
|
|
137
|
+
};
|
|
112
138
|
}
|
|
113
|
-
interface ChargeFailed {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Axios } from 'axios';
|
|
2
|
-
import {
|
|
3
|
-
import { CreateCustomer, CustomerCreated, CustomerData, ListCustomerQueryParams,
|
|
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<
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
92
|
+
return response;
|
|
99
93
|
});
|
|
100
94
|
}
|
|
101
95
|
}
|
|
@@ -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 {
|
|
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
|
|
8
|
-
metadata
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 {};
|
package/dist/paystack.d.ts
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
import { Charge } from './charge';
|
|
2
|
-
import { Customer } from './customer
|
|
2
|
+
import { Customer } from './customer';
|
|
3
3
|
import { Plan } from './plan';
|
|
4
|
+
import { Product } from './product/product';
|
|
5
|
+
import { Subscription } from './subscription/subscription';
|
|
4
6
|
import { Transaction } from './transaction';
|
|
7
|
+
import { Transfer } from './transfer/transfer';
|
|
5
8
|
/**
|
|
6
9
|
* Paystack SDK
|
|
7
|
-
* @author Asaju Enitan <@
|
|
10
|
+
* @author Asaju Enitan <@tPriest>
|
|
8
11
|
*/
|
|
9
12
|
export declare class Paystack {
|
|
10
13
|
readonly key: string;
|
|
11
14
|
private readonly http;
|
|
12
15
|
charge: Charge;
|
|
13
|
-
transaction: Transaction;
|
|
14
|
-
plan: Plan;
|
|
15
16
|
customer: Customer;
|
|
17
|
+
plan: Plan;
|
|
18
|
+
product: Product;
|
|
19
|
+
subscription: Subscription;
|
|
20
|
+
transaction: Transaction;
|
|
21
|
+
transfer: Transfer;
|
|
16
22
|
constructor(key: string);
|
|
17
23
|
}
|
package/dist/paystack.js
CHANGED
|
@@ -3,12 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Paystack = void 0;
|
|
4
4
|
const axios_1 = require("axios");
|
|
5
5
|
const charge_1 = require("./charge");
|
|
6
|
-
const customer_1 = require("./customer
|
|
6
|
+
const customer_1 = require("./customer");
|
|
7
7
|
const plan_1 = require("./plan");
|
|
8
|
+
const product_1 = require("./product/product");
|
|
9
|
+
const subscription_1 = require("./subscription/subscription");
|
|
8
10
|
const transaction_1 = require("./transaction");
|
|
11
|
+
const transfer_1 = require("./transfer/transfer");
|
|
9
12
|
/**
|
|
10
13
|
* Paystack SDK
|
|
11
|
-
* @author Asaju Enitan <@
|
|
14
|
+
* @author Asaju Enitan <@tPriest>
|
|
12
15
|
*/
|
|
13
16
|
class Paystack {
|
|
14
17
|
constructor(key) {
|
|
@@ -17,12 +20,17 @@ class Paystack {
|
|
|
17
20
|
baseURL: 'https://api.paystack.co',
|
|
18
21
|
headers: {
|
|
19
22
|
Authorization: `Bearer ${this.key}`,
|
|
23
|
+
'Content-Type': 'application/json',
|
|
20
24
|
},
|
|
21
25
|
});
|
|
26
|
+
this.http.interceptors.response.use((response) => (response.data = JSON.parse(response.data)));
|
|
22
27
|
this.charge = new charge_1.Charge(this.http);
|
|
23
|
-
this.transaction = new transaction_1.Transaction(this.http);
|
|
24
|
-
this.plan = new plan_1.Plan(this.http);
|
|
25
28
|
this.customer = new customer_1.Customer(this.http);
|
|
29
|
+
this.plan = new plan_1.Plan(this.http);
|
|
30
|
+
this.product = new product_1.Product(this.http);
|
|
31
|
+
this.subscription = new subscription_1.Subscription(this.http);
|
|
32
|
+
this.transaction = new transaction_1.Transaction(this.http);
|
|
33
|
+
this.transfer = new transfer_1.Transfer(this.http);
|
|
26
34
|
}
|
|
27
35
|
}
|
|
28
36
|
exports.Paystack = Paystack;
|