mainstack-payments 0.0.6 → 0.0.7
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/build/src/api/index.d.ts
CHANGED
|
@@ -8,11 +8,7 @@ export declare const useGetTransactionFees: ({ account_id, currency, amount, slu
|
|
|
8
8
|
}, AuthMSRequest: any) => {
|
|
9
9
|
data: any;
|
|
10
10
|
isLoading: boolean;
|
|
11
|
-
refetch: () => Promise<
|
|
12
|
-
data: {};
|
|
13
|
-
isSuccess: boolean;
|
|
14
|
-
error: {};
|
|
15
|
-
}>;
|
|
11
|
+
refetch: () => Promise<import('hooks/useApi').IFetchResponse>;
|
|
16
12
|
};
|
|
17
13
|
interface IInitPayment {
|
|
18
14
|
amount: number;
|
|
@@ -45,10 +41,17 @@ export declare const useChargePayment: (Request: any) => {
|
|
|
45
41
|
export declare const useVerifyPayment: (reference: string, Request: any) => {
|
|
46
42
|
data: any;
|
|
47
43
|
isLoading: boolean;
|
|
48
|
-
refetch: () => Promise<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
refetch: () => Promise<import('hooks/useApi').IFetchResponse>;
|
|
45
|
+
};
|
|
46
|
+
interface IApplyDiscount {
|
|
47
|
+
discount_code: string;
|
|
48
|
+
product_id: string;
|
|
49
|
+
account_id: string;
|
|
50
|
+
currency: string;
|
|
51
|
+
}
|
|
52
|
+
export declare const useApplyDiscount: ({ discount_code, product_id, account_id, currency }: IApplyDiscount, Request: any) => {
|
|
53
|
+
data: any;
|
|
54
|
+
isLoading: boolean;
|
|
55
|
+
refetch: () => Promise<import('hooks/useApi').IFetchResponse>;
|
|
53
56
|
};
|
|
54
57
|
export {};
|
|
@@ -4,6 +4,7 @@ import { TPaymentConfig } from 'types';
|
|
|
4
4
|
interface IMainstackPaymentProps {
|
|
5
5
|
paymentConfig: TPaymentConfig;
|
|
6
6
|
summaryTitle?: string | ReactNode;
|
|
7
|
+
checkoutTitle?: string | ReactNode;
|
|
7
8
|
customForm?: ReactNode;
|
|
8
9
|
customFormValidation?: {
|
|
9
10
|
[key: string]: any;
|
|
@@ -11,8 +12,14 @@ interface IMainstackPaymentProps {
|
|
|
11
12
|
customFormValues?: {
|
|
12
13
|
[key: string]: any;
|
|
13
14
|
};
|
|
15
|
+
defaultFormValues?: {
|
|
16
|
+
fullname?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
};
|
|
14
19
|
onGoBack: () => void;
|
|
15
|
-
onInitializePayment?: () =>
|
|
20
|
+
onInitializePayment?: () => Promise<{
|
|
21
|
+
terminate?: boolean;
|
|
22
|
+
}>;
|
|
16
23
|
onPaymentComplete: (payload: object) => void;
|
|
17
24
|
}
|
|
18
25
|
declare const MainstackPayment: import('react').ForwardRefExoticComponent<IMainstackPaymentProps & import('react').RefAttributes<unknown>>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
export interface IFetchResponse {
|
|
2
|
+
data: any;
|
|
3
|
+
isSuccess: boolean;
|
|
4
|
+
error: any;
|
|
5
|
+
}
|
|
1
6
|
export declare const useQuery: ({ queryFn, enabled, dependingOn, }: {
|
|
2
7
|
queryFn: () => Promise<any>;
|
|
3
8
|
enabled?: boolean | undefined;
|
|
@@ -5,11 +10,7 @@ export declare const useQuery: ({ queryFn, enabled, dependingOn, }: {
|
|
|
5
10
|
}) => {
|
|
6
11
|
data: any;
|
|
7
12
|
isLoading: boolean;
|
|
8
|
-
refetch: () => Promise<
|
|
9
|
-
data: {};
|
|
10
|
-
isSuccess: boolean;
|
|
11
|
-
error: {};
|
|
12
|
-
}>;
|
|
13
|
+
refetch: () => Promise<IFetchResponse>;
|
|
13
14
|
};
|
|
14
15
|
export declare const useMutation: <T>({ mutationFn, }: {
|
|
15
16
|
mutationFn: (data: T) => Promise<any>;
|
|
@@ -15,6 +15,9 @@ type TCustomizations = {
|
|
|
15
15
|
theme_color?: string;
|
|
16
16
|
button_label?: string;
|
|
17
17
|
font_family?: string;
|
|
18
|
+
hideDetails?: boolean;
|
|
19
|
+
hideNameInput?: boolean;
|
|
20
|
+
padding?: string;
|
|
18
21
|
};
|
|
19
22
|
type TPaymentConfig = {
|
|
20
23
|
reference: string;
|
|
@@ -31,5 +34,7 @@ type TPaymentConfig = {
|
|
|
31
34
|
accountId: string;
|
|
32
35
|
userAllowsWalletPayment: boolean;
|
|
33
36
|
userAllowsCardPayment: boolean;
|
|
37
|
+
hasDiscountCode?: boolean;
|
|
38
|
+
disableTransactionFees?: boolean;
|
|
34
39
|
};
|
|
35
40
|
export type { TPaymentConfig, TMetadata, TCustomizations, TPaymentOption };
|