tf-checkout-react 1.2.18 → 1.2.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.
@@ -8,8 +8,8 @@ export declare const publicRequest: IPublicRequest;
8
8
  export declare const setXSourceOrigin: (sourceOrigin: string) => void;
9
9
  export declare const setCustomHeader: (response: any) => void;
10
10
  export declare const handleSetAccessToken: (token: string) => void;
11
- export declare function getEvent(id: string | number): Promise<AxiosResponse<any, any>>;
12
- export declare function getTickets(id: string | number, promoCode: string): Promise<AxiosResponse<any, any>>;
11
+ export declare function getEvent(id: string | number, pk?: string): Promise<AxiosResponse<any, any>>;
12
+ export declare function getTickets(id: string | number, promoCode: string, pk?: string): Promise<AxiosResponse<any, any>>;
13
13
  export declare const addToCart: (id: string | number, data: any) => Promise<AxiosResponse<any, any>>;
14
14
  export declare const getCart: () => Promise<AxiosResponse<any, any>>;
15
15
  export declare const postOnCheckout: (data: any, accessToken?: string | undefined) => Promise<AxiosResponse<any, any>>;
@@ -50,5 +50,5 @@ export interface ITicket {
50
50
  export interface ISelectedTickets {
51
51
  [key: string]: string | number;
52
52
  }
53
- export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, enableInfluencersSection }: IGetTickets) => JSX.Element;
53
+ export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, enableInfluencersSection, }: IGetTickets) => JSX.Element;
54
54
  export {};
@@ -1312,7 +1312,7 @@ var handleSetAccessToken = function handleSetAccessToken(token) {
1312
1312
  }
1313
1313
  }
1314
1314
  };
1315
- function getEvent(id) {
1315
+ function getEvent(id, pk) {
1316
1316
  var referralValue = '';
1317
1317
 
1318
1318
  if (isWindowDefined) {
@@ -1330,6 +1330,9 @@ function getEvent(id) {
1330
1330
  }
1331
1331
 
1332
1332
  var response = publicRequest.get("v1/event/" + id, {
1333
+ params: {
1334
+ pk: pk
1335
+ },
1333
1336
  headers: _extends({}, ttfHeaders, {
1334
1337
  'Referer-Url': isDocumentDefined ? document.referrer : '',
1335
1338
  'Referrer-Id': isWindowDefined ? referralValue : ''
@@ -1339,8 +1342,11 @@ function getEvent(id) {
1339
1342
  });
1340
1343
  return response;
1341
1344
  }
1342
- function getTickets(id, promoCode) {
1343
- var response = publicRequest.get("v1/event/" + id + "/tickets/", {
1345
+ function getTickets(id, promoCode, pk) {
1346
+ var response = publicRequest.get("v1/event/" + id + "/tickets", {
1347
+ params: {
1348
+ pk: pk
1349
+ },
1344
1350
  headers: promoCode ? _extends({}, ttfHeaders, {
1345
1351
  'Promotion-Event': String(id),
1346
1352
  'Promotion-Code': promoCode
@@ -1429,7 +1435,7 @@ var getStates = function getStates(countryId) {
1429
1435
  return publicRequest.get("/countries/" + countryId + "/states/");
1430
1436
  };
1431
1437
  var getOrders = function getOrders(page, limit, eventSlug) {
1432
- return publicRequest.get("v1/account/orders/?page=" + page + "&limit=" + limit + "&filter[event]=" + eventSlug + "&filter[brand]=" + CONFIGS.BRAND_SLUG);
1438
+ return publicRequest.get("v1/account/orders/?page=" + page + "&limit=" + limit + "&filter[event]=" + eventSlug + "&filter[brand]=" + CONFIGS.BRAND_SLUG + "&filter[subbrands]=yes");
1433
1439
  };
1434
1440
  var getOrderDetails = function getOrderDetails(orderId) {
1435
1441
  return publicRequest.get("v1/account/order/" + orderId);
@@ -3480,6 +3486,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref3) {
3480
3486
  }, React__default.createElement("div", {
3481
3487
  className: element.className
3482
3488
  }, element.component ? element.component : React__default.createElement(formik.Field, {
3489
+ setPhoneValidationIsLoading: element.type === 'phone' ? setPhoneValidationIsLoading : undefined,
3483
3490
  name: element.name,
3484
3491
  label: element.name === 'phone' ? "" + element.label + (flagRequirePhone ? '' : ' (optional)') + " " : element.label,
3485
3492
  type: element.type,
@@ -5370,7 +5377,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
5370
5377
 
5371
5378
  function _getTicketsApi() {
5372
5379
  _getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(isUpdateingCode, type) {
5373
- var response, eventResponse, attributes, _event2;
5380
+ var previewKey, response, eventResponse, attributes, _event2;
5374
5381
 
5375
5382
  return runtime_1.wrap(function _callee3$(_context3) {
5376
5383
  while (1) {
@@ -5378,15 +5385,16 @@ var TicketsContainer = function TicketsContainer(_ref) {
5378
5385
  case 0:
5379
5386
  _context3.prev = 0;
5380
5387
  isUpdateingCode ? setCodeIsLoading(true) : setIsLoading(true);
5381
- _context3.next = 4;
5382
- return getTickets(eventId, code);
5388
+ previewKey = getQueryVariable('pk') || undefined;
5389
+ _context3.next = 5;
5390
+ return getTickets(eventId, code, previewKey);
5383
5391
 
5384
- case 4:
5392
+ case 5:
5385
5393
  response = _context3.sent;
5386
- _context3.next = 7;
5387
- return getEvent(eventId);
5394
+ _context3.next = 8;
5395
+ return getEvent(eventId, previewKey);
5388
5396
 
5389
- case 7:
5397
+ case 8:
5390
5398
  eventResponse = _context3.sent;
5391
5399
 
5392
5400
  if (response.data.success) {
@@ -5405,29 +5413,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
5405
5413
  setEvent(_event2);
5406
5414
  }
5407
5415
 
5408
- _context3.next = 15;
5416
+ _context3.next = 16;
5409
5417
  break;
5410
5418
 
5411
- case 12:
5412
- _context3.prev = 12;
5419
+ case 13:
5420
+ _context3.prev = 13;
5413
5421
  _context3.t0 = _context3["catch"](0);
5414
5422
 
5415
5423
  if (axios.isAxiosError(_context3.t0)) {
5416
5424
  onGetTicketsError(_context3.t0);
5417
5425
  }
5418
5426
 
5419
- case 15:
5420
- _context3.prev = 15;
5427
+ case 16:
5428
+ _context3.prev = 16;
5421
5429
  setIsLoading(false);
5422
5430
  setCodeIsLoading(false);
5423
- return _context3.finish(15);
5431
+ return _context3.finish(16);
5424
5432
 
5425
- case 19:
5433
+ case 20:
5426
5434
  case "end":
5427
5435
  return _context3.stop();
5428
5436
  }
5429
5437
  }
5430
- }, _callee3, null, [[0, 12, 15, 19]]);
5438
+ }, _callee3, null, [[0, 13, 16, 20]]);
5431
5439
  }));
5432
5440
  return _getTicketsApi.apply(this, arguments);
5433
5441
  }