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.
Files changed (117) hide show
  1. package/README.md +278 -1
  2. package/dist/api/index.d.ts +31 -26
  3. package/dist/components/account-settings/index.d.ts +3 -0
  4. package/dist/components/billing-info-container/index.d.ts +5 -5
  5. package/dist/components/billing-info-container/utils.d.ts +1 -0
  6. package/dist/components/common/CustomField.d.ts +1 -1
  7. package/dist/components/common/DatePickerField.d.ts +14 -0
  8. package/dist/components/common/RedirectModal.d.ts +7 -0
  9. package/dist/components/common/SnackbarAlert.d.ts +13 -0
  10. package/dist/components/confirmationContainer/index.d.ts +2 -1
  11. package/dist/components/countdown/index.d.ts +4 -1
  12. package/dist/components/myTicketsContainer/tableConfig.d.ts +0 -1
  13. package/dist/components/orderDetailsContainer/index.d.ts +5 -1
  14. package/dist/components/orderDetailsContainer/ticketsTable.d.ts +4 -1
  15. package/dist/components/paymentContainer/index.d.ts +3 -1
  16. package/dist/components/rsvpContainer/index.d.ts +7 -0
  17. package/dist/components/stripePayment/index.d.ts +2 -1
  18. package/dist/components/ticketResale/index.d.ts +5 -3
  19. package/dist/components/ticketsContainer/AccessCodeSection.d.ts +7 -0
  20. package/dist/components/ticketsContainer/PromoCodeSection.d.ts +6 -9
  21. package/dist/components/ticketsContainer/TicketsSection.d.ts +5 -3
  22. package/dist/components/ticketsContainer/index.d.ts +13 -2
  23. package/dist/components/timerWidget/index.d.ts +3 -3
  24. package/dist/env.d.ts +1 -0
  25. package/dist/images/cross.svg +44 -0
  26. package/dist/images/done.svg +3 -3
  27. package/dist/index.d.ts +2 -0
  28. package/dist/tf-checkout-react.cjs.development.js +1400 -575
  29. package/dist/tf-checkout-react.cjs.development.js.map +1 -1
  30. package/dist/tf-checkout-react.cjs.production.min.js +1 -1
  31. package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
  32. package/dist/tf-checkout-react.esm.js +1409 -586
  33. package/dist/tf-checkout-react.esm.js.map +1 -1
  34. package/dist/tf-checkout-styles.css +1 -1
  35. package/dist/utils/cookies.d.ts +3 -0
  36. package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
  37. package/dist/utils/downloadPDF.d.ts +1 -1
  38. package/dist/utils/getDomain.d.ts +1 -0
  39. package/dist/utils/index.d.ts +2 -0
  40. package/package.json +89 -89
  41. package/src/.DS_Store +0 -0
  42. package/src/.d.ts +2 -2
  43. package/src/api/index.ts +313 -278
  44. package/src/assets/images/cross.svg +44 -0
  45. package/src/assets/images/done.svg +3 -3
  46. package/src/components/.DS_Store +0 -0
  47. package/src/components/account-settings/index.tsx +161 -0
  48. package/src/components/account-settings/style.css +200 -0
  49. package/src/components/billing-info-container/index.tsx +821 -777
  50. package/src/components/billing-info-container/style.css +106 -106
  51. package/src/components/billing-info-container/utils.ts +233 -223
  52. package/src/components/common/CheckboxField.tsx +41 -41
  53. package/src/components/common/CustomField.tsx +87 -84
  54. package/src/components/common/DatePickerField.tsx +98 -0
  55. package/src/components/common/FormikPhoneNumberField.tsx +51 -51
  56. package/src/components/common/Loader.tsx +9 -9
  57. package/src/components/common/RadioField.tsx +35 -35
  58. package/src/components/common/RedirectModal.tsx +43 -0
  59. package/src/components/common/SelectField.tsx +80 -80
  60. package/src/components/common/SnackbarAlert.tsx +54 -0
  61. package/src/components/common/dist/PhoneNumberField.js +96 -0
  62. package/src/components/common/index.tsx +4 -4
  63. package/src/components/confirmModal/index.tsx +51 -51
  64. package/src/components/confirmModal/style.css +21 -21
  65. package/src/components/confirmationContainer/config.ts +72 -72
  66. package/src/components/confirmationContainer/index.tsx +197 -194
  67. package/src/components/confirmationContainer/social-buttons.tsx +94 -94
  68. package/src/components/confirmationContainer/style.css +202 -202
  69. package/src/components/countdown/index.tsx +100 -89
  70. package/src/components/countdown/style.css +9 -9
  71. package/src/components/index.ts +7 -7
  72. package/src/components/loginModal/index.tsx +171 -209
  73. package/src/components/loginModal/style.css +71 -71
  74. package/src/components/myTicketsContainer/index.tsx +201 -137
  75. package/src/components/myTicketsContainer/row.tsx +41 -41
  76. package/src/components/myTicketsContainer/style.css +40 -40
  77. package/src/components/myTicketsContainer/tableConfig.tsx +32 -34
  78. package/src/components/orderDetailsContainer/index.tsx +289 -249
  79. package/src/components/orderDetailsContainer/style.css +73 -73
  80. package/src/components/orderDetailsContainer/ticketsTable.tsx +177 -124
  81. package/src/components/paymentContainer/index.tsx +352 -284
  82. package/src/components/registerModal/index.tsx +183 -190
  83. package/src/components/rsvpContainer/index.tsx +126 -0
  84. package/src/components/stripePayment/index.tsx +258 -253
  85. package/src/components/stripePayment/style.css +60 -60
  86. package/src/components/ticketResale/index.tsx +74 -56
  87. package/src/components/ticketResaleModal/index.tsx +213 -210
  88. package/src/components/ticketResaleModal/style.css +28 -28
  89. package/src/components/ticketsContainer/AccessCodeSection.tsx +50 -0
  90. package/src/components/ticketsContainer/PromoCodeSection.tsx +89 -99
  91. package/src/components/ticketsContainer/ReferralLogic.tsx +31 -33
  92. package/src/components/ticketsContainer/TicketRow.tsx +89 -83
  93. package/src/components/ticketsContainer/TicketsSection.tsx +87 -81
  94. package/src/components/ticketsContainer/index.tsx +506 -409
  95. package/src/components/ticketsContainer/style.css +181 -181
  96. package/src/components/ticketsContainer/utils.ts +11 -11
  97. package/src/components/timerWidget/index.tsx +87 -70
  98. package/src/components/timerWidget/style.css +34 -26
  99. package/src/components/waitingList/index.tsx +178 -178
  100. package/src/components/waitingList/style.css +26 -26
  101. package/src/env.ts +20 -19
  102. package/src/index.ts +15 -13
  103. package/src/normalizers/index.ts +45 -45
  104. package/src/types/billing-info-data.ts +37 -37
  105. package/src/types/payment-field.ts +7 -7
  106. package/src/types/referral-promotion.ts +7 -7
  107. package/src/utils/cookies.ts +42 -0
  108. package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +71 -59
  109. package/src/utils/downloadPDF.tsx +52 -30
  110. package/src/utils/formikErrorFocus.ts +24 -24
  111. package/src/utils/getDomain.ts +15 -0
  112. package/src/utils/getImage.ts +14 -14
  113. package/src/utils/getQueryVariable.ts +13 -13
  114. package/src/utils/index.ts +7 -5
  115. package/src/utils/setConfigs.ts +26 -26
  116. package/src/utils/showZero.tsx +10 -10
  117. 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 => response,
30
- error => {
31
- if (error?.response?.status === 401) {
32
- if (isWindowDefined) {
33
- window.localStorage.removeItem('auth_guest_token')
34
- window.localStorage.removeItem('user_data')
35
- window.localStorage.removeItem('access_token')
36
- const errorType = error?.response?.data?.error
37
- if (errorType === 'invalid_token') {
38
- window.location.href = '/'
39
- }
40
- }
41
- }
42
- return Promise.reject(error)
43
- }
44
- )
45
-
46
- publicRequest.interceptors.request.use((config: AxiosRequestConfig) => {
47
- const guestToken = isWindowDefined
48
- ? window.localStorage.getItem('auth_guest_token')
49
- : null
50
- const userData = isWindowDefined
51
- ? window.localStorage.getItem('user_data')
52
- : null
53
- const accessToken = isWindowDefined
54
- ? window.localStorage.getItem('access_token')
55
- : null
56
-
57
- if (userData && accessToken) {
58
- const updatedHeaders = {
59
- ...config.headers,
60
- Authorization: `Bearer ${accessToken}`,
61
- }
62
- config.headers = updatedHeaders
63
- }
64
-
65
- if (guestToken) {
66
- publicRequest.setGuestToken(guestToken)
67
- const updatedHeaders = {
68
- ...config.headers,
69
- 'Authorization-Guest': guestToken,
70
- }
71
- config.headers = updatedHeaders
72
- }
73
-
74
- if (CONFIGS.X_SOURCE_ORIGIN) {
75
- const updatedHeaders = {
76
- ...config.headers,
77
- 'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN,
78
- }
79
- config.headers = updatedHeaders
80
- }
81
-
82
- if (CONFIGS.BASE_URL) {
83
- config.baseURL = CONFIGS.BASE_URL + '/api'
84
- }
85
-
86
- return config
87
- })
88
-
89
- publicRequest.setGuestToken = token =>
90
- (publicRequest.defaults.headers.common['Authorization-Guest'] = token)
91
-
92
- publicRequest.setBaseUrl = (baseUrl: string) =>
93
- (publicRequest.defaults.baseURL = baseUrl + '/api')
94
-
95
- publicRequest.setAccessToken = token =>
96
- (publicRequest.defaults.headers.common.Authorization = token)
97
-
98
- export const setXSourceOrigin = (sourceOrigin: string) => {
99
- ttfHeaders['X-Source-Origin'] = sourceOrigin
100
- }
101
-
102
- export const setCustomHeader = (response: any) => {
103
- const guestHeaderResponseValue = _get(response, 'headers.authorization-guest')
104
- const guestHeaderExistingValue = _get(
105
- response,
106
- 'config.headers[Authorization-Guest]'
107
- )
108
- const guestHeader = guestHeaderResponseValue || guestHeaderExistingValue
109
-
110
- if (guestHeader) {
111
- if (isWindowDefined) {
112
- window.localStorage.setItem('auth_guest_token', guestHeader)
113
- publicRequest.setGuestToken(guestHeader)
114
- }
115
- }
116
- }
117
-
118
- export const handleSetAccessToken = (token: any) => {
119
- if (token) {
120
- if (isWindowDefined) {
121
- window.localStorage.setItem('access_token', token)
122
- publicRequest.setAccessToken(token)
123
- }
124
- }
125
- }
126
-
127
- export function getEvent(id: string | number) {
128
- const response = publicRequest
129
- .get(`v1/event/${id}`, { headers: ttfHeaders })
130
- .catch(error => {
131
- throw error
132
- })
133
- return response
134
- }
135
-
136
- export function getTickets(id: string | number, promoCode: string) {
137
- const response = publicRequest
138
- .get(`v1/event/${id}/tickets/`, {
139
- headers: promoCode
140
- ? {
141
- ...ttfHeaders,
142
- 'Promotion-Event': String(id),
143
- 'Promotion-Code': promoCode,
144
- }
145
- : { ...ttfHeaders },
146
- })
147
- .catch(error => {
148
- throw error
149
- })
150
- return response
151
- }
152
-
153
- export const addToCart = (id: string | number, data: any) => {
154
- const res = publicRequest.post(`v1/event/${id}/add-to-cart/`, { data })
155
- return res
156
- }
157
-
158
- export const getCart = () => {
159
- const res = publicRequest.get(`v1/cart/`)
160
- return res
161
- }
162
-
163
- export const postOnCheckout = (data: any, accessToken: string) => {
164
- const res = publicRequest.post(
165
- `v1/on-checkout/`,
166
- { data },
167
- {
168
- headers: {
169
- ...ttfHeaders,
170
- Authorization: `Bearer ${accessToken}`,
171
- },
172
- }
173
- )
174
- return res
175
- }
176
-
177
- export const authorize = (data: FormData) =>
178
- publicRequest.post(
179
- `v1/oauth/authorize-rn?client_id=${CONFIGS.CLIENT_ID ||
180
- 'e9d8f8922797b4621e562255afe90dbf'}`,
181
- data
182
- )
183
-
184
- export const register = (data: FormData) =>
185
- publicRequest.post('v1/oauth/register-rn', data)
186
-
187
- export const getAccessToken = (data: FormData) =>
188
- publicRequest.post('v1/oauth/access_token', data)
189
-
190
- export const getPaymentData = (hash: string) => {
191
- const response = publicRequest
192
- .get(`v1/order/${hash}/review/`)
193
- .catch(error => {
194
- throw error
195
- })
196
- return response
197
- }
198
-
199
- export const handlePaymentData = (orderHash: string, data: any) => {
200
- const res = publicRequest
201
- .post(`v1/order/${orderHash}/pay`, {
202
- data: { attributes: { 'stripe-source': data } },
203
- })
204
- .catch(error => {
205
- throw error
206
- })
207
- return res
208
- }
209
-
210
- export const handlePaymentSuccess = (orderHash: string) => {
211
- const res = publicRequest
212
- .post(`v1/order/${orderHash}/success`)
213
- .catch(error => {
214
- throw error
215
- })
216
- return res
217
- }
218
-
219
- export const handleFreeSuccess = (orderHash: string) => {
220
- const res = publicRequest
221
- .post(`v1/order/${orderHash}/complete_free_registration`)
222
- .catch(error => {
223
- throw error
224
- })
225
- return res
226
- }
227
-
228
- export const getProfileData = (accessToken: any) =>
229
- publicRequest
230
- .get('/customer/profile/', {
231
- headers: {
232
- ...ttfHeaders,
233
- Authorization: `Bearer ${accessToken}`,
234
- },
235
- })
236
- .catch((e: any) => {
237
- return e
238
- })
239
-
240
- export const getCountries = () => publicRequest.get('/countries/')
241
-
242
- export const getConfirmationData = (orderHash: string) =>
243
- publicRequest.get(`v1/order/${orderHash}/payment/complete`)
244
-
245
- export const getStates = (countryId: string) =>
246
- publicRequest.get(`/countries/${countryId}/states/`)
247
-
248
- export const getOrders = (page: number, limit: number, eventSlug: string) =>
249
- publicRequest.get(
250
- `v1/account/orders/?page=${page}&limit=${limit}&filter[event]=${eventSlug}&filter[brand]=${CONFIGS.BRAND_SLUG}`
251
- )
252
-
253
- export const getOrderDetails = (orderId: string) =>
254
- publicRequest.get(`v1/account/order/${orderId}`)
255
-
256
- export const addToWaitingList = (id: number, data: any) =>
257
- publicRequest.post(`v1/event/${id}/add_to_waiting_list`, data)
258
-
259
- export const getConditions = (eventId: string) =>
260
- publicRequest.get(`v1/event/${eventId}/conditions`)
261
-
262
- // resale
263
- export const resaleTicket = (data: any, hash: string) => {
264
- return publicRequest.post(`v1/ticket/${hash}/sell`, data)
265
- }
266
-
267
- export const removeFromResale = (hash: string) => {
268
- return publicRequest.delete(`v1/ticket/${hash}/sell`)
269
- }
270
-
271
- export const postReferralVisits = (eventId: string, referralId: string) =>
272
- publicRequest.post(`v1/event/${eventId}/referrer/`, {
273
- referrer: `${referralId}`,
274
- })
275
-
276
- export const checkTicketStatus = (hash: string) => {
277
- return publicRequest.post(`v1/ticket/${hash}/status/`)
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