mainstack-payments 1.0.50 → 1.0.52
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/CashAppPayment-e2e1cc87.js +142 -0
- package/build/CryptoPayments-657f142e.js +117 -0
- package/build/index-a66753aa.js +29209 -0
- package/build/mainstack-payments.js +22 -29347
- package/build/src/api/index.d.ts +4 -4
- package/build/src/components/Payment.d.ts +2 -12
- package/build/src/hooks/usePaystackPayment.d.ts +3 -3
- package/build/src/types/index.d.ts +19 -5
- package/package.json +1 -1
package/build/src/api/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TAPIMetadata } from 'types';
|
|
2
2
|
|
|
3
3
|
export declare const useGetTransactionFees: ({ account_id, currency, amount, slug, apply_tranche_fee, ip, country, postal_code, product_id, apply_switching_fee, apply_currency_conversion_fee, }: {
|
|
4
4
|
account_id: string;
|
|
@@ -22,7 +22,7 @@ interface IInitPayment {
|
|
|
22
22
|
amount: number;
|
|
23
23
|
reference: string;
|
|
24
24
|
currency: string;
|
|
25
|
-
metadata:
|
|
25
|
+
metadata: TAPIMetadata;
|
|
26
26
|
is_crypto_payment?: boolean;
|
|
27
27
|
is_cashapp_payment?: boolean;
|
|
28
28
|
}
|
|
@@ -38,7 +38,7 @@ interface IChargePayment {
|
|
|
38
38
|
amount: number;
|
|
39
39
|
currency: string;
|
|
40
40
|
callback_url?: string;
|
|
41
|
-
metadata:
|
|
41
|
+
metadata: TAPIMetadata;
|
|
42
42
|
}
|
|
43
43
|
export declare const useChargePayment: (Request: any) => {
|
|
44
44
|
data: any;
|
|
@@ -52,7 +52,7 @@ interface IIntentPayment {
|
|
|
52
52
|
amount: number;
|
|
53
53
|
currency: string;
|
|
54
54
|
payment_method_id?: string;
|
|
55
|
-
metadata:
|
|
55
|
+
metadata: TAPIMetadata;
|
|
56
56
|
is_crypto_payment?: boolean;
|
|
57
57
|
is_cashapp_payment?: boolean;
|
|
58
58
|
}
|
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { TError, TPaymentConfig } from 'types';
|
|
2
|
+
import { TDefaultFormValues, TError, TPaymentConfig } from 'types';
|
|
3
3
|
|
|
4
4
|
export interface IMainstackPaymentProps {
|
|
5
5
|
paymentConfig: TPaymentConfig;
|
|
6
6
|
summaryTitle?: string | ReactNode;
|
|
7
7
|
checkoutTitle?: string | ReactNode;
|
|
8
8
|
customForm?: ReactNode;
|
|
9
|
-
|
|
10
|
-
[key: string]: any;
|
|
11
|
-
};
|
|
12
|
-
customFormValues?: {
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
};
|
|
15
|
-
defaultFormValues?: {
|
|
16
|
-
fullname?: string;
|
|
17
|
-
email?: string;
|
|
18
|
-
phone?: string;
|
|
19
|
-
};
|
|
9
|
+
defaultFormValues?: TDefaultFormValues;
|
|
20
10
|
contactForm?: ReactNode;
|
|
21
11
|
preCheckoutBanner?: ReactNode;
|
|
22
12
|
height?: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { TAPIMetadata } from 'types';
|
|
3
3
|
|
|
4
4
|
type TInitPayload = {
|
|
5
5
|
amount: number;
|
|
6
6
|
currency: string;
|
|
7
7
|
reference: string;
|
|
8
|
-
metadata:
|
|
8
|
+
metadata: TAPIMetadata;
|
|
9
9
|
};
|
|
10
10
|
type TChargePayload = {
|
|
11
11
|
amount: number;
|
|
12
12
|
currency: string;
|
|
13
|
-
metadata:
|
|
13
|
+
metadata: TAPIMetadata;
|
|
14
14
|
callback_url?: string;
|
|
15
15
|
};
|
|
16
16
|
interface IProps {
|
|
@@ -3,21 +3,30 @@ type TPaymentOption = "wallet" | "startbutton" | "stripe" | "paystack" | "crypto
|
|
|
3
3
|
type TPaymentMode = "card" | "transfer" | "mobile_money";
|
|
4
4
|
type TPaymentModel = "ips" | "default";
|
|
5
5
|
type TMetadata = {
|
|
6
|
-
reference?: string;
|
|
7
|
-
actual_price?: string;
|
|
8
6
|
type: string;
|
|
9
7
|
account_id: string;
|
|
10
8
|
user_id: string;
|
|
11
9
|
product_id: string;
|
|
12
10
|
mainstack_product_type: "store" | "editor" | "bookings" | "mediakit" | "invoicing" | "hosted_courses";
|
|
13
11
|
productName: string;
|
|
14
|
-
productImage: string;
|
|
15
12
|
quantity: number;
|
|
13
|
+
};
|
|
14
|
+
type TClientMetadata = TMetadata & {
|
|
15
|
+
productImage: string;
|
|
16
16
|
ticket_payload?: string;
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
payment_mode?: TPaymentMode;
|
|
19
19
|
cart_id?: string;
|
|
20
20
|
};
|
|
21
|
+
type TAPIMetadata = TMetadata & {
|
|
22
|
+
reference: string;
|
|
23
|
+
actual_price: string;
|
|
24
|
+
payment_mode?: TPaymentMode;
|
|
25
|
+
email: string;
|
|
26
|
+
name: string;
|
|
27
|
+
phone_number?: string;
|
|
28
|
+
[key: string]: any;
|
|
29
|
+
};
|
|
21
30
|
type TCustomizations = {
|
|
22
31
|
theme_color?: string;
|
|
23
32
|
button_label?: string;
|
|
@@ -45,7 +54,7 @@ type TPaymentConfig = TCryptoPaymentConfig & {
|
|
|
45
54
|
currency: string;
|
|
46
55
|
amount: number;
|
|
47
56
|
discountAmount?: number;
|
|
48
|
-
metadata:
|
|
57
|
+
metadata: TClientMetadata;
|
|
49
58
|
customizations?: TCustomizations;
|
|
50
59
|
transactionFeesSlug: string;
|
|
51
60
|
paymentOptions?: TPaymentOption[];
|
|
@@ -86,4 +95,9 @@ type TItemList = {
|
|
|
86
95
|
type TError = {
|
|
87
96
|
message: string;
|
|
88
97
|
};
|
|
89
|
-
|
|
98
|
+
type TDefaultFormValues = {
|
|
99
|
+
fullname?: string;
|
|
100
|
+
email?: string;
|
|
101
|
+
phone?: string;
|
|
102
|
+
};
|
|
103
|
+
export type { TPaymentConfig, TMetadata, TClientMetadata, TAPIMetadata, TCustomizations, TPaymentOption, TPaymentModel, TDiscount, TItemList, TPaymentMode, TError, TDefaultFormValues, };
|