tf-checkout-react 1.6.6-beta.26 → 1.6.6-beta.27

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.
Files changed (41) hide show
  1. package/dist/api/checkout.d.ts +1 -0
  2. package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +17 -0
  3. package/dist/components/addonsContainer/index.d.ts +2 -1
  4. package/dist/components/billing-info-container/index.d.ts +6 -1
  5. package/dist/components/billing-info-container/utils.d.ts +25 -1
  6. package/dist/components/countdown/index.d.ts +1 -1
  7. package/dist/components/paymentContainer/OrderDetails.d.ts +2 -0
  8. package/dist/components/paymentContainer/handlePayment.d.ts +15 -0
  9. package/dist/components/paymentContainer/index.d.ts +8 -5
  10. package/dist/components/stripePayment/index.d.ts +18 -3
  11. package/dist/components/ticketsContainer/index.d.ts +1 -0
  12. package/dist/components/timerWidget/index.d.ts +2 -1
  13. package/dist/index.d.ts +1 -0
  14. package/dist/tf-checkout-react.cjs.development.js +2925 -2148
  15. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  16. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  17. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  18. package/dist/tf-checkout-react.esm.js +2926 -2150
  19. package/dist/tf-checkout-react.esm.js.map +1 -1
  20. package/dist/tf-checkout-styles.css +1 -1
  21. package/dist/types/order-data.d.ts +1 -1
  22. package/package.json +3 -3
  23. package/src/api/checkout.ts +8 -4
  24. package/src/api/interceptors.ts +6 -22
  25. package/src/api/publicRequest.ts +1 -5
  26. package/src/components/addonsContainer/AddonComponent.tsx +1 -1
  27. package/src/components/addonsContainer/SimpleAddonsContainer.tsx +384 -0
  28. package/src/components/addonsContainer/index.tsx +7 -2
  29. package/src/components/billing-info-container/index.tsx +523 -327
  30. package/src/components/billing-info-container/{utils.ts → utils.tsx} +119 -0
  31. package/src/components/countdown/index.tsx +22 -22
  32. package/src/components/paymentContainer/OrderDetails.tsx +125 -0
  33. package/src/components/paymentContainer/handlePayment.ts +86 -0
  34. package/src/components/paymentContainer/index.tsx +261 -252
  35. package/src/components/preRegistration/index.tsx +4 -3
  36. package/src/components/stripePayment/index.tsx +129 -24
  37. package/src/components/ticketsContainer/TicketsSection.tsx +83 -79
  38. package/src/components/ticketsContainer/index.tsx +7 -5
  39. package/src/components/timerWidget/index.tsx +15 -3
  40. package/src/index.ts +2 -0
  41. package/src/types/order-data.ts +1 -1
@@ -1 +1,2 @@
1
1
  export declare const postOnCheckout: (data: any, freeTicket?: boolean) => Promise<ICheckoutResponse>;
2
+ export declare const updateCheckout: (data: any) => Promise<ICheckoutResponse>;
@@ -0,0 +1,17 @@
1
+ /// <reference types="react" />
2
+ export interface ISimpleAddonContainerProps {
3
+ classNamePrefix?: string;
4
+ onGetAddonsPageInfoSuccess?: (res: any) => void;
5
+ onGetAddonsPageInfoError?: (error: any) => void;
6
+ descriptionTrigger?: 'click' | 'hover' | 'always';
7
+ addOnDataWithCustomFields: any;
8
+ configs: any;
9
+ eventId: string;
10
+ onAddOnSelect?: (id: string, value: string, addon: any) => void;
11
+ handleConfirm?: (values: any) => void;
12
+ }
13
+ export interface ObjectLiteral {
14
+ [key: string]: any;
15
+ }
16
+ export declare const SimpleAddonsContainer: ({ classNamePrefix, onGetAddonsPageInfoSuccess, onGetAddonsPageInfoError, descriptionTrigger, addOnDataWithCustomFields, configs, eventId, onAddOnSelect, handleConfirm, }: ISimpleAddonContainerProps) => JSX.Element;
17
+ export default SimpleAddonsContainer;
@@ -15,8 +15,9 @@ export interface IAddonContainterProps {
15
15
  descriptionTrigger?: 'click' | 'hover' | 'always';
16
16
  addOnDataWithCustomFields: any;
17
17
  configs: any;
18
+ onAddOnSelect?: (id: string, value: string, addon: any) => void;
18
19
  }
19
20
  export interface ObjectLiteral {
20
21
  [key: string]: any;
21
22
  }
22
- export declare const AddonsContainter: ({ classNamePrefix, enableBillingInfoAutoCreate, enableTimer, onGetAddonsPageInfoSuccess, onGetAddonsPageInfoError, onPostCheckoutSuccess, onPostCheckoutError, onConfirmSelectionSuccess, onConfirmSelectionError, onCountdownFinish, onPendingVerification, samePage, descriptionTrigger, addOnDataWithCustomFields, configs, }: IAddonContainterProps) => JSX.Element;
23
+ export declare const AddonsContainter: ({ classNamePrefix, enableBillingInfoAutoCreate, enableTimer, onGetAddonsPageInfoSuccess, onGetAddonsPageInfoError, onPostCheckoutSuccess, onPostCheckoutError, onConfirmSelectionSuccess, onConfirmSelectionError, onCountdownFinish, onPendingVerification, samePage, descriptionTrigger, addOnDataWithCustomFields, configs, onAddOnSelect, }: IAddonContainterProps) => JSX.Element;
@@ -6,10 +6,11 @@ import { AxiosError } from 'axios';
6
6
  import { FormikHelpers, FormikValues } from 'formik';
7
7
  import { IBillingInfoData } from '../../types';
8
8
  import { IAddonContainterProps } from '../addonsContainer';
9
+ import { IPaymentPage } from '../paymentContainer';
9
10
  export interface IBillingInfoPage {
10
11
  data?: IBillingInfoData[];
11
12
  ticketHoldersFields?: IBillingInfoData;
12
- handleSubmit?: (values: FormikValues, formikHelpers: FormikHelpers<FormikValues>, eventId: any, res: any) => void;
13
+ handleSubmit?: (values: FormikValues, formikHelpers: FormikHelpers<FormikValues>, eventId: any, res: any, checkoutUpdateResponse?: any, paymentResponse?: any) => void;
13
14
  onRegisterSuccess?: (value: any) => void;
14
15
  onRegisterError?: (e: AxiosError, email: string) => void;
15
16
  onSubmitError?: (e: AxiosError) => void;
@@ -26,6 +27,8 @@ export interface IBillingInfoPage {
26
27
  onLogin?: () => void;
27
28
  onLoginSuccess?: () => void;
28
29
  onErrorClose?: () => void;
30
+ onCheckoutUpdateSuccess?: (res: any) => void;
31
+ onCheckoutUpdateError?: (e: AxiosError) => void;
29
32
  initialValues?: FormikValues;
30
33
  buttonName?: string;
31
34
  theme?: 'light' | 'dark';
@@ -57,6 +60,8 @@ export interface IBillingInfoPage {
57
60
  includeAddons?: boolean;
58
61
  addonsProps?: IAddonContainterProps;
59
62
  addOnDataWithCustomFields?: any;
63
+ isSinglePageCheckout?: boolean;
64
+ paymentProps?: Partial<IPaymentPage>;
60
65
  }
61
66
  declare const WithCustomFieldsBillingInfoContainer: (props: any) => JSX.Element;
62
67
  export { WithCustomFieldsBillingInfoContainer as BillingInfoContainer };
@@ -1,5 +1,5 @@
1
- /// <reference types="react" />
2
1
  import { FormikErrors, FormikValues } from 'formik';
2
+ import React from 'react';
3
3
  import { AttributesConfig } from '../../api';
4
4
  import { IGroupItem } from '../../types';
5
5
  export interface ILoggedInValues {
@@ -32,3 +32,27 @@ export declare const assingUniqueIds: (data: any) => any;
32
32
  export declare const isRequiredField: (element: IGroupItem, configs?: AttributesConfig | null | undefined) => boolean;
33
33
  export declare const getFieldLabel: (element: IGroupItem, configs?: AttributesConfig | null | undefined) => string | JSX.Element;
34
34
  export declare const getFieldComponent: (element: IGroupItem) => any;
35
+ /**
36
+ * Renders a React component with the provided props
37
+ * @param Component - The React component to render
38
+ * @param props - The props to apply to the component
39
+ * @returns JSX element with applied props
40
+ */
41
+ export declare const renderComponentWithProps: <T extends Record<string, any>>(Component: React.ComponentType<T>, props: T) => React.ReactElement<T, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
42
+ export declare const filterBillingInfoFields: (fields: IGroupItem[], options: {
43
+ showDOB: boolean;
44
+ hideTtfOptIn: boolean;
45
+ hidePhoneField: boolean;
46
+ flagRequirePhone: boolean;
47
+ collectMandatoryWalletAddress: boolean;
48
+ collectMandatoryJobTitle: boolean;
49
+ collectMandatoryBusinessCategory: boolean;
50
+ collectMandatoryCompany: boolean;
51
+ collectMandatoryInstagram: boolean;
52
+ flagFreeTicket: boolean;
53
+ hideWalletAddressField: boolean;
54
+ hideJobTitleField: boolean;
55
+ hideBusinessCategoryField: boolean;
56
+ hideCompanyField: boolean;
57
+ hideInstagramField: boolean;
58
+ }) => IGroupItem[];
@@ -10,5 +10,5 @@ interface CountdownTypes {
10
10
  callback?: () => void;
11
11
  isLoggedIn?: boolean;
12
12
  }
13
- declare function Countdown({ startDate, timezone, title, message, showMessage, disableLeadingZero, callback, isLoggedIn }: CountdownTypes): JSX.Element;
13
+ declare function Countdown({ startDate, timezone, title, message, showMessage, disableLeadingZero, callback, isLoggedIn, }: CountdownTypes): JSX.Element;
14
14
  export default Countdown;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const OrderDetails: ({ orderData, paymentFieldsData }: any) => JSX.Element;
@@ -0,0 +1,15 @@
1
+ interface Options {
2
+ reviewData: any;
3
+ isFreeTickets: boolean;
4
+ paymentPlanIsAvailable: boolean;
5
+ showPaymentPlanSection: boolean;
6
+ handlePayment: any;
7
+ setPaymentIsLoading: any;
8
+ setError: any;
9
+ orderData: any;
10
+ eventId: any;
11
+ isBrowser: boolean;
12
+ onPaymentError: any;
13
+ }
14
+ export declare const handlePaymentMiddleWare: (error: any, data: object, { reviewData, isFreeTickets, paymentPlanIsAvailable, showPaymentPlanSection, handlePayment, setPaymentIsLoading, setError, orderData, eventId, isBrowser, onPaymentError, }: Options) => Promise<void>;
15
+ export {};
@@ -2,9 +2,10 @@
2
2
  import './style.css';
3
3
  import { ThemeOptions } from '@mui/material';
4
4
  import { CSSProperties } from '@mui/styles';
5
- import { StripeCardNumberElementOptions, StripeElementsOptions } from '@stripe/stripe-js';
5
+ import { StripeElementsOptions } from '@stripe/stripe-js';
6
6
  import { AxiosError } from 'axios';
7
7
  import { IPaymentField } from '../../types';
8
+ import { ICheckoutForm } from '../stripePayment';
8
9
  export interface IPaymentPage {
9
10
  paymentFields: IPaymentField[];
10
11
  handlePayment: any;
@@ -15,8 +16,6 @@ export interface IPaymentPage {
15
16
  onGetPaymentDataSuccess: (value: any) => void;
16
17
  onGetPaymentDataError: (value: AxiosError) => void;
17
18
  onPaymentError: (value: AxiosError, slug?: string) => void;
18
- stripeCardOptions?: StripeCardNumberElementOptions;
19
- disableZipSection: boolean;
20
19
  themeOptions?: ThemeOptions & {
21
20
  input?: CSSProperties;
22
21
  checkbox?: CSSProperties;
@@ -25,8 +24,12 @@ export interface IPaymentPage {
25
24
  onCountdownFinish?: () => void;
26
25
  enableTimer?: boolean;
27
26
  enablePaymentPlan?: boolean;
28
- paymentButtonText?: string;
29
27
  paymentInfoLabel?: string;
30
28
  orderInfoLabel?: string;
29
+ displayPaymentButton?: boolean;
30
+ hidePaymentForm?: boolean;
31
+ hideFieldsBlock?: boolean;
32
+ isSinglePageCheckout?: boolean;
33
+ stripePaymentProps?: Partial<ICheckoutForm>;
31
34
  }
32
- export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, elementsOptions, onCountdownFinish, enableTimer, enablePaymentPlan, paymentButtonText, orderInfoLabel, paymentInfoLabel, }: IPaymentPage) => JSX.Element;
35
+ export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, themeOptions, elementsOptions, onCountdownFinish, enableTimer, enablePaymentPlan, orderInfoLabel, paymentInfoLabel, displayPaymentButton, hidePaymentForm, hideFieldsBlock, isSinglePageCheckout, stripePaymentProps, }: IPaymentPage) => JSX.Element;
@@ -1,6 +1,16 @@
1
1
  /// <reference types="react" />
2
2
  import './style.css';
3
- import { StripeCardNumberElementOptions } from '@stripe/stripe-js';
3
+ import { Stripe, StripeCardNumberElement, StripeCardNumberElementOptions, StripeError } from '@stripe/stripe-js';
4
+ interface PaymentFieldsData {
5
+ billing_info: {
6
+ city?: string;
7
+ street_address?: string;
8
+ state?: string;
9
+ };
10
+ postalCode?: string;
11
+ disableZipSection?: boolean;
12
+ cardComplete?: boolean;
13
+ }
4
14
  export interface ICheckoutForm {
5
15
  total: string | number;
6
16
  currency: string;
@@ -14,11 +24,16 @@ export interface ICheckoutForm {
14
24
  isLoading: any;
15
25
  handleSetLoading: (loading: any) => void;
16
26
  conditions: any;
17
- disableZipSection: boolean;
27
+ disableZipSection?: boolean;
18
28
  paymentButtonText?: string;
19
29
  forPaymentPlan?: boolean;
20
30
  orderId?: string;
21
31
  hasSeatMapActions: boolean;
32
+ enableAddressElement?: boolean;
33
+ collectPaymentMethodOnly?: boolean;
34
+ displayPaymentButton?: boolean;
35
+ onPaymentFieldsUpdate?: (error: any, paymentFieldsData: PaymentFieldsData, stripe: Stripe | null, card: StripeCardNumberElement | null) => void;
36
+ stripeCardError?: StripeError | null;
22
37
  }
23
- declare const CheckoutForm: ({ total, orderId, onSubmit, stripeCardOptions, error, stripe_client_secret, currency, billing_info, isLoading, handleSetLoading, conditions, disableZipSection, paymentButtonText, forPaymentPlan, hasSeatMapActions, }: ICheckoutForm) => JSX.Element;
38
+ declare const CheckoutForm: ({ total, orderId, onSubmit, stripeCardOptions, error, stripe_client_secret, currency, billing_info, isLoading, handleSetLoading, conditions, disableZipSection, paymentButtonText, forPaymentPlan, hasSeatMapActions, enableAddressElement, displayPaymentButton, onPaymentFieldsUpdate, stripeCardError, }: ICheckoutForm) => JSX.Element;
24
39
  export default CheckoutForm;
@@ -9,6 +9,7 @@ interface CartSuccess {
9
9
  hash?: string | number;
10
10
  total?: string | number;
11
11
  hasAddOn?: boolean;
12
+ eventSlug?: string;
12
13
  }
13
14
  export interface IGetTickets {
14
15
  eventId: number;
@@ -4,6 +4,7 @@ export interface ITimerWidgetPage {
4
4
  expires_at: number;
5
5
  buyLoading?: boolean;
6
6
  onCountdownFinish?: () => void;
7
+ container?: string;
7
8
  }
8
9
  export interface IRenderer {
9
10
  minutes: number;
@@ -11,5 +12,5 @@ export interface IRenderer {
11
12
  completed: number;
12
13
  handleCountdownFinish: () => void;
13
14
  }
14
- declare const _default: React.MemoExoticComponent<({ expires_at, buyLoading, onCountdownFinish, }: ITimerWidgetPage) => JSX.Element | null>;
15
+ declare const _default: React.MemoExoticComponent<({ expires_at, buyLoading, onCountdownFinish, container, }: ITimerWidgetPage) => JSX.Element | null>;
15
16
  export default _default;
package/dist/index.d.ts CHANGED
@@ -24,3 +24,4 @@ export { IDVerification } from './components/idVerificationContainer';
24
24
  export { VERIFICATION_STATUSES } from './components/idVerificationContainer/constants';
25
25
  export { setConfigs } from './utils/setConfigs';
26
26
  export { logoutUser } from './utils/auth';
27
+ export { OrderDetails } from './components/paymentContainer/OrderDetails';