Skip to content

Commit abc313e

Browse files
committed
2.6.0
1 parent 20b244e commit abc313e

File tree

4 files changed

+32
-19
lines changed

4 files changed

+32
-19
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "paystack-sdk",
3-
"version": "2.5.27",
3+
"version": "2.6.0",
44
"description": "Paystack SDK written in Typescript",
55
"main": "dist/index.js",
66
"author": "Tech Priest",

src/misc/interface.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export type Bank = {
66
code: string;
77
longcode: string;
88
gateway?: string;
9-
pay_with_bank: boolean
9+
pay_with_bank: boolean;
1010
active: boolean;
1111
is_deleted: boolean;
1212
country: string;
@@ -15,16 +15,20 @@ export type Bank = {
1515
id: number;
1616
createdAt: Date;
1717
updatedAt: Date;
18-
}
18+
};
1919

20-
type RelationshipType = "currency" | "integration_feature" | "integration_type" | "payment_method"
20+
type RelationshipType =
21+
| 'currency'
22+
| 'integration_feature'
23+
| 'integration_type'
24+
| 'payment_method';
2125

2226
type Relationship = {
2327
[K in RelationshipType]: {
2428
type: K;
2529
data: string[];
26-
}
27-
}
30+
};
31+
};
2832

2933
export type Country = {
3034
id: number;
@@ -33,13 +37,13 @@ export type Country = {
3337
default_currency_code: string;
3438
integration_defaults: Record<string, any>;
3539
relationships: Relationship;
36-
}
40+
};
3741

3842
export type State = {
3943
name: string;
4044
slug: string;
4145
abbreviation: string;
42-
}
46+
};
4347

4448
export type ListBanksQueryParams = {
4549
/**
@@ -113,7 +117,7 @@ export type ListBanksQueryParams = {
113117
* The returned value can be used in identifying institutions on NIP.
114118
*/
115119
include_nip_sort_code?: string;
116-
}
120+
};
117121

118122
export interface BanksResponse extends Response {
119123
data: Bank[];

src/misc/misc.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,32 @@
1-
import { Axios } from "axios";
2-
import { BadRequest } from "../interface";
3-
import { BanksResponse, CountriesResponse, ListBanksQueryParams, StatesResponse } from "./interface";
1+
import { Axios } from 'axios';
2+
import { BadRequest } from '../interface';
3+
import {
4+
BanksResponse,
5+
CountriesResponse,
6+
ListBanksQueryParams,
7+
StatesResponse,
8+
} from './interface';
49

510
export class Misc {
611
private http: Axios;
712
constructor(http: Axios) {
813
this.http = http;
914
}
1015

11-
async banks(query?: ListBanksQueryParams): Promise<BanksResponse | BadRequest> {
12-
return await this.http.get('/bank', { params: { ...query } })
16+
async banks(
17+
query?: ListBanksQueryParams,
18+
): Promise<BanksResponse | BadRequest> {
19+
return await this.http.get('/bank', { params: { ...query } });
1320
}
1421

1522
async countries(): Promise<CountriesResponse | BadRequest> {
16-
return await this.http.get('/country')
23+
return await this.http.get('/country');
1724
}
1825

1926
async states(country?: string): Promise<StatesResponse | BadRequest> {
20-
const query: { country?: string } = country ? { country } : {}
21-
return await this.http.get('/address_verification/states', { params: query })
27+
const query: { country?: string } = country ? { country } : {};
28+
return await this.http.get('/address_verification/states', {
29+
params: query,
30+
});
2231
}
2332
}

0 commit comments

Comments
 (0)