tf-checkout-react 1.0.99 → 1.0.100-beta.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 +278 -1
- package/dist/api/index.d.ts +31 -26
- package/dist/components/account-settings/index.d.ts +3 -0
- package/dist/components/billing-info-container/index.d.ts +5 -5
- package/dist/components/billing-info-container/utils.d.ts +1 -0
- package/dist/components/common/CustomField.d.ts +1 -1
- package/dist/components/common/DatePickerField.d.ts +14 -0
- package/dist/components/common/RedirectModal.d.ts +7 -0
- package/dist/components/common/SnackbarAlert.d.ts +13 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/countdown/index.d.ts +4 -1
- package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -1
- package/dist/components/orderDetailsContainer/index.d.ts +5 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +4 -1
- package/dist/components/paymentContainer/index.d.ts +3 -1
- package/dist/components/rsvpContainer/index.d.ts +7 -0
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketResale/index.d.ts +5 -3
- package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +6 -9
- package/dist/components/ticketsContainer/TicketsSection.d.ts +5 -3
- package/dist/components/ticketsContainer/index.d.ts +13 -2
- package/dist/components/timerWidget/index.d.ts +3 -3
- package/dist/env.d.ts +1 -0
- package/dist/images/cross.svg +44 -0
- package/dist/images/done.svg +3 -3
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +1400 -575
- 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 +1409 -586
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/cookies.d.ts +3 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
- package/dist/utils/downloadPDF.d.ts +1 -1
- package/dist/utils/getDomain.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +89 -89
- package/src/.DS_Store +0 -0
- package/src/.d.ts +2 -2
- package/src/api/index.ts +313 -278
- package/src/assets/images/cross.svg +44 -0
- package/src/assets/images/done.svg +3 -3
- package/src/components/.DS_Store +0 -0
- package/src/components/account-settings/index.tsx +161 -0
- package/src/components/account-settings/style.css +200 -0
- package/src/components/billing-info-container/index.tsx +821 -777
- package/src/components/billing-info-container/style.css +106 -106
- package/src/components/billing-info-container/utils.ts +233 -223
- package/src/components/common/CheckboxField.tsx +41 -41
- package/src/components/common/CustomField.tsx +87 -84
- package/src/components/common/DatePickerField.tsx +98 -0
- package/src/components/common/FormikPhoneNumberField.tsx +51 -51
- package/src/components/common/Loader.tsx +9 -9
- package/src/components/common/RadioField.tsx +35 -35
- package/src/components/common/RedirectModal.tsx +43 -0
- package/src/components/common/SelectField.tsx +80 -80
- package/src/components/common/SnackbarAlert.tsx +54 -0
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +4 -4
- package/src/components/confirmModal/index.tsx +51 -51
- package/src/components/confirmModal/style.css +21 -21
- package/src/components/confirmationContainer/config.ts +72 -72
- package/src/components/confirmationContainer/index.tsx +197 -194
- package/src/components/confirmationContainer/social-buttons.tsx +94 -94
- package/src/components/confirmationContainer/style.css +202 -202
- package/src/components/countdown/index.tsx +100 -89
- package/src/components/countdown/style.css +9 -9
- package/src/components/index.ts +7 -7
- package/src/components/loginModal/index.tsx +171 -209
- package/src/components/loginModal/style.css +71 -71
- package/src/components/myTicketsContainer/index.tsx +201 -137
- package/src/components/myTicketsContainer/row.tsx +41 -41
- package/src/components/myTicketsContainer/style.css +40 -40
- package/src/components/myTicketsContainer/tableConfig.tsx +32 -34
- package/src/components/orderDetailsContainer/index.tsx +289 -249
- package/src/components/orderDetailsContainer/style.css +73 -73
- package/src/components/orderDetailsContainer/ticketsTable.tsx +177 -124
- package/src/components/paymentContainer/index.tsx +352 -284
- package/src/components/registerModal/index.tsx +183 -190
- package/src/components/rsvpContainer/index.tsx +126 -0
- package/src/components/stripePayment/index.tsx +258 -253
- package/src/components/stripePayment/style.css +60 -60
- package/src/components/ticketResale/index.tsx +74 -56
- package/src/components/ticketResaleModal/index.tsx +213 -210
- package/src/components/ticketResaleModal/style.css +28 -28
- package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +89 -99
- package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
- package/src/components/ticketsContainer/TicketRow.tsx +89 -83
- package/src/components/ticketsContainer/TicketsSection.tsx +87 -81
- package/src/components/ticketsContainer/index.tsx +506 -409
- package/src/components/ticketsContainer/style.css +181 -181
- package/src/components/ticketsContainer/utils.ts +11 -11
- package/src/components/timerWidget/index.tsx +87 -70
- package/src/components/timerWidget/style.css +34 -26
- package/src/components/waitingList/index.tsx +178 -178
- package/src/components/waitingList/style.css +26 -26
- package/src/env.ts +20 -19
- package/src/index.ts +15 -13
- package/src/normalizers/index.ts +45 -45
- package/src/types/billing-info-data.ts +37 -37
- package/src/types/payment-field.ts +7 -7
- package/src/types/referral-promotion.ts +7 -7
- package/src/utils/cookies.ts +42 -0
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +71 -59
- package/src/utils/downloadPDF.tsx +52 -30
- package/src/utils/formikErrorFocus.ts +24 -24
- package/src/utils/getDomain.ts +15 -0
- package/src/utils/getImage.ts +14 -14
- package/src/utils/getQueryVariable.ts +13 -13
- package/src/utils/index.ts +7 -5
- package/src/utils/setConfigs.ts +26 -26
- package/src/utils/showZero.tsx +10 -10
- package/src/validators/index.ts +20 -20
package/src/api/index.ts
CHANGED
|
@@ -1,278 +1,313 @@
|
|
|
1
|
-
import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'
|
|
2
|
-
import _get from 'lodash/get'
|
|
3
|
-
|
|
4
|
-
import { CONFIGS } from '../utils'
|
|
5
|
-
|
|
6
|
-
const isWindowDefined = typeof window !== 'undefined'
|
|
7
|
-
|
|
8
|
-
const ttfHeaders: { [key: string]: any } = {
|
|
9
|
-
Accept: 'application/vnd.api+json',
|
|
10
|
-
'Content-Type': 'application/vnd.api+json',
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
14
|
-
ttfHeaders['Authorization-Guest'] = localStorage.getItem('auth_guest_token')
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
interface IPublicRequest extends AxiosInstance {
|
|
18
|
-
setGuestToken: (token: string) => void;
|
|
19
|
-
setAccessToken: (token: string) => void;
|
|
20
|
-
setBaseUrl: (baseUrl: string) => void;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export const publicRequest: IPublicRequest = axios.create({
|
|
24
|
-
baseURL: CONFIGS.BASE_URL || `https://www.ticketfairy.com/api`,
|
|
25
|
-
headers: ttfHeaders,
|
|
26
|
-
}) as IPublicRequest
|
|
27
|
-
|
|
28
|
-
publicRequest.interceptors.response.use(
|
|
29
|
-
response =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
export const
|
|
185
|
-
publicRequest.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
export const
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
export const
|
|
246
|
-
publicRequest
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
export const
|
|
272
|
-
publicRequest.
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
1
|
+
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'
|
|
2
|
+
import _get from 'lodash/get'
|
|
3
|
+
|
|
4
|
+
import { CONFIGS, getCookieByName, setCustomCookie } from '../utils'
|
|
5
|
+
|
|
6
|
+
const isWindowDefined = typeof window !== 'undefined'
|
|
7
|
+
|
|
8
|
+
const ttfHeaders: { [key: string]: any } = {
|
|
9
|
+
Accept: 'application/vnd.api+json',
|
|
10
|
+
'Content-Type': 'application/vnd.api+json',
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
14
|
+
ttfHeaders['Authorization-Guest'] = localStorage.getItem('auth_guest_token')
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface IPublicRequest extends AxiosInstance {
|
|
18
|
+
setGuestToken: (token: string) => void;
|
|
19
|
+
setAccessToken: (token: string) => void;
|
|
20
|
+
setBaseUrl: (baseUrl: string) => void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const publicRequest: IPublicRequest = axios.create({
|
|
24
|
+
baseURL: CONFIGS.BASE_URL || `https://www.ticketfairy.com/api`,
|
|
25
|
+
headers: ttfHeaders,
|
|
26
|
+
}) as IPublicRequest
|
|
27
|
+
|
|
28
|
+
publicRequest.interceptors.response.use(
|
|
29
|
+
response => {
|
|
30
|
+
const authGuestToken = _get(response, 'headers.authorization-guest')
|
|
31
|
+
|
|
32
|
+
if (isWindowDefined && authGuestToken) {
|
|
33
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken)
|
|
34
|
+
publicRequest.setGuestToken(authGuestToken)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return response
|
|
38
|
+
},
|
|
39
|
+
error => {
|
|
40
|
+
if (error?.response?.status === 401) {
|
|
41
|
+
if (isWindowDefined) {
|
|
42
|
+
window.localStorage.removeItem('user_data')
|
|
43
|
+
window.localStorage.removeItem('access_token')
|
|
44
|
+
const errorType = error?.response?.data?.error
|
|
45
|
+
if (errorType === 'invalid_token') {
|
|
46
|
+
window.location.href = '/'
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const authGuestToken = _get(error, 'response.headers.authorization-guest')
|
|
52
|
+
if (isWindowDefined && authGuestToken) {
|
|
53
|
+
window.localStorage.setItem('auth_guest_token', authGuestToken)
|
|
54
|
+
publicRequest.setGuestToken(authGuestToken)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return Promise.reject(error)
|
|
58
|
+
}
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
publicRequest.interceptors.request.use((config: AxiosRequestConfig) => {
|
|
62
|
+
const guestToken = isWindowDefined
|
|
63
|
+
? window.localStorage.getItem('auth_guest_token')
|
|
64
|
+
: null
|
|
65
|
+
const userData = isWindowDefined
|
|
66
|
+
? window.localStorage.getItem('user_data')
|
|
67
|
+
: null
|
|
68
|
+
const accessToken = isWindowDefined
|
|
69
|
+
? window.localStorage.getItem('access_token')
|
|
70
|
+
: null
|
|
71
|
+
|
|
72
|
+
if (userData && accessToken) {
|
|
73
|
+
const updatedHeaders = {
|
|
74
|
+
...config.headers,
|
|
75
|
+
Authorization: `Bearer ${accessToken}`,
|
|
76
|
+
}
|
|
77
|
+
config.headers = updatedHeaders
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (guestToken) {
|
|
81
|
+
publicRequest.setGuestToken(guestToken)
|
|
82
|
+
const updatedHeaders = {
|
|
83
|
+
...config.headers,
|
|
84
|
+
'Authorization-Guest': guestToken,
|
|
85
|
+
}
|
|
86
|
+
config.headers = updatedHeaders
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
90
|
+
const updatedHeaders = {
|
|
91
|
+
...config.headers,
|
|
92
|
+
'X-TF-ECOMMERCE': getCookieByName('X-TF-ECOMMERCE'),
|
|
93
|
+
}
|
|
94
|
+
config.headers = updatedHeaders
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
98
|
+
const updatedHeaders = {
|
|
99
|
+
...config.headers,
|
|
100
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN,
|
|
101
|
+
}
|
|
102
|
+
config.headers = updatedHeaders
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (CONFIGS.BASE_URL) {
|
|
106
|
+
config.baseURL = CONFIGS.BASE_URL + '/api'
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return config
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
publicRequest.interceptors.response.use((response: AxiosResponse) => {
|
|
113
|
+
const xtfCookie = _get(response, 'headers.x-tf-ecommerce')
|
|
114
|
+
const url = _get(response, 'config.url')
|
|
115
|
+
const method = _get(response, 'config.method')
|
|
116
|
+
|
|
117
|
+
if (xtfCookie && !(url === '/auth' && method === 'delete')) {
|
|
118
|
+
setCustomCookie('X-TF-ECOMMERCE', xtfCookie)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return response
|
|
122
|
+
})
|
|
123
|
+
|
|
124
|
+
publicRequest.setGuestToken = token =>
|
|
125
|
+
(publicRequest.defaults.headers.common['Authorization-Guest'] = token)
|
|
126
|
+
|
|
127
|
+
publicRequest.setBaseUrl = (baseUrl: string) =>
|
|
128
|
+
(publicRequest.defaults.baseURL = baseUrl + '/api')
|
|
129
|
+
|
|
130
|
+
publicRequest.setAccessToken = token =>
|
|
131
|
+
(publicRequest.defaults.headers.common.Authorization = token)
|
|
132
|
+
|
|
133
|
+
export const setXSourceOrigin = (sourceOrigin: string) => {
|
|
134
|
+
ttfHeaders['X-Source-Origin'] = sourceOrigin
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const setCustomHeader = (response: any) => {
|
|
138
|
+
const guestHeaderResponseValue = _get(response, 'headers.authorization-guest')
|
|
139
|
+
const guestHeaderExistingValue = _get(
|
|
140
|
+
response,
|
|
141
|
+
'config.headers[Authorization-Guest]'
|
|
142
|
+
)
|
|
143
|
+
const guestHeader = guestHeaderResponseValue || guestHeaderExistingValue
|
|
144
|
+
|
|
145
|
+
if (guestHeader) {
|
|
146
|
+
if (isWindowDefined) {
|
|
147
|
+
window.localStorage.setItem('auth_guest_token', guestHeader)
|
|
148
|
+
publicRequest.setGuestToken(guestHeader)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function getEvent(id: string | number) {
|
|
154
|
+
const response = publicRequest
|
|
155
|
+
.get(`v1/event/${id}`, { headers: ttfHeaders })
|
|
156
|
+
.catch(error => {
|
|
157
|
+
throw error
|
|
158
|
+
})
|
|
159
|
+
return response
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function getTickets(id: string | number, promoCode: string) {
|
|
163
|
+
const response = publicRequest
|
|
164
|
+
.get(`v1/event/${id}/tickets/`, {
|
|
165
|
+
headers: promoCode
|
|
166
|
+
? {
|
|
167
|
+
...ttfHeaders,
|
|
168
|
+
'Promotion-Event': String(id),
|
|
169
|
+
'Promotion-Code': promoCode,
|
|
170
|
+
}
|
|
171
|
+
: { ...ttfHeaders },
|
|
172
|
+
})
|
|
173
|
+
.catch(error => {
|
|
174
|
+
throw error
|
|
175
|
+
})
|
|
176
|
+
return response
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export const addToCart = (id: string | number, data: any) => {
|
|
180
|
+
const res = publicRequest.post(`v1/event/${id}/add-to-cart/`, { data })
|
|
181
|
+
return res
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export const getCart = () => {
|
|
185
|
+
const res = publicRequest.get(`v1/cart/`)
|
|
186
|
+
return res
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export const postOnCheckout = (data: any, accessToken?: string) => {
|
|
190
|
+
const res = publicRequest.post(
|
|
191
|
+
`v1/on-checkout/`,
|
|
192
|
+
{ data },
|
|
193
|
+
{
|
|
194
|
+
headers: {
|
|
195
|
+
...ttfHeaders,
|
|
196
|
+
Authorization: `Bearer ${accessToken}`,
|
|
197
|
+
},
|
|
198
|
+
}
|
|
199
|
+
)
|
|
200
|
+
return res
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export const authorize = (data: { email: string, password: string }) =>
|
|
204
|
+
publicRequest.post(
|
|
205
|
+
`/auth?clientId=${CONFIGS.CLIENT_ID ||
|
|
206
|
+
'e9d8f8922797b4621e562255afe90dbf'}`,
|
|
207
|
+
data
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
export const register = (data: FormData) =>
|
|
211
|
+
publicRequest.post('v1/oauth/register-rn', data)
|
|
212
|
+
|
|
213
|
+
export const getAccessToken = (data: FormData) =>
|
|
214
|
+
publicRequest.post('v1/oauth/access_token', data)
|
|
215
|
+
|
|
216
|
+
export const getPaymentData = (hash: string) => {
|
|
217
|
+
const response = publicRequest
|
|
218
|
+
.get(`v1/order/${hash}/review/`)
|
|
219
|
+
.catch(error => {
|
|
220
|
+
throw error
|
|
221
|
+
})
|
|
222
|
+
return response
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export const handlePaymentData = (orderHash: string, data: any) => {
|
|
226
|
+
const res = publicRequest
|
|
227
|
+
.post(`v1/order/${orderHash}/pay`, {
|
|
228
|
+
data: { attributes: { 'stripe-source': data } },
|
|
229
|
+
})
|
|
230
|
+
.catch(error => {
|
|
231
|
+
throw error
|
|
232
|
+
})
|
|
233
|
+
return res
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export const handlePaymentSuccess = (orderHash: string) => {
|
|
237
|
+
const res = publicRequest
|
|
238
|
+
.post(`v1/order/${orderHash}/success`)
|
|
239
|
+
.catch(error => {
|
|
240
|
+
throw error
|
|
241
|
+
})
|
|
242
|
+
return res
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export const handleFreeSuccess = (orderHash: string) => {
|
|
246
|
+
const res = publicRequest
|
|
247
|
+
.post(`v1/order/${orderHash}/complete_free_registration`)
|
|
248
|
+
.catch(error => {
|
|
249
|
+
throw error
|
|
250
|
+
})
|
|
251
|
+
return res
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export const getProfileData = (accessToken?: string) =>
|
|
255
|
+
publicRequest
|
|
256
|
+
.get('/customer/profile/', {
|
|
257
|
+
headers: {
|
|
258
|
+
...ttfHeaders,
|
|
259
|
+
Authorization: `Bearer ${accessToken}`,
|
|
260
|
+
},
|
|
261
|
+
})
|
|
262
|
+
.catch((e: any) => {
|
|
263
|
+
return e
|
|
264
|
+
})
|
|
265
|
+
|
|
266
|
+
export const getCountries = () => publicRequest.get('/countries/')
|
|
267
|
+
|
|
268
|
+
export const getConfirmationData = (orderHash: string) =>
|
|
269
|
+
publicRequest.get(`v1/order/${orderHash}/payment/complete`)
|
|
270
|
+
|
|
271
|
+
export const getStates = (countryId: string) =>
|
|
272
|
+
publicRequest.get(`/countries/${countryId}/states/`)
|
|
273
|
+
|
|
274
|
+
export const getOrders = (page: number, limit: number, eventSlug: string) =>
|
|
275
|
+
publicRequest.get(
|
|
276
|
+
`v1/account/orders/?page=${page}&limit=${limit}&filter[event]=${eventSlug}&filter[brand]=${CONFIGS.BRAND_SLUG}`
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
export const getOrderDetails = (orderId: string) =>
|
|
280
|
+
publicRequest.get(`v1/account/order/${orderId}`)
|
|
281
|
+
|
|
282
|
+
export const addToWaitingList = (id: number, data: any) =>
|
|
283
|
+
publicRequest.post(`v1/event/${id}/add_to_waiting_list`, data)
|
|
284
|
+
|
|
285
|
+
export const getConditions = (eventId: string) =>
|
|
286
|
+
publicRequest.get(`v1/event/${eventId}/conditions`)
|
|
287
|
+
|
|
288
|
+
// resale
|
|
289
|
+
export const resaleTicket = (data: any, hash: string) => {
|
|
290
|
+
return publicRequest.post(`v1/ticket/${hash}/sell`, data)
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export const removeFromResale = (hash: string) => {
|
|
294
|
+
return publicRequest.delete(`v1/ticket/${hash}/sell`)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
export const postReferralVisits = (eventId: string, referralId: string) =>
|
|
298
|
+
publicRequest.post(`v1/event/${eventId}/referrer/`, {
|
|
299
|
+
referrer: `${referralId}`,
|
|
300
|
+
})
|
|
301
|
+
|
|
302
|
+
export const logout = () => publicRequest.delete('/auth')
|
|
303
|
+
|
|
304
|
+
export const processTicket = (hash: string) => {
|
|
305
|
+
return publicRequest.post(`v1/ticket/${hash}/process/`)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
export const declineInvitation = (hash: string) => {
|
|
309
|
+
return publicRequest.post(`v1/ticket/${hash}/decline`)
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export const sendRSVPInfo = (eventId: number, data: any) =>
|
|
313
|
+
publicRequest.post(`v1/event/${eventId}/send-rsvp-info`, data)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
2
|
+
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
|
3
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
4
|
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
|
5
|
+
width="94.926px" height="94.926px" viewBox="0 0 94.926 94.926" style="enable-background:new 0 0 94.926 94.926;"
|
|
6
|
+
xml:space="preserve">
|
|
7
|
+
<g>
|
|
8
|
+
<path d="M55.931,47.463L94.306,9.09c0.826-0.827,0.826-2.167,0-2.994L88.833,0.62C88.436,0.224,87.896,0,87.335,0
|
|
9
|
+
c-0.562,0-1.101,0.224-1.498,0.62L47.463,38.994L9.089,0.62c-0.795-0.795-2.202-0.794-2.995,0L0.622,6.096
|
|
10
|
+
c-0.827,0.827-0.827,2.167,0,2.994l38.374,38.373L0.622,85.836c-0.827,0.827-0.827,2.167,0,2.994l5.473,5.476
|
|
11
|
+
c0.397,0.396,0.936,0.62,1.498,0.62s1.1-0.224,1.497-0.62l38.374-38.374l38.374,38.374c0.397,0.396,0.937,0.62,1.498,0.62
|
|
12
|
+
s1.101-0.224,1.498-0.62l5.473-5.476c0.826-0.827,0.826-2.167,0-2.994L55.931,47.463z"/>
|
|
13
|
+
</g>
|
|
14
|
+
<g>
|
|
15
|
+
</g>
|
|
16
|
+
<g>
|
|
17
|
+
</g>
|
|
18
|
+
<g>
|
|
19
|
+
</g>
|
|
20
|
+
<g>
|
|
21
|
+
</g>
|
|
22
|
+
<g>
|
|
23
|
+
</g>
|
|
24
|
+
<g>
|
|
25
|
+
</g>
|
|
26
|
+
<g>
|
|
27
|
+
</g>
|
|
28
|
+
<g>
|
|
29
|
+
</g>
|
|
30
|
+
<g>
|
|
31
|
+
</g>
|
|
32
|
+
<g>
|
|
33
|
+
</g>
|
|
34
|
+
<g>
|
|
35
|
+
</g>
|
|
36
|
+
<g>
|
|
37
|
+
</g>
|
|
38
|
+
<g>
|
|
39
|
+
</g>
|
|
40
|
+
<g>
|
|
41
|
+
</g>
|
|
42
|
+
<g>
|
|
43
|
+
</g>
|
|
44
|
+
</svg>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
|
|
3
|
-
</svg>
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
|
|
3
|
+
</svg>
|
|
Binary file
|