paystack-sdk 2.5.27 → 3.2.0
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/README.md +1 -1
- package/dist/apple/apple.js +7 -22
- package/dist/apple/interface.d.ts +2 -2
- package/dist/bulkcharge/bulkcharge.js +13 -34
- package/dist/charge/charge.js +15 -38
- package/dist/customer/customer.js +15 -38
- package/dist/dedicated/dedicated.js +16 -39
- package/dist/interface.d.ts +1 -1
- package/dist/invoice/interface.d.ts +1 -1
- package/dist/invoice/invoice.js +19 -46
- package/dist/misc/interface.d.ts +109 -0
- package/dist/misc/interface.js +2 -0
- package/dist/misc/misc.d.ts +10 -0
- package/dist/misc/misc.js +21 -0
- package/dist/payment/payment.js +12 -33
- package/dist/paystack.d.ts +2 -0
- package/dist/paystack.js +8 -3
- package/dist/plan/index.js +5 -1
- package/dist/plan/plan.js +9 -26
- package/dist/product/product.js +9 -26
- package/dist/recipient/recipient.js +18 -37
- package/dist/refund/refund.js +7 -22
- package/dist/settlement/interface.d.ts +2 -2
- package/dist/settlement/settlement.js +5 -18
- package/dist/split/interface.d.ts +2 -2
- package/dist/split/split.js +29 -50
- package/dist/subaccounts/subaccount.js +8 -25
- package/dist/subscription/index.js +5 -1
- package/dist/subscription/subscription.js +20 -43
- package/dist/transaction/transaction.js +23 -52
- package/dist/transfer/control.js +12 -33
- package/dist/transfer/transfer.js +13 -34
- package/dist/verification/interface.d.ts +2 -2
- package/dist/verification/verification.js +6 -21
- package/package.json +9 -6
package/README.md
CHANGED
package/dist/apple/apple.js
CHANGED
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.ApplePay = void 0;
|
|
13
4
|
class ApplePay {
|
|
14
5
|
constructor(http) {
|
|
15
6
|
this.http = http;
|
|
16
7
|
}
|
|
17
|
-
registerDomain(domainName) {
|
|
18
|
-
return
|
|
19
|
-
return yield this.http.post('/apple-pay/domain', JSON.stringify({ domainName }));
|
|
20
|
-
});
|
|
8
|
+
async registerDomain(domainName) {
|
|
9
|
+
return await this.http.post('/apple-pay/domain', JSON.stringify({ domainName }));
|
|
21
10
|
}
|
|
22
|
-
listDomains() {
|
|
23
|
-
return
|
|
24
|
-
return yield this.http.get('/apple-pay');
|
|
25
|
-
});
|
|
11
|
+
async listDomains() {
|
|
12
|
+
return await this.http.get('/apple-pay');
|
|
26
13
|
}
|
|
27
|
-
unregisterDomain(domainName) {
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
params: { domainName },
|
|
31
|
-
});
|
|
14
|
+
async unregisterDomain(domainName) {
|
|
15
|
+
return await this.http.delete('/apple-pay', {
|
|
16
|
+
params: { domainName },
|
|
32
17
|
});
|
|
33
18
|
}
|
|
34
19
|
}
|
|
@@ -2,8 +2,8 @@ export interface Response {
|
|
|
2
2
|
status: boolean;
|
|
3
3
|
message: string;
|
|
4
4
|
}
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type DomainRegisterResponse = Response;
|
|
6
|
+
export type UnregisterDomainRegisterResponse = Response;
|
|
7
7
|
export interface ListDomainsResponse extends Response {
|
|
8
8
|
data: {
|
|
9
9
|
domainNames: string[];
|
|
@@ -1,50 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.BulkCharge = void 0;
|
|
13
4
|
class BulkCharge {
|
|
14
5
|
constructor(http) {
|
|
15
6
|
this.http = http;
|
|
16
7
|
}
|
|
17
|
-
initiate(data) {
|
|
18
|
-
return
|
|
19
|
-
return yield this.http.post('/bulkcharge', JSON.stringify(data));
|
|
20
|
-
});
|
|
8
|
+
async initiate(data) {
|
|
9
|
+
return await this.http.post('/bulkcharge', JSON.stringify(data));
|
|
21
10
|
}
|
|
22
|
-
list(queryParams) {
|
|
23
|
-
return
|
|
24
|
-
return yield this.http.get('/bulkcharge', { params: Object.assign({}, queryParams) });
|
|
25
|
-
});
|
|
11
|
+
async list(queryParams) {
|
|
12
|
+
return await this.http.get('/bulkcharge', { params: { ...queryParams } });
|
|
26
13
|
}
|
|
27
|
-
fetchBulkCharge(id) {
|
|
28
|
-
return
|
|
29
|
-
return yield this.http.get(`/bulkcharge/${id}`);
|
|
30
|
-
});
|
|
14
|
+
async fetchBulkCharge(id) {
|
|
15
|
+
return await this.http.get(`/bulkcharge/${id}`);
|
|
31
16
|
}
|
|
32
|
-
fetchBatchChrges(id, queryParams) {
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
params: Object.assign({}, queryParams),
|
|
36
|
-
});
|
|
17
|
+
async fetchBatchChrges(id, queryParams) {
|
|
18
|
+
return await this.http.get(`/bulkcharge/${id}/charges`, {
|
|
19
|
+
params: { ...queryParams },
|
|
37
20
|
});
|
|
38
21
|
}
|
|
39
|
-
pause(batchCode) {
|
|
40
|
-
return
|
|
41
|
-
return yield this.http.get(`/bulkcharge/pause/${batchCode}`);
|
|
42
|
-
});
|
|
22
|
+
async pause(batchCode) {
|
|
23
|
+
return await this.http.get(`/bulkcharge/pause/${batchCode}`);
|
|
43
24
|
}
|
|
44
|
-
resume(batchCode) {
|
|
45
|
-
return
|
|
46
|
-
return yield this.http.get(`/bulkcharge/resume/${batchCode}`);
|
|
47
|
-
});
|
|
25
|
+
async resume(batchCode) {
|
|
26
|
+
return await this.http.get(`/bulkcharge/resume/${batchCode}`);
|
|
48
27
|
}
|
|
49
28
|
}
|
|
50
29
|
exports.BulkCharge = BulkCharge;
|
package/dist/charge/charge.js
CHANGED
|
@@ -1,54 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Charge = void 0;
|
|
13
4
|
class Charge {
|
|
14
5
|
constructor(http) {
|
|
15
6
|
this.http = http;
|
|
16
7
|
}
|
|
17
|
-
create(data) {
|
|
18
|
-
return
|
|
19
|
-
return yield this.http.post('/charge', JSON.stringify(data));
|
|
20
|
-
});
|
|
8
|
+
async create(data) {
|
|
9
|
+
return await this.http.post('/charge', JSON.stringify(data));
|
|
21
10
|
}
|
|
22
|
-
submitPIN(data) {
|
|
23
|
-
return
|
|
24
|
-
return yield this.http.post('/charge/submit_pin', JSON.stringify(data));
|
|
25
|
-
});
|
|
11
|
+
async submitPIN(data) {
|
|
12
|
+
return await this.http.post('/charge/submit_pin', JSON.stringify(data));
|
|
26
13
|
}
|
|
27
|
-
submitOTP(data) {
|
|
28
|
-
return
|
|
29
|
-
return yield this.http.post('/charge/submit_otp', JSON.stringify(data));
|
|
30
|
-
});
|
|
14
|
+
async submitOTP(data) {
|
|
15
|
+
return await this.http.post('/charge/submit_otp', JSON.stringify(data));
|
|
31
16
|
}
|
|
32
|
-
submitPhone(data) {
|
|
33
|
-
return
|
|
34
|
-
return yield this.http.post('/charge/submit_phone', JSON.stringify(data));
|
|
35
|
-
});
|
|
17
|
+
async submitPhone(data) {
|
|
18
|
+
return await this.http.post('/charge/submit_phone', JSON.stringify(data));
|
|
36
19
|
}
|
|
37
|
-
submitBirthday(data) {
|
|
38
|
-
return
|
|
39
|
-
return yield this.http.post('/charge/submit_birthday', JSON.stringify(data));
|
|
40
|
-
});
|
|
20
|
+
async submitBirthday(data) {
|
|
21
|
+
return await this.http.post('/charge/submit_birthday', JSON.stringify(data));
|
|
41
22
|
}
|
|
42
|
-
submitAddress(data) {
|
|
43
|
-
return
|
|
44
|
-
return yield this.http.post('/charge/submit_address', JSON.stringify(data));
|
|
45
|
-
});
|
|
23
|
+
async submitAddress(data) {
|
|
24
|
+
return await this.http.post('/charge/submit_address', JSON.stringify(data));
|
|
46
25
|
}
|
|
47
|
-
checkPending(reference) {
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
params: { reference },
|
|
51
|
-
});
|
|
26
|
+
async checkPending(reference) {
|
|
27
|
+
return await this.http.get('/charge/submit_address', {
|
|
28
|
+
params: { reference },
|
|
52
29
|
});
|
|
53
30
|
}
|
|
54
31
|
}
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Customer = void 0;
|
|
13
4
|
/**
|
|
@@ -24,20 +15,16 @@ class Customer {
|
|
|
24
15
|
* Create a customer on your integration
|
|
25
16
|
* @param {CreateCustomer} data
|
|
26
17
|
*/
|
|
27
|
-
create(data) {
|
|
28
|
-
return
|
|
29
|
-
return yield this.http.post('/customer', JSON.stringify(data));
|
|
30
|
-
});
|
|
18
|
+
async create(data) {
|
|
19
|
+
return await this.http.post('/customer', JSON.stringify(data));
|
|
31
20
|
}
|
|
32
21
|
/**
|
|
33
22
|
* ## List Customers
|
|
34
23
|
* List customers available on your integration
|
|
35
24
|
*/
|
|
36
|
-
list(queryParams) {
|
|
37
|
-
return
|
|
38
|
-
|
|
39
|
-
params: Object.assign({}, queryParams),
|
|
40
|
-
});
|
|
25
|
+
async list(queryParams) {
|
|
26
|
+
return await this.http.get('/customer', {
|
|
27
|
+
params: { ...queryParams },
|
|
41
28
|
});
|
|
42
29
|
}
|
|
43
30
|
/**
|
|
@@ -45,46 +32,36 @@ class Customer {
|
|
|
45
32
|
* Get details of a customer on your integration
|
|
46
33
|
* @param {String} email_or_code
|
|
47
34
|
*/
|
|
48
|
-
fetch(emailCode) {
|
|
49
|
-
return
|
|
50
|
-
return yield this.http.get(`/customer/${emailCode}`);
|
|
51
|
-
});
|
|
35
|
+
async fetch(emailCode) {
|
|
36
|
+
return await this.http.get(`/customer/${emailCode}`);
|
|
52
37
|
}
|
|
53
38
|
/**
|
|
54
39
|
* ## Update CUstomer
|
|
55
40
|
* Update a customer's details on your integration
|
|
56
41
|
*/
|
|
57
|
-
update(code, data) {
|
|
58
|
-
return
|
|
59
|
-
return yield this.http.put(`/customer/${code}`, JSON.stringify(data));
|
|
60
|
-
});
|
|
42
|
+
async update(code, data) {
|
|
43
|
+
return await this.http.put(`/customer/${code}`, JSON.stringify(data));
|
|
61
44
|
}
|
|
62
45
|
/**
|
|
63
46
|
* ## Validate Customer
|
|
64
47
|
* Validate a customer's identity
|
|
65
48
|
*/
|
|
66
|
-
validate(customerCode, data) {
|
|
67
|
-
return
|
|
68
|
-
return yield this.http.post(`/customer/${customerCode}/identification`, JSON.stringify(data));
|
|
69
|
-
});
|
|
49
|
+
async validate(customerCode, data) {
|
|
50
|
+
return await this.http.post(`/customer/${customerCode}/identification`, JSON.stringify(data));
|
|
70
51
|
}
|
|
71
52
|
/**
|
|
72
53
|
* ## Whitelist/Blacklist Customer
|
|
73
54
|
* Whitelist or black a customer on your integration
|
|
74
55
|
*/
|
|
75
|
-
setRiskAction(data) {
|
|
76
|
-
return
|
|
77
|
-
return yield this.http.post('/customer/set_risk_action', JSON.stringify(data));
|
|
78
|
-
});
|
|
56
|
+
async setRiskAction(data) {
|
|
57
|
+
return await this.http.post('/customer/set_risk_action', JSON.stringify(data));
|
|
79
58
|
}
|
|
80
59
|
/**
|
|
81
60
|
* ## Deactivate Authorization
|
|
82
61
|
* Deactivate an authorization when the card needs to be forgotten
|
|
83
62
|
*/
|
|
84
|
-
deactivateAutorization(authorizationCode) {
|
|
85
|
-
return
|
|
86
|
-
return yield this.http.post('/customer/deactivate_authorization', JSON.stringify({ authorizaion_code: authorizationCode }));
|
|
87
|
-
});
|
|
63
|
+
async deactivateAutorization(authorizationCode) {
|
|
64
|
+
return await this.http.post('/customer/deactivate_authorization', JSON.stringify({ authorizaion_code: authorizationCode }));
|
|
88
65
|
}
|
|
89
66
|
}
|
|
90
67
|
exports.Customer = Customer;
|
|
@@ -1,57 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.DedicatedAccount = void 0;
|
|
13
4
|
class DedicatedAccount {
|
|
14
5
|
constructor(http) {
|
|
15
6
|
this.http = http;
|
|
16
7
|
}
|
|
17
|
-
create(data) {
|
|
18
|
-
return
|
|
19
|
-
return yield this.http.post('/dedicated_account', JSON.stringify(data));
|
|
20
|
-
});
|
|
8
|
+
async create(data) {
|
|
9
|
+
return await this.http.post('/dedicated_account', JSON.stringify(data));
|
|
21
10
|
}
|
|
22
|
-
list(queryParams) {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
params: Object.assign({}, queryParams),
|
|
26
|
-
});
|
|
11
|
+
async list(queryParams) {
|
|
12
|
+
return await this.http.get('/dedicated_account', {
|
|
13
|
+
params: { ...queryParams },
|
|
27
14
|
});
|
|
28
15
|
}
|
|
29
|
-
fetch(dedicatedAccountId) {
|
|
30
|
-
return
|
|
31
|
-
return yield this.http.get(`/dedicated_account/${dedicatedAccountId}`);
|
|
32
|
-
});
|
|
16
|
+
async fetch(dedicatedAccountId) {
|
|
17
|
+
return await this.http.get(`/dedicated_account/${dedicatedAccountId}`);
|
|
33
18
|
}
|
|
34
|
-
deactivate(dedicatedAccountId) {
|
|
35
|
-
return
|
|
36
|
-
return yield this.http.delete(`/dedicated_account/${dedicatedAccountId}`);
|
|
37
|
-
});
|
|
19
|
+
async deactivate(dedicatedAccountId) {
|
|
20
|
+
return await this.http.delete(`/dedicated_account/${dedicatedAccountId}`);
|
|
38
21
|
}
|
|
39
|
-
splitTransaction(data) {
|
|
40
|
-
return
|
|
41
|
-
return yield this.http.post('/dedicated_account/split', JSON.stringify(data));
|
|
42
|
-
});
|
|
22
|
+
async splitTransaction(data) {
|
|
23
|
+
return await this.http.post('/dedicated_account/split', JSON.stringify(data));
|
|
43
24
|
}
|
|
44
|
-
removeSplit(accountNumber) {
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
data: { account_number: accountNumber },
|
|
48
|
-
});
|
|
25
|
+
async removeSplit(accountNumber) {
|
|
26
|
+
return await this.http.delete('/dedicated_account/split', {
|
|
27
|
+
data: { account_number: accountNumber },
|
|
49
28
|
});
|
|
50
29
|
}
|
|
51
|
-
providers() {
|
|
52
|
-
return
|
|
53
|
-
return yield this.http.get('/dedicated_account/available_providers');
|
|
54
|
-
});
|
|
30
|
+
async providers() {
|
|
31
|
+
return await this.http.get('/dedicated_account/available_providers');
|
|
55
32
|
}
|
|
56
33
|
}
|
|
57
34
|
exports.DedicatedAccount = DedicatedAccount;
|
package/dist/interface.d.ts
CHANGED
|
@@ -42,4 +42,4 @@ export interface QueryParams {
|
|
|
42
42
|
* For example, if a customer is supposed to make a payment of NGN 100,
|
|
43
43
|
* you would send 10000 = 100 * 100 in your request.
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type Currency = 'NGN' | 'USD' | 'GHS' | 'ZAR' | 'KES';
|
|
@@ -67,7 +67,7 @@ export interface InvoiceQueryParams extends QueryParams {
|
|
|
67
67
|
/** Show archived invoices */
|
|
68
68
|
include_archive?: string;
|
|
69
69
|
}
|
|
70
|
-
export
|
|
70
|
+
export type UpdateInvoice = CreateInvoice;
|
|
71
71
|
interface InvoiceLineItem {
|
|
72
72
|
name: string;
|
|
73
73
|
amount: number;
|
package/dist/invoice/invoice.js
CHANGED
|
@@ -1,65 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Invoice = void 0;
|
|
13
4
|
class Invoice {
|
|
14
5
|
constructor(http) {
|
|
15
6
|
this.http = http;
|
|
16
7
|
}
|
|
17
|
-
create(data) {
|
|
18
|
-
return
|
|
19
|
-
return yield this.http.post('/paymentrequest', JSON.stringify(data));
|
|
20
|
-
});
|
|
8
|
+
async create(data) {
|
|
9
|
+
return await this.http.post('/paymentrequest', JSON.stringify(data));
|
|
21
10
|
}
|
|
22
|
-
list(queryParams) {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
params: Object.assign({}, queryParams),
|
|
26
|
-
});
|
|
11
|
+
async list(queryParams) {
|
|
12
|
+
return await this.http.get('/paymentrequest', {
|
|
13
|
+
params: { ...queryParams },
|
|
27
14
|
});
|
|
28
15
|
}
|
|
29
|
-
view(id) {
|
|
30
|
-
return
|
|
31
|
-
return yield this.http.get(`'/paymentrequest/${id}`);
|
|
32
|
-
});
|
|
16
|
+
async view(id) {
|
|
17
|
+
return await this.http.get(`'/paymentrequest/${id}`);
|
|
33
18
|
}
|
|
34
|
-
verify(code) {
|
|
35
|
-
return
|
|
36
|
-
return yield this.http.get(`/paymentrequest/verify/${code}`);
|
|
37
|
-
});
|
|
19
|
+
async verify(code) {
|
|
20
|
+
return await this.http.get(`/paymentrequest/verify/${code}`);
|
|
38
21
|
}
|
|
39
|
-
sendNotification(code) {
|
|
40
|
-
return
|
|
41
|
-
return yield this.http.post(`/paymentrequest/notify/${code}`);
|
|
42
|
-
});
|
|
22
|
+
async sendNotification(code) {
|
|
23
|
+
return await this.http.post(`/paymentrequest/notify/${code}`);
|
|
43
24
|
}
|
|
44
|
-
total() {
|
|
45
|
-
return
|
|
46
|
-
return yield this.http.get('/paymentrequest/totals');
|
|
47
|
-
});
|
|
25
|
+
async total() {
|
|
26
|
+
return await this.http.get('/paymentrequest/totals');
|
|
48
27
|
}
|
|
49
|
-
finalize(code) {
|
|
50
|
-
return
|
|
51
|
-
return yield this.http.post(`/paymentrequest/finalize/${code}`);
|
|
52
|
-
});
|
|
28
|
+
async finalize(code) {
|
|
29
|
+
return await this.http.post(`/paymentrequest/finalize/${code}`);
|
|
53
30
|
}
|
|
54
|
-
update(id, data) {
|
|
55
|
-
return
|
|
56
|
-
return yield this.http.put(`/paymentrequest/${id}`, JSON.stringify(data));
|
|
57
|
-
});
|
|
31
|
+
async update(id, data) {
|
|
32
|
+
return await this.http.put(`/paymentrequest/${id}`, JSON.stringify(data));
|
|
58
33
|
}
|
|
59
|
-
archive(code) {
|
|
60
|
-
return
|
|
61
|
-
return yield this.http.post(`/paymentrequest/archive/${code}`);
|
|
62
|
-
});
|
|
34
|
+
async archive(code) {
|
|
35
|
+
return await this.http.post(`/paymentrequest/archive/${code}`);
|
|
63
36
|
}
|
|
64
37
|
}
|
|
65
38
|
exports.Invoice = Invoice;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { Response } from '../interface';
|
|
2
|
+
export type Bank = {
|
|
3
|
+
name: string;
|
|
4
|
+
slug: string;
|
|
5
|
+
code: string;
|
|
6
|
+
longcode: string;
|
|
7
|
+
gateway?: string;
|
|
8
|
+
pay_with_bank: boolean;
|
|
9
|
+
active: boolean;
|
|
10
|
+
is_deleted: boolean;
|
|
11
|
+
country: string;
|
|
12
|
+
currency: string;
|
|
13
|
+
type: string;
|
|
14
|
+
id: number;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
};
|
|
18
|
+
type RelationshipType = 'currency' | 'integration_feature' | 'integration_type' | 'payment_method';
|
|
19
|
+
type Relationship = {
|
|
20
|
+
[K in RelationshipType]: {
|
|
21
|
+
type: K;
|
|
22
|
+
data: string[];
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type Country = {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
iso_code: string;
|
|
29
|
+
default_currency_code: string;
|
|
30
|
+
integration_defaults: Record<string, any>;
|
|
31
|
+
relationships: Relationship;
|
|
32
|
+
};
|
|
33
|
+
export type State = {
|
|
34
|
+
name: string;
|
|
35
|
+
slug: string;
|
|
36
|
+
abbreviation: string;
|
|
37
|
+
};
|
|
38
|
+
export type ListBanksQueryParams = {
|
|
39
|
+
/**
|
|
40
|
+
* The country from which to obtain the list of supported banks.
|
|
41
|
+
* Accepted values are: `ghana`, `kenya`, `nigeria`, `south africa`
|
|
42
|
+
*/
|
|
43
|
+
country?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Flag to enable cursor pagination on the endpoint
|
|
46
|
+
*/
|
|
47
|
+
use_cursor?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The number of objects to return per page.
|
|
50
|
+
* Defaults to `50`, and limited to `100` records per page.
|
|
51
|
+
*/
|
|
52
|
+
perPage?: number;
|
|
53
|
+
/**
|
|
54
|
+
* A flag to filter for available banks a customer can make
|
|
55
|
+
* a transfer to complete a payment
|
|
56
|
+
*/
|
|
57
|
+
pay_with_bank_transfer?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* A flag to filter for banks a customer can pay directly from
|
|
60
|
+
*/
|
|
61
|
+
pay_with_bank?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* A flag to filter the banks that are supported for account
|
|
64
|
+
* verification in South Africa. You need to combine this with
|
|
65
|
+
* either the currency or country filter.
|
|
66
|
+
*/
|
|
67
|
+
enabled_for_verification?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* A cursor that indicates your place in the list.
|
|
70
|
+
* It can be used to fetch the next page of the list
|
|
71
|
+
*/
|
|
72
|
+
next?: string;
|
|
73
|
+
/**
|
|
74
|
+
* A cursor that indicates your place in the list.
|
|
75
|
+
* It should be used to fetch the previous page of the list
|
|
76
|
+
* after an initial next request
|
|
77
|
+
*/
|
|
78
|
+
previous?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The gateway type of the bank.
|
|
81
|
+
* It can be one of these: `['emandate', 'digitalbankmandate']`
|
|
82
|
+
*/
|
|
83
|
+
gateway?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Type of financial channel.
|
|
86
|
+
* For Ghanaian channels, please use either **mobile_money** for
|
|
87
|
+
* mobile money channels OR **ghipps** for bank channels
|
|
88
|
+
*/
|
|
89
|
+
type?: string;
|
|
90
|
+
/**
|
|
91
|
+
* One of the [supported currency](https://paystack.com/docs/api/#supported-currency)
|
|
92
|
+
*/
|
|
93
|
+
currency?: string;
|
|
94
|
+
/**
|
|
95
|
+
* A flag that returns Nigerian banks with their nip institution code.
|
|
96
|
+
* The returned value can be used in identifying institutions on NIP.
|
|
97
|
+
*/
|
|
98
|
+
include_nip_sort_code?: string;
|
|
99
|
+
};
|
|
100
|
+
export interface BanksResponse extends Response {
|
|
101
|
+
data: Bank[];
|
|
102
|
+
}
|
|
103
|
+
export interface CountriesResponse extends Response {
|
|
104
|
+
data: Country[];
|
|
105
|
+
}
|
|
106
|
+
export interface StatesResponse extends Response {
|
|
107
|
+
data: State[];
|
|
108
|
+
}
|
|
109
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Axios } from 'axios';
|
|
2
|
+
import { BadRequest } from '../interface';
|
|
3
|
+
import { BanksResponse, CountriesResponse, ListBanksQueryParams, StatesResponse } from './interface';
|
|
4
|
+
export declare class Misc {
|
|
5
|
+
private http;
|
|
6
|
+
constructor(http: Axios);
|
|
7
|
+
banks(query?: ListBanksQueryParams): Promise<BanksResponse | BadRequest>;
|
|
8
|
+
countries(): Promise<CountriesResponse | BadRequest>;
|
|
9
|
+
states(country?: string): Promise<StatesResponse | BadRequest>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Misc = void 0;
|
|
4
|
+
class Misc {
|
|
5
|
+
constructor(http) {
|
|
6
|
+
this.http = http;
|
|
7
|
+
}
|
|
8
|
+
async banks(query) {
|
|
9
|
+
return await this.http.get('/bank', { params: { ...query } });
|
|
10
|
+
}
|
|
11
|
+
async countries() {
|
|
12
|
+
return await this.http.get('/country');
|
|
13
|
+
}
|
|
14
|
+
async states(country) {
|
|
15
|
+
const query = country ? { country } : {};
|
|
16
|
+
return await this.http.get('/address_verification/states', {
|
|
17
|
+
params: query,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.Misc = Misc;
|