-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathtypes.d.ts
More file actions
51 lines (51 loc) · 1.5 KB
/
types.d.ts
File metadata and controls
51 lines (51 loc) · 1.5 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
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[];
}
interface PaystackMetadata {
[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;
accessCode?: string;
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'>;
export {};