-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathtypes.ts
More file actions
66 lines (56 loc) · 1.4 KB
/
types.ts
File metadata and controls
66 lines (56 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
export type Currency = 'NGN' | 'GHS' | 'USD' | 'ZAR' | 'KES' | 'XOF';
export type PaymentChannels =
| 'bank'
| 'card'
| 'qr'
| 'ussd'
| 'mobile_money'
| 'eft'
| 'bank_transfer'
| 'payattitude';
type Bearer = 'account' | 'subaccount';
type phone = number | string;
interface PaystackCustomFields {
display_name: string;
variable_name: string;
value: any;
}
interface PaystackMetadata {
custom_fields?: PaystackCustomFields[];
[key: string]: any;
}
interface PaystackConnectSplit {
account_id: string;
share: number;
}
export type callback = (response?: any) => void;
export interface PaystackProps {
publicKey: string;
email: string;
amount: number;
firstname?: string;
lastname?: string;
phone?: phone;
reference?: string;
metadata?: PaystackMetadata;
currency?: Currency | string;
channels?: PaymentChannels[] | string[];
label?: string;
plan?: string;
quantity?: number;
subaccount?: string;
transaction_charge?: number;
bearer?: Bearer;
split_code?: string;
split?: Record<string, any>;
connect_split?: PaystackConnectSplit[];
connect_account?: string;
onBankTransferConfirmationPending?: callback;
}
export type InitializePayment = (options: {
onSuccess?: callback;
onClose?: callback;
config?: Omit<PaystackProps, 'publicKey'>;
}) => void;
export type HookConfig = Omit<Partial<PaystackProps>, 'publicKey'> &
Pick<PaystackProps, 'publicKey'>;