mainstack-payments 2.0.2 → 2.0.4
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-ByktxjXA.js → CashAppPayment-BghcQZPY.js} +44 -45
- package/build/{CryptoPayments-BkqcfMtz.js → CryptoPayments-eVW9ZpTq.js} +43 -44
- package/build/api/config.d.ts +10 -0
- package/build/api/index.d.ts +121 -0
- package/build/{src/components → components}/CheckoutForm.d.ts +7 -2
- package/build/{src/components → components}/PaymentOptions/CashAppPayment.d.ts +3 -2
- package/build/components/PaymentOptions/CryptoPayments.d.ts +12 -0
- package/build/{src/components → components}/WalletPay.d.ts +2 -2
- package/build/hooks/usePaystackPayment.d.ts +21 -0
- package/build/{index-BWm87vgg.js → index-OyliAwvi.js} +2088 -1988
- package/build/index.css +1 -1
- package/build/mainstack-payments.js +12 -10
- package/build/{payments-CjiNVkeO.js → payments-B3Hm80pK.js} +145 -143
- package/build/types/index.d.ts +233 -0
- package/package.json +3 -3
- package/build/src/api/config.d.ts +0 -7
- package/build/src/api/index.d.ts +0 -89
- package/build/src/components/PaymentOptions/CryptoPayments.d.ts +0 -11
- package/build/src/hooks/usePaystackPayment.d.ts +0 -31
- package/build/src/types/index.d.ts +0 -101
- /package/build/{src/app.d.ts → app.d.ts} +0 -0
- /package/build/{src/components → components}/ConfirmEmailModal.d.ts +0 -0
- /package/build/{src/components → components}/ContactAction.d.ts +0 -0
- /package/build/{src/components → components}/ContactForm.d.ts +0 -0
- /package/build/{src/components → components}/Payment.d.ts +0 -0
- /package/build/{src/components → components}/PaymentActionModal.d.ts +0 -0
- /package/build/{src/components → components}/PaymentOptions/PaystackPayments.d.ts +0 -0
- /package/build/{src/components → components}/PaystackPaymentErrorModal.d.ts +0 -0
- /package/build/{src/components → components}/PrivacyPolicy.d.ts +0 -0
- /package/build/{src/components → components}/SummaryCard.d.ts +0 -0
- /package/build/{src/components → components}/UI/CardButton.d.ts +0 -0
- /package/build/{src/components → components}/UI/Collapse.d.ts +0 -0
- /package/build/{src/components → components}/UI/PaymentsDivider.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/AfricanPayIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/ApplePayIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/CashAppIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/CheckoutCardIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/CryptoIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/GooglePayIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/MainstackLogo.d.ts +0 -0
- /package/build/{src/constants → constants}/index.d.ts +0 -0
- /package/build/{src/enums → enums}/currenciesEnums.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useApi.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useDebounce.d.ts +0 -0
- /package/build/{src/hooks → hooks}/usePayment.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useSmoothScroll.d.ts +0 -0
- /package/build/{src/index.d.ts → index.d.ts} +0 -0
- /package/build/{src/pages → pages}/DiscountCode.d.ts +0 -0
- /package/build/{src/pages → pages}/Home.d.ts +0 -0
- /package/build/{src/pages → pages}/Login.d.ts +0 -0
- /package/build/{src/pages → pages}/Page404.d.ts +0 -0
- /package/build/{src/pages → pages}/PaymentRedirect.d.ts +0 -0
- /package/build/{src/pages → pages}/index.d.ts +0 -0
- /package/build/{src/provider → provider}/index.d.ts +0 -0
- /package/build/{src/routes → routes}/index.d.ts +0 -0
- /package/build/{src/utils → utils}/ValidatePostcode.d.ts +0 -0
- /package/build/{src/utils → utils}/countries_flag.json.d.ts +0 -0
- /package/build/{src/utils → utils}/countries_with_flags_and_currencies.json.d.ts +0 -0
- /package/build/{src/utils → utils}/formatUnderscoreText.d.ts +0 -0
- /package/build/{src/utils → utils}/index.d.ts +0 -0
- /package/build/{src/utils → utils}/stringifyPrice.d.ts +0 -0
- /package/build/{src/utils → utils}/validations.d.ts +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
/** @format */
|
|
2
|
+
type TPaymentOption = "wallet" | "startbutton" | "stripe" | "paystack" | "crypto" | "cashapp";
|
|
3
|
+
type TPaymentMode = "card" | "transfer" | "mobile_money";
|
|
4
|
+
type TPaymentModel = "ips" | "default";
|
|
5
|
+
declare enum EPaymentMethods {
|
|
6
|
+
CARD = "card",
|
|
7
|
+
GOOGLE_PAY = "google_pay",
|
|
8
|
+
APPLE_PAY = "apple_pay",
|
|
9
|
+
BANK_TRANSFER = "bank_transfer",
|
|
10
|
+
USSD = "ussd",
|
|
11
|
+
PAY_ATTITUDE = "payattitude",
|
|
12
|
+
VISA_QR = "qr",
|
|
13
|
+
WECHAT_PAY = "wechat_pay",
|
|
14
|
+
CRYPTO = "crypto",
|
|
15
|
+
TRANSFER = "transfer",
|
|
16
|
+
MOBILE_MONEY = "mobile_money",
|
|
17
|
+
CASHAPP = "cashapp"
|
|
18
|
+
}
|
|
19
|
+
type TPaymentMethods = `${EPaymentMethods}`;
|
|
20
|
+
type TMetadata = {
|
|
21
|
+
type: string;
|
|
22
|
+
account_id: string;
|
|
23
|
+
user_id: string;
|
|
24
|
+
product_id: string;
|
|
25
|
+
mainstack_product_type: "store" | "editor" | "bookings" | "mediakit" | "invoicing" | "hosted_courses" | "products";
|
|
26
|
+
productName: string;
|
|
27
|
+
quantity: number;
|
|
28
|
+
};
|
|
29
|
+
type TClientMetadata = TMetadata & {
|
|
30
|
+
productImage: string;
|
|
31
|
+
ticket_payload?: string;
|
|
32
|
+
[key: string]: any;
|
|
33
|
+
payment_mode?: TPaymentMode;
|
|
34
|
+
cart_id?: string;
|
|
35
|
+
};
|
|
36
|
+
type TAPIMetadata = TMetadata & {
|
|
37
|
+
reference: string;
|
|
38
|
+
actual_price: string;
|
|
39
|
+
payment_mode?: TPaymentMode;
|
|
40
|
+
email: string;
|
|
41
|
+
name: string;
|
|
42
|
+
phone_number?: string;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
};
|
|
45
|
+
type TCustomizations = {
|
|
46
|
+
theme_color?: string;
|
|
47
|
+
button_label?: string;
|
|
48
|
+
back_button_label?: string;
|
|
49
|
+
font_family?: string;
|
|
50
|
+
hideDetails?: boolean;
|
|
51
|
+
showDefaultInputFields?: {
|
|
52
|
+
email?: boolean;
|
|
53
|
+
phone?: boolean;
|
|
54
|
+
fullname?: boolean;
|
|
55
|
+
};
|
|
56
|
+
hideBackButton?: boolean;
|
|
57
|
+
padding?: string;
|
|
58
|
+
isSingleColumn?: boolean;
|
|
59
|
+
summaryWidth?: string;
|
|
60
|
+
};
|
|
61
|
+
type TCryptoPaymentConfig = {
|
|
62
|
+
userAllowsCryptoPayment: true;
|
|
63
|
+
cryptoRedirectUrl: string;
|
|
64
|
+
} | {
|
|
65
|
+
userAllowsCryptoPayment: false;
|
|
66
|
+
cryptoRedirectUrl?: string;
|
|
67
|
+
};
|
|
68
|
+
type TPaymentConfig = TCryptoPaymentConfig & {
|
|
69
|
+
currency: string;
|
|
70
|
+
amount: number;
|
|
71
|
+
metadata: TClientMetadata;
|
|
72
|
+
customizations?: TCustomizations;
|
|
73
|
+
transactionFeesSlug: string;
|
|
74
|
+
paymentOptions?: TPaymentOption[];
|
|
75
|
+
paymentRedirectUrl?: string;
|
|
76
|
+
baseUrl: string;
|
|
77
|
+
paymentBaseUrl: string;
|
|
78
|
+
productBaseUrl: string;
|
|
79
|
+
feeBaseUrl: string;
|
|
80
|
+
accountId: string;
|
|
81
|
+
userAllowsWalletPayment: boolean;
|
|
82
|
+
userAllowsCardPayment: boolean;
|
|
83
|
+
merchantBearsTax?: boolean;
|
|
84
|
+
STRIPE_SECRET_KEY: string;
|
|
85
|
+
STRIPE_SECRET_KEY_GBP: string;
|
|
86
|
+
STRIPE_SECRET_KEY_CAD: string;
|
|
87
|
+
applyTrancheFee?: boolean;
|
|
88
|
+
ip: string;
|
|
89
|
+
shouldApplyTax?: boolean;
|
|
90
|
+
paymentModel?: TPaymentModel;
|
|
91
|
+
isFreeTrial?: boolean;
|
|
92
|
+
merchantCountry?: string;
|
|
93
|
+
merchantName?: string;
|
|
94
|
+
merchantCanReceivePayment?: boolean;
|
|
95
|
+
merchantIsKycVerified?: boolean;
|
|
96
|
+
itemsList?: TItemList[];
|
|
97
|
+
isPowerUser?: boolean;
|
|
98
|
+
payment_plan_id?: string;
|
|
99
|
+
amountDiscounted?: number;
|
|
100
|
+
};
|
|
101
|
+
type TDiscount = {
|
|
102
|
+
amount: number;
|
|
103
|
+
type: string;
|
|
104
|
+
value: number;
|
|
105
|
+
isFullDiscount: boolean;
|
|
106
|
+
};
|
|
107
|
+
type TItemList = {
|
|
108
|
+
name: string;
|
|
109
|
+
price: number;
|
|
110
|
+
currency: string;
|
|
111
|
+
quantity: number;
|
|
112
|
+
image?: string;
|
|
113
|
+
};
|
|
114
|
+
type TError = {
|
|
115
|
+
message: string;
|
|
116
|
+
};
|
|
117
|
+
type TDefaultFormValues = {
|
|
118
|
+
fullname?: string;
|
|
119
|
+
email?: string;
|
|
120
|
+
phone?: string;
|
|
121
|
+
};
|
|
122
|
+
export interface IInitPaymentItem {
|
|
123
|
+
productId: string;
|
|
124
|
+
quantity: number;
|
|
125
|
+
amount: number;
|
|
126
|
+
}
|
|
127
|
+
export interface IAppliedDiscount {
|
|
128
|
+
code: string;
|
|
129
|
+
amount: number;
|
|
130
|
+
value: number;
|
|
131
|
+
type: string;
|
|
132
|
+
}
|
|
133
|
+
export interface IInitPayment {
|
|
134
|
+
source: string;
|
|
135
|
+
merchantId: string;
|
|
136
|
+
currency: string;
|
|
137
|
+
countryISO?: string;
|
|
138
|
+
items: IInitPaymentItem[];
|
|
139
|
+
customer: {
|
|
140
|
+
fullName: string;
|
|
141
|
+
email: string;
|
|
142
|
+
phoneNumber?: string;
|
|
143
|
+
};
|
|
144
|
+
subtotal: number;
|
|
145
|
+
totalAmount: number;
|
|
146
|
+
totalDiscountAmount?: number;
|
|
147
|
+
appliedDiscount?: IAppliedDiscount;
|
|
148
|
+
isDiscountApplied?: boolean;
|
|
149
|
+
metadata?: Record<string, any>;
|
|
150
|
+
}
|
|
151
|
+
export interface IAppliedFee {
|
|
152
|
+
_id: string;
|
|
153
|
+
type: string;
|
|
154
|
+
displayName: string;
|
|
155
|
+
amount: number;
|
|
156
|
+
amountType: string;
|
|
157
|
+
value: number;
|
|
158
|
+
valueUsd: number;
|
|
159
|
+
isMainstack: string;
|
|
160
|
+
isProcessor: string;
|
|
161
|
+
isDeposit: string;
|
|
162
|
+
}
|
|
163
|
+
export interface ITransactionFeesResponse {
|
|
164
|
+
dollarAmount: number;
|
|
165
|
+
dollarTransactionFee: number;
|
|
166
|
+
localTransactionFee: number;
|
|
167
|
+
localCurrency: string;
|
|
168
|
+
localAmount: string;
|
|
169
|
+
exchangeRate: number;
|
|
170
|
+
appliedFees: IAppliedFee[];
|
|
171
|
+
appliedFeeIds: string[];
|
|
172
|
+
tax: any;
|
|
173
|
+
}
|
|
174
|
+
export interface IOrderAmount {
|
|
175
|
+
currency: string;
|
|
176
|
+
amount: number;
|
|
177
|
+
countryISO?: string;
|
|
178
|
+
amountInKobo?: number;
|
|
179
|
+
amountInCents?: number;
|
|
180
|
+
}
|
|
181
|
+
export interface IOrderCustomer {
|
|
182
|
+
firstName: string;
|
|
183
|
+
lastName: string;
|
|
184
|
+
fullName: string;
|
|
185
|
+
email: string;
|
|
186
|
+
_id: string;
|
|
187
|
+
phoneNumber?: string;
|
|
188
|
+
}
|
|
189
|
+
export interface IOrderItemImage {
|
|
190
|
+
path: string;
|
|
191
|
+
contentType: string;
|
|
192
|
+
_id: string;
|
|
193
|
+
}
|
|
194
|
+
export interface IOrderItem {
|
|
195
|
+
productId: string;
|
|
196
|
+
quantity: number;
|
|
197
|
+
amount: IOrderAmount;
|
|
198
|
+
name: string;
|
|
199
|
+
slug: string;
|
|
200
|
+
images: IOrderItemImage[];
|
|
201
|
+
type: string;
|
|
202
|
+
status: string;
|
|
203
|
+
hasOffering: boolean;
|
|
204
|
+
pricingModel: string;
|
|
205
|
+
_id: string;
|
|
206
|
+
}
|
|
207
|
+
export interface IOrderFee {
|
|
208
|
+
type: string;
|
|
209
|
+
amount: IOrderAmount;
|
|
210
|
+
description: string;
|
|
211
|
+
_id: string;
|
|
212
|
+
}
|
|
213
|
+
export interface IInitPaymentResponse {
|
|
214
|
+
reference: string;
|
|
215
|
+
source: string;
|
|
216
|
+
merchantId: string;
|
|
217
|
+
userId: string;
|
|
218
|
+
customer: IOrderCustomer;
|
|
219
|
+
items: IOrderItem[];
|
|
220
|
+
subtotal: IOrderAmount;
|
|
221
|
+
fees: IOrderFee[];
|
|
222
|
+
totalFeeAmount: IOrderAmount;
|
|
223
|
+
totalAmount: IOrderAmount;
|
|
224
|
+
status: string;
|
|
225
|
+
metadata: Record<string, any>;
|
|
226
|
+
isDeleted: boolean;
|
|
227
|
+
_id: string;
|
|
228
|
+
createdAt: string;
|
|
229
|
+
updatedAt: string;
|
|
230
|
+
orderId: string;
|
|
231
|
+
purchasedAt: string;
|
|
232
|
+
}
|
|
233
|
+
export type { TPaymentConfig, TMetadata, TClientMetadata, TAPIMetadata, TCustomizations, TPaymentOption, TPaymentModel, TDiscount, TItemList, TPaymentMode, TError, TDefaultFormValues, TPaymentMethods, };
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mainstack-payments",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"main": "build/mainstack-payments.js",
|
|
6
6
|
"types": "build/src/index.d.ts",
|
|
7
|
-
"style": "build/
|
|
7
|
+
"style": "build/index.css",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./build/src/index.d.ts",
|
|
11
11
|
"import": "./build/mainstack-payments.js"
|
|
12
12
|
},
|
|
13
|
-
"./style.css": "./build/
|
|
13
|
+
"./style.css": "./build/index.css"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
16
|
"build"
|
package/build/src/api/index.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { TAPIMetadata } from 'types';
|
|
2
|
-
|
|
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
|
-
account_id: string;
|
|
5
|
-
currency: string;
|
|
6
|
-
amount: number;
|
|
7
|
-
slug?: string | undefined;
|
|
8
|
-
apply_tranche_fee?: boolean | undefined;
|
|
9
|
-
ip?: string | undefined;
|
|
10
|
-
country?: string | undefined;
|
|
11
|
-
postal_code?: string | undefined;
|
|
12
|
-
product_id?: string | undefined;
|
|
13
|
-
apply_switching_fee?: boolean | undefined;
|
|
14
|
-
apply_currency_conversion_fee?: boolean | undefined;
|
|
15
|
-
}, Request: any) => {
|
|
16
|
-
data: any;
|
|
17
|
-
isLoading: boolean;
|
|
18
|
-
refetch: () => Promise<import('hooks/useApi').IFetchResponse>;
|
|
19
|
-
error: any;
|
|
20
|
-
};
|
|
21
|
-
interface IInitPayment {
|
|
22
|
-
amount: number;
|
|
23
|
-
reference: string;
|
|
24
|
-
currency: string;
|
|
25
|
-
metadata: TAPIMetadata;
|
|
26
|
-
is_crypto_payment?: boolean;
|
|
27
|
-
is_cashapp_payment?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export declare const useInitPayment: (Request: any) => {
|
|
30
|
-
data: any;
|
|
31
|
-
isLoading: boolean;
|
|
32
|
-
mutate: (dataParams: IInitPayment, { onSuccess, onError, }: {
|
|
33
|
-
onSuccess: (data: any) => void;
|
|
34
|
-
onError: (error: any) => void;
|
|
35
|
-
}) => Promise<any>;
|
|
36
|
-
};
|
|
37
|
-
interface IChargePayment {
|
|
38
|
-
amount: number;
|
|
39
|
-
currency: string;
|
|
40
|
-
callback_url?: string;
|
|
41
|
-
metadata: TAPIMetadata;
|
|
42
|
-
}
|
|
43
|
-
export declare const useChargePayment: (Request: any) => {
|
|
44
|
-
data: any;
|
|
45
|
-
isLoading: boolean;
|
|
46
|
-
mutate: (dataParams: IChargePayment, { onSuccess, onError, }: {
|
|
47
|
-
onSuccess: (data: any) => void;
|
|
48
|
-
onError: (error: any) => void;
|
|
49
|
-
}) => Promise<any>;
|
|
50
|
-
};
|
|
51
|
-
interface IIntentPayment {
|
|
52
|
-
amount: number;
|
|
53
|
-
currency: string;
|
|
54
|
-
payment_method_id?: string;
|
|
55
|
-
metadata: TAPIMetadata;
|
|
56
|
-
is_crypto_payment?: boolean;
|
|
57
|
-
is_cashapp_payment?: boolean;
|
|
58
|
-
}
|
|
59
|
-
export declare const useIntentPayment: (Request: any) => {
|
|
60
|
-
data: any;
|
|
61
|
-
isLoading: boolean;
|
|
62
|
-
mutate: (dataParams: IIntentPayment, { onSuccess, onError, }: {
|
|
63
|
-
onSuccess: (data: any) => void;
|
|
64
|
-
onError: (error: any) => void;
|
|
65
|
-
}) => Promise<any>;
|
|
66
|
-
};
|
|
67
|
-
export declare const useVerifyPayment: (reference: string, Request: any) => {
|
|
68
|
-
data: any;
|
|
69
|
-
isLoading: boolean;
|
|
70
|
-
refetch: () => Promise<import('hooks/useApi').IFetchResponse>;
|
|
71
|
-
error: any;
|
|
72
|
-
};
|
|
73
|
-
interface IApplyDiscount {
|
|
74
|
-
discount_code: string;
|
|
75
|
-
product_id: string;
|
|
76
|
-
account_id: string;
|
|
77
|
-
currency: string;
|
|
78
|
-
store_id: string;
|
|
79
|
-
cart_id?: string;
|
|
80
|
-
ticket_payload?: string;
|
|
81
|
-
payment_plan_id?: string;
|
|
82
|
-
}
|
|
83
|
-
export declare const useApplyDiscount: ({ discount_code, product_id, account_id, currency, store_id, ticket_payload, cart_id, payment_plan_id, }: IApplyDiscount, Request: any) => {
|
|
84
|
-
data: any;
|
|
85
|
-
isLoading: boolean;
|
|
86
|
-
refetch: () => Promise<import('hooks/useApi').IFetchResponse>;
|
|
87
|
-
error: any;
|
|
88
|
-
};
|
|
89
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
interface CryptoPaymentsProps {
|
|
3
|
-
Request: any;
|
|
4
|
-
metadata: any;
|
|
5
|
-
amount: number;
|
|
6
|
-
currency: string;
|
|
7
|
-
redirectUrl: string;
|
|
8
|
-
checkForErrors: () => Promise<boolean>;
|
|
9
|
-
}
|
|
10
|
-
declare const CryptoPayments: ({ Request, metadata, amount, currency, redirectUrl, checkForErrors, }: CryptoPaymentsProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export default CryptoPayments;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { TAPIMetadata } from 'types';
|
|
3
|
-
|
|
4
|
-
type TInitPayload = {
|
|
5
|
-
amount: number;
|
|
6
|
-
currency: string;
|
|
7
|
-
reference: string;
|
|
8
|
-
metadata: TAPIMetadata;
|
|
9
|
-
};
|
|
10
|
-
type TChargePayload = {
|
|
11
|
-
amount: number;
|
|
12
|
-
currency: string;
|
|
13
|
-
metadata: TAPIMetadata;
|
|
14
|
-
callback_url?: string;
|
|
15
|
-
};
|
|
16
|
-
interface IProps {
|
|
17
|
-
Request: AxiosInstance;
|
|
18
|
-
}
|
|
19
|
-
interface IMakePaymentArgs {
|
|
20
|
-
initPayload: TInitPayload;
|
|
21
|
-
chargePayload: TChargePayload;
|
|
22
|
-
handleChargeSuccess: (data: object) => void;
|
|
23
|
-
handleChargeError: (err?: object) => void;
|
|
24
|
-
handleInitError: (err?: object) => void;
|
|
25
|
-
}
|
|
26
|
-
export declare function usePaystackPayment({ Request }: IProps): {
|
|
27
|
-
makePaystackPayment: ({ initPayload, chargePayload, handleChargeError, handleInitError, handleChargeSuccess, }: IMakePaymentArgs) => void;
|
|
28
|
-
isInitializingPayment: boolean;
|
|
29
|
-
isChargingCard: boolean;
|
|
30
|
-
};
|
|
31
|
-
export {};
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/** @format */
|
|
2
|
-
type TPaymentOption = "wallet" | "startbutton" | "stripe" | "paystack" | "crypto" | "cashapp";
|
|
3
|
-
type TPaymentMode = "card" | "transfer" | "mobile_money";
|
|
4
|
-
type TPaymentModel = "ips" | "default";
|
|
5
|
-
type TMetadata = {
|
|
6
|
-
type: string;
|
|
7
|
-
account_id: string;
|
|
8
|
-
user_id: string;
|
|
9
|
-
product_id: string;
|
|
10
|
-
mainstack_product_type: "store" | "editor" | "bookings" | "mediakit" | "invoicing" | "hosted_courses";
|
|
11
|
-
productName: string;
|
|
12
|
-
quantity: number;
|
|
13
|
-
};
|
|
14
|
-
type TClientMetadata = TMetadata & {
|
|
15
|
-
productImage: string;
|
|
16
|
-
ticket_payload?: string;
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
payment_mode?: TPaymentMode;
|
|
19
|
-
cart_id?: string;
|
|
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
|
-
};
|
|
30
|
-
type TCustomizations = {
|
|
31
|
-
theme_color?: string;
|
|
32
|
-
button_label?: string;
|
|
33
|
-
back_button_label?: string;
|
|
34
|
-
font_family?: string;
|
|
35
|
-
hideDetails?: boolean;
|
|
36
|
-
showDefaultInputFields?: {
|
|
37
|
-
email?: boolean;
|
|
38
|
-
phone?: boolean;
|
|
39
|
-
fullname?: boolean;
|
|
40
|
-
};
|
|
41
|
-
hideBackButton?: boolean;
|
|
42
|
-
padding?: string;
|
|
43
|
-
isSingleColumn?: boolean;
|
|
44
|
-
summaryWidth?: string;
|
|
45
|
-
};
|
|
46
|
-
type TCryptoPaymentConfig = {
|
|
47
|
-
userAllowsCryptoPayment: true;
|
|
48
|
-
cryptoRedirectUrl: string;
|
|
49
|
-
} | {
|
|
50
|
-
userAllowsCryptoPayment: false;
|
|
51
|
-
cryptoRedirectUrl?: string;
|
|
52
|
-
};
|
|
53
|
-
type TPaymentConfig = TCryptoPaymentConfig & {
|
|
54
|
-
currency: string;
|
|
55
|
-
amount: number;
|
|
56
|
-
metadata: TClientMetadata;
|
|
57
|
-
customizations?: TCustomizations;
|
|
58
|
-
transactionFeesSlug: string;
|
|
59
|
-
paymentOptions?: TPaymentOption[];
|
|
60
|
-
paymentRedirectUrl?: string;
|
|
61
|
-
baseUrl: string;
|
|
62
|
-
accountId: string;
|
|
63
|
-
userAllowsWalletPayment: boolean;
|
|
64
|
-
userAllowsCardPayment: boolean;
|
|
65
|
-
merchantBearsTax?: boolean;
|
|
66
|
-
STRIPE_SECRET_KEY: string;
|
|
67
|
-
STRIPE_SECRET_KEY_GBP: string;
|
|
68
|
-
STRIPE_SECRET_KEY_CAD: string;
|
|
69
|
-
applyTrancheFee?: boolean;
|
|
70
|
-
ip: string;
|
|
71
|
-
shouldApplyTax?: boolean;
|
|
72
|
-
paymentModel?: TPaymentModel;
|
|
73
|
-
isFreeTrial?: boolean;
|
|
74
|
-
merchantCountry?: string;
|
|
75
|
-
itemsList?: TItemList[];
|
|
76
|
-
isPowerUser?: boolean;
|
|
77
|
-
payment_plan_id?: string;
|
|
78
|
-
amountDiscounted?: number;
|
|
79
|
-
};
|
|
80
|
-
type TDiscount = {
|
|
81
|
-
amount: number;
|
|
82
|
-
type: string;
|
|
83
|
-
value: number;
|
|
84
|
-
isFullDiscount: boolean;
|
|
85
|
-
};
|
|
86
|
-
type TItemList = {
|
|
87
|
-
name: string;
|
|
88
|
-
price: number;
|
|
89
|
-
currency: string;
|
|
90
|
-
quantity: number;
|
|
91
|
-
image?: string;
|
|
92
|
-
};
|
|
93
|
-
type TError = {
|
|
94
|
-
message: string;
|
|
95
|
-
};
|
|
96
|
-
type TDefaultFormValues = {
|
|
97
|
-
fullname?: string;
|
|
98
|
-
email?: string;
|
|
99
|
-
phone?: string;
|
|
100
|
-
};
|
|
101
|
-
export type { TPaymentConfig, TMetadata, TClientMetadata, TAPIMetadata, TCustomizations, TPaymentOption, TPaymentModel, TDiscount, TItemList, TPaymentMode, TError, TDefaultFormValues, };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|