tf-checkout-react-native 1.0.11 → 1.0.14

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 (82) hide show
  1. package/README.md +595 -294
  2. package/android/build.gradle +3 -3
  3. package/lib/api/ApiClient.d.ts +13 -21
  4. package/lib/api/ApiClient.js +122 -51
  5. package/lib/api/ApiClient.js.map +1 -1
  6. package/lib/api/types.d.ts +21 -11
  7. package/lib/components/login/Login.d.ts +1 -1
  8. package/lib/components/login/Login.js +22 -10
  9. package/lib/components/login/Login.js.map +1 -1
  10. package/lib/components/login/LoginView.d.ts +1 -1
  11. package/lib/components/login/LoginView.js +16 -13
  12. package/lib/components/login/LoginView.js.map +1 -1
  13. package/lib/components/login/styles.d.ts +2 -1
  14. package/lib/components/login/styles.js +2 -1
  15. package/lib/components/login/styles.js.map +1 -1
  16. package/lib/components/login/types.d.ts +19 -9
  17. package/lib/components/waitingList/WaitingList.d.ts +1 -1
  18. package/lib/components/waitingList/WaitingList.js +20 -3
  19. package/lib/components/waitingList/WaitingList.js.map +1 -1
  20. package/lib/components/waitingList/WaitingListView.js +19 -7
  21. package/lib/components/waitingList/WaitingListView.js.map +1 -1
  22. package/lib/components/waitingList/types.d.ts +10 -0
  23. package/lib/containers/billingInfo/Billing.d.ts +2 -1
  24. package/lib/containers/billingInfo/Billing.js +100 -66
  25. package/lib/containers/billingInfo/Billing.js.map +1 -1
  26. package/lib/containers/billingInfo/types.d.ts +42 -93
  27. package/lib/containers/checkout/Checkout.d.ts +1 -1
  28. package/lib/containers/checkout/Checkout.js +146 -50
  29. package/lib/containers/checkout/Checkout.js.map +1 -1
  30. package/lib/containers/checkout/styles.d.ts +2 -0
  31. package/lib/containers/checkout/styles.js +4 -2
  32. package/lib/containers/checkout/styles.js.map +1 -1
  33. package/lib/containers/checkout/types.d.ts +32 -8
  34. package/lib/containers/myOrderDetails/MyOrderDetails.js +21 -3
  35. package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
  36. package/lib/containers/myOrderDetails/MyOrderDetailsView.js +10 -7
  37. package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
  38. package/lib/containers/myOrderDetails/components/Notification.d.ts +10 -2
  39. package/lib/containers/myOrderDetails/components/Notification.js +5 -7
  40. package/lib/containers/myOrderDetails/components/Notification.js.map +1 -1
  41. package/lib/containers/myOrderDetails/types.d.ts +18 -0
  42. package/lib/containers/myOrders/MyOrders.js +37 -9
  43. package/lib/containers/myOrders/MyOrders.js.map +1 -1
  44. package/lib/containers/myOrders/MyOrdersView.d.ts +1 -1
  45. package/lib/containers/myOrders/MyOrdersView.js +3 -3
  46. package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
  47. package/lib/containers/myOrders/types.d.ts +13 -1
  48. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +1 -1
  49. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +21 -5
  50. package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
  51. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +2 -2
  52. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js +4 -3
  53. package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
  54. package/lib/containers/purchaseConfirmation/types.d.ts +12 -1
  55. package/lib/containers/tickets/Tickets.d.ts +1 -1
  56. package/lib/containers/tickets/Tickets.js +59 -9
  57. package/lib/containers/tickets/Tickets.js.map +1 -1
  58. package/lib/containers/tickets/TicketsView.d.ts +1 -1
  59. package/lib/containers/tickets/TicketsView.js +5 -4
  60. package/lib/containers/tickets/TicketsView.js.map +1 -1
  61. package/lib/containers/tickets/components/TicketListItem.js +14 -7
  62. package/lib/containers/tickets/components/TicketListItem.js.map +1 -1
  63. package/lib/containers/tickets/components/types.d.ts +6 -0
  64. package/lib/containers/tickets/types.d.ts +28 -11
  65. package/lib/helpers/LocalStorage.d.ts +1 -1
  66. package/lib/helpers/LocalStorage.js +1 -3
  67. package/lib/helpers/LocalStorage.js.map +1 -1
  68. package/lib/index.d.ts +3 -3
  69. package/lib/res/colors.d.ts +2 -2
  70. package/lib/res/colors.js +2 -18
  71. package/lib/res/colors.js.map +1 -1
  72. package/lib/types/IError.d.ts +5 -0
  73. package/lib/types/IError.js +2 -0
  74. package/lib/types/IError.js.map +1 -0
  75. package/lib/types/ITicket.d.ts +12 -0
  76. package/lib/types/index.d.ts +1 -0
  77. package/lib/types/index.js +1 -0
  78. package/lib/types/index.js.map +1 -1
  79. package/package.json +3 -3
  80. package/lib/containers/checkout/CheckoutView.d.ts +0 -3
  81. package/lib/containers/checkout/CheckoutView.js +0 -48
  82. package/lib/containers/checkout/CheckoutView.js.map +0 -1
@@ -1,13 +1,11 @@
1
- import { ColorValue, ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native';
1
+ import { ColorValue, ImageSourcePropType, ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native';
2
2
  import { IButtonStyles } from '../../components/button/types';
3
3
  import { ICheckboxStyles } from '../../components/checkbox/types';
4
4
  import { IDatePickerStyles } from '../../components/datePicker/types';
5
- import { IDropdownItem, IDropdownStyles } from '../../components/dropdown/types';
6
- import { IFormFieldProps } from '../../components/formField/types';
5
+ import { IDropdownStyles } from '../../components/dropdown/types';
7
6
  import { IInputStyles } from '../../components/input/types';
8
- import { ILoginViewStyles, ILoginViewTexts } from '../../components/login/types';
9
- import { IUserProfile } from '../../types';
10
- import { IAddToCartSuccess } from '../tickets/types';
7
+ import { ILoginBrandImages, ILoginViewStyles, ILoginViewTexts } from '../../components/login/types';
8
+ import { IError, ITicketsResponseData } from '../../types';
11
9
  export interface ITokens {
12
10
  accessToken: string;
13
11
  refreshToken: string;
@@ -19,38 +17,43 @@ export interface IOnCheckoutSuccess {
19
17
  status: string;
20
18
  }
21
19
  export interface IBillingProps {
22
- cartProps: IAddToCartSuccess;
20
+ cartProps: ITicketsResponseData;
23
21
  onRegisterSuccess?: (tokens: ITokens) => void;
24
- onRegisterFail?: (error: string) => void;
22
+ onRegisterError?: (error: string) => void;
25
23
  onCheckoutSuccess: (data: IOnCheckoutSuccess) => void;
26
- onCheckoutFail?: (error: string) => void;
24
+ onCheckoutError?: (error: IError) => void;
27
25
  onLoginSuccess: (data: any) => void;
28
- onLoginFail?: (error: string) => void;
26
+ onLoginError?: (error: IError) => void;
29
27
  onFetchUserProfileSuccess?: (data: any) => void;
30
- onFetchUserProfileFail?: (error: any) => void;
31
- onFetchCartError?: (error: string) => void;
32
- privacyPolicyLinkStyle?: StyleProp<TextStyle>;
33
- onFetchUserProfileFailure?: (error: string) => void;
34
- onFetchAccessTokenFailure?: (error: string) => void;
35
- styles?: IBillingInfoViewStyles;
36
- texts?: IBillingInfoViewTexts;
37
- }
38
- export interface IBillingInfoProps {
39
- cartProps: IAddToCartSuccess;
40
- onRegisterSuccess?: (tokens: ITokens) => void;
41
- onRegisterFail?: (error: string) => void;
42
- onCheckoutSuccess: (data: IOnCheckoutSuccess) => void;
43
- onCheckoutFail?: (error: string) => void;
44
- onLoginSuccess: (data: any) => void;
45
- onLoginFail?: (error: string) => void;
46
- onFetchUserProfileSuccess?: (data: any) => void;
47
- onFetchUserProfileFail?: (error: any) => void;
48
- onFetchCartError?: (error: string) => void;
28
+ onFetchUserProfileError?: (error: IError) => void;
29
+ onFetchCartError?: (error: IError) => void;
30
+ onFetchCartSuccess?: () => void;
31
+ onFetchCountriesError?: (error: IError) => void;
32
+ onFetchCountriesSuccess?: () => void;
33
+ onFetchStatesError?: (error: IError) => void;
34
+ onFetchStatesSuccess?: () => void;
35
+ onFetchAccessTokenError?: (error: IError) => void;
36
+ onFetchAccessTokenSuccess?: () => void;
49
37
  styles?: IBillingInfoViewStyles;
50
38
  texts?: IBillingInfoViewTexts;
51
- privacyPolicyLinkStyle?: StyleProp<TextStyle>;
52
- onFetchUserProfileFailure?: (error: string) => void;
53
- onFetchAccessTokenFailure?: (error: string) => void;
39
+ skipBillingConfig?: {
40
+ styles?: {
41
+ rootContainer?: StyleProp<ViewStyle>;
42
+ dialogContainer?: StyleProp<ViewStyle>;
43
+ brandImage?: StyleProp<ImageStyle>;
44
+ text?: StyleProp<TextStyle>;
45
+ activityIndicator?: {
46
+ color?: ColorValue;
47
+ size?: 'large' | 'small';
48
+ };
49
+ };
50
+ brandImage?: ImageSourcePropType;
51
+ isActivityIndicatorVisible?: boolean;
52
+ };
53
+ loginBrandImages?: ILoginBrandImages;
54
+ areLoadingIndicatorsEnabled?: boolean;
55
+ areAlertsEnabled?: boolean;
56
+ onLoadingChange?: (isLoading: boolean) => void;
54
57
  }
55
58
  export interface ITicketHolderField {
56
59
  firstName: string;
@@ -62,36 +65,6 @@ export interface ITicketHolderFieldError {
62
65
  firstNameError?: string;
63
66
  lastNameError?: string;
64
67
  }
65
- export interface IBillingInfoFormData {
66
- firstName: string;
67
- lastName: string;
68
- email: string;
69
- confirmEmail: string;
70
- password: string;
71
- confirmPassword: string;
72
- phone: string;
73
- street: string;
74
- city: string;
75
- country?: IDropdownItem;
76
- state?: IDropdownItem;
77
- zipCode: string;
78
- isSubToNewsletter: boolean;
79
- isSubToMarketing: boolean;
80
- ticketHoldersFields: ITicketHolderField[];
81
- birthday?: Date;
82
- errors: {
83
- firstName: string;
84
- lastName: string;
85
- email: string;
86
- confirmEmail: string;
87
- password: string;
88
- confirmPassword: string;
89
- phone: string;
90
- street: string;
91
- city: string;
92
- zipCode: string;
93
- };
94
- }
95
68
  export interface IBillingInfoViewStyles {
96
69
  rootContainer?: StyleProp<ViewStyle>;
97
70
  loginStyles?: ILoginViewStyles;
@@ -101,21 +74,13 @@ export interface IBillingInfoViewStyles {
101
74
  inputStyles?: IInputStyles;
102
75
  dropdownStyles?: IDropdownStyles;
103
76
  checkboxStyles?: ICheckboxStyles;
104
- titles?: StyleProp<TextStyle>;
105
- headers?: StyleProp<TextStyle>;
77
+ screenTitle?: StyleProp<TextStyle>;
78
+ ticketHoldersTitle?: StyleProp<TextStyle>;
79
+ ticketHolderItemHeader?: StyleProp<TextStyle>;
106
80
  texts?: StyleProp<TextStyle>;
107
81
  customCheckbox?: ICheckboxStyles;
108
82
  datePicker?: IDatePickerStyles;
109
- skippingDialog?: {
110
- rootContainer?: StyleProp<ViewStyle>;
111
- dialogContainer?: StyleProp<ViewStyle>;
112
- brandImage?: StyleProp<ImageStyle>;
113
- message?: StyleProp<TextStyle>;
114
- spinner?: {
115
- color: ColorValue;
116
- size: 'large' | 'small';
117
- };
118
- };
83
+ privacyPolicyLinkStyle?: StyleProp<TextStyle>;
119
84
  }
120
85
  export interface IBillingInfoViewTexts {
121
86
  loginTexts?: ILoginViewTexts;
@@ -137,6 +102,8 @@ export interface IBillingInfoViewTexts {
137
102
  zipCode?: string;
138
103
  dateOfBirth?: string;
139
104
  isSubToBrand?: string;
105
+ isSubToTicketFairy?: string;
106
+ privacyPolicy?: string;
140
107
  ticketHoldersTitle?: string;
141
108
  ticketHolderItem?: string;
142
109
  holderFirstName?: string;
@@ -147,24 +114,6 @@ export interface IBillingInfoViewTexts {
147
114
  emailsAdvice?: string;
148
115
  choosePassword?: string;
149
116
  checkbox?: string;
117
+ fillAllRequiredFieldsAlert?: string;
150
118
  };
151
119
  }
152
- export interface IBillingInfoViewProps {
153
- formFields: IFormFieldProps[];
154
- isLoading: boolean;
155
- onSubmit: () => void;
156
- onLoginSuccessful: (userProfile: IUserProfile, accessToken: string) => void;
157
- isDataValid: boolean;
158
- isLoginDialogVisible: boolean;
159
- showLoginDialog: () => void;
160
- hideLoginDialog: () => void;
161
- loginMessage?: string;
162
- userProfile?: IUserProfile;
163
- isSubmitLoading?: boolean;
164
- onLogoutSuccess?: () => void;
165
- styles?: IBillingInfoViewStyles;
166
- texts?: IBillingInfoViewTexts;
167
- onLoginFail?: (error: string) => void;
168
- onFetchUserProfileFailure?: (error: string) => void;
169
- onFetchAccessTokenFailure?: (error: string) => void;
170
- }
@@ -1,3 +1,3 @@
1
1
  import { ICheckoutProps } from './types';
2
- declare const Checkout: ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuccess, onFetchEventConditionsFail, onFetchEventConditionsSuccess, onCheckoutCompletedFail, onCheckoutCompletedSuccess, onPaymentError, onPaymentSuccess, onStripeInitializeError, texts, styles, onPressExit, }: ICheckoutProps) => JSX.Element;
2
+ declare const Checkout: ({ eventId, checkoutData, onFetchOrderReviewError, onFetchOrderReviewSuccess, onFetchEventConditionsError, onFetchEventConditionsSuccess, onCheckoutCompletedError, onCheckoutCompletedSuccess, onPaymentError, onPaymentSuccess, onStripeInitializeError, texts, styles, onPressExit, areAlertsEnabled, areLoadingIndicatorsEnabled, onLoadingChange, onFetchOrderDetailsError, onFetchOrderDetailsSuccess, }: ICheckoutProps) => JSX.Element;
3
3
  export default Checkout;
@@ -1,16 +1,22 @@
1
- import { initStripe, useConfirmPayment, } from '@stripe/stripe-react-native';
1
+ import { CardForm, initStripe, useConfirmPayment, } from '@stripe/stripe-react-native';
2
2
  import _every from 'lodash/every';
3
3
  import _forEach from 'lodash/forEach';
4
4
  import _map from 'lodash/map';
5
5
  import _mapKeys from 'lodash/mapKeys';
6
- import React, { useEffect, useState } from 'react';
7
- import { Alert } from 'react-native';
8
- import { fetchEventConditions, fetchOrderReview, postOnFreeRegistration, postOnPaymentSuccess, } from '../../api/ApiClient';
6
+ import React, { useCallback, useEffect, useState } from 'react';
7
+ import { Alert, Text, View } from 'react-native';
8
+ import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
9
+ import { fetchEventConditions, fetchOrderDetails, fetchOrderReview, postOnFreeRegistration, postOnPaymentSuccess, } from '../../api/ApiClient';
10
+ import { Loading } from '../../components';
11
+ import Button from '../../components/button/Button';
9
12
  import { priceWithCurrency } from '../../helpers/StringsHelper';
10
13
  import { orderReviewItems } from './CheckoutData';
11
- import CheckoutView from './CheckoutView';
12
- const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuccess, onFetchEventConditionsFail, onFetchEventConditionsSuccess, onCheckoutCompletedFail, onCheckoutCompletedSuccess, onPaymentError, onPaymentSuccess, onStripeInitializeError, texts, styles, onPressExit, }) => {
13
- const { confirmPayment, loading: isStripeLoading } = useConfirmPayment();
14
+ import Conditions from './components/Conditions';
15
+ import OrderReview from './components/OrderReview';
16
+ import s from './styles';
17
+ const Checkout = ({ eventId, checkoutData, onFetchOrderReviewError, onFetchOrderReviewSuccess, onFetchEventConditionsError, onFetchEventConditionsSuccess, onCheckoutCompletedError, onCheckoutCompletedSuccess, onPaymentError, onPaymentSuccess, onStripeInitializeError, texts, styles, onPressExit, areAlertsEnabled = true, areLoadingIndicatorsEnabled = true, onLoadingChange, onFetchOrderDetailsError, onFetchOrderDetailsSuccess, }) => {
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
19
+ const { confirmPayment, loading: isLoadingPayment } = useConfirmPayment();
14
20
  const [isLoading, setIsLoading] = useState(true);
15
21
  const [orderReview, setOrderReview] = useState();
16
22
  const [conditionsTexts, setConditionsTexts] = useState([]);
@@ -19,8 +25,17 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
19
25
  const [paymentInfo, setPaymentInfo] = useState();
20
26
  const [isStripeConfigMissing, setIsStripeConfigMissing] = useState(false);
21
27
  const [isPaymentRequired, setIsPaymentRequired] = useState(false);
22
- const [isLoadingFreeRegistration, setIsLoadingFreeRegistration] = useState(false);
28
+ const showLoading = () => setIsLoading(true);
29
+ const hideLoading = () => setIsLoading(false);
30
+ const showAlert = (message) => {
31
+ if (areAlertsEnabled) {
32
+ Alert.alert('', message);
33
+ }
34
+ };
23
35
  //#region Handlers
36
+ const handleOnPressExit = () => {
37
+ onPressExit();
38
+ };
24
39
  const handleOnChangePaymentInfo = (details) => {
25
40
  setPaymentInfo(details);
26
41
  };
@@ -29,25 +44,64 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
29
44
  tConditionsValues[index] = !conditionsValues[index];
30
45
  setConditionsValues(tConditionsValues);
31
46
  };
47
+ const handleFetchOrderDetails = async () => {
48
+ var _a, _b, _c;
49
+ showLoading();
50
+ const { orderDetailsData, orderDetailsError } = await fetchOrderDetails(checkoutData.id);
51
+ hideLoading();
52
+ if (orderDetailsError) {
53
+ onFetchOrderDetailsError === null || onFetchOrderDetailsError === void 0 ? void 0 : onFetchOrderDetailsError(orderDetailsError);
54
+ return showAlert(orderDetailsError.message || 'Error while fetching order details');
55
+ }
56
+ if (!orderDetailsData) {
57
+ onFetchOrderDetailsError === null || onFetchOrderDetailsError === void 0 ? void 0 : onFetchOrderDetailsError({
58
+ code: 404,
59
+ message: 'No order data found',
60
+ });
61
+ return showAlert('No order data found');
62
+ }
63
+ const orderDetails = {
64
+ eventId: eventId,
65
+ ticketName: (_a = orderDetailsData.items[0]) === null || _a === void 0 ? void 0 : _a.name,
66
+ ticketCost: (_b = orderDetailsData.items[0]) === null || _b === void 0 ? void 0 : _b.price,
67
+ numberOfTickets: parseInt((_c = orderDetailsData.items[0]) === null || _c === void 0 ? void 0 : _c.quantity, 10),
68
+ eventUserTickets: _map(orderDetailsData.tickets, (ticket) => ({
69
+ hash: ticket.hash,
70
+ ticketType: ticket.ticketType,
71
+ holderEmail: ticket.holderEmail,
72
+ holderPhone: ticket.holderPhone,
73
+ holderName: ticket.holderName,
74
+ qrData: ticket.qrData,
75
+ pdfLink: ticket.pdfLink,
76
+ })),
77
+ };
78
+ onFetchOrderDetailsSuccess === null || onFetchOrderDetailsSuccess === void 0 ? void 0 : onFetchOrderDetailsSuccess(orderDetails);
79
+ };
32
80
  const handleOnPressFreeRegistration = async () => {
33
- setIsLoadingFreeRegistration(true);
34
- const { freeRegistrationData, freeRegistrationError } = await postOnFreeRegistration(hash);
35
- setIsLoadingFreeRegistration(false);
81
+ showLoading();
82
+ const { freeRegistrationData, freeRegistrationError } = await postOnFreeRegistration(checkoutData.hash);
36
83
  if (freeRegistrationError) {
84
+ hideLoading();
37
85
  if (onPaymentError) {
38
- onPaymentError(freeRegistrationError || 'Error while registering');
86
+ onPaymentError(freeRegistrationError);
39
87
  }
40
- return Alert.alert('', freeRegistrationError || 'Error while registering');
41
- }
42
- if (onPaymentSuccess) {
43
- return onPaymentSuccess(freeRegistrationData);
88
+ return showAlert(freeRegistrationError.message || 'Error while registering');
44
89
  }
90
+ hideLoading();
91
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(freeRegistrationData);
92
+ await handleFetchOrderDetails();
45
93
  };
46
94
  const handleOnPressPay = async () => {
47
- if (!orderReview || !paymentInfo) {
48
- return;
95
+ if (!orderReview) {
96
+ if (onPaymentError) {
97
+ onPaymentError({
98
+ message: `Order data is missing ${JSON.stringify(orderReview)}`,
99
+ });
100
+ }
101
+ return showAlert('No order data found');
49
102
  }
50
103
  const { addressData } = orderReview;
104
+ showLoading();
51
105
  const { error: confirmPaymentError, paymentIntent } = await confirmPayment(orderReview.paymentData.stripeClientSecret, {
52
106
  type: 'Card',
53
107
  billingDetails: {
@@ -58,25 +112,26 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
58
112
  name: `${orderReview.billingData.firstName} ${orderReview.billingData.lastName}`,
59
113
  },
60
114
  });
61
- if (confirmPaymentError || !paymentInfo) {
62
- if (onCheckoutCompletedFail) {
63
- onCheckoutCompletedFail((confirmPaymentError === null || confirmPaymentError === void 0 ? void 0 : confirmPaymentError.message) || 'Missing Payment Info');
115
+ if (confirmPaymentError || (paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status) !== 'Succeeded') {
116
+ hideLoading();
117
+ if (onCheckoutCompletedError) {
118
+ onCheckoutCompletedError({
119
+ message: (confirmPaymentError === null || confirmPaymentError === void 0 ? void 0 : confirmPaymentError.message) || 'Error confirming payment',
120
+ extraData: confirmPaymentError === null || confirmPaymentError === void 0 ? void 0 : confirmPaymentError.code,
121
+ });
64
122
  }
65
- return Alert.alert('', 'Missing Payment Info');
66
- }
67
- if (onCheckoutCompletedSuccess) {
68
- onCheckoutCompletedSuccess(paymentIntent);
123
+ return showAlert((confirmPaymentError === null || confirmPaymentError === void 0 ? void 0 : confirmPaymentError.message) || 'Error confirming payment');
69
124
  }
70
- const { data: onPaymentSuccessData, error: onPaymentSuccessError } = await postOnPaymentSuccess(hash);
125
+ onCheckoutCompletedSuccess === null || onCheckoutCompletedSuccess === void 0 ? void 0 : onCheckoutCompletedSuccess(checkoutData);
126
+ const { data: onPaymentSuccessData, error: onPaymentSuccessError } = await postOnPaymentSuccess(checkoutData.hash);
71
127
  if (onPaymentSuccessError) {
72
- if (onPaymentError) {
73
- onPaymentError(onPaymentSuccessError);
74
- }
75
- return Alert.alert('', onPaymentSuccessError || 'Error while performing payment');
76
- }
77
- if (onPaymentSuccess) {
78
- onPaymentSuccess(onPaymentSuccessData);
128
+ hideLoading();
129
+ onPaymentError === null || onPaymentError === void 0 ? void 0 : onPaymentError(onPaymentSuccessError);
130
+ return showAlert(onPaymentSuccessError.message || 'Error while performing payment');
79
131
  }
132
+ hideLoading();
133
+ onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess(onPaymentSuccessData);
134
+ await handleFetchOrderDetails();
80
135
  };
81
136
  //#endregion
82
137
  const getConditions = () => _map(conditionsTexts, (conditionTxt, index) => {
@@ -90,38 +145,54 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
90
145
  },
91
146
  };
92
147
  });
148
+ const onLoadingChangeCallback = useCallback((loading) => {
149
+ if (onLoadingChange) {
150
+ onLoadingChange(loading);
151
+ }
152
+ }, [onLoadingChange]);
93
153
  //#region useEffects
154
+ useEffect(() => {
155
+ onLoadingChangeCallback(isLoading);
156
+ }, [isLoading, onLoadingChangeCallback]);
94
157
  useEffect(() => {
95
158
  const fetchEventConditionsAsync = async () => {
96
159
  const { error: conditionsError, data: conditionsData } = await fetchEventConditions(eventId.toString());
97
160
  if (conditionsError) {
98
- setIsLoadingFreeRegistration(false);
99
- if (onFetchEventConditionsFail) {
100
- onFetchEventConditionsFail(conditionsError);
161
+ hideLoading();
162
+ if (onFetchEventConditionsError) {
163
+ onFetchEventConditionsError(conditionsError);
101
164
  }
102
- return Alert.alert('', conditionsError || 'Error while fetching conditions');
165
+ return showAlert(conditionsError.message || 'Error while fetching conditions');
103
166
  }
104
167
  setConditionsValues(_map(conditionsData, () => false));
105
168
  setConditionsTexts(conditionsData);
169
+ hideLoading();
106
170
  if (onFetchEventConditionsSuccess) {
107
- setIsLoadingFreeRegistration(false);
108
171
  onFetchEventConditionsSuccess(conditionsData);
109
172
  }
110
173
  };
111
174
  const fetchOrderReviewAsync = async () => {
112
175
  var _a;
113
- const { data: orderReviewData, error: orderReviewError } = await fetchOrderReview(hash);
114
- setIsLoading(false);
115
- if (orderReviewError || !orderReviewData) {
116
- setIsLoadingFreeRegistration(false);
176
+ const { data: orderReviewData, error: orderReviewError } = await fetchOrderReview(checkoutData.hash);
177
+ hideLoading();
178
+ if (orderReviewError) {
179
+ hideLoading();
117
180
  setIsStripeConfigMissing(true);
118
- if (onFetchOrderReviewFail) {
119
- onFetchOrderReviewFail(orderReviewError || 'Error while getting Order Review');
181
+ if (onFetchOrderReviewError) {
182
+ onFetchOrderReviewError(orderReviewError);
183
+ }
184
+ return showAlert((orderReviewError === null || orderReviewError === void 0 ? void 0 : orderReviewError.message) || 'Error while getting Order Review');
185
+ }
186
+ if (!orderReviewData) {
187
+ if (onFetchOrderReviewError) {
188
+ onFetchOrderReviewError({
189
+ message: 'No order review data found. Please try again later',
190
+ });
120
191
  }
121
- return Alert.alert('', orderReviewError || 'Error while getting Order Review');
192
+ return showAlert('No order review data found. Please try again later');
122
193
  }
194
+ hideLoading();
123
195
  if (onFetchOrderReviewSuccess) {
124
- setIsLoadingFreeRegistration(false);
125
196
  onFetchOrderReviewSuccess(orderReviewData);
126
197
  }
127
198
  const tOrderInfo = [...orderInfo];
@@ -145,7 +216,8 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
145
216
  if (onStripeInitializeError) {
146
217
  onStripeInitializeError('Stripe is not configured for this event');
147
218
  }
148
- return Alert.alert('Stripe is not configured for this event', 'Please contact support.');
219
+ showAlert('Stripe is not configured for this event.Please contact support.');
220
+ return;
149
221
  }
150
222
  setIsPaymentRequired(true);
151
223
  try {
@@ -165,10 +237,10 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
165
237
  }
166
238
  };
167
239
  const fetchInitialData = async () => {
168
- setIsLoading(true);
240
+ showLoading();
169
241
  await fetchEventConditionsAsync();
170
242
  await fetchOrderReviewAsync();
171
- setIsLoading(false);
243
+ hideLoading();
172
244
  };
173
245
  fetchInitialData();
174
246
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -178,7 +250,31 @@ const Checkout = ({ eventId, hash, onFetchOrderReviewFail, onFetchOrderReviewSuc
178
250
  const paymentValid = paymentInfo === null || paymentInfo === void 0 ? void 0 : paymentInfo.complete;
179
251
  return paymentValid && _every(conditionsValues, (item) => item === true);
180
252
  };
181
- return (React.createElement(CheckoutView, { orderReviewDataItems: orderInfo, onPressPay: handleOnPressPay, onPressFreeRegistration: handleOnPressFreeRegistration, conditions: getConditions(), onFormComplete: handleOnChangePaymentInfo, isLoading: isLoading || isStripeLoading, isDataValid: !getIsDataValid(), isStripeConfigMissing: isStripeConfigMissing, styles: styles, texts: texts, onPressExit: onPressExit, isPaymentRequired: isPaymentRequired, isLoadingFreeRegistration: isLoadingFreeRegistration }));
253
+ const isDataValid = getIsDataValid();
254
+ const payButtonStyle = isDataValid
255
+ ? (_a = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _a === void 0 ? void 0 : _a.button
256
+ : (_b = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _b === void 0 ? void 0 : _b.buttonDisabled;
257
+ return isStripeConfigMissing ? (React.createElement(View, { style: [s.missingStripeContainer, (_c = styles === null || styles === void 0 ? void 0 : styles.missingStripeConfig) === null || _c === void 0 ? void 0 : _c.container] },
258
+ React.createElement(Text, { style: [s.missingStripeMessage, (_d = styles === null || styles === void 0 ? void 0 : styles.missingStripeConfig) === null || _d === void 0 ? void 0 : _d.message] }, (texts === null || texts === void 0 ? void 0 : texts.missingStripeConfigMessage) ||
259
+ 'Payment handler is missing, please contact support'),
260
+ React.createElement(Button, { styles: (_e = styles === null || styles === void 0 ? void 0 : styles.missingStripeConfig) === null || _e === void 0 ? void 0 : _e.exitButton, text: (texts === null || texts === void 0 ? void 0 : texts.exitButton) || 'Exit', onPress: handleOnPressExit }))) : (React.createElement(KeyboardAwareScrollView, { extraScrollHeight: 32 },
261
+ React.createElement(View, { style: styles === null || styles === void 0 ? void 0 : styles.rootStyle },
262
+ React.createElement(View, null,
263
+ React.createElement(Text, { style: [s.title, styles === null || styles === void 0 ? void 0 : styles.title] }, (texts === null || texts === void 0 ? void 0 : texts.title) || 'GET YOUR TICKETS'),
264
+ React.createElement(Text, { style: [styles === null || styles === void 0 ? void 0 : styles.subTitle] }, (texts === null || texts === void 0 ? void 0 : texts.subTitle) || 'Order review')),
265
+ React.createElement(OrderReview, { orderItems: orderInfo, styles: styles === null || styles === void 0 ? void 0 : styles.orderReview }),
266
+ isPaymentRequired && !isStripeConfigMissing && (React.createElement(View, { style: (_f = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _f === void 0 ? void 0 : _f.container },
267
+ React.createElement(Text, { style: (_g = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _g === void 0 ? void 0 : _g.title }, "Please provide your payment information"),
268
+ React.createElement(CardForm, { onFormComplete: handleOnChangePaymentInfo, style: [s.card, (_h = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _h === void 0 ? void 0 : _h.cardContainer], cardStyle: ((_j = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _j === void 0 ? void 0 : _j.cardBackgroundColor)
269
+ ? { backgroundColor: (_k = styles === null || styles === void 0 ? void 0 : styles.payment) === null || _k === void 0 ? void 0 : _k.cardBackgroundColor }
270
+ : s.cardBackground }))),
271
+ React.createElement(Conditions, { ...getConditions() }),
272
+ isPaymentRequired && !isStripeConfigMissing && (React.createElement(Button, { text: (texts === null || texts === void 0 ? void 0 : texts.payButton) || 'PAY', onPress: handleOnPressPay, isLoading: isLoading || isLoadingPayment, isDisabled: !isDataValid, styles: {
273
+ container: s.payButton,
274
+ ...payButtonStyle,
275
+ } })),
276
+ !isPaymentRequired && (React.createElement(Button, { text: (texts === null || texts === void 0 ? void 0 : texts.freeRegistrationButton) || 'COMPLETE REGISTRATION', onPress: handleOnPressFreeRegistration, isLoading: isLoading || isLoadingPayment, styles: styles === null || styles === void 0 ? void 0 : styles.freeRegistrationButton }))),
277
+ isLoading && areLoadingIndicatorsEnabled && React.createElement(Loading, null)));
182
278
  };
183
279
  export default Checkout;
184
280
  //# sourceMappingURL=Checkout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkout.js","sourceRoot":"","sources":["../../../src/containers/checkout/Checkout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,iBAAiB,GAClB,MAAM,6BAA6B,CAAA;AACpC,OAAO,MAAM,MAAM,cAAc,CAAA;AACjC,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,IAAI,MAAM,YAAY,CAAA;AAC7B,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAEpC,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,YAAY,MAAM,gBAAgB,CAAA;AAGzC,MAAM,QAAQ,GA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tB,CACG,CACR;YACD,oBAAC,UAAU,OAAK,aAAa,EAAE,GAAI;YAClC,iBAAiB,IAAI,CAAC,qBAAqB,IAAI,CAC9C,oBAAC,MAAM,IACL,IAAI,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,KAAI,KAAK,EAC/B,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,SAAS,IAAI,gBAAgB,EACxC,UAAU,EAAE,CAAC,WAAW,EACxB,MAAM,EAAE;oBACN,SAAS,EAAE,CAAC,CAAC,SAAS;oBACtB,GAAG,cAAc;iBAClB,GACD,CACH;YACA,CAAC,iBAAiB,IAAI,CACrB,oBAAC,MAAM,IACL,IAAI,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,sBAAsB,KAAI,uBAAuB,EAC9D,OAAO,EAAE,6BAA6B,EACtC,SAAS,EAAE,SAAS,IAAI,gBAAgB,EACxC,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,sBAAsB,GACtC,CACH,CACI;QACN,SAAS,IAAI,2BAA2B,IAAI,oBAAC,OAAO,OAAG,CAChC,CAC3B,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
@@ -24,6 +24,8 @@ declare const _default: {
24
24
  borderRadius: number;
25
25
  padding: number;
26
26
  alignSelf: "center";
27
+ };
28
+ cardBackground: {
27
29
  backgroundColor: string;
28
30
  };
29
31
  missingStripeContainer: {
@@ -1,4 +1,4 @@
1
- import { StyleSheet, Platform } from 'react-native';
1
+ import { Platform, StyleSheet } from 'react-native';
2
2
  import R from '../../res';
3
3
  export default StyleSheet.create({
4
4
  title: {
@@ -26,7 +26,9 @@ export default StyleSheet.create({
26
26
  borderRadius: 10,
27
27
  padding: 8,
28
28
  alignSelf: 'center',
29
- backgroundColor: R.colors.white,
29
+ },
30
+ cardBackground: {
31
+ backgroundColor: 'gray',
30
32
  },
31
33
  missingStripeContainer: {
32
34
  flex: 1,
@@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oB,EAAE;QACpB,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK;QACrB,SAAS,EAAE,QAAQ;QACnB,YAAY,EAAE,EAAE;KACjB;IACD,SAAS,EAAE;QACT,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG;KAC9B;CACF,CAAC,CAAA"}
@@ -2,6 +2,8 @@ import { CardFormView } from '@stripe/stripe-react-native';
2
2
  import { StyleProp, TextStyle, ViewStyle } from 'react-native';
3
3
  import { IButtonStyles } from '../../components/button/types';
4
4
  import { IFormFieldProps } from '../../components/formField/types';
5
+ import { IError } from '../../types';
6
+ import { IOnCheckoutSuccess } from '../billingInfo/types';
5
7
  export interface ICheckoutStyles {
6
8
  rootStyle?: ViewStyle;
7
9
  title?: StyleProp<TextStyle>;
@@ -22,27 +24,49 @@ export interface ICheckoutStyles {
22
24
  buttonDisabled?: IButtonStyles;
23
25
  };
24
26
  }
27
+ export interface IOrderDetailsTicketHolder {
28
+ hash: string;
29
+ ticketType: string;
30
+ holderName?: string;
31
+ holderEmail?: string;
32
+ holderPhone?: string;
33
+ qrData?: string;
34
+ pdfLink?: string;
35
+ }
36
+ export interface IOrderDetails {
37
+ eventId: number;
38
+ ticketName?: string;
39
+ ticketCost?: string;
40
+ numberOfTickets: number;
41
+ eventUserTickets: IOrderDetailsTicketHolder[];
42
+ }
25
43
  export interface ICheckoutProps {
26
44
  eventId: number;
27
- hash: string;
28
- total: string;
29
- onFetchOrderReviewFail?: (error: string) => void;
45
+ checkoutData: IOnCheckoutSuccess;
46
+ onFetchOrderReviewError?: (error: IError) => void;
30
47
  onFetchOrderReviewSuccess?: (data: any) => void;
31
- onFetchEventConditionsFail?: (error: string) => void;
48
+ onFetchEventConditionsError?: (error: IError) => void;
32
49
  onFetchEventConditionsSuccess?: (data: any) => void;
33
- onCheckoutCompletedSuccess?: (data: any) => void;
34
- onCheckoutCompletedFail?: (error: string) => void;
50
+ onCheckoutCompletedSuccess?: (data: IOnCheckoutSuccess) => void;
51
+ onCheckoutCompletedError?: (error: IError) => void;
35
52
  onPaymentSuccess: (data: any) => void;
36
- onPaymentError?: (error: string) => void;
53
+ onPaymentError?: (error: IError) => void;
54
+ onFetchOrderDetailsSuccess: (orderData: IOrderDetails) => void;
55
+ onFetchOrderDetailsError: (error: IError) => void;
37
56
  onStripeInitializeError?: (error: string) => void;
38
- onPressExit?: () => void;
57
+ onPressExit: () => void;
39
58
  texts?: {
40
59
  title?: string;
41
60
  subTitle?: string;
42
61
  missingStripeConfigMessage?: string;
43
62
  exitButton?: string;
63
+ payButton?: string;
64
+ freeRegistrationButton?: string;
44
65
  };
45
66
  styles?: ICheckoutStyles;
67
+ onLoadingChange?: (isLoading: boolean) => void;
68
+ areAlertsEnabled?: boolean;
69
+ areLoadingIndicatorsEnabled?: boolean;
46
70
  }
47
71
  export interface IOrderItem {
48
72
  id: string;