tf-checkout-react 1.6.6-beta.27 → 1.6.6-beta.29
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/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +1 -1
- package/dist/components/addonsContainer/index.d.ts +1 -1
- package/dist/components/billing-info-container/index.d.ts +1 -0
- package/dist/components/myTicketsContainer/index.d.ts +3 -2
- package/dist/components/paymentContainer/OrderDetails.d.ts +7 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +310 -157
- 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 +310 -157
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/getDomain.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/addonsContainer/SimpleAddonsContainer.tsx +4 -0
- package/src/components/addonsContainer/index.tsx +4 -0
- package/src/components/billing-info-container/index.tsx +84 -27
- package/src/components/common/SnackbarAlert.tsx +32 -34
- package/src/components/loginModal/style.css +3 -1
- package/src/components/myTicketsContainer/index.tsx +12 -8
- package/src/components/paymentContainer/OrderDetails.tsx +43 -3
- package/src/components/paymentContainer/index.tsx +25 -23
- package/src/components/paymentContainer/style.css +113 -0
- package/src/types/api/payment.d.ts +2 -2
- package/src/utils/cookies.ts +43 -12
- package/src/utils/getDomain.ts +10 -4
|
@@ -574,11 +574,18 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
574
574
|
}(React.Component);
|
|
575
575
|
var ErrorFocus = /*#__PURE__*/formik.connect(ErrorFocusInternal);
|
|
576
576
|
|
|
577
|
-
function getDomain(url, subdomain) {
|
|
577
|
+
function getDomain(url, subdomain, publicSuffix) {
|
|
578
578
|
var updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
579
579
|
if (!subdomain) {
|
|
580
|
-
|
|
581
|
-
|
|
580
|
+
if (publicSuffix) {
|
|
581
|
+
var updatedPublicSuffix = publicSuffix.startsWith('.') ? publicSuffix : '.' + publicSuffix;
|
|
582
|
+
updatedUrl = url.replace(updatedPublicSuffix, '').split('.');
|
|
583
|
+
updatedUrl = updatedUrl.length > 0 ? updatedUrl[updatedUrl.length - 1] : '';
|
|
584
|
+
updatedUrl += updatedPublicSuffix;
|
|
585
|
+
} else {
|
|
586
|
+
updatedUrl = updatedUrl.split(".");
|
|
587
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join(".");
|
|
588
|
+
}
|
|
582
589
|
}
|
|
583
590
|
if (updatedUrl.indexOf('/') !== -1) {
|
|
584
591
|
return updatedUrl.split('/')[0];
|
|
@@ -586,6 +593,7 @@ function getDomain(url, subdomain) {
|
|
|
586
593
|
return updatedUrl;
|
|
587
594
|
}
|
|
588
595
|
|
|
596
|
+
var generalDomain;
|
|
589
597
|
function setCustomCookie(name, value, days) {
|
|
590
598
|
if (days === void 0) {
|
|
591
599
|
days = 5;
|
|
@@ -596,10 +604,22 @@ function setCustomCookie(name, value, days) {
|
|
|
596
604
|
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
597
605
|
expires = '; expires=' + date.toUTCString();
|
|
598
606
|
}
|
|
599
|
-
if (typeof window
|
|
600
|
-
|
|
601
|
-
document.cookie = name + '=' + (value || '') + expires + ("; path=/; domain=" + domain);
|
|
607
|
+
if (typeof window === 'undefined') {
|
|
608
|
+
return;
|
|
602
609
|
}
|
|
610
|
+
var hostname = window.location.hostname;
|
|
611
|
+
if (generalDomain && generalDomain.endsWith(getDomain(hostname))) {
|
|
612
|
+
document.cookie = name + '=' + (value || '') + expires + ("; path=/;domain=" + generalDomain);
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
var previousDomain = undefined;
|
|
616
|
+
var domain = undefined;
|
|
617
|
+
do {
|
|
618
|
+
previousDomain = domain;
|
|
619
|
+
domain = getDomain(hostname, undefined, previousDomain);
|
|
620
|
+
document.cookie = name + '=' + (value || '') + expires + ("; path=/;domain=" + domain);
|
|
621
|
+
} while (getCookieByName(name) === '' && hostname !== domain);
|
|
622
|
+
generalDomain = domain;
|
|
603
623
|
}
|
|
604
624
|
function getCookieByName(cname) {
|
|
605
625
|
if (typeof window === 'undefined') return '';
|
|
@@ -617,10 +637,25 @@ function getCookieByName(cname) {
|
|
|
617
637
|
return '';
|
|
618
638
|
}
|
|
619
639
|
function deleteCookieByName(name) {
|
|
620
|
-
if (
|
|
621
|
-
|
|
622
|
-
|
|
640
|
+
if (getCookieByName(name) === '') {
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (typeof window === 'undefined') {
|
|
644
|
+
return;
|
|
623
645
|
}
|
|
646
|
+
var hostname = window.location.hostname;
|
|
647
|
+
if (generalDomain && generalDomain.endsWith(getDomain(hostname))) {
|
|
648
|
+
document.cookie = name + ("=; Path=/;domain=" + generalDomain + "; Expires=Thu, 01 Jan 1970 00:00:01 GMT;");
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
var previousDomain = undefined;
|
|
652
|
+
var domain = undefined;
|
|
653
|
+
do {
|
|
654
|
+
previousDomain = domain;
|
|
655
|
+
domain = getDomain(hostname, undefined, previousDomain);
|
|
656
|
+
document.cookie = name + ("=; Path=/;domain=" + domain + "; Expires=Thu, 01 Jan 1970 00:00:01 GMT;");
|
|
657
|
+
} while (getCookieByName(name) !== '' && hostname !== domain);
|
|
658
|
+
generalDomain = domain;
|
|
624
659
|
}
|
|
625
660
|
|
|
626
661
|
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
@@ -4073,6 +4108,9 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
4073
4108
|
size: 50
|
|
4074
4109
|
}));
|
|
4075
4110
|
}
|
|
4111
|
+
if ((addons == null ? void 0 : addons.length) === 0) {
|
|
4112
|
+
return null;
|
|
4113
|
+
}
|
|
4076
4114
|
var params = new URL("" + window.location).searchParams;
|
|
4077
4115
|
var addOnIsIncluded = params.get('include_add_on') === 'true';
|
|
4078
4116
|
var isResale = params.get('resale') === 'true';
|
|
@@ -4392,6 +4430,9 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4392
4430
|
size: 50
|
|
4393
4431
|
}));
|
|
4394
4432
|
}
|
|
4433
|
+
if ((addons == null ? void 0 : addons.length) === 0) {
|
|
4434
|
+
return null;
|
|
4435
|
+
}
|
|
4395
4436
|
return React__default.createElement("div", {
|
|
4396
4437
|
className: classNamePrefix + "_container"
|
|
4397
4438
|
}, React__default.createElement("div", {
|
|
@@ -5415,15 +5456,6 @@ var PaymentPlanSection = function PaymentPlanSection(props) {
|
|
|
5415
5456
|
};
|
|
5416
5457
|
|
|
5417
5458
|
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
5418
|
-
var getStripePromise = function getStripePromise(reviewData) {
|
|
5419
|
-
var stripePublishableKey = _get(reviewData, 'payment_method.stripe_publishable_key') || publishableKey || 'pk_test_3Ov1P1oP33A1cxaSjxWE0VjT';
|
|
5420
|
-
var stripeAccount = _get(reviewData, 'payment_method.stripe_connected_account');
|
|
5421
|
-
var options = {};
|
|
5422
|
-
if (stripeAccount) {
|
|
5423
|
-
options.stripeAccount = stripeAccount;
|
|
5424
|
-
}
|
|
5425
|
-
return stripeJs.loadStripe(stripePublishableKey, options);
|
|
5426
|
-
};
|
|
5427
5459
|
var initialPaymentPlanConfiguration = {
|
|
5428
5460
|
requires_deposit: false,
|
|
5429
5461
|
deposit: 0,
|
|
@@ -5462,7 +5494,8 @@ var initialReviewValues = {
|
|
|
5462
5494
|
payment_method: {
|
|
5463
5495
|
stripe_client_secret: '',
|
|
5464
5496
|
stripe_payment_plan_enabled: false,
|
|
5465
|
-
stripe_payment_plan_configuration: {}
|
|
5497
|
+
stripe_payment_plan_configuration: {},
|
|
5498
|
+
stripe_publishable_key: ''
|
|
5466
5499
|
},
|
|
5467
5500
|
billing_info: {},
|
|
5468
5501
|
event_details: {
|
|
@@ -5507,7 +5540,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
5507
5540
|
_ref$isSinglePageChec = _ref.isSinglePageCheckout,
|
|
5508
5541
|
isSinglePageCheckout = _ref$isSinglePageChec === void 0 ? false : _ref$isSinglePageChec,
|
|
5509
5542
|
_ref$stripePaymentPro = _ref.stripePaymentProps,
|
|
5510
|
-
stripePaymentProps = _ref$stripePaymentPro === void 0 ? {} : _ref$stripePaymentPro
|
|
5543
|
+
stripePaymentProps = _ref$stripePaymentPro === void 0 ? {} : _ref$stripePaymentPro,
|
|
5544
|
+
stripePublishableKeyProps = _ref.stripePublishableKey;
|
|
5511
5545
|
var _useState = React.useState(initialReviewValues),
|
|
5512
5546
|
reviewData = _useState[0],
|
|
5513
5547
|
setReviewData = _useState[1];
|
|
@@ -5585,14 +5619,16 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
5585
5619
|
}
|
|
5586
5620
|
}, [showPaymentPlanSection, paymentPlanUseSavedCard, orderData == null ? void 0 : orderData.id]);
|
|
5587
5621
|
React.useEffect(function () {
|
|
5588
|
-
if (isSinglePageCheckout
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5622
|
+
if (isSinglePageCheckout) {
|
|
5623
|
+
if (!(orderData != null && orderData.total)) {
|
|
5624
|
+
setOrderData(function (current) {
|
|
5625
|
+
return _extends({}, current, {
|
|
5626
|
+
pay_now: 1,
|
|
5627
|
+
total: 1
|
|
5628
|
+
});
|
|
5594
5629
|
});
|
|
5595
|
-
|
|
5630
|
+
setPaymentDataIsLoading(false);
|
|
5631
|
+
}
|
|
5596
5632
|
return;
|
|
5597
5633
|
}
|
|
5598
5634
|
_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -5709,6 +5745,15 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
5709
5745
|
}
|
|
5710
5746
|
return showPaymentForm;
|
|
5711
5747
|
};
|
|
5748
|
+
var getStripePromise = React.useCallback(function () {
|
|
5749
|
+
var stripePublishableKey = stripePublishableKeyProps || _get(reviewData, 'payment_method.stripe_publishable_key') || publishableKey;
|
|
5750
|
+
var stripeAccount = _get(reviewData, 'payment_method.stripe_connected_account');
|
|
5751
|
+
var options = {};
|
|
5752
|
+
if (stripeAccount) {
|
|
5753
|
+
options.stripeAccount = stripeAccount;
|
|
5754
|
+
}
|
|
5755
|
+
return stripeJs.loadStripe(stripePublishableKey, options);
|
|
5756
|
+
}, [reviewData, stripePublishableKeyProps]);
|
|
5712
5757
|
var themeMui = styles.createTheme(themeOptions);
|
|
5713
5758
|
var hasTableTypes = Boolean(Number(orderData.guest_count));
|
|
5714
5759
|
var paymentFieldsData = hasTableTypes ? [{
|
|
@@ -5856,7 +5901,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
5856
5901
|
}, paymentInfoLabel), showErrorText && React__default.createElement("p", {
|
|
5857
5902
|
className: "payment_info__error"
|
|
5858
5903
|
}, errorText), React__default.createElement("div", null, React__default.createElement(reactStripeJs.Elements, {
|
|
5859
|
-
stripe: getStripePromise(
|
|
5904
|
+
stripe: getStripePromise(),
|
|
5860
5905
|
options: elementsOptions
|
|
5861
5906
|
}, React__default.createElement(CheckoutForm, Object.assign({
|
|
5862
5907
|
stripe_client_secret: paymentPlanIsAvailable && showPaymentPlanSection ? paymentPlanConfig.stripe_setup_intent_secret : _get(reviewData, 'payment_method.stripe_client_secret'),
|
|
@@ -6177,6 +6222,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
6177
6222
|
return null;
|
|
6178
6223
|
};
|
|
6179
6224
|
var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
6225
|
+
var _reviewData$payment_m, _checkoutUpdateData$a, _checkoutUpdateData$a2;
|
|
6180
6226
|
var _ref4$data = _ref4.data,
|
|
6181
6227
|
data = _ref4$data === void 0 ? [] : _ref4$data,
|
|
6182
6228
|
_ref4$ticketHoldersFi = _ref4.ticketHoldersFields,
|
|
@@ -6188,6 +6234,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6188
6234
|
initialValues = _ref4$initialValues === void 0 ? {} : _ref4$initialValues,
|
|
6189
6235
|
_ref4$buttonName = _ref4.buttonName,
|
|
6190
6236
|
buttonName = _ref4$buttonName === void 0 ? 'Submit' : _ref4$buttonName,
|
|
6237
|
+
_ref4$freeOrderButton = _ref4.freeOrderButtonName,
|
|
6238
|
+
freeOrderButtonName = _ref4$freeOrderButton === void 0 ? 'Complete Registration' : _ref4$freeOrderButton,
|
|
6191
6239
|
_ref4$handleSubmit = _ref4.handleSubmit,
|
|
6192
6240
|
handleSubmit = _ref4$handleSubmit === void 0 ? _identity : _ref4$handleSubmit,
|
|
6193
6241
|
_ref4$theme = _ref4.theme,
|
|
@@ -6415,11 +6463,18 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6415
6463
|
var _useState24 = React.useState({}),
|
|
6416
6464
|
checkoutData = _useState24[0],
|
|
6417
6465
|
setCheckoutData = _useState24[1];
|
|
6466
|
+
var _useState25 = React.useState({}),
|
|
6467
|
+
checkoutUpdateData = _useState25[0],
|
|
6468
|
+
setCheckoutUpdateData = _useState25[1];
|
|
6418
6469
|
var prevData = React.useRef(data);
|
|
6419
6470
|
var addAddOnsInAttributes = React.useCallback(function (checkoutBody) {
|
|
6420
6471
|
var selectedAddOns = window.localStorage.getItem('add_ons') || '{}';
|
|
6421
6472
|
checkoutBody.attributes.add_ons = JSON.parse(selectedAddOns);
|
|
6422
6473
|
}, []);
|
|
6474
|
+
var _useState26 = React.useState({}),
|
|
6475
|
+
singleCheckoutAddons = _useState26[0],
|
|
6476
|
+
setSingleCheckoutAddOns = _useState26[1];
|
|
6477
|
+
var orderIsFree = !Number(checkoutData == null ? void 0 : checkoutData.total);
|
|
6423
6478
|
React.useEffect(function () {
|
|
6424
6479
|
var hasUniqueId = _get(dataWithUniqueIds, '[0].uniqueId');
|
|
6425
6480
|
var isEqualData = _isEqual(prevData.current, data);
|
|
@@ -6584,51 +6639,94 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6584
6639
|
fetchCart();
|
|
6585
6640
|
}, [isLoggedIn]);
|
|
6586
6641
|
React.useEffect(function () {
|
|
6587
|
-
var
|
|
6642
|
+
var fetchCheckoutUpdate = /*#__PURE__*/function () {
|
|
6588
6643
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
6589
|
-
var
|
|
6644
|
+
var checkoutUpdateResponse;
|
|
6590
6645
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
6591
6646
|
while (1) switch (_context5.prev = _context5.next) {
|
|
6647
|
+
case 0:
|
|
6648
|
+
if (eventId) {
|
|
6649
|
+
_context5.next = 2;
|
|
6650
|
+
break;
|
|
6651
|
+
}
|
|
6652
|
+
return _context5.abrupt("return");
|
|
6653
|
+
case 2:
|
|
6654
|
+
_context5.prev = 2;
|
|
6655
|
+
_context5.next = 5;
|
|
6656
|
+
return updateCheckout({
|
|
6657
|
+
attributes: {
|
|
6658
|
+
event_id: eventId
|
|
6659
|
+
}
|
|
6660
|
+
});
|
|
6661
|
+
case 5:
|
|
6662
|
+
checkoutUpdateResponse = _context5.sent;
|
|
6663
|
+
if (checkoutUpdateResponse.success) {
|
|
6664
|
+
setCheckoutUpdateData(checkoutUpdateResponse.data.attributes);
|
|
6665
|
+
}
|
|
6666
|
+
_context5.next = 12;
|
|
6667
|
+
break;
|
|
6668
|
+
case 9:
|
|
6669
|
+
_context5.prev = 9;
|
|
6670
|
+
_context5.t0 = _context5["catch"](2);
|
|
6671
|
+
console.error('Failed to fetch checkout update:', _context5.t0);
|
|
6672
|
+
case 12:
|
|
6673
|
+
case "end":
|
|
6674
|
+
return _context5.stop();
|
|
6675
|
+
}
|
|
6676
|
+
}, _callee5, null, [[2, 9]]);
|
|
6677
|
+
}));
|
|
6678
|
+
return function fetchCheckoutUpdate() {
|
|
6679
|
+
return _ref8.apply(this, arguments);
|
|
6680
|
+
};
|
|
6681
|
+
}();
|
|
6682
|
+
fetchCheckoutUpdate();
|
|
6683
|
+
}, [eventId]);
|
|
6684
|
+
React.useEffect(function () {
|
|
6685
|
+
var collectPaymentData = /*#__PURE__*/function () {
|
|
6686
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
6687
|
+
var checkoutBody, checkoutResponse;
|
|
6688
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
6689
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
6592
6690
|
case 0:
|
|
6593
6691
|
if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading && !isNewUser)) {
|
|
6594
|
-
|
|
6692
|
+
_context6.next = 19;
|
|
6595
6693
|
break;
|
|
6596
6694
|
}
|
|
6597
6695
|
setLoading(true);
|
|
6598
6696
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, userData);
|
|
6599
|
-
|
|
6697
|
+
_context6.prev = 3;
|
|
6600
6698
|
if (isBrowser) {
|
|
6601
6699
|
addAddOnsInAttributes(checkoutBody);
|
|
6602
6700
|
}
|
|
6603
|
-
|
|
6701
|
+
_context6.next = 7;
|
|
6604
6702
|
return postOnCheckout(checkoutBody, flagFreeTicket);
|
|
6605
6703
|
case 7:
|
|
6606
|
-
checkoutResponse =
|
|
6704
|
+
checkoutResponse = _context6.sent;
|
|
6607
6705
|
removeReferralKey();
|
|
6608
6706
|
onSkipBillingPage(checkoutResponse.data.attributes);
|
|
6609
6707
|
setLoading(false);
|
|
6610
|
-
|
|
6708
|
+
_context6.next = 17;
|
|
6611
6709
|
break;
|
|
6612
6710
|
case 13:
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
onSubmitError(
|
|
6616
|
-
if (_get(
|
|
6617
|
-
setPendingVerificationMessage(_get(
|
|
6711
|
+
_context6.prev = 13;
|
|
6712
|
+
_context6.t0 = _context6["catch"](3);
|
|
6713
|
+
onSubmitError(_context6.t0);
|
|
6714
|
+
if (_get(_context6.t0, 'response.data.data.hasUnverifiedOrder')) {
|
|
6715
|
+
setPendingVerificationMessage(_get(_context6.t0, 'response.data.message'));
|
|
6618
6716
|
}
|
|
6619
6717
|
case 17:
|
|
6620
|
-
|
|
6718
|
+
_context6.next = 20;
|
|
6621
6719
|
break;
|
|
6622
6720
|
case 19:
|
|
6623
6721
|
setLoading(false);
|
|
6624
6722
|
case 20:
|
|
6625
6723
|
case "end":
|
|
6626
|
-
return
|
|
6724
|
+
return _context6.stop();
|
|
6627
6725
|
}
|
|
6628
|
-
},
|
|
6726
|
+
}, _callee6, null, [[3, 13]]);
|
|
6629
6727
|
}));
|
|
6630
6728
|
return function collectPaymentData() {
|
|
6631
|
-
return
|
|
6729
|
+
return _ref9.apply(this, arguments);
|
|
6632
6730
|
};
|
|
6633
6731
|
}();
|
|
6634
6732
|
collectPaymentData();
|
|
@@ -6693,68 +6791,80 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6693
6791
|
localStorage.removeItem('referral_key');
|
|
6694
6792
|
}, []);
|
|
6695
6793
|
var updateCheckoutWithAddOns = React.useCallback( /*#__PURE__*/function () {
|
|
6696
|
-
var
|
|
6697
|
-
var
|
|
6698
|
-
return _regeneratorRuntime().wrap(function
|
|
6699
|
-
while (1) switch (
|
|
6794
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(addOns) {
|
|
6795
|
+
var mergedAddOns, _checkoutUpdateData, checkoutResponse, errorMessage;
|
|
6796
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
6797
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
6700
6798
|
case 0:
|
|
6701
6799
|
if (addOns === void 0) {
|
|
6702
6800
|
addOns = {};
|
|
6703
6801
|
}
|
|
6704
6802
|
if (isSinglePageCheckout) {
|
|
6705
|
-
|
|
6803
|
+
_context7.next = 3;
|
|
6706
6804
|
break;
|
|
6707
6805
|
}
|
|
6708
|
-
return
|
|
6806
|
+
return _context7.abrupt("return");
|
|
6709
6807
|
case 3:
|
|
6710
|
-
|
|
6711
|
-
|
|
6808
|
+
mergedAddOns = _extends({}, singleCheckoutAddons); // Update existing entries and add new ones
|
|
6809
|
+
Object.entries(addOns).forEach(function (_ref11) {
|
|
6810
|
+
var key = _ref11[0],
|
|
6811
|
+
value = _ref11[1];
|
|
6812
|
+
var amount = Number(value);
|
|
6813
|
+
if (amount) {
|
|
6814
|
+
mergedAddOns[key] = amount;
|
|
6815
|
+
} else {
|
|
6816
|
+
delete mergedAddOns[key];
|
|
6817
|
+
}
|
|
6818
|
+
});
|
|
6819
|
+
_context7.prev = 5;
|
|
6820
|
+
_checkoutUpdateData = {
|
|
6712
6821
|
attributes: {
|
|
6713
6822
|
event_id: eventId,
|
|
6714
|
-
add_ons:
|
|
6823
|
+
add_ons: mergedAddOns
|
|
6715
6824
|
}
|
|
6716
6825
|
};
|
|
6717
|
-
|
|
6718
|
-
return updateCheckout(
|
|
6719
|
-
case
|
|
6720
|
-
checkoutResponse =
|
|
6826
|
+
_context7.next = 9;
|
|
6827
|
+
return updateCheckout(_checkoutUpdateData);
|
|
6828
|
+
case 9:
|
|
6829
|
+
checkoutResponse = _context7.sent;
|
|
6721
6830
|
if (checkoutResponse.success) {
|
|
6722
6831
|
setCheckoutData(_get(checkoutResponse, 'data.attributes.cart_price_breakdown', {}));
|
|
6723
6832
|
onCheckoutUpdateSuccess(checkoutResponse.data.attributes);
|
|
6833
|
+
setSingleCheckoutAddOns(mergedAddOns);
|
|
6724
6834
|
}
|
|
6725
|
-
|
|
6835
|
+
_context7.next = 18;
|
|
6726
6836
|
break;
|
|
6727
|
-
case
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
errorMessage = _get(
|
|
6837
|
+
case 13:
|
|
6838
|
+
_context7.prev = 13;
|
|
6839
|
+
_context7.t0 = _context7["catch"](5);
|
|
6840
|
+
errorMessage = _get(_context7.t0, 'response.data.message', 'Failed to update add-ons');
|
|
6731
6841
|
setError(errorMessage);
|
|
6732
|
-
onCheckoutUpdateError(
|
|
6733
|
-
case
|
|
6842
|
+
onCheckoutUpdateError(_context7.t0);
|
|
6843
|
+
case 18:
|
|
6734
6844
|
case "end":
|
|
6735
|
-
return
|
|
6845
|
+
return _context7.stop();
|
|
6736
6846
|
}
|
|
6737
|
-
},
|
|
6847
|
+
}, _callee7, null, [[5, 13]]);
|
|
6738
6848
|
}));
|
|
6739
6849
|
return function (_x) {
|
|
6740
|
-
return
|
|
6850
|
+
return _ref10.apply(this, arguments);
|
|
6741
6851
|
};
|
|
6742
6852
|
}(), [eventId, isSinglePageCheckout, onCheckoutUpdateError, onCheckoutUpdateSuccess]);
|
|
6743
6853
|
var handleAddOnSelect = React.useCallback( /*#__PURE__*/function () {
|
|
6744
|
-
var
|
|
6745
|
-
return _regeneratorRuntime().wrap(function
|
|
6746
|
-
while (1) switch (
|
|
6854
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(selectedAddOns) {
|
|
6855
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
6856
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
6747
6857
|
case 0:
|
|
6748
|
-
|
|
6858
|
+
_context8.next = 2;
|
|
6749
6859
|
return updateCheckoutWithAddOns(selectedAddOns);
|
|
6750
6860
|
case 2:
|
|
6751
6861
|
case "end":
|
|
6752
|
-
return
|
|
6862
|
+
return _context8.stop();
|
|
6753
6863
|
}
|
|
6754
|
-
},
|
|
6864
|
+
}, _callee8);
|
|
6755
6865
|
}));
|
|
6756
6866
|
return function (_x2) {
|
|
6757
|
-
return
|
|
6867
|
+
return _ref12.apply(this, arguments);
|
|
6758
6868
|
};
|
|
6759
6869
|
}(), [updateCheckoutWithAddOns]);
|
|
6760
6870
|
var onAddOnSelect = React.useCallback(function (id, value, addon) {
|
|
@@ -6762,9 +6872,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6762
6872
|
var addonId = addon.id || id;
|
|
6763
6873
|
// Create updated add-ons object
|
|
6764
6874
|
var updatedAddOns = {};
|
|
6765
|
-
|
|
6766
|
-
updatedAddOns[addonId] = quantity;
|
|
6767
|
-
}
|
|
6875
|
+
updatedAddOns[addonId] = quantity;
|
|
6768
6876
|
// Call handleAddOnSelect with the updated addons object
|
|
6769
6877
|
handleAddOnSelect(updatedAddOns);
|
|
6770
6878
|
}, [handleAddOnSelect]);
|
|
@@ -6786,6 +6894,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6786
6894
|
if (isTable) {
|
|
6787
6895
|
dataWithUniqueIds[0].label = 'Get Your Tables';
|
|
6788
6896
|
}
|
|
6897
|
+
var stripePublishableKey = (reviewData == null ? void 0 : (_reviewData$payment_m = reviewData.payment_method) == null ? void 0 : _reviewData$payment_m.stripe_publishable_key) || (checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a = checkoutUpdateData.additional_payment_information) == null ? void 0 : (_checkoutUpdateData$a2 = _checkoutUpdateData$a.basic_config) == null ? void 0 : _checkoutUpdateData$a2.apiKey);
|
|
6789
6898
|
return React__default.createElement(styles.ThemeProvider, {
|
|
6790
6899
|
theme: themeMui
|
|
6791
6900
|
}, (loading || cardLoading || isCountriesLoading || isConfigLoading) && React__default.createElement(Backdrop, {
|
|
@@ -6816,18 +6925,18 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6816
6925
|
}, initialValues), userValues, ticketHoldersFields, ticketsQuantity),
|
|
6817
6926
|
enableReinitialize: false,
|
|
6818
6927
|
onSubmit: function () {
|
|
6819
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
6820
|
-
var checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, refreshToken, userProfile, hasUnverifiedOrder, message, profileData, profileSpecifiedData, profileDataObj, userDataObj, checkoutBody, checkoutResponse, checkoutUpdateResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, card, paymentMethodReq, _hasUnverifiedOrder, _message, _e$response, event;
|
|
6821
|
-
return _regeneratorRuntime().wrap(function
|
|
6822
|
-
while (1) switch (
|
|
6928
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(values, formikHelpers) {
|
|
6929
|
+
var checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, refreshToken, userProfile, hasUnverifiedOrder, message, profileData, profileSpecifiedData, profileDataObj, userDataObj, checkoutBody, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, card, paymentMethodReq, _hasUnverifiedOrder, _message, _e$response, event;
|
|
6930
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
6931
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
6823
6932
|
case 0:
|
|
6824
|
-
|
|
6825
|
-
if (!(!cardRef.current || !stripeRef.current)) {
|
|
6826
|
-
|
|
6933
|
+
_context9.prev = 0;
|
|
6934
|
+
if (!((!cardRef.current || !stripeRef.current) && !orderIsFree)) {
|
|
6935
|
+
_context9.next = 4;
|
|
6827
6936
|
break;
|
|
6828
6937
|
}
|
|
6829
6938
|
setError('Fill in the card details');
|
|
6830
|
-
return
|
|
6939
|
+
return _context9.abrupt("return");
|
|
6831
6940
|
case 4:
|
|
6832
6941
|
if (isBrowser) {
|
|
6833
6942
|
window.localStorage.setItem('extraData', JSON.stringify({
|
|
@@ -6840,7 +6949,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6840
6949
|
}));
|
|
6841
6950
|
}
|
|
6842
6951
|
if (isLoggedIn) {
|
|
6843
|
-
|
|
6952
|
+
_context9.next = 27;
|
|
6844
6953
|
break;
|
|
6845
6954
|
}
|
|
6846
6955
|
checkoutBodyForRegistration = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
@@ -6849,12 +6958,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6849
6958
|
lastNameLogged: lastNameLogged
|
|
6850
6959
|
}, showDOB);
|
|
6851
6960
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration, flagFreeTicket);
|
|
6852
|
-
|
|
6961
|
+
_context9.prev = 8;
|
|
6853
6962
|
setLoading(true);
|
|
6854
|
-
|
|
6963
|
+
_context9.next = 12;
|
|
6855
6964
|
return register(bodyFormData);
|
|
6856
6965
|
case 12:
|
|
6857
|
-
resRegister =
|
|
6966
|
+
resRegister = _context9.sent;
|
|
6858
6967
|
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
6859
6968
|
refreshToken = _get(resRegister, 'data.attributes.refresh_token');
|
|
6860
6969
|
userProfile = _get(resRegister, 'data.attributes.user_profile');
|
|
@@ -6864,17 +6973,17 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6864
6973
|
refreshToken: refreshToken,
|
|
6865
6974
|
userProfile: userProfile
|
|
6866
6975
|
});
|
|
6867
|
-
|
|
6976
|
+
_context9.next = 27;
|
|
6868
6977
|
break;
|
|
6869
6978
|
case 20:
|
|
6870
|
-
|
|
6871
|
-
|
|
6979
|
+
_context9.prev = 20;
|
|
6980
|
+
_context9.t0 = _context9["catch"](8);
|
|
6872
6981
|
setLoading(false);
|
|
6873
|
-
hasUnverifiedOrder = _get(
|
|
6874
|
-
message = _get(
|
|
6982
|
+
hasUnverifiedOrder = _get(_context9.t0, 'response.data.data.hasUnverifiedOrder');
|
|
6983
|
+
message = _get(_context9.t0, 'response.data.message', {});
|
|
6875
6984
|
if (hasUnverifiedOrder && typeof message === 'string') {
|
|
6876
6985
|
setPendingVerificationMessage(message);
|
|
6877
|
-
} else if (axios.isAxiosError(
|
|
6986
|
+
} else if (axios.isAxiosError(_context9.t0)) {
|
|
6878
6987
|
if (_includes(message, 'You must be aged') && typeof message === 'string') {
|
|
6879
6988
|
formikHelpers.setFieldError('holderAge', message);
|
|
6880
6989
|
}
|
|
@@ -6890,14 +6999,14 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6890
6999
|
if (_includes(error, 'The cart is expired') && !hideErrorsAlertSection) {
|
|
6891
7000
|
setError(error);
|
|
6892
7001
|
}
|
|
6893
|
-
onRegisterError(
|
|
7002
|
+
onRegisterError(_context9.t0, values.email);
|
|
6894
7003
|
}
|
|
6895
|
-
return
|
|
7004
|
+
return _context9.abrupt("return");
|
|
6896
7005
|
case 27:
|
|
6897
|
-
|
|
7006
|
+
_context9.next = 29;
|
|
6898
7007
|
return getProfileData();
|
|
6899
7008
|
case 29:
|
|
6900
|
-
profileData =
|
|
7009
|
+
profileData = _context9.sent;
|
|
6901
7010
|
profileSpecifiedData = _get(profileData, 'data');
|
|
6902
7011
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
6903
7012
|
userDataObj = isLoggedIn ? userData : profileDataObj;
|
|
@@ -6905,32 +7014,36 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6905
7014
|
window.localStorage.setItem('user_data', JSON.stringify(userDataObj));
|
|
6906
7015
|
}
|
|
6907
7016
|
checkoutBody = collectCheckoutBody(values, userDataObj);
|
|
6908
|
-
if (isBrowser) {
|
|
7017
|
+
if (isBrowser && !isSinglePageCheckout) {
|
|
6909
7018
|
addAddOnsInAttributes(checkoutBody);
|
|
6910
7019
|
}
|
|
6911
|
-
|
|
7020
|
+
if (isSinglePageCheckout) {
|
|
7021
|
+
checkoutBody.attributes.add_ons = singleCheckoutAddons;
|
|
7022
|
+
}
|
|
7023
|
+
_context9.next = 39;
|
|
6912
7024
|
return postOnCheckout(checkoutBody, flagFreeTicket);
|
|
6913
|
-
case
|
|
6914
|
-
checkoutResponse =
|
|
6915
|
-
|
|
7025
|
+
case 39:
|
|
7026
|
+
checkoutResponse = _context9.sent;
|
|
7027
|
+
_context9.next = 42;
|
|
6916
7028
|
return updateCheckout({
|
|
6917
7029
|
attributes: {
|
|
6918
7030
|
event_id: eventId
|
|
6919
7031
|
}
|
|
6920
7032
|
});
|
|
6921
|
-
case
|
|
6922
|
-
checkoutUpdateResponse =
|
|
7033
|
+
case 42:
|
|
7034
|
+
checkoutUpdateResponse = _context9.sent;
|
|
7035
|
+
paymentResponse = null;
|
|
6923
7036
|
if (!isSinglePageCheckout) {
|
|
6924
|
-
|
|
7037
|
+
_context9.next = 67;
|
|
6925
7038
|
break;
|
|
6926
7039
|
}
|
|
6927
7040
|
_checkoutResponse$dat = checkoutResponse.data.attributes, hash = _checkoutResponse$dat.hash, total = _checkoutResponse$dat.total;
|
|
6928
|
-
|
|
7041
|
+
_context9.next = 48;
|
|
6929
7042
|
return getPaymentData(String(hash));
|
|
6930
|
-
case
|
|
6931
|
-
paymentDataResponse =
|
|
7043
|
+
case 48:
|
|
7044
|
+
paymentDataResponse = _context9.sent;
|
|
6932
7045
|
if (!paymentDataResponse.success) {
|
|
6933
|
-
|
|
7046
|
+
_context9.next = 67;
|
|
6934
7047
|
break;
|
|
6935
7048
|
}
|
|
6936
7049
|
attributes = paymentDataResponse.data.attributes;
|
|
@@ -6956,8 +7069,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6956
7069
|
isFreeTickets = !Number(total) && !Number(updatedOrderData.total) || !Number((updatedOrderData == null ? void 0 : updatedOrderData.pay_now) || 0);
|
|
6957
7070
|
paymentMethod = attributes.payment_method || {};
|
|
6958
7071
|
paymentPlanAvailable = paymentMethod.stripe_payment_plan_enabled;
|
|
7072
|
+
if (isFreeTickets) {
|
|
7073
|
+
_context9.next = 65;
|
|
7074
|
+
break;
|
|
7075
|
+
}
|
|
6959
7076
|
card = cardRef.current;
|
|
6960
|
-
|
|
7077
|
+
_context9.next = 62;
|
|
6961
7078
|
return stripeRef.current.createPaymentMethod({
|
|
6962
7079
|
type: 'card',
|
|
6963
7080
|
card: card || {
|
|
@@ -6967,43 +7084,47 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
6967
7084
|
address: addressRef.current
|
|
6968
7085
|
}
|
|
6969
7086
|
});
|
|
6970
|
-
case
|
|
6971
|
-
paymentMethodReq =
|
|
6972
|
-
|
|
7087
|
+
case 62:
|
|
7088
|
+
paymentMethodReq = _context9.sent;
|
|
7089
|
+
_context9.next = 65;
|
|
6973
7090
|
return stripeRef.current.confirmCardPayment(paymentMethod.stripe_client_secret, {
|
|
6974
7091
|
payment_method: paymentMethodReq.paymentMethod.id
|
|
6975
7092
|
});
|
|
6976
|
-
case
|
|
6977
|
-
|
|
7093
|
+
case 65:
|
|
7094
|
+
_context9.next = 67;
|
|
6978
7095
|
return handlePaymentMiddleWare(null, {}, {
|
|
6979
7096
|
reviewData: attributes,
|
|
6980
7097
|
isFreeTickets: isFreeTickets,
|
|
6981
7098
|
paymentPlanIsAvailable: paymentPlanAvailable,
|
|
6982
7099
|
showPaymentPlanSection: true,
|
|
6983
|
-
handlePayment:
|
|
7100
|
+
handlePayment: function handlePayment(data) {
|
|
7101
|
+
paymentResponse = data;
|
|
7102
|
+
},
|
|
6984
7103
|
setPaymentIsLoading: _identity,
|
|
6985
7104
|
setError: _identity,
|
|
6986
7105
|
orderData: updatedOrderData,
|
|
6987
7106
|
eventId: eventId,
|
|
6988
7107
|
isBrowser: isBrowser,
|
|
6989
|
-
onPaymentError:
|
|
7108
|
+
onPaymentError: function onPaymentError(error) {
|
|
7109
|
+
throw error;
|
|
7110
|
+
}
|
|
6990
7111
|
});
|
|
6991
|
-
case
|
|
7112
|
+
case 67:
|
|
6992
7113
|
removeReferralKey();
|
|
6993
|
-
handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse);
|
|
6994
|
-
|
|
7114
|
+
handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse, paymentResponse);
|
|
7115
|
+
_context9.next = 78;
|
|
6995
7116
|
break;
|
|
6996
|
-
case
|
|
6997
|
-
|
|
6998
|
-
|
|
7117
|
+
case 71:
|
|
7118
|
+
_context9.prev = 71;
|
|
7119
|
+
_context9.t1 = _context9["catch"](0);
|
|
6999
7120
|
setLoading(false);
|
|
7000
|
-
onSubmitError(
|
|
7001
|
-
_hasUnverifiedOrder = _get(
|
|
7002
|
-
_message = _get(
|
|
7121
|
+
onSubmitError(_context9.t1);
|
|
7122
|
+
_hasUnverifiedOrder = _get(_context9.t1, 'response.data.data.hasUnverifiedOrder');
|
|
7123
|
+
_message = _get(_context9.t1, 'response.data.message', {});
|
|
7003
7124
|
if (_hasUnverifiedOrder && typeof _message === 'string') {
|
|
7004
7125
|
setPendingVerificationMessage(_message);
|
|
7005
|
-
} else if (axios.isAxiosError(
|
|
7006
|
-
if (((_e$response =
|
|
7126
|
+
} else if (axios.isAxiosError(_context9.t1)) {
|
|
7127
|
+
if (((_e$response = _context9.t1.response) == null ? void 0 : _e$response.status) === 401 || _get(_context9.t1, 'response.data.error') === 'invalid_token') {
|
|
7007
7128
|
if (isBrowser) {
|
|
7008
7129
|
window.localStorage.removeItem('user_data');
|
|
7009
7130
|
setUserExpired(true);
|
|
@@ -7019,17 +7140,17 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
7019
7140
|
if (_message && !hideErrorsAlertSection && typeof _message === 'string') {
|
|
7020
7141
|
setError(_message);
|
|
7021
7142
|
}
|
|
7022
|
-
onSubmitError(
|
|
7143
|
+
onSubmitError(_context9.t1);
|
|
7023
7144
|
}
|
|
7024
|
-
case 75:
|
|
7025
|
-
_context8.prev = 75;
|
|
7026
|
-
setLoading(false);
|
|
7027
|
-
return _context8.finish(75);
|
|
7028
7145
|
case 78:
|
|
7146
|
+
_context9.prev = 78;
|
|
7147
|
+
setLoading(false);
|
|
7148
|
+
return _context9.finish(78);
|
|
7149
|
+
case 81:
|
|
7029
7150
|
case "end":
|
|
7030
|
-
return
|
|
7151
|
+
return _context9.stop();
|
|
7031
7152
|
}
|
|
7032
|
-
},
|
|
7153
|
+
}, _callee9, null, [[0, 71, 78, 81], [8, 20]]);
|
|
7033
7154
|
}));
|
|
7034
7155
|
function onSubmit(_x3, _x4) {
|
|
7035
7156
|
return _onSubmit.apply(this, arguments);
|
|
@@ -7060,7 +7181,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
7060
7181
|
setError(null);
|
|
7061
7182
|
onErrorClose();
|
|
7062
7183
|
}
|
|
7063
|
-
}), !isLoggedIn && React__default.createElement("div", {
|
|
7184
|
+
}), !isLoggedIn && !isSinglePageCheckout && React__default.createElement("div", {
|
|
7064
7185
|
className: "account-actions-block"
|
|
7065
7186
|
}, React__default.createElement("div", {
|
|
7066
7187
|
className: "action-item"
|
|
@@ -7185,7 +7306,8 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
7185
7306
|
})));
|
|
7186
7307
|
})));
|
|
7187
7308
|
}));
|
|
7188
|
-
})), isSinglePageCheckout && React__default.createElement(PaymentContainer, {
|
|
7309
|
+
})), isSinglePageCheckout && !orderIsFree && stripePublishableKey && React__default.createElement(PaymentContainer, {
|
|
7310
|
+
stripePublishableKey: stripePublishableKey,
|
|
7189
7311
|
formTitle: "Payment Information",
|
|
7190
7312
|
orderInfoLabel: "",
|
|
7191
7313
|
enableTimer: false,
|
|
@@ -7227,10 +7349,10 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
7227
7349
|
paymentButtonText: '',
|
|
7228
7350
|
enableAddressElement: false,
|
|
7229
7351
|
onPaymentFieldsUpdate: function () {
|
|
7230
|
-
var _onPaymentFieldsUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
7352
|
+
var _onPaymentFieldsUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_error, paymentFieldsData, stripe, card) {
|
|
7231
7353
|
var _paymentFieldsData$bi, _paymentFieldsData$bi2, _paymentFieldsData$bi3, address;
|
|
7232
|
-
return _regeneratorRuntime().wrap(function
|
|
7233
|
-
while (1) switch (
|
|
7354
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
7355
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
7234
7356
|
case 0:
|
|
7235
7357
|
try {
|
|
7236
7358
|
address = {
|
|
@@ -7244,9 +7366,9 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
7244
7366
|
} catch (error) {}
|
|
7245
7367
|
case 1:
|
|
7246
7368
|
case "end":
|
|
7247
|
-
return
|
|
7369
|
+
return _context10.stop();
|
|
7248
7370
|
}
|
|
7249
|
-
},
|
|
7371
|
+
}, _callee10);
|
|
7250
7372
|
}));
|
|
7251
7373
|
function onPaymentFieldsUpdate(_x5, _x6, _x7, _x8) {
|
|
7252
7374
|
return _onPaymentFieldsUpdate.apply(this, arguments);
|
|
@@ -7263,7 +7385,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref4) {
|
|
|
7263
7385
|
disabled: props.isSubmitting || phoneValidationIsLoading
|
|
7264
7386
|
}, props.isSubmitting ? React__default.createElement(material.CircularProgress, {
|
|
7265
7387
|
size: 26
|
|
7266
|
-
}) : buttonName))));
|
|
7388
|
+
}) : orderIsFree ? freeOrderButtonName : buttonName))));
|
|
7267
7389
|
}), showModalLogin && React__default.createElement(LoginModal, {
|
|
7268
7390
|
logo: logo,
|
|
7269
7391
|
onClose: function onClose() {
|
|
@@ -9662,7 +9784,9 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
9662
9784
|
hideDetailsButton = _ref$hideDetailsButto === void 0 ? false : _ref$hideDetailsButto,
|
|
9663
9785
|
_ref$columns = _ref.columns,
|
|
9664
9786
|
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
9665
|
-
openLoginModal = _ref.openLoginModal
|
|
9787
|
+
openLoginModal = _ref.openLoginModal,
|
|
9788
|
+
_ref$customNoOrderCon = _ref.customNoOrderContent,
|
|
9789
|
+
customNoOrderContent = _ref$customNoOrderCon === void 0 ? null : _ref$customNoOrderCon;
|
|
9666
9790
|
var _useState = React.useState(null),
|
|
9667
9791
|
data = _useState[0],
|
|
9668
9792
|
setData = _useState[1];
|
|
@@ -9745,6 +9869,15 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
9745
9869
|
fetchData(1, limit, (eventFilter == null ? void 0 : eventFilter.url_name) || '');
|
|
9746
9870
|
setFilter((eventFilter == null ? void 0 : eventFilter.url_name) || '');
|
|
9747
9871
|
};
|
|
9872
|
+
var noOrderContent = customNoOrderContent || React__default.createElement("div", {
|
|
9873
|
+
className: "no_orders_section"
|
|
9874
|
+
}, React__default.createElement("div", {
|
|
9875
|
+
className: "nodata_title"
|
|
9876
|
+
}, "You have no current ticket orders on this account"), React__default.createElement("div", {
|
|
9877
|
+
className: "nodata_subtitle"
|
|
9878
|
+
}, "Discover your next nite out ", React__default.createElement("a", {
|
|
9879
|
+
href: "/events"
|
|
9880
|
+
}, "here"), "."));
|
|
9748
9881
|
return React__default.createElement("div", {
|
|
9749
9882
|
className: "my-ticket " + theme
|
|
9750
9883
|
}, React__default.createElement(React__default.Fragment, null, showModalLogin || !isLogged ? openLoginModal ? openLoginModal() : React__default.createElement(LoginModal, {
|
|
@@ -9801,15 +9934,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
9801
9934
|
page: data.page,
|
|
9802
9935
|
onPageChange: handleChangePage,
|
|
9803
9936
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
9804
|
-
}))) : !loading && React__default.createElement(React__default.Fragment, null, React__default.createElement("h2", null, "My Ticket Orders"), React__default.createElement(
|
|
9805
|
-
className: "no_orders_section"
|
|
9806
|
-
}, React__default.createElement("div", {
|
|
9807
|
-
className: "nodata_title"
|
|
9808
|
-
}, "You have no current ticket orders on this account"), React__default.createElement("div", {
|
|
9809
|
-
className: "nodata_subtitle"
|
|
9810
|
-
}, "Discover your next nite out ", React__default.createElement("a", {
|
|
9811
|
-
href: "/events"
|
|
9812
|
-
}, "here"), "."))), React__default.createElement(React__default.Fragment, null, showModalLogin && React__default.createElement(LoginModal, {
|
|
9937
|
+
}))) : !loading && React__default.createElement(React__default.Fragment, null, React__default.createElement("h2", null, "My Ticket Orders"), noOrderContent), React__default.createElement(React__default.Fragment, null, showModalLogin && React__default.createElement(LoginModal, {
|
|
9813
9938
|
onClose: function onClose() {
|
|
9814
9939
|
setShowModalLogin(false);
|
|
9815
9940
|
},
|
|
@@ -14608,14 +14733,42 @@ var OrderDetails = function OrderDetails(_ref) {
|
|
|
14608
14733
|
var _ref$orderData = _ref.orderData,
|
|
14609
14734
|
orderData = _ref$orderData === void 0 ? {} : _ref$orderData,
|
|
14610
14735
|
_ref$paymentFieldsDat = _ref.paymentFieldsData,
|
|
14611
|
-
paymentFieldsData = _ref$paymentFieldsDat === void 0 ? [] : _ref$paymentFieldsDat
|
|
14736
|
+
paymentFieldsData = _ref$paymentFieldsDat === void 0 ? [] : _ref$paymentFieldsDat,
|
|
14737
|
+
_ref$customMobileText = _ref.customMobileText,
|
|
14738
|
+
customMobileText = _ref$customMobileText === void 0 ? 'Your order total' : _ref$customMobileText;
|
|
14612
14739
|
var currency = orderData.currency,
|
|
14613
14740
|
guest_count = orderData.guest_count;
|
|
14614
14741
|
var hasTableTypes = Boolean(Number(guest_count));
|
|
14742
|
+
var _useState = React.useState(false),
|
|
14743
|
+
isExpanded = _useState[0],
|
|
14744
|
+
setIsExpanded = _useState[1];
|
|
14745
|
+
// Find the total field to display in the mobile view
|
|
14746
|
+
var totalField = paymentFieldsData.find(function (field) {
|
|
14747
|
+
return field.id === 'total';
|
|
14748
|
+
});
|
|
14749
|
+
var totalValue = totalField && orderData.total ? totalField.normalizer ? totalField.normalizer(orderData.total, currency, orderData) : orderData.total : '';
|
|
14750
|
+
var toggleExpand = function toggleExpand() {
|
|
14751
|
+
setIsExpanded(!isExpanded);
|
|
14752
|
+
};
|
|
14615
14753
|
return React__default.createElement("div", {
|
|
14616
14754
|
className: "payment_page payment_page_single"
|
|
14617
14755
|
}, React__default.createElement("div", {
|
|
14618
|
-
className: "
|
|
14756
|
+
className: "mobile-order-summary"
|
|
14757
|
+
}, React__default.createElement("div", {
|
|
14758
|
+
className: "mobile-order-summary-content",
|
|
14759
|
+
onClick: toggleExpand
|
|
14760
|
+
}, React__default.createElement("div", {
|
|
14761
|
+
className: "mobile-order-info"
|
|
14762
|
+
}, React__default.createElement("div", {
|
|
14763
|
+
className: "mobile-order-info-container order-info-container-left " + (isExpanded ? 'open' : '')
|
|
14764
|
+
}, React__default.createElement("div", {
|
|
14765
|
+
className: "mobile-order-text"
|
|
14766
|
+
}, customMobileText)), !isExpanded && React__default.createElement("div", {
|
|
14767
|
+
className: "mobile-order-info-container order-info-container-right"
|
|
14768
|
+
}, React__default.createElement("div", {
|
|
14769
|
+
className: "mobile-order-total"
|
|
14770
|
+
}, totalValue))))), React__default.createElement("div", {
|
|
14771
|
+
className: "order_info_section " + (isExpanded ? 'expanded' : 'collapsed'),
|
|
14619
14772
|
style: {
|
|
14620
14773
|
display: hasTableTypes ? 'block' : 'grid'
|
|
14621
14774
|
}
|