tf-checkout-react-native 1.0.18 → 1.0.21
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/README.md +1000 -21
- package/lib/api/ApiClient.d.ts +16 -36
- package/lib/api/ApiClient.js +140 -40
- package/lib/api/ApiClient.js.map +1 -1
- package/lib/api/Constants.js +3 -3
- package/lib/api/Constants.js.map +1 -1
- package/lib/api/types.d.ts +117 -22
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.js +3 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/login/Login.d.ts +2 -1
- package/lib/components/login/Login.js +25 -63
- package/lib/components/login/Login.js.map +1 -1
- package/lib/components/login/LoginView.d.ts +2 -1
- package/lib/components/login/LoginView.js +4 -1
- package/lib/components/login/LoginView.js.map +1 -1
- package/lib/components/login/types.d.ts +9 -9
- package/lib/components/phoneInput/PhoneInput.d.ts +4 -0
- package/lib/components/phoneInput/PhoneInput.js +33 -0
- package/lib/components/phoneInput/PhoneInput.js.map +1 -0
- package/lib/components/phoneInput/styles.d.ts +28 -0
- package/lib/components/phoneInput/styles.js +30 -0
- package/lib/components/phoneInput/styles.js.map +1 -0
- package/lib/components/phoneInput/types.d.ts +30 -0
- package/lib/components/phoneInput/types.js +2 -0
- package/lib/components/phoneInput/types.js.map +1 -0
- package/lib/components/promoCode/PromoCode.d.ts +2 -1
- package/lib/components/promoCode/PromoCode.js.map +1 -1
- package/lib/components/promoCode/types.d.ts +1 -1
- package/lib/components/radioButton/RadioButton.d.ts +4 -0
- package/lib/components/radioButton/RadioButton.js +9 -0
- package/lib/components/radioButton/RadioButton.js.map +1 -0
- package/lib/components/radioButton/styles.d.ts +24 -0
- package/lib/components/radioButton/styles.js +30 -0
- package/lib/components/radioButton/styles.js.map +1 -0
- package/lib/components/radioButton/types.d.ts +15 -0
- package/lib/components/radioButton/types.js +2 -0
- package/lib/components/radioButton/types.js.map +1 -0
- package/lib/components/stripePayment/StripePayment.d.ts +4 -0
- package/lib/components/stripePayment/StripePayment.js +23 -0
- package/lib/components/stripePayment/StripePayment.js.map +1 -0
- package/lib/components/stripePayment/types.d.ts +12 -0
- package/lib/components/stripePayment/types.js +2 -0
- package/lib/components/stripePayment/types.js.map +1 -0
- package/lib/components/waitingList/WaitingList.d.ts +2 -1
- package/lib/components/waitingList/WaitingList.js +32 -29
- package/lib/components/waitingList/WaitingList.js.map +1 -1
- package/lib/components/waitingList/WaitingListView.d.ts +2 -1
- package/lib/components/waitingList/WaitingListView.js.map +1 -1
- package/lib/components/waitingList/types.d.ts +0 -1
- package/lib/containers/billingInfo/Billing.js +209 -123
- package/lib/containers/billingInfo/Billing.js.map +1 -1
- package/lib/containers/billingInfo/types.d.ts +10 -6
- package/lib/containers/checkout/Checkout.d.ts +2 -1
- package/lib/containers/checkout/Checkout.js +67 -69
- package/lib/containers/checkout/Checkout.js.map +1 -1
- package/lib/containers/checkout/types.d.ts +1 -1
- package/lib/containers/index.d.ts +1 -0
- package/lib/containers/index.js +1 -0
- package/lib/containers/index.js.map +1 -1
- package/lib/containers/myOrderDetails/MyOrderDetails.js +50 -4
- package/lib/containers/myOrderDetails/MyOrderDetails.js.map +1 -1
- package/lib/containers/myOrderDetails/MyOrderDetailsView.d.ts +2 -2
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js +69 -47
- package/lib/containers/myOrderDetails/MyOrderDetailsView.js.map +1 -1
- package/lib/containers/myOrderDetails/types.d.ts +101 -77
- package/lib/containers/myOrders/MyOrders.js +26 -4
- package/lib/containers/myOrders/MyOrders.js.map +1 -1
- package/lib/containers/myOrders/MyOrdersView.d.ts +2 -1
- package/lib/containers/myOrders/MyOrdersView.js.map +1 -1
- package/lib/containers/myOrders/types.d.ts +4 -2
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.d.ts +2 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js +23 -8
- package/lib/containers/purchaseConfirmation/PurchaseConfirmation.js.map +1 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.d.ts +2 -1
- package/lib/containers/purchaseConfirmation/PurchaseConfirmationView.js.map +1 -1
- package/lib/containers/resaleTickets/ResaleTickets.d.ts +4 -0
- package/lib/containers/resaleTickets/ResaleTickets.js +149 -0
- package/lib/containers/resaleTickets/ResaleTickets.js.map +1 -0
- package/lib/containers/resaleTickets/ResaleTicketsView.d.ts +4 -0
- package/lib/containers/resaleTickets/ResaleTicketsView.js +182 -0
- package/lib/containers/resaleTickets/ResaleTicketsView.js.map +1 -0
- package/lib/containers/resaleTickets/types.d.ts +128 -0
- package/lib/containers/resaleTickets/types.js +11 -0
- package/lib/containers/resaleTickets/types.js.map +1 -0
- package/lib/containers/tickets/Tickets.d.ts +2 -1
- package/lib/containers/tickets/Tickets.js +73 -84
- package/lib/containers/tickets/Tickets.js.map +1 -1
- package/lib/containers/tickets/TicketsView.d.ts +1 -1
- package/lib/containers/tickets/TicketsView.js +2 -2
- package/lib/containers/tickets/TicketsView.js.map +1 -1
- package/lib/containers/tickets/types.d.ts +3 -14
- package/lib/core/BillingCore/BillingCore.d.ts +5 -0
- package/lib/core/BillingCore/BillingCore.js +28 -0
- package/lib/core/BillingCore/BillingCore.js.map +1 -0
- package/lib/core/BillingCore/BillingCoreTypes.d.ts +16 -0
- package/lib/core/BillingCore/BillingCoreTypes.js +2 -0
- package/lib/core/BillingCore/BillingCoreTypes.js.map +1 -0
- package/lib/core/CheckoutCore/CheckoutCore.d.ts +5 -0
- package/lib/core/CheckoutCore/CheckoutCore.js +25 -0
- package/lib/core/CheckoutCore/CheckoutCore.js.map +1 -0
- package/lib/core/CheckoutCore/CheckoutCoreTypes.d.ts +8 -0
- package/lib/core/CheckoutCore/CheckoutCoreTypes.js +2 -0
- package/lib/core/CheckoutCore/CheckoutCoreTypes.js.map +1 -0
- package/lib/core/CoreProps.d.ts +4 -0
- package/lib/core/CoreProps.js +2 -0
- package/lib/core/CoreProps.js.map +1 -0
- package/lib/core/LoginCore/LoginCore.d.ts +5 -0
- package/lib/core/LoginCore/LoginCore.js +100 -0
- package/lib/core/LoginCore/LoginCore.js.map +1 -0
- package/lib/core/LoginCore/LoginCoreTypes.d.ts +10 -0
- package/lib/core/LoginCore/LoginCoreTypes.js +2 -0
- package/lib/core/LoginCore/LoginCoreTypes.js.map +1 -0
- package/lib/core/MyOrdersCore/MyOrdersCore.d.ts +3 -0
- package/lib/core/MyOrdersCore/MyOrdersCore.js +16 -0
- package/lib/core/MyOrdersCore/MyOrdersCore.js.map +1 -0
- package/lib/core/MyOrdersCore/MyOrdersCoreTypes.d.ts +5 -0
- package/lib/core/MyOrdersCore/MyOrdersCoreTypes.js +2 -0
- package/lib/core/MyOrdersCore/MyOrdersCoreTypes.js.map +1 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCore.d.ts +5 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCore.js +15 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCore.js.map +1 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.d.ts +7 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.js +2 -0
- package/lib/core/OrderDetailsCore/OrderDetailsCoreTypes.js.map +1 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.d.ts +5 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.js +12 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCore.js.map +1 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.d.ts +4 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.js +2 -0
- package/lib/core/PurchaseConfirmationCore/PurchaseConfirmationCoreTypes.js.map +1 -0
- package/lib/core/TicketsCore/TicketsCore.d.ts +5 -0
- package/lib/core/TicketsCore/TicketsCore.js +59 -0
- package/lib/core/TicketsCore/TicketsCore.js.map +1 -0
- package/lib/core/TicketsCore/TicketsCoreTypes.d.ts +15 -0
- package/lib/core/TicketsCore/TicketsCoreTypes.js +2 -0
- package/lib/core/TicketsCore/TicketsCoreTypes.js.map +1 -0
- package/lib/core/WaitingListCore/WaitingListCore.d.ts +5 -0
- package/lib/core/WaitingListCore/WaitingListCore.js +17 -0
- package/lib/core/WaitingListCore/WaitingListCore.js.map +1 -0
- package/lib/core/WaitingListCore/WaitingListCoreTypes.d.ts +9 -0
- package/lib/core/WaitingListCore/WaitingListCoreTypes.js +2 -0
- package/lib/core/WaitingListCore/WaitingListCoreTypes.js.map +1 -0
- package/lib/core/index.d.ts +16 -0
- package/lib/core/index.js +9 -0
- package/lib/core/index.js.map +1 -0
- package/lib/helpers/Config.d.ts +1 -0
- package/lib/helpers/Config.js.map +1 -1
- package/lib/helpers/CountryCodes.d.ts +15 -0
- package/lib/helpers/CountryCodes.js +3382 -0
- package/lib/helpers/CountryCodes.js.map +1 -0
- package/lib/helpers/LocalStorage.d.ts +1 -0
- package/lib/helpers/LocalStorage.js +4 -1
- package/lib/helpers/LocalStorage.js.map +1 -1
- package/lib/helpers/Validators.d.ts +6 -0
- package/lib/helpers/Validators.js +10 -0
- package/lib/helpers/Validators.js.map +1 -1
- package/lib/index.d.ts +5 -3
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/types/IEvent.d.ts +6 -0
- package/lib/types/ITicket.d.ts +10 -1
- package/lib/types/IUserProfile.d.ts +15 -11
- package/package.json +13 -6
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { StyleProp, Text, TextStyle, ViewStyle } from 'react-native';
|
|
2
|
+
import { IMyOrderDetailsTicket, IResaleTicketData } from '../../api/types';
|
|
3
|
+
import { IButtonStyles } from '../../components/button/types';
|
|
4
|
+
import { ICheckboxStyles } from '../../components/checkbox/types';
|
|
5
|
+
import { IInputStyles } from '../../components/input/types';
|
|
6
|
+
import { IRadioButtonStyles } from '../../components/radioButton/types';
|
|
7
|
+
import { IError } from '../../types';
|
|
8
|
+
export interface ITicketOrderDetailsStyles {
|
|
9
|
+
title?: StyleProp<TextStyle>;
|
|
10
|
+
label?: StyleProp<TextStyle>;
|
|
11
|
+
value?: StyleProp<TextStyle>;
|
|
12
|
+
rootContainer?: StyleProp<ViewStyle>;
|
|
13
|
+
}
|
|
14
|
+
export interface ITicketOrderDetailsProps {
|
|
15
|
+
styles?: ITicketOrderDetailsStyles;
|
|
16
|
+
}
|
|
17
|
+
export interface ITicketBuyerFormStyles {
|
|
18
|
+
rootContainer?: StyleProp<ViewStyle>;
|
|
19
|
+
radioButtons?: IRadioButtonStyles;
|
|
20
|
+
inputs?: IInputStyles;
|
|
21
|
+
title?: StyleProp<TextStyle>;
|
|
22
|
+
formContainer?: StyleProp<ViewStyle>;
|
|
23
|
+
}
|
|
24
|
+
export interface IResaleTicketsFormData {
|
|
25
|
+
firstName: string;
|
|
26
|
+
lastName: string;
|
|
27
|
+
email: string;
|
|
28
|
+
emailConfirm: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IResaleTicketsFormDataErrors {
|
|
31
|
+
firstNameError?: string;
|
|
32
|
+
lastNameError?: string;
|
|
33
|
+
emailError?: string;
|
|
34
|
+
emailConfirmError?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface IResaleToWhomData {
|
|
37
|
+
toWhom: 'friend' | 'anyone' | undefined;
|
|
38
|
+
someoneData: IResaleTicketsFormData;
|
|
39
|
+
isTermsAgreed: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface ITicketBuyerFormProps {
|
|
42
|
+
isDataValid?: boolean;
|
|
43
|
+
styles?: ITicketBuyerFormStyles;
|
|
44
|
+
}
|
|
45
|
+
export interface IResaleTermsStyles {
|
|
46
|
+
rootContainer?: StyleProp<ViewStyle>;
|
|
47
|
+
title?: StyleProp<TextStyle>;
|
|
48
|
+
item?: StyleProp<TextStyle>;
|
|
49
|
+
itemBold?: StyleProp<TextStyle>;
|
|
50
|
+
}
|
|
51
|
+
export interface IResaleTermsProps {
|
|
52
|
+
styles?: IResaleTermsStyles;
|
|
53
|
+
terms: string[] | Text[];
|
|
54
|
+
}
|
|
55
|
+
export interface IResaleTicketsStyles {
|
|
56
|
+
rootContainer?: StyleProp<ViewStyle>;
|
|
57
|
+
title?: StyleProp<TextStyle>;
|
|
58
|
+
terms?: IResaleTermsStyles;
|
|
59
|
+
resaleTicketsButton?: IButtonStyles;
|
|
60
|
+
resaleTicketsButtonDisabled?: IButtonStyles;
|
|
61
|
+
resaleTicketsButtonLoading?: IButtonStyles;
|
|
62
|
+
ticketOrderDetails?: ITicketOrderDetailsStyles;
|
|
63
|
+
ticketBuyerForm?: ITicketBuyerFormStyles;
|
|
64
|
+
termsCheckbox?: ICheckboxStyles;
|
|
65
|
+
}
|
|
66
|
+
export interface IResaleTicketsProps {
|
|
67
|
+
ticket: IMyOrderDetailsTicket;
|
|
68
|
+
isTicketTypeActive?: boolean;
|
|
69
|
+
styles?: IResaleTicketsStyles;
|
|
70
|
+
onResaleTicketsSuccess: (resaleTicketData: IResaleTicketData, ticket: IMyOrderDetailsTicket) => void;
|
|
71
|
+
onResaleTicketsError?: (error: IError) => void;
|
|
72
|
+
config?: {
|
|
73
|
+
areAlertsEnabled?: boolean;
|
|
74
|
+
areActivityIndicatorsEnabled?: boolean;
|
|
75
|
+
};
|
|
76
|
+
texts?: IResaleTicketsViewTexts;
|
|
77
|
+
}
|
|
78
|
+
export interface IResaleTicketsViewTexts {
|
|
79
|
+
title?: string;
|
|
80
|
+
orderDetails?: {
|
|
81
|
+
title?: string;
|
|
82
|
+
eventName?: string;
|
|
83
|
+
orderedBy?: string;
|
|
84
|
+
orderId?: string;
|
|
85
|
+
};
|
|
86
|
+
sellToWhom?: {
|
|
87
|
+
title?: string;
|
|
88
|
+
friend?: string;
|
|
89
|
+
anyone?: string;
|
|
90
|
+
};
|
|
91
|
+
friendForm?: {
|
|
92
|
+
firstName?: string;
|
|
93
|
+
lastName?: string;
|
|
94
|
+
email?: string;
|
|
95
|
+
emailConfirm?: string;
|
|
96
|
+
};
|
|
97
|
+
terms?: {
|
|
98
|
+
title?: string;
|
|
99
|
+
paragraph1?: string;
|
|
100
|
+
paragraph2_1?: string;
|
|
101
|
+
paragraph2_2?: string;
|
|
102
|
+
paragraph3_1?: string;
|
|
103
|
+
paragraph3_2?: string;
|
|
104
|
+
};
|
|
105
|
+
agree?: string;
|
|
106
|
+
resaleTicketsButton?: string;
|
|
107
|
+
}
|
|
108
|
+
export declare enum ResaleToWhomFieldIdEnum {
|
|
109
|
+
firstName = 0,
|
|
110
|
+
lastName = 1,
|
|
111
|
+
email = 2,
|
|
112
|
+
emailConfirm = 3,
|
|
113
|
+
radioIndex = 4,
|
|
114
|
+
terms = 5
|
|
115
|
+
}
|
|
116
|
+
export interface IResaleTicketsViewProps {
|
|
117
|
+
isLoading?: boolean;
|
|
118
|
+
someoneDataErrors: IResaleTicketsFormDataErrors;
|
|
119
|
+
resaleToWhomData: IResaleToWhomData;
|
|
120
|
+
onResaleToWhomDataChanged: (id: ResaleToWhomFieldIdEnum, value?: string | number) => void;
|
|
121
|
+
isDataValid?: boolean;
|
|
122
|
+
isSomeoneDataValid?: boolean;
|
|
123
|
+
styles?: IResaleTicketsStyles;
|
|
124
|
+
texts?: IResaleTicketsViewTexts;
|
|
125
|
+
onPressResaleTickets: () => void;
|
|
126
|
+
ticket: IMyOrderDetailsTicket;
|
|
127
|
+
isTicketsTypeActive?: boolean;
|
|
128
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// eslint-disable-next-line no-shadow
|
|
2
|
+
export var ResaleToWhomFieldIdEnum;
|
|
3
|
+
(function (ResaleToWhomFieldIdEnum) {
|
|
4
|
+
ResaleToWhomFieldIdEnum[ResaleToWhomFieldIdEnum["firstName"] = 0] = "firstName";
|
|
5
|
+
ResaleToWhomFieldIdEnum[ResaleToWhomFieldIdEnum["lastName"] = 1] = "lastName";
|
|
6
|
+
ResaleToWhomFieldIdEnum[ResaleToWhomFieldIdEnum["email"] = 2] = "email";
|
|
7
|
+
ResaleToWhomFieldIdEnum[ResaleToWhomFieldIdEnum["emailConfirm"] = 3] = "emailConfirm";
|
|
8
|
+
ResaleToWhomFieldIdEnum[ResaleToWhomFieldIdEnum["radioIndex"] = 4] = "radioIndex";
|
|
9
|
+
ResaleToWhomFieldIdEnum[ResaleToWhomFieldIdEnum["terms"] = 5] = "terms";
|
|
10
|
+
})(ResaleToWhomFieldIdEnum || (ResaleToWhomFieldIdEnum = {}));
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/containers/resaleTickets/types.ts"],"names":[],"mappings":"AAiIA,qCAAqC;AACrC,MAAM,CAAN,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,+EAAS,CAAA;IACT,6EAAQ,CAAA;IACR,uEAAK,CAAA;IACL,qFAAY,CAAA;IACZ,iFAAU,CAAA;IACV,uEAAK,CAAA;AACP,CAAC,EAPW,uBAAuB,KAAvB,uBAAuB,QAOlC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
1
2
|
import { ITicketsProps } from './types';
|
|
2
|
-
declare const Tickets:
|
|
3
|
+
declare const Tickets: FC<ITicketsProps>;
|
|
3
4
|
export default Tickets;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
//@ts-nocheck
|
|
2
|
-
import jwtDecode from 'jwt-decode';
|
|
3
1
|
import _get from 'lodash/get';
|
|
4
2
|
import _isEmpty from 'lodash/isEmpty';
|
|
5
3
|
import _some from 'lodash/some';
|
|
6
4
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
5
|
import { Alert } from 'react-native';
|
|
8
|
-
import {
|
|
9
|
-
import { deleteAllData, deleteData, getData, LocalStorageKeys, } from '../../helpers/LocalStorage';
|
|
6
|
+
import { TicketsCore } from '../../core';
|
|
10
7
|
import TicketsView from './TicketsView';
|
|
11
|
-
const Tickets = ({
|
|
8
|
+
const Tickets = ({ onAddToCartSuccess, onAddToCartError, onFetchTicketsError, styles, texts, isAccessCodeEnabled = false, isPromoEnabled = true, onPressMyOrders, onPressLogout, onFetchTicketsSuccess, onFetchEventError, onLoadingChange, areAlertsEnabled = true, areLoadingIndicatorsEnabled = true, onFetchEventSuccess, onAddToWaitingListError, onAddToWaitingListSuccess, promoCodeCloseIcon, }) => {
|
|
12
9
|
const [isUserLogged, setIsUserLogged] = useState(false);
|
|
13
10
|
const [isGettingTickets, setIsGettingTickets] = useState(false);
|
|
14
11
|
const [isGettingEvent, setIsGettingEvent] = useState(false);
|
|
@@ -20,7 +17,10 @@ const Tickets = ({ eventId, onAddToCartSuccess, onAddToCartError, onFetchTickets
|
|
|
20
17
|
const [selectedTicket, setSelectedTicket] = useState();
|
|
21
18
|
const [promoCodeResponse, setPromoCodeResponse] = useState(undefined);
|
|
22
19
|
const [isFirstCall, setIsFirstCall] = useState(true);
|
|
20
|
+
//#region Refs
|
|
23
21
|
const eventErrorCodeRef = useRef(0);
|
|
22
|
+
const ticketsCoreRef = useRef(null);
|
|
23
|
+
//#endregion
|
|
24
24
|
const showAlert = (message) => {
|
|
25
25
|
if (areAlertsEnabled) {
|
|
26
26
|
Alert.alert('', message);
|
|
@@ -29,26 +29,35 @@ const Tickets = ({ eventId, onAddToCartSuccess, onAddToCartError, onFetchTickets
|
|
|
29
29
|
const isTicketOnSale = _some(tickets, (item) => item.salesStarted && !item.salesEnded && !item.soldOut);
|
|
30
30
|
//#region Api calls
|
|
31
31
|
const retrieveStoredAccessToken = async () => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
if (!ticketsCoreRef.current) {
|
|
33
|
+
return { eventError: { message: 'Ticket core is not initialized' } };
|
|
34
|
+
}
|
|
35
|
+
setIsUserLogged(await ticketsCoreRef.current.getIsUserLoggedIn());
|
|
36
|
+
};
|
|
37
|
+
const getTicketsCore = async (promoCode) => {
|
|
38
|
+
if (!ticketsCoreRef.current) {
|
|
39
|
+
return { error: { message: 'Ticket core is not initialized' } };
|
|
35
40
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return
|
|
41
|
+
return await ticketsCoreRef.current.getTickets(promoCode);
|
|
42
|
+
};
|
|
43
|
+
const getEventCore = async () => {
|
|
44
|
+
if (!ticketsCoreRef.current) {
|
|
45
|
+
return { eventError: { message: 'Ticket core is not initialized' } };
|
|
46
|
+
}
|
|
47
|
+
return await ticketsCoreRef.current.getEvent();
|
|
48
|
+
};
|
|
49
|
+
const addToCartCore = async (data) => {
|
|
50
|
+
if (!ticketsCoreRef.current) {
|
|
51
|
+
return { error: { message: 'Ticket core is not initialized' } };
|
|
41
52
|
}
|
|
42
|
-
|
|
53
|
+
return await ticketsCoreRef.current.addToCart(data);
|
|
43
54
|
};
|
|
44
55
|
const getTickets = async (promoCode = '') => {
|
|
45
56
|
setIsGettingTickets(true);
|
|
46
|
-
const { error, tickets: responseTickets, promoCodeResult, isInWaitingList, isAccessCodeRequired, } = await
|
|
57
|
+
const { error, tickets: responseTickets, promoCodeResult, isInWaitingList, isAccessCodeRequired, } = await getTicketsCore(promoCode);
|
|
47
58
|
setIsGettingTickets(false);
|
|
48
59
|
if (error) {
|
|
49
|
-
|
|
50
|
-
onFetchTicketsError(error);
|
|
51
|
-
}
|
|
60
|
+
onFetchTicketsError === null || onFetchTicketsError === void 0 ? void 0 : onFetchTicketsError(error);
|
|
52
61
|
return showAlert('Error while getting tickets, please try again');
|
|
53
62
|
}
|
|
54
63
|
setIsWaitingListVisible(!!isInWaitingList);
|
|
@@ -61,93 +70,69 @@ const Tickets = ({ eventId, onAddToCartSuccess, onAddToCartError, onFetchTickets
|
|
|
61
70
|
else if (!isFirstCall) {
|
|
62
71
|
setPromoCodeResponse(promoCodeResult);
|
|
63
72
|
}
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
const onFetchTicketsData = {
|
|
74
|
+
promoCodeResponse: {
|
|
75
|
+
success: true,
|
|
76
|
+
message: promoCodeResponse === null || promoCodeResponse === void 0 ? void 0 : promoCodeResponse.message,
|
|
77
|
+
},
|
|
78
|
+
tickets: responseTickets,
|
|
79
|
+
isInWaitingList,
|
|
80
|
+
isAccessCodeRequired,
|
|
81
|
+
};
|
|
82
|
+
onFetchTicketsSuccess === null || onFetchTicketsSuccess === void 0 ? void 0 : onFetchTicketsSuccess(onFetchTicketsData);
|
|
83
|
+
if (!isFirstCall &&
|
|
84
|
+
(!(promoCodeResult === null || promoCodeResult === void 0 ? void 0 : promoCodeResult.isValid) || promoCodeResult.isValid === 0)) {
|
|
85
|
+
onFetchTicketsSuccess === null || onFetchTicketsSuccess === void 0 ? void 0 : onFetchTicketsSuccess({
|
|
86
|
+
...onFetchTicketsData,
|
|
66
87
|
promoCodeResponse: {
|
|
67
|
-
success:
|
|
68
|
-
message:
|
|
88
|
+
success: false,
|
|
89
|
+
message: promoCodeResult === null || promoCodeResult === void 0 ? void 0 : promoCodeResult.message,
|
|
69
90
|
},
|
|
70
|
-
tickets: responseTickets,
|
|
71
|
-
isInWaitingList,
|
|
72
|
-
isAccessCodeRequired,
|
|
73
91
|
});
|
|
74
92
|
}
|
|
75
|
-
if (!isFirstCall &&
|
|
76
|
-
(!(promoCodeResult === null || promoCodeResult === void 0 ? void 0 : promoCodeResult.isValid) || promoCodeResult.isValid === 0)) {
|
|
77
|
-
if (onFetchTicketsSuccess) {
|
|
78
|
-
onFetchTicketsSuccess({
|
|
79
|
-
promoCodeResponse: {
|
|
80
|
-
success: false,
|
|
81
|
-
message: promoCodeResponse === null || promoCodeResponse === void 0 ? void 0 : promoCodeResponse.message,
|
|
82
|
-
},
|
|
83
|
-
tickets: responseTickets,
|
|
84
|
-
isInWaitingList,
|
|
85
|
-
isAccessCodeRequired,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
93
|
}
|
|
90
94
|
setIsFirstCall(false);
|
|
91
95
|
};
|
|
92
96
|
const getEventData = async () => {
|
|
93
97
|
setIsGettingEvent(true);
|
|
94
|
-
const { eventError, eventData } = await
|
|
98
|
+
const { eventError, eventData } = await getEventCore();
|
|
95
99
|
setIsGettingEvent(false);
|
|
96
100
|
if (eventError) {
|
|
97
|
-
|
|
98
|
-
onFetchEventError(eventError || 'There was an error while fetching event');
|
|
99
|
-
}
|
|
100
|
-
eventErrorCodeRef.current = eventError.code;
|
|
101
|
+
eventErrorCodeRef.current = eventError.code || 400;
|
|
101
102
|
showAlert(eventError.message);
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
slug: eventData === null || eventData === void 0 ? void 0 : eventData.slug,
|
|
108
|
-
description: eventData === null || eventData === void 0 ? void 0 : eventData.description,
|
|
109
|
-
title: eventData === null || eventData === void 0 ? void 0 : eventData.title,
|
|
103
|
+
return onFetchEventError === null || onFetchEventError === void 0 ? void 0 : onFetchEventError(eventError || { message: 'There was an error while fetching event' });
|
|
104
|
+
}
|
|
105
|
+
if (!eventData) {
|
|
106
|
+
return onFetchEventError === null || onFetchEventError === void 0 ? void 0 : onFetchEventError({
|
|
107
|
+
message: 'There was an error while fetching event',
|
|
110
108
|
});
|
|
111
109
|
}
|
|
110
|
+
onFetchEventSuccess === null || onFetchEventSuccess === void 0 ? void 0 : onFetchEventSuccess(eventData);
|
|
112
111
|
setEvent(eventData);
|
|
113
112
|
};
|
|
114
113
|
const performBookTickets = async () => {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
product_id: eventId,
|
|
128
|
-
ticket_types: {
|
|
129
|
-
[ticketId]: {
|
|
130
|
-
product_options: {
|
|
131
|
-
[optionName]: ticketId,
|
|
132
|
-
ticket_price: ticketPrice,
|
|
133
|
-
},
|
|
134
|
-
quantity: ticketQuantity,
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
},
|
|
114
|
+
if (!selectedTicket || !selectedTicket.selectedOption) {
|
|
115
|
+
onAddToCartError === null || onAddToCartError === void 0 ? void 0 : onAddToCartError({ message: 'Please select a ticket' });
|
|
116
|
+
return showAlert('Please select a ticket');
|
|
117
|
+
}
|
|
118
|
+
const ticketQuantity = typeof selectedTicket.selectedOption.value === 'string'
|
|
119
|
+
? parseInt(selectedTicket.selectedOption.value, 10)
|
|
120
|
+
: selectedTicket.selectedOption.value;
|
|
121
|
+
const ticketsOptions = {
|
|
122
|
+
quantity: ticketQuantity,
|
|
123
|
+
optionName: _get(selectedTicket, 'optionName'),
|
|
124
|
+
ticketId: _get(selectedTicket, 'id'),
|
|
125
|
+
price: selectedTicket.price,
|
|
138
126
|
};
|
|
139
127
|
setIsBooking(true);
|
|
140
|
-
const { data: result, error: addToCartError } = await
|
|
128
|
+
const { data: result, error: addToCartError } = await addToCartCore(ticketsOptions);
|
|
141
129
|
setIsBooking(false);
|
|
142
130
|
if (result) {
|
|
143
|
-
return onAddToCartSuccess(result);
|
|
131
|
+
return onAddToCartSuccess === null || onAddToCartSuccess === void 0 ? void 0 : onAddToCartSuccess(result);
|
|
144
132
|
}
|
|
145
133
|
if (addToCartError) {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
showAlert(addToCartError);
|
|
150
|
-
return;
|
|
134
|
+
showAlert(addToCartError.message || 'Error while adding tickets to cart');
|
|
135
|
+
return onAddToCartError === null || onAddToCartError === void 0 ? void 0 : onAddToCartError(addToCartError);
|
|
151
136
|
}
|
|
152
137
|
};
|
|
153
138
|
//#endregion
|
|
@@ -193,7 +178,10 @@ const Tickets = ({ eventId, onAddToCartSuccess, onAddToCartError, onFetchTickets
|
|
|
193
178
|
setSelectedTicket(ticket);
|
|
194
179
|
};
|
|
195
180
|
const handleOnLogout = async () => {
|
|
196
|
-
|
|
181
|
+
if (!ticketsCoreRef.current) {
|
|
182
|
+
return { error: { message: 'Ticket core is not initialized' } };
|
|
183
|
+
}
|
|
184
|
+
await ticketsCoreRef.current.logout();
|
|
197
185
|
setIsUserLogged(false);
|
|
198
186
|
await getTickets();
|
|
199
187
|
await getEventData();
|
|
@@ -205,7 +193,8 @@ const Tickets = ({ eventId, onAddToCartSuccess, onAddToCartError, onFetchTickets
|
|
|
205
193
|
onLoadingChangeCallback(loading);
|
|
206
194
|
};
|
|
207
195
|
//#endregion
|
|
208
|
-
return (React.createElement(
|
|
196
|
+
return (React.createElement(TicketsCore, { ref: ticketsCoreRef },
|
|
197
|
+
React.createElement(TicketsView, { isGettingTickets: isGettingTickets, tickets: tickets, onPressGetTickets: handleOnPressGetTickets, onPressApplyPromoCode: handleOnPressApplyPromoCode, promoCodeValidationMessage: promoCodeResponse === null || promoCodeResponse === void 0 ? void 0 : promoCodeResponse.message, isPromoCodeValid: promoCodeResponse === null || promoCodeResponse === void 0 ? void 0 : promoCodeResponse.isValid, onSelectTicketOption: handleOnSelectTicketOption, selectedTicket: selectedTicket, isBookingTickets: isBooking, styles: styles, isGettingEvent: isGettingEvent, texts: texts, event: event, isWaitingListVisible: isWaitingListVisible, isGetTicketsButtonVisible: isTicketOnSale || !(event === null || event === void 0 ? void 0 : event.salesEnded), isAccessCodeEnabled: isAccessCodeEnabled || isAccessCode, isPromoEnabled: isPromoEnabled, isUserLogged: isUserLogged, onPressMyOrders: onPressMyOrders, onPressLogout: handleOnLogout, areLoadingIndicatorsEnabled: areLoadingIndicatorsEnabled, onAddToWaitingListError: onAddToWaitingListError, onAddToWaitingListSuccess: onAddToWaitingListSuccess, onLoadingChange: handleOnLoadingChange, promoCodeCloseIcon: promoCodeCloseIcon })));
|
|
209
198
|
};
|
|
210
199
|
export default Tickets;
|
|
211
200
|
//# sourceMappingURL=Tickets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tickets.js","sourceRoot":"","sources":["../../../src/containers/tickets/Tickets.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":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AiB,uBAAjB,iBAAiB,CAAE,OAAO,EAC5C,oBAAoB,EAAE,0BAA0B,EAChD,cAAc,EAAE,cAAc,EAC9B,gBAAgB,EAAE,SAAS,EAC3B,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,EACZ,oBAAoB,EAAE,oBAAoB,EAC1C,yBAAyB,EAAE,cAAc,IAAI,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,CAAA,EAC/D,mBAAmB,EAAE,mBAAmB,IAAI,YAAY,EACxD,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,cAAc,EAC7B,2BAA2B,EAAE,2BAA2B,EACxD,uBAAuB,EAAE,uBAAuB,EAChD,yBAAyB,EAAE,yBAAyB,EACpD,eAAe,EAAE,qBAAqB,EACtC,kBAAkB,EAAE,kBAAkB,GACtC,CACU,CACf,CAAA;AACH,CAAC,CAAA;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ITicketsViewProps } from './types';
|
|
2
|
-
declare const TicketsView: ({ isGettingTickets, tickets, styles, onPressGetTickets, onPressApplyPromoCode, promoCodeValidationMessage, isPromoCodeValid, onSelectTicketOption, selectedTicket, isBookingTickets, texts, isGettingEvent, event, isWaitingListVisible, isGetTicketsButtonVisible,
|
|
2
|
+
declare const TicketsView: ({ isGettingTickets, tickets, styles, onPressGetTickets, onPressApplyPromoCode, promoCodeValidationMessage, isPromoCodeValid, onSelectTicketOption, selectedTicket, isBookingTickets, texts, isGettingEvent, event, isWaitingListVisible, isGetTicketsButtonVisible, isAccessCodeEnabled, isUserLogged, onPressMyOrders, onPressLogout, areLoadingIndicatorsEnabled, onAddToWaitingListError, onAddToWaitingListSuccess, onLoadingChange, areAlertsEnabled, promoCodeCloseIcon, }: ITicketsViewProps) => JSX.Element;
|
|
3
3
|
export default TicketsView;
|
|
@@ -5,7 +5,7 @@ import Button from '../../components/button/Button';
|
|
|
5
5
|
import Separator from '../../components/separator/Separator';
|
|
6
6
|
import CartListItem from './components/TicketListItem';
|
|
7
7
|
import s from './styles';
|
|
8
|
-
const TicketsView = ({ isGettingTickets, tickets, styles, onPressGetTickets, onPressApplyPromoCode, promoCodeValidationMessage, isPromoCodeValid, onSelectTicketOption, selectedTicket, isBookingTickets, texts, isGettingEvent, event, isWaitingListVisible, isGetTicketsButtonVisible,
|
|
8
|
+
const TicketsView = ({ isGettingTickets, tickets, styles, onPressGetTickets, onPressApplyPromoCode, promoCodeValidationMessage, isPromoCodeValid, onSelectTicketOption, selectedTicket, isBookingTickets, texts, isGettingEvent, event, isWaitingListVisible, isGetTicketsButtonVisible, isAccessCodeEnabled, isUserLogged, onPressMyOrders, onPressLogout, areLoadingIndicatorsEnabled, onAddToWaitingListError, onAddToWaitingListSuccess, onLoadingChange, areAlertsEnabled, promoCodeCloseIcon, }) => {
|
|
9
9
|
var _a, _b, _c;
|
|
10
10
|
const isButtonDisabled = !selectedTicket || ((_a = selectedTicket.selectedOption) === null || _a === void 0 ? void 0 : _a.value) === 0;
|
|
11
11
|
const buttonText = (texts === null || texts === void 0 ? void 0 : texts.getTicketsButton)
|
|
@@ -23,7 +23,7 @@ const TicketsView = ({ isGettingTickets, tickets, styles, onPressGetTickets, onP
|
|
|
23
23
|
var _a;
|
|
24
24
|
return (React.createElement(CartListItem, { onSelectTicketItem: onSelectTicketOption, ticket: item, ticketNumber: index, selectedTicket: selectedTicket, styles: (_a = styles === null || styles === void 0 ? void 0 : styles.ticketList) === null || _a === void 0 ? void 0 : _a.item, texts: texts === null || texts === void 0 ? void 0 : texts.listItem, ...item }));
|
|
25
25
|
}, ItemSeparatorComponent: () => React.createElement(Separator, null) }),
|
|
26
|
-
isWaitingListVisible && (event === null || event === void 0 ? void 0 : event.salesStarted) && (React.createElement(WaitingList, {
|
|
26
|
+
isWaitingListVisible && (event === null || event === void 0 ? void 0 : event.salesStarted) && (React.createElement(WaitingList, { styles: styles === null || styles === void 0 ? void 0 : styles.waitingList, texts: texts === null || texts === void 0 ? void 0 : texts.waitingList, onAddToWaitingListSuccess: onAddToWaitingListSuccess, onAddToWaitingListError: onAddToWaitingListError, onLoadingChange: onLoadingChange, areAlertsEnabled: areAlertsEnabled })),
|
|
27
27
|
isGetTicketsButtonVisible && (React.createElement(Button, { text: buttonText, onPress: onPressGetTickets, isUpperCase: true, isLoading: isBookingTickets, isDisabled: isButtonDisabled, styles: isButtonDisabled
|
|
28
28
|
? styles === null || styles === void 0 ? void 0 : styles.getTicketsButtonDisabled
|
|
29
29
|
: styles === null || styles === void 0 ? void 0 : styles.getTicketsButtonActive })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TicketsView.js","sourceRoot":"","sources":["../../../src/containers/tickets/TicketsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAEnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,MAAM,MAAM,gCAAgC,CAAA;AACnD,OAAO,SAAS,MAAM,sCAAsC,CAAA;AAC5D,OAAO,YAAY,MAAM,6BAA6B,CAAA;AACtD,OAAO,CAAC,MAAM,UAAU,CAAA;AAGxB,MAAM,WAAW,GAAG,CAAC,EACnB,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACrB,0BAA0B,EAC1B,gBAAgB,EAChB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,KAAK,EACL,oBAAoB,EACpB,yBAAyB,EACzB,
|
|
1
|
+
{"version":3,"file":"TicketsView.js","sourceRoot":"","sources":["../../../src/containers/t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,11 +5,10 @@ import { ILoadingStyles } from '../../components/loading/types';
|
|
|
5
5
|
import { ILoggedInStyles, ILoggedInTexts } from '../../components/loggedIn/types';
|
|
6
6
|
import { IPromoCodeStyles, IPromoCodeTexts } from '../../components/promoCode/types';
|
|
7
7
|
import { IWaitingListStyles, IWaitingListTexts } from '../../components/waitingList/types';
|
|
8
|
-
import { IEvent, ISelectedTicket, ITicket, ITicketsResponseData } from '../../types';
|
|
8
|
+
import { IEvent, IOnFetchTicketsSuccess, ISelectedTicket, ITicket, ITicketsResponseData } from '../../types';
|
|
9
9
|
import { IError } from '../../types/IError';
|
|
10
10
|
import { ITicketListItemStyles, ITicketListItemTexts } from './components/types';
|
|
11
11
|
export interface ITicketsViewProps {
|
|
12
|
-
eventId: number;
|
|
13
12
|
isGettingTickets?: boolean;
|
|
14
13
|
isBookingTickets?: boolean;
|
|
15
14
|
isGettingEvent?: boolean;
|
|
@@ -18,7 +17,7 @@ export interface ITicketsViewProps {
|
|
|
18
17
|
onPressGetTickets: () => void;
|
|
19
18
|
onPressApplyPromoCode: (promoCode: string) => void;
|
|
20
19
|
promoCodeValidationMessage?: string;
|
|
21
|
-
isPromoCodeValid?: boolean;
|
|
20
|
+
isPromoCodeValid?: boolean | number;
|
|
22
21
|
onSelectTicketOption: (selectedTicket: ISelectedTicket) => void;
|
|
23
22
|
selectedTicket?: ISelectedTicket;
|
|
24
23
|
texts?: ITicketsViewTexts;
|
|
@@ -62,22 +61,12 @@ export interface ITicketsViewTexts {
|
|
|
62
61
|
listItem?: ITicketListItemTexts;
|
|
63
62
|
waitingList?: IWaitingListTexts;
|
|
64
63
|
}
|
|
65
|
-
export interface IOnFetchTicketsSuccess {
|
|
66
|
-
tickets: ITicket[];
|
|
67
|
-
promoCodeResponse: {
|
|
68
|
-
success?: boolean;
|
|
69
|
-
message?: string;
|
|
70
|
-
};
|
|
71
|
-
isInWaitingList: boolean;
|
|
72
|
-
isAccessCodeRequired: boolean;
|
|
73
|
-
}
|
|
74
64
|
export interface ITicketsProps {
|
|
75
|
-
eventId: number;
|
|
76
65
|
onAddToCartSuccess: (data: ITicketsResponseData) => void;
|
|
77
66
|
onAddToCartError?: (error: IError) => void;
|
|
78
67
|
onFetchTicketsSuccess?: (data: IOnFetchTicketsSuccess) => void;
|
|
79
68
|
onFetchTicketsError?: (error: IError) => void;
|
|
80
|
-
onFetchEventError?: (error:
|
|
69
|
+
onFetchEventError?: (error: IError) => void;
|
|
81
70
|
onFetchEventSuccess?: (data: IEventData) => void;
|
|
82
71
|
onAddToWaitingListSuccess?: () => void;
|
|
83
72
|
onAddToWaitingListError?: (error: IError) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICoreProps } from '../CoreProps';
|
|
3
|
+
import { BillingCoreHandle } from './BillingCoreTypes';
|
|
4
|
+
declare const BillingCore: React.ForwardRefExoticComponent<ICoreProps & React.RefAttributes<BillingCoreHandle>>;
|
|
5
|
+
export default BillingCore;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import { checkoutOrder, fetchCart, fetchCountries, fetchStates, fetchUserProfile, registerNewUser, } from '../../api/ApiClient';
|
|
4
|
+
const BillingCore = forwardRef((props, ref) => {
|
|
5
|
+
useImperativeHandle(ref, () => ({
|
|
6
|
+
async checkoutOrder(body) {
|
|
7
|
+
return await checkoutOrder(body);
|
|
8
|
+
},
|
|
9
|
+
async getCart() {
|
|
10
|
+
return await fetchCart();
|
|
11
|
+
},
|
|
12
|
+
async getCountries() {
|
|
13
|
+
return await fetchCountries();
|
|
14
|
+
},
|
|
15
|
+
async getStates(countryId) {
|
|
16
|
+
return await fetchStates(countryId);
|
|
17
|
+
},
|
|
18
|
+
async getUserProfile() {
|
|
19
|
+
return await fetchUserProfile();
|
|
20
|
+
},
|
|
21
|
+
async registerNewUser(data) {
|
|
22
|
+
return await registerNewUser(data);
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
26
|
+
});
|
|
27
|
+
export default BillingCore;
|
|
28
|
+
//# sourceMappingURL=BillingCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BillingCore.js","sourceRoot":"","sources":["../../../src/core/BillingCore/BillingCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EACL,aAAa,EACb,SAAS,EACT,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,qBAAqB,CAAA;AAY5B,MAAM,WAAW,GAAG,UAAU,CAAgC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC3E,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,aAAa,CAAC,IAAmB;YACrC,OAAO,MAAM,aAAa,CAAC,IAAI,CAAC,CAAA;QAClC,CAAC;QAED,KAAK,CAAC,OAAO;YACX,OAAO,MAAM,SAAS,EAAE,CAAA;QAC1B,CAAC;QAED,KAAK,CAAC,YAAY;YAChB,OAAO,MAAM,cAAc,EAAE,CAAA;QAC/B,CAAC;QAED,KAAK,CAAC,SAAS,CAAC,SAAiB;YAC/B,OAAO,MAAM,WAAW,CAAC,SAAS,CAAC,CAAA;QACrC,CAAC;QAED,KAAK,CAAC,cAAc;YAClB,OAAO,MAAM,gBAAgB,EAAE,CAAA;QACjC,CAAC;QAED,KAAK,CAAC,eAAe,CAAC,IAAc;YAClC,OAAO,MAAM,eAAe,CAAC,IAAI,CAAC,CAAA;QACpC,CAAC;KACF,CAAC,CAAC,CAAA;IAEH,OAAO,0CAAG,KAAK,CAAC,QAAQ,CAAI,CAAA;AAC9B,CAAC,CAAC,CAAA;AAEF,eAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react-native" />
|
|
2
|
+
import { IOnCheckoutSuccess } from '../..';
|
|
3
|
+
import { ICartResponse, ICheckoutBody, ICountriesResponse, IRegisterNewUserResponse, IStatesResponse, IUserProfileResponse } from '../../api/types';
|
|
4
|
+
import { IError } from '../../types';
|
|
5
|
+
export interface ICheckoutResponse {
|
|
6
|
+
error?: IError;
|
|
7
|
+
data?: IOnCheckoutSuccess;
|
|
8
|
+
}
|
|
9
|
+
export declare type BillingCoreHandle = {
|
|
10
|
+
checkoutOrder(body: ICheckoutBody): Promise<ICheckoutResponse>;
|
|
11
|
+
getCart(): Promise<ICartResponse>;
|
|
12
|
+
getCountries(): Promise<ICountriesResponse>;
|
|
13
|
+
getStates(countryId: string): Promise<IStatesResponse>;
|
|
14
|
+
getUserProfile(): Promise<IUserProfileResponse>;
|
|
15
|
+
registerNewUser(data: FormData): Promise<IRegisterNewUserResponse>;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BillingCoreTypes.js","sourceRoot":"","sources":["../../../src/core/BillingCore/BillingCoreTypes.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ICoreProps } from '../CoreProps';
|
|
3
|
+
import { CheckoutCoreHandle } from './CheckoutCoreTypes';
|
|
4
|
+
declare const CheckoutCore: React.ForwardRefExoticComponent<ICoreProps & React.RefAttributes<CheckoutCoreHandle>>;
|
|
5
|
+
export default CheckoutCore;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { forwardRef, useImperativeHandle } from 'react';
|
|
3
|
+
import { fetchEventConditions, fetchOrderDetails, fetchOrderReview, postOnFreeRegistration, postOnPaymentSuccess, } from '../../api/ApiClient';
|
|
4
|
+
const CheckoutCore = forwardRef((props, ref) => {
|
|
5
|
+
useImperativeHandle(ref, () => ({
|
|
6
|
+
async getEventConditions(eventId) {
|
|
7
|
+
return await fetchEventConditions(eventId);
|
|
8
|
+
},
|
|
9
|
+
async getPurchaseOrderDetails(orderId) {
|
|
10
|
+
return await fetchOrderDetails(orderId);
|
|
11
|
+
},
|
|
12
|
+
async getOrderReview(orderHash) {
|
|
13
|
+
return await fetchOrderReview(orderHash);
|
|
14
|
+
},
|
|
15
|
+
async freeRegistration(orderHash) {
|
|
16
|
+
return await postOnFreeRegistration(orderHash);
|
|
17
|
+
},
|
|
18
|
+
async paymentSuccess(orderHash) {
|
|
19
|
+
return await postOnPaymentSuccess(orderHash);
|
|
20
|
+
},
|
|
21
|
+
}));
|
|
22
|
+
return React.createElement(React.Fragment, null, props.children);
|
|
23
|
+
});
|
|
24
|
+
export default CheckoutCore;
|
|
25
|
+
//# sourceMappingURL=CheckoutCore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckoutCore.js","sourceRoot":"","sources":["../../../src/core/CheckoutCore/CheckoutCore.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,qBAAqB,CAAA;AAS5B,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;QAC9B,KAAK,CAAC,kBAAkB,CAAC,OAAe;YACtC,OAAO,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAA;QAC5C,CAAC;QACD,KAAK,CAAC,uBAAuB,CAC3B,OAAe;YAEf,OAAO,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAA;QACzC,CAAC;QACD,KAAK,CAAC,cAAc,CAAC,SAAiB;YACpC,OAAO,MAAM,gBAAgB,CAAC,SAAS,CAAC,CAAA;QAC1C,CAAC;QACD,KAAK,CAAC,gBAAgB,CACpB,SAAiB;YAEjB,OAAO,MAAM,sBAAsB,CAAC,SAAS,CAAC,CAAA;QAChD,CAAC;QACD,KAAK,CAAC,cAAc,CAAC,SAAiB;YACpC,OAAO,MAAM,oBAAoB,CAAC,SAAS,CAAC,CAAA;QAC9C,CAAC;KACF,CAAC,CAAC,CAAA;IAEH,OAAO,0CAAG,KAAK,CAAC,QAAQ,CAAI,CAAA;AAC9B,CAAC,CACF,CAAA;AAED,eAAe,YAAY,CAAA"}
|