tf-checkout-react 1.2.8 → 1.2.11

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.
@@ -33,8 +33,8 @@ import _isNumber from 'lodash-es/isNumber';
33
33
  import SVG from 'react-inlinesvg';
34
34
  import _flatMapDeep from 'lodash-es/flatMapDeep';
35
35
  import _isArray from 'lodash-es/isArray';
36
- import Container from '@mui/material/Container';
37
36
  import Alert$1 from '@mui/material/Alert';
37
+ import Container from '@mui/material/Container';
38
38
  import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
39
39
  import { loadStripe } from '@stripe/stripe-js';
40
40
  import { FacebookShareButton, FacebookIcon, FacebookMessengerShareButton, FacebookMessengerIcon, TwitterShareButton, TwitterIcon, LinkedinShareButton, LinkedinIcon, PinterestShareButton, PinterestIcon, VKShareButton, VKIcon, OKShareButton, OKIcon, TelegramShareButton, TelegramIcon, WhatsappShareButton, WhatsappIcon, RedditShareButton, RedditIcon, TumblrShareButton, TumblrIcon, MailruShareButton, MailruIcon, EmailShareButton, EmailIcon, LivejournalShareButton, LivejournalIcon, ViberShareButton, ViberIcon, WorkplaceShareButton, WorkplaceIcon, LineShareButton, LineIcon, PocketShareButton, PocketIcon, InstapaperShareButton, InstapaperIcon, WeiboShareButton, WeiboIcon, HatenaShareButton, HatenaIcon } from 'react-share';
@@ -1159,8 +1159,8 @@ var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWit
1159
1159
  return body;
1160
1160
  };
1161
1161
 
1162
- var isWindowDefined = typeof window !== 'undefined'; // const isDocumentDefined = typeof document !== 'undefined'
1163
-
1162
+ var isWindowDefined = typeof window !== 'undefined';
1163
+ var isDocumentDefined = typeof document !== 'undefined';
1164
1164
  var ttfHeaders = {
1165
1165
  Accept: 'application/vnd.api+json',
1166
1166
  'Content-Type': 'application/vnd.api+json'
@@ -1320,11 +1320,13 @@ function getEvent(id) {
1320
1320
  }
1321
1321
 
1322
1322
  referralValue = referralId || referralIdlocal;
1323
- console.log(referralValue);
1324
1323
  }
1325
1324
 
1326
1325
  var response = publicRequest.get("v1/event/" + id, {
1327
- headers: _extends({}, ttfHeaders)
1326
+ headers: _extends({}, ttfHeaders, {
1327
+ 'Referer-Url': isDocumentDefined ? document.referrer : '',
1328
+ 'Referrer-Id': isWindowDefined ? referralValue : ''
1329
+ })
1328
1330
  })["catch"](function (error) {
1329
1331
  throw error;
1330
1332
  });
@@ -1345,7 +1347,8 @@ var addToCart = function addToCart(id, data) {
1345
1347
  var res = publicRequest.post("v1/event/" + id + "/add-to-cart/", {
1346
1348
  data: data
1347
1349
  }, {
1348
- headers: {// 'Referer-Url': isDocumentDefined ? document.referrer : '',
1350
+ headers: {
1351
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1349
1352
  }
1350
1353
  });
1351
1354
  return res;
@@ -1372,7 +1375,8 @@ var register = function register(data) {
1372
1375
  };
1373
1376
  var getPaymentData = function getPaymentData(hash) {
1374
1377
  var response = publicRequest.get("v1/order/" + hash + "/review/", {
1375
- headers: {// 'Referer-Url': isDocumentDefined ? document.referrer : '',
1378
+ headers: {
1379
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1376
1380
  }
1377
1381
  })["catch"](function (error) {
1378
1382
  throw error;
@@ -1381,7 +1385,8 @@ var getPaymentData = function getPaymentData(hash) {
1381
1385
  };
1382
1386
  var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
1383
1387
  var res = publicRequest.post("v1/order/" + orderHash + "/success", undefined, {
1384
- headers: {// 'Referer-Url': isDocumentDefined ? document.referrer : '',
1388
+ headers: {
1389
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1385
1390
  }
1386
1391
  })["catch"](function (error) {
1387
1392
  throw error;
@@ -1390,7 +1395,8 @@ var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
1390
1395
  };
1391
1396
  var handleFreeSuccess = function handleFreeSuccess(orderHash) {
1392
1397
  var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", undefined, {
1393
- headers: {// 'Referer-Url': isDocumentDefined ? document.referrer : '',
1398
+ headers: {
1399
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1394
1400
  }
1395
1401
  })["catch"](function (error) {
1396
1402
  throw error;
@@ -3949,11 +3955,11 @@ var PaymentContainer = function PaymentContainer(_ref) {
3949
3955
  _ref$onErrorClose = _ref.onErrorClose,
3950
3956
  onErrorClose = _ref$onErrorClose === void 0 ? _identity : _ref$onErrorClose,
3951
3957
  _ref$onGetPaymentData = _ref.onGetPaymentDataSuccess,
3952
- onGetPaymentDataSuccess = _ref$onGetPaymentData === void 0 ? function () {} : _ref$onGetPaymentData,
3958
+ onGetPaymentDataSuccess = _ref$onGetPaymentData === void 0 ? _identity : _ref$onGetPaymentData,
3953
3959
  _ref$onGetPaymentData2 = _ref.onGetPaymentDataError,
3954
- onGetPaymentDataError = _ref$onGetPaymentData2 === void 0 ? function () {} : _ref$onGetPaymentData2,
3960
+ onGetPaymentDataError = _ref$onGetPaymentData2 === void 0 ? _identity : _ref$onGetPaymentData2,
3955
3961
  _ref$onPaymentError = _ref.onPaymentError,
3956
- onPaymentError = _ref$onPaymentError === void 0 ? function () {} : _ref$onPaymentError,
3962
+ onPaymentError = _ref$onPaymentError === void 0 ? _identity : _ref$onPaymentError,
3957
3963
  _ref$stripeCardOption = _ref.stripeCardOptions,
3958
3964
  stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
3959
3965
  _ref$disableZipSectio = _ref.disableZipSection,
@@ -3961,7 +3967,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
3961
3967
  themeOptions = _ref.themeOptions,
3962
3968
  elementsOptions = _ref.elementsOptions,
3963
3969
  _ref$onCountdownFinis = _ref.onCountdownFinish,
3964
- onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis,
3970
+ onCountdownFinish = _ref$onCountdownFinis === void 0 ? _identity : _ref$onCountdownFinis,
3965
3971
  _ref$enableTimer = _ref.enableTimer,
3966
3972
  enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
3967
3973
  _ref$enablePaymentPla = _ref.enablePaymentPlan,
@@ -4001,6 +4007,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
4001
4007
  var eventId = getQueryVariable('event_id');
4002
4008
  var hash = checkoutData.hash,
4003
4009
  total = checkoutData.total;
4010
+ var isFreeTickets = !Number(total) && !Number(orderData.total);
4004
4011
  useEffect(function () {
4005
4012
  _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
4006
4013
  var response, _cart$, attributes, cart, order_details, _order_details$ticket, ticket, _orderData;
@@ -4121,7 +4128,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
4121
4128
  case 3:
4122
4129
  order_hash = reviewData.order_details.order_hash;
4123
4130
 
4124
- if (!(total === '0.00')) {
4131
+ if (!isFreeTickets) {
4125
4132
  _context3.next = 10;
4126
4133
  break;
4127
4134
  }
@@ -4228,7 +4235,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
4228
4235
  className: "plan_block"
4229
4236
  }, React.createElement("h3", null, "Mbrand Payment Plan Terms"), React.createElement("p", null, "By clicking on the \u201CConfirm Payment Plan\u201D button, you are starting your payment plan of 2 payments of $115.00, which will be drawn from your account every 2 weeks, with the first payment taken later today."), React.createElement("p", null, "This includes a non-refundable admin fee of $3.00 per payment."), React.createElement("p", {
4230
4237
  className: "payment_note"
4231
- }, "NOTE: If today\u2019s payment fails, your payment plan will not activate, and your tickets will not be issued until you complete your final payment."), React.createElement("p", null, "If you do not complete your payements, your order will be canceled. Your first payment of $115.00, plus the non-refundable admin fee of $3.00 will not be refunded."), React.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))), total !== '0.00' ? React.createElement("div", {
4238
+ }, "NOTE: If today\u2019s payment fails, your payment plan will not activate, and your tickets will not be issued until you complete your final payment."), React.createElement("p", null, "If you do not complete your payements, your order will be canceled. Your first payment of $115.00, plus the non-refundable admin fee of $3.00 will not be refunded."), React.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))), !isFreeTickets ? React.createElement("div", {
4232
4239
  className: "payment_info"
4233
4240
  }, React.createElement("div", {
4234
4241
  className: "payment_info_label"