tf-checkout-react 1.6.6 → 1.7.2
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 +401 -59
- package/dist/adapters/customFields.d.ts +1 -0
- package/dist/api/checkout.d.ts +2 -0
- package/dist/api/common.d.ts +1 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/preRegistrationComplete.d.ts +1 -1
- package/dist/components/addonsContainer/AddonComponent.d.ts +6 -1
- package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +17 -0
- package/dist/components/addonsContainer/index.d.ts +6 -1
- package/dist/components/billing-info-container/hooks/index.d.ts +3 -0
- package/dist/components/billing-info-container/hooks/usePaymentContext.d.ts +5 -0
- package/dist/components/billing-info-container/hooks/usePaymentRedirect.d.ts +14 -0
- package/dist/components/billing-info-container/hooks/useStripePayment.d.ts +18 -0
- package/dist/components/billing-info-container/index.d.ts +13 -2
- package/dist/components/billing-info-container/utils.d.ts +26 -1
- package/dist/components/common/DatePickerField.d.ts +7 -1
- package/dist/components/common/PhoneNumberField.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +4 -1
- package/dist/components/countdown/index.d.ts +1 -1
- package/dist/components/forgotPasswordModal/index.d.ts +2 -1
- package/dist/components/myTicketsContainer/index.d.ts +3 -2
- package/dist/components/orderDetailsContainer/index.d.ts +8 -1
- package/dist/components/paymentContainer/OrderDetails.d.ts +9 -0
- package/dist/components/paymentContainer/handlePayment.d.ts +15 -0
- package/dist/components/paymentContainer/index.d.ts +12 -6
- package/dist/components/preRegistration/FieldsSection.d.ts +7 -1
- package/dist/components/preRegistration/PreRegistrationComplete.d.ts +8 -0
- package/dist/components/preRegistration/constants.d.ts +2 -2
- package/dist/components/preRegistration/index.d.ts +6 -0
- package/dist/components/resetPasswordContainer/index.d.ts +2 -2
- package/dist/components/ticketsContainer/InfoIcon.d.ts +5 -0
- package/dist/components/ticketsContainer/TicketsSection.d.ts +3 -2
- package/dist/components/ticketsContainer/TimeSlotsSection.d.ts +25 -0
- package/dist/components/ticketsContainer/index.d.ts +29 -5
- package/dist/components/timerWidget/index.d.ts +2 -1
- package/dist/constants/index.d.ts +5 -0
- package/dist/index.d.ts +4 -1
- package/dist/tf-checkout-react.cjs.development.js +11284 -9565
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +11293 -9577
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/types/add_on.d.ts +1 -0
- package/dist/types/checkoutPageConfigs.d.ts +1 -1
- package/dist/types/order-data.d.ts +3 -1
- package/dist/utils/auth.d.ts +8 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +1 -0
- package/dist/utils/customFields.d.ts +11 -0
- package/dist/utils/getDomain.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/setConfigs.d.ts +1 -0
- package/package.json +14 -8
- package/src/adapters/customFields.ts +7 -1
- package/src/api/auth.ts +2 -1
- package/src/api/checkout.ts +9 -4
- package/src/api/common.ts +49 -2
- package/src/api/index.ts +1 -0
- package/src/api/interceptors.ts +7 -23
- package/src/api/preRegistrationComplete.ts +1 -1
- package/src/api/publicRequest.ts +10 -0
- package/src/components/addonsContainer/AddonComponent.tsx +96 -11
- package/src/components/addonsContainer/SimpleAddonsContainer.tsx +420 -0
- package/src/components/addonsContainer/index.tsx +198 -47
- package/src/components/billing-info-container/hooks/index.ts +3 -0
- package/src/components/billing-info-container/hooks/usePaymentContext.ts +22 -0
- package/src/components/billing-info-container/hooks/usePaymentRedirect.ts +147 -0
- package/src/components/billing-info-container/hooks/useStripePayment.ts +121 -0
- package/src/components/billing-info-container/index.tsx +859 -418
- package/src/components/billing-info-container/{utils.ts → utils.tsx} +124 -1
- package/src/components/common/CheckboxField/index.tsx +1 -1
- package/src/components/common/CustomField.tsx +39 -3
- package/src/components/common/DatePickerField.tsx +25 -10
- package/src/components/common/PhoneNumberField.tsx +4 -2
- package/src/components/common/SnackbarAlert.tsx +32 -34
- package/src/components/confirmationContainer/config.ts +3 -3
- package/src/components/confirmationContainer/index.tsx +20 -1
- package/src/components/confirmationContainer/social-buttons.tsx +5 -3
- package/src/components/confirmationContainer/style.css +9 -5
- package/src/components/countdown/index.tsx +22 -22
- package/src/components/delegationsContainer/IssueComponent.tsx +2 -1
- package/src/components/forgotPasswordModal/index.tsx +44 -13
- package/src/components/loginForm/index.tsx +1 -1
- package/src/components/loginModal/index.tsx +19 -27
- package/src/components/loginModal/style.css +3 -1
- package/src/components/myTicketsContainer/index.tsx +13 -9
- package/src/components/orderDetailsContainer/index.tsx +206 -174
- package/src/components/paymentContainer/OrderDetails.tsx +257 -0
- package/src/components/paymentContainer/handlePayment.ts +86 -0
- package/src/components/paymentContainer/index.tsx +299 -259
- package/src/components/paymentContainer/style.css +141 -0
- package/src/components/preRegistration/FieldsSection.tsx +8 -0
- package/src/components/preRegistration/PreRegistrationComplete.tsx +138 -118
- package/src/components/preRegistration/PreRegistrationInformations.tsx +21 -15
- package/src/components/preRegistration/constants.tsx +10 -4
- package/src/components/preRegistration/index.tsx +233 -179
- package/src/components/preRegistration/style.css +3 -0
- package/src/components/registerForm/constants.tsx +3 -1
- package/src/components/registerForm/index.tsx +3 -3
- package/src/components/registerModal/index.tsx +47 -72
- package/src/components/resetPasswordContainer/index.tsx +20 -14
- package/src/components/seatMapContainer/TicketsSection.tsx +2 -2
- package/src/components/signupModal/index.tsx +13 -6
- package/src/components/ticketResale/index.tsx +7 -0
- package/src/components/ticketsContainer/InfoIcon.tsx +35 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +34 -28
- package/src/components/ticketsContainer/TicketRow.tsx +1 -1
- package/src/components/ticketsContainer/TicketsSection.tsx +189 -57
- package/src/components/ticketsContainer/TimeSlotsSection.tsx +120 -0
- package/src/components/ticketsContainer/index.tsx +268 -106
- package/src/components/timerWidget/index.tsx +15 -3
- package/src/components/timerWidget/style.css +2 -1
- package/src/constants/index.ts +2 -0
- package/src/env.ts +14 -6
- package/src/hoc/CustomFields/index.tsx +9 -1
- package/src/index.ts +7 -2
- package/src/types/add_on.ts +1 -0
- package/src/types/api/cart.d.ts +8 -0
- package/src/types/api/checkout.d.ts +58 -7
- package/src/types/api/common.d.ts +30 -0
- package/src/types/api/orders.d.ts +19 -3
- package/src/types/api/payment.d.ts +6 -2
- package/src/types/api/preRegistrationComplete.d.ts +2 -2
- package/src/types/checkoutPageConfigs.ts +1 -1
- package/src/types/order-data.ts +3 -1
- package/src/types/pre-registration-complete.d.ts +6 -1
- package/src/utils/auth.ts +32 -0
- package/src/utils/cookies.ts +42 -11
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +3 -1
- package/src/utils/customFields.ts +22 -0
- package/src/utils/getDomain.ts +10 -4
- package/src/utils/index.ts +1 -1
- package/src/utils/setConfigs.ts +3 -1
- package/dist/components/stripePayment/index.d.ts +0 -24
- package/src/components/stripePayment/index.tsx +0 -281
- package/src/components/stripePayment/style.css +0 -60
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import _identity from 'lodash/identity'
|
|
3
|
+
import _isEmpty from 'lodash/isEmpty'
|
|
4
|
+
import _map from 'lodash/map'
|
|
5
|
+
import React, { memo, useState } from 'react'
|
|
6
|
+
|
|
7
|
+
import { FEES_STYLES } from '../../constants'
|
|
8
|
+
import { createFixedFloatNormalizer, currencyNormalizerCreator } from '../../normalizers'
|
|
9
|
+
import { IOrderData } from '../../types'
|
|
10
|
+
import { CONFIGS } from '../../utils'
|
|
11
|
+
import Countdown from 'react-countdown'
|
|
12
|
+
import { showZero } from '../../utils/showZero'
|
|
13
|
+
import { IRenderer } from '../timerWidget'
|
|
14
|
+
|
|
15
|
+
interface OrderDetailsProps {
|
|
16
|
+
orderData: any;
|
|
17
|
+
paymentFieldsData: any[];
|
|
18
|
+
customMobileText?: string;
|
|
19
|
+
handleCountdownFinish?: () => void;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
interface CountdownI {
|
|
23
|
+
expiresAt: number;
|
|
24
|
+
handleCountdownFinish: () => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const SimpleCountdown = memo(({ expiresAt, handleCountdownFinish }: CountdownI) => {
|
|
28
|
+
const renderer = ({
|
|
29
|
+
minutes,
|
|
30
|
+
seconds,
|
|
31
|
+
completed,
|
|
32
|
+
handleCountdownFinish,
|
|
33
|
+
}: IRenderer) => {
|
|
34
|
+
if (completed) {
|
|
35
|
+
handleCountdownFinish()
|
|
36
|
+
return null
|
|
37
|
+
}
|
|
38
|
+
return (
|
|
39
|
+
<span>
|
|
40
|
+
{showZero(minutes)}:{showZero(seconds)}
|
|
41
|
+
</span>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return (<div className="mobile-order-timer">
|
|
46
|
+
{expiresAt && (
|
|
47
|
+
<Countdown
|
|
48
|
+
date={Date.now() + expiresAt * 1000}
|
|
49
|
+
renderer={(props: any) =>
|
|
50
|
+
renderer({
|
|
51
|
+
...props,
|
|
52
|
+
handleCountdownFinish,
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
</div>)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
export const OrderDetails = ({
|
|
61
|
+
orderData = {},
|
|
62
|
+
paymentFieldsData = [],
|
|
63
|
+
customMobileText = 'Your order total',
|
|
64
|
+
handleCountdownFinish = _identity
|
|
65
|
+
}: OrderDetailsProps) => {
|
|
66
|
+
const { currency, guest_count } = orderData || {}
|
|
67
|
+
const hasTableTypes = Boolean(Number(guest_count))
|
|
68
|
+
const [isExpanded, setIsExpanded] = useState(false)
|
|
69
|
+
|
|
70
|
+
// Find the total field to display in the mobile view
|
|
71
|
+
const totalField = paymentFieldsData.find(field => field.id === 'total')
|
|
72
|
+
const totalValue =
|
|
73
|
+
totalField && orderData.total
|
|
74
|
+
? totalField.normalizer
|
|
75
|
+
? totalField.normalizer(orderData.total, currency, orderData)
|
|
76
|
+
: orderData.total
|
|
77
|
+
: ''
|
|
78
|
+
|
|
79
|
+
const toggleExpand = () => {
|
|
80
|
+
setIsExpanded(!isExpanded)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const defaultItemRenderer = (item: any) => {
|
|
84
|
+
return (<div>
|
|
85
|
+
<div key={item.id} className="add-on-container">
|
|
86
|
+
<span>{item.quantity}</span>
|
|
87
|
+
<span className="add-on-x">{' x '}</span>
|
|
88
|
+
<span>{item.groupName ? item.groupName + ' - ' : ''}</span>
|
|
89
|
+
<span>{item.name}</span>
|
|
90
|
+
<span>{' - '}</span>
|
|
91
|
+
<span>
|
|
92
|
+
{CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL &&
|
|
93
|
+
currencyNormalizerCreator(
|
|
94
|
+
createFixedFloatNormalizer(2)(parseFloat(item.price)),
|
|
95
|
+
currency,
|
|
96
|
+
) + ' (incl. fees)'}
|
|
97
|
+
{CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH &&
|
|
98
|
+
currencyNormalizerCreator(
|
|
99
|
+
createFixedFloatNormalizer(2)(parseFloat(item.cost)),
|
|
100
|
+
currency,
|
|
101
|
+
)}
|
|
102
|
+
</span>
|
|
103
|
+
<span className="add-on-each">{' each'}</span>
|
|
104
|
+
</div>
|
|
105
|
+
{CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && (
|
|
106
|
+
<p className="fees">
|
|
107
|
+
{`(${currencyNormalizerCreator(
|
|
108
|
+
createFixedFloatNormalizer(2)(
|
|
109
|
+
parseFloat(String(item.price)),
|
|
110
|
+
),
|
|
111
|
+
currency,
|
|
112
|
+
)} with fees)`}
|
|
113
|
+
</p>
|
|
114
|
+
)}
|
|
115
|
+
</div>)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const defaultTableRenderer = (item: any) => {
|
|
119
|
+
return (<div>
|
|
120
|
+
<div key={item.id} className="table-type-container">
|
|
121
|
+
<span>{item.groupName ? item.groupName + ' - ' : ''}</span>
|
|
122
|
+
<span>{item.name}</span>
|
|
123
|
+
<span>{' - '}</span>
|
|
124
|
+
<span>Guest Count{': '}</span>
|
|
125
|
+
<span>{item.guestCount}</span>
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<span>
|
|
129
|
+
{CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL &&
|
|
130
|
+
currencyNormalizerCreator(
|
|
131
|
+
createFixedFloatNormalizer(2)(parseFloat(item.price)),
|
|
132
|
+
currency,
|
|
133
|
+
) + ' (incl. fees)'}
|
|
134
|
+
{CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH &&
|
|
135
|
+
currencyNormalizerCreator(
|
|
136
|
+
createFixedFloatNormalizer(2)(parseFloat(item.cost)),
|
|
137
|
+
currency,
|
|
138
|
+
)}
|
|
139
|
+
</span>
|
|
140
|
+
<br/>
|
|
141
|
+
{CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && (
|
|
142
|
+
<p className="fees">
|
|
143
|
+
{`(${currencyNormalizerCreator(
|
|
144
|
+
createFixedFloatNormalizer(2)(
|
|
145
|
+
parseFloat(String(item.price)),
|
|
146
|
+
),
|
|
147
|
+
currency,
|
|
148
|
+
)} with fees)`}
|
|
149
|
+
</p>
|
|
150
|
+
)}
|
|
151
|
+
</div>
|
|
152
|
+
</div>)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return (
|
|
156
|
+
<div className="payment_page payment_page_single">
|
|
157
|
+
{/* Mobile view summary */}
|
|
158
|
+
<div className="mobile-order-summary">
|
|
159
|
+
<div className="mobile-order-summary-content" onClick={toggleExpand}>
|
|
160
|
+
<div className="mobile-order-info">
|
|
161
|
+
<div
|
|
162
|
+
className={`mobile-order-info-container order-info-container-left ${
|
|
163
|
+
isExpanded ? 'open' : ''
|
|
164
|
+
}`}
|
|
165
|
+
>
|
|
166
|
+
<div className="mobile-order-text">{customMobileText}</div>
|
|
167
|
+
</div>
|
|
168
|
+
<div className="mobile-order-info-container order-info-container-right">
|
|
169
|
+
{!isExpanded && (
|
|
170
|
+
<div className="mobile-order-total">{totalValue}</div>
|
|
171
|
+
)}
|
|
172
|
+
{orderData?.expires_at && (
|
|
173
|
+
<SimpleCountdown expiresAt={orderData?.expires_at} handleCountdownFinish={handleCountdownFinish} />
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
|
|
180
|
+
{/* Original content - will be hidden on mobile when collapsed */}
|
|
181
|
+
<div
|
|
182
|
+
className={`order_info_section ${isExpanded ? 'expanded' : 'collapsed'}`}
|
|
183
|
+
style={{ display: hasTableTypes ? 'block' : 'grid' }}
|
|
184
|
+
>
|
|
185
|
+
{_map(paymentFieldsData, field => {
|
|
186
|
+
const { id, label, className = '', normalizer = _identity } = field
|
|
187
|
+
const value = orderData[id as keyof IOrderData] || ''
|
|
188
|
+
let component = null
|
|
189
|
+
|
|
190
|
+
if (field.id === 'add_ons' && _isEmpty(value)) {
|
|
191
|
+
return false
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (field.id === 'tableTypes') {
|
|
195
|
+
const valueArray = value as Array<any>
|
|
196
|
+
|
|
197
|
+
component = (
|
|
198
|
+
<div
|
|
199
|
+
key={id}
|
|
200
|
+
className="order_info_block"
|
|
201
|
+
style={{
|
|
202
|
+
display: 'flex',
|
|
203
|
+
flexDirection: 'column',
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
{_map(valueArray, tableTypeItem => (
|
|
207
|
+
<div
|
|
208
|
+
key={tableTypeItem.id}
|
|
209
|
+
style={{
|
|
210
|
+
display: 'grid',
|
|
211
|
+
gridTemplateColumns: '33% 33% 33%',
|
|
212
|
+
gridColumnGap: '10%',
|
|
213
|
+
}}
|
|
214
|
+
>
|
|
215
|
+
<div className="order_info_block">
|
|
216
|
+
<div className="order_info_title">Table Type</div>
|
|
217
|
+
<div className={`${className} order_info_text`}>
|
|
218
|
+
{tableTypeItem.ticketType}
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
<div className="order_info_block">
|
|
222
|
+
<div className="order_info_title">Number of Tables</div>
|
|
223
|
+
<div className={`${className} order_info_text`}>
|
|
224
|
+
{tableTypeItem.count}
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
<div className="order_info_block">
|
|
228
|
+
<div className="order_info_title">Guest Count</div>
|
|
229
|
+
<div className={`${className} order_info_text`}>
|
|
230
|
+
{tableTypeItem.quantity}
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
</div>
|
|
234
|
+
))}
|
|
235
|
+
</div>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
component || (
|
|
241
|
+
<div key={id} className={`order_info_block ${className}`}>
|
|
242
|
+
<div className="order_info_title">{label}</div>
|
|
243
|
+
<div className={`${className} order_info_text`}>
|
|
244
|
+
{typeof value === 'string' || typeof value === 'number'
|
|
245
|
+
? normalizer(value, currency, orderData)
|
|
246
|
+
: _map(value, item => (
|
|
247
|
+
item.isTable ? defaultTableRenderer(item) : defaultItemRenderer(item)
|
|
248
|
+
))}
|
|
249
|
+
</div>
|
|
250
|
+
</div>
|
|
251
|
+
)
|
|
252
|
+
)
|
|
253
|
+
})}
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { AxiosError } from 'axios'
|
|
3
|
+
import _get from 'lodash/get'
|
|
4
|
+
|
|
5
|
+
import { createPaymentPlan, handleFreeSuccess, handlePaymentSuccess } from '../../api'
|
|
6
|
+
|
|
7
|
+
interface Options {
|
|
8
|
+
reviewData: any;
|
|
9
|
+
isFreeTickets: boolean;
|
|
10
|
+
paymentPlanIsAvailable: boolean;
|
|
11
|
+
showPaymentPlanSection: boolean;
|
|
12
|
+
handlePayment: any;
|
|
13
|
+
setPaymentIsLoading: any;
|
|
14
|
+
setError: any;
|
|
15
|
+
orderData: any;
|
|
16
|
+
eventId: any;
|
|
17
|
+
isBrowser: boolean;
|
|
18
|
+
onPaymentError: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const handlePaymentMiddleWare = async (
|
|
22
|
+
error: any,
|
|
23
|
+
data: object,
|
|
24
|
+
{
|
|
25
|
+
reviewData,
|
|
26
|
+
isFreeTickets,
|
|
27
|
+
paymentPlanIsAvailable,
|
|
28
|
+
showPaymentPlanSection,
|
|
29
|
+
handlePayment,
|
|
30
|
+
setPaymentIsLoading,
|
|
31
|
+
setError,
|
|
32
|
+
orderData,
|
|
33
|
+
eventId,
|
|
34
|
+
isBrowser,
|
|
35
|
+
onPaymentError,
|
|
36
|
+
}: Options
|
|
37
|
+
) => {
|
|
38
|
+
try {
|
|
39
|
+
if (error) {
|
|
40
|
+
throw error
|
|
41
|
+
}
|
|
42
|
+
const {
|
|
43
|
+
order_details: { order_hash },
|
|
44
|
+
} = reviewData
|
|
45
|
+
|
|
46
|
+
let paymentSuccessResponse
|
|
47
|
+
|
|
48
|
+
if (isFreeTickets) {
|
|
49
|
+
paymentSuccessResponse = await handleFreeSuccess(order_hash)
|
|
50
|
+
} else if (paymentPlanIsAvailable && showPaymentPlanSection) {
|
|
51
|
+
paymentSuccessResponse = await createPaymentPlan(
|
|
52
|
+
order_hash,
|
|
53
|
+
_get(data, 'paymentMethodId', '')
|
|
54
|
+
)
|
|
55
|
+
} else {
|
|
56
|
+
paymentSuccessResponse = await handlePaymentSuccess(order_hash)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (paymentSuccessResponse.status === 200) {
|
|
60
|
+
handlePayment(paymentSuccessResponse)
|
|
61
|
+
setPaymentIsLoading(false)
|
|
62
|
+
|
|
63
|
+
// clear seat-map related data from localStorage
|
|
64
|
+
localStorage.removeItem('reservationData')
|
|
65
|
+
localStorage.removeItem(`reservationStart-${eventId}`)
|
|
66
|
+
localStorage.removeItem('ownReservations')
|
|
67
|
+
localStorage.removeItem('tierId')
|
|
68
|
+
|
|
69
|
+
if (isBrowser) {
|
|
70
|
+
(window as any)?.dataLayer?.push({
|
|
71
|
+
event: 'Purchase',
|
|
72
|
+
orderValue: orderData.total,
|
|
73
|
+
orderCurrency: orderData.currency,
|
|
74
|
+
orderId: orderData.id,
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
} catch (e) {
|
|
79
|
+
setError(_get(e, 'response.data.message', null))
|
|
80
|
+
setPaymentIsLoading(false)
|
|
81
|
+
onPaymentError(
|
|
82
|
+
((e as Record<string, unknown>).response as AxiosError) || e,
|
|
83
|
+
reviewData.event_details.slug
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
}
|