tf-checkout-react 1.7.7-beta.9 → 1.7.8
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/api/payment.d.ts +1 -3
- package/dist/components/confirmationContainer/index.d.ts +0 -1
- package/dist/components/index.d.ts +0 -1
- package/dist/components/paymentContainer/index.d.ts +6 -20
- package/dist/constants/index.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/tf-checkout-react.cjs.development.js +380 -693
- 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 +382 -694
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -8
- package/src/api/payment.ts +1 -17
- package/src/components/billing-info-container/index.tsx +67 -166
- package/src/components/confirmationContainer/index.tsx +0 -1
- package/src/components/index.ts +0 -1
- package/src/components/paymentContainer/OrderDetails.tsx +20 -0
- package/src/components/paymentContainer/index.tsx +81 -146
- package/src/components/ticketsContainer/TicketsSection.tsx +52 -10
- package/src/components/ticketsContainer/TimeSlotTicketRow.tsx +24 -5
- package/src/constants/index.ts +1 -1
- package/src/index.ts +0 -1
- package/src/types/api/checkout.d.ts +16 -27
- package/src/types/api/common.d.ts +3 -0
- package/src/types/api/payment.d.ts +1 -32
- package/dist/components/process-redirect-container/index.d.ts +0 -18
- package/src/components/process-redirect-container/index.tsx +0 -180
|
@@ -67,7 +67,6 @@ var Alert = _interopDefault(require('@mui/material/Alert'));
|
|
|
67
67
|
var Container = _interopDefault(require('@mui/material/Container'));
|
|
68
68
|
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
69
69
|
var stripeJs = require('@stripe/stripe-js');
|
|
70
|
-
var sdkReact = require('@mercadopago/sdk-react');
|
|
71
70
|
var reactShare = require('react-share');
|
|
72
71
|
var _filter = _interopDefault(require('lodash/filter'));
|
|
73
72
|
var _flatten = _interopDefault(require('lodash/flatten'));
|
|
@@ -526,7 +525,8 @@ publicRequest.setGuestToken = function (guestToken) {
|
|
|
526
525
|
var X_TF_ECOMMERCE = 'X-TF-ECOMMERCE';
|
|
527
526
|
var FEES_STYLES = {
|
|
528
527
|
TRADITIONAL: 'TRADITIONAL',
|
|
529
|
-
DISPLAY_BOTH: 'DISPLAY_BOTH'
|
|
528
|
+
DISPLAY_BOTH: 'DISPLAY_BOTH',
|
|
529
|
+
FINAL_WITH_BREAKDOWN: 'FINAL_WITH_BREAKDOWN'
|
|
530
530
|
};
|
|
531
531
|
var DEFAULT_FEES_STYLE = FEES_STYLES.TRADITIONAL;
|
|
532
532
|
|
|
@@ -1772,28 +1772,6 @@ var getConditions = /*#__PURE__*/function () {
|
|
|
1772
1772
|
return _ref5.apply(this, arguments);
|
|
1773
1773
|
};
|
|
1774
1774
|
}();
|
|
1775
|
-
var processPayment = /*#__PURE__*/function () {
|
|
1776
|
-
var _ref6 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(orderHash, params) {
|
|
1777
|
-
var queryParams, response;
|
|
1778
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1779
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
1780
|
-
case 0:
|
|
1781
|
-
queryParams = new URLSearchParams(params);
|
|
1782
|
-
_context6.next = 3;
|
|
1783
|
-
return publicRequest.post("v1/order/" + orderHash + "/process_payment?" + queryParams.toString());
|
|
1784
|
-
case 3:
|
|
1785
|
-
response = _context6.sent;
|
|
1786
|
-
return _context6.abrupt("return", response.data.data.attributes);
|
|
1787
|
-
case 5:
|
|
1788
|
-
case "end":
|
|
1789
|
-
return _context6.stop();
|
|
1790
|
-
}
|
|
1791
|
-
}, _callee6);
|
|
1792
|
-
}));
|
|
1793
|
-
return function processPayment(_x6, _x7) {
|
|
1794
|
-
return _ref6.apply(this, arguments);
|
|
1795
|
-
};
|
|
1796
|
-
}();
|
|
1797
1775
|
|
|
1798
1776
|
var resaleTicket = /*#__PURE__*/function () {
|
|
1799
1777
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, hash) {
|
|
@@ -5675,11 +5653,6 @@ var StripeWrapper = function StripeWrapper(_ref) {
|
|
|
5675
5653
|
options: options
|
|
5676
5654
|
});
|
|
5677
5655
|
};
|
|
5678
|
-
var PaymentType;
|
|
5679
|
-
(function (PaymentType) {
|
|
5680
|
-
PaymentType["STRIPE_INTENTS"] = "stripe_intents";
|
|
5681
|
-
PaymentType["MERCADO_PAGO_PRO"] = "mercado_pago_pro";
|
|
5682
|
-
})(PaymentType || (PaymentType = {}));
|
|
5683
5656
|
var initialPaymentPlanConfiguration = {
|
|
5684
5657
|
requires_deposit: false,
|
|
5685
5658
|
deposit: 0,
|
|
@@ -5731,16 +5704,9 @@ var initialReviewValues = {
|
|
|
5731
5704
|
}
|
|
5732
5705
|
};
|
|
5733
5706
|
var PaymentContainer = function PaymentContainer(_ref2) {
|
|
5734
|
-
var _paymentTypeConfigs$o;
|
|
5735
5707
|
var _ref2$paymentFields = _ref2.paymentFields,
|
|
5736
5708
|
paymentFields = _ref2$paymentFields === void 0 ? [] : _ref2$paymentFields,
|
|
5737
5709
|
handlePayment = _ref2.handlePayment,
|
|
5738
|
-
_ref2$paymentTypeConf = _ref2.paymentTypeConfigs,
|
|
5739
|
-
paymentTypeConfigs = _ref2$paymentTypeConf === void 0 ? {
|
|
5740
|
-
type: PaymentType.STRIPE_INTENTS,
|
|
5741
|
-
elementsOptions: {},
|
|
5742
|
-
onReady: _identity
|
|
5743
|
-
} : _ref2$paymentTypeConf,
|
|
5744
5710
|
_ref2$formTitle = _ref2.formTitle,
|
|
5745
5711
|
formTitle = _ref2$formTitle === void 0 ? 'Get Your Tickets' : _ref2$formTitle,
|
|
5746
5712
|
errorText = _ref2.errorText,
|
|
@@ -5754,6 +5720,8 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5754
5720
|
_ref2$onPaymentError = _ref2.onPaymentError,
|
|
5755
5721
|
onPaymentError = _ref2$onPaymentError === void 0 ? _identity : _ref2$onPaymentError,
|
|
5756
5722
|
themeOptions = _ref2.themeOptions,
|
|
5723
|
+
elementsOptions = _ref2.elementsOptions,
|
|
5724
|
+
paymentElementOptions = _ref2.paymentElementOptions,
|
|
5757
5725
|
_ref2$onCountdownFini = _ref2.onCountdownFinish,
|
|
5758
5726
|
onCountdownFinish = _ref2$onCountdownFini === void 0 ? _identity : _ref2$onCountdownFini,
|
|
5759
5727
|
_ref2$enableTimer = _ref2.enableTimer,
|
|
@@ -5770,6 +5738,10 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5770
5738
|
hideFieldsBlock = _ref2$hideFieldsBlock === void 0 ? false : _ref2$hideFieldsBlock,
|
|
5771
5739
|
_ref2$isSinglePageChe = _ref2.isSinglePageCheckout,
|
|
5772
5740
|
isSinglePageCheckout = _ref2$isSinglePageChe === void 0 ? false : _ref2$isSinglePageChe,
|
|
5741
|
+
stripePublishableKey = _ref2.stripePublishableKey,
|
|
5742
|
+
stripeAccountId = _ref2.stripeAccountId,
|
|
5743
|
+
_ref2$onStripeReady = _ref2.onStripeReady,
|
|
5744
|
+
onStripeReady = _ref2$onStripeReady === void 0 ? _identity : _ref2$onStripeReady,
|
|
5773
5745
|
_ref2$enablePaymentPl = _ref2.enablePaymentPlan,
|
|
5774
5746
|
enablePaymentPlan = _ref2$enablePaymentPl === void 0 ? true : _ref2$enablePaymentPl;
|
|
5775
5747
|
var _useState = React.useState(initialReviewValues),
|
|
@@ -5797,20 +5769,14 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5797
5769
|
showPaymentPlanSection = _useState8[0],
|
|
5798
5770
|
setShowPaymentPlanSection = _useState8[1];
|
|
5799
5771
|
var _useState9 = React.useState(false),
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
var _useState10 = React.useState(
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
var _useState11 = React.useState(
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
var _useState12 = React.useState(true),
|
|
5809
|
-
paymentPlanUseSavedCard = _useState12[0],
|
|
5810
|
-
setPaymentPlanUseSavedCard = _useState12[1];
|
|
5811
|
-
var _useState13 = React.useState(false),
|
|
5812
|
-
hasInitializedOrderData = _useState13[0],
|
|
5813
|
-
setHasInitializedOrderData = _useState13[1];
|
|
5772
|
+
paymentPlanIsAvailable = _useState9[0],
|
|
5773
|
+
setPaymentPlanIsAvailable = _useState9[1];
|
|
5774
|
+
var _useState10 = React.useState(initialPaymentPlanConfiguration),
|
|
5775
|
+
paymentPlanConfig = _useState10[0],
|
|
5776
|
+
setPaymentPlanConfig = _useState10[1];
|
|
5777
|
+
var _useState11 = React.useState(true),
|
|
5778
|
+
paymentPlanUseSavedCard = _useState11[0],
|
|
5779
|
+
setPaymentPlanUseSavedCard = _useState11[1];
|
|
5814
5780
|
var showFormTitle = Boolean(formTitle);
|
|
5815
5781
|
var showErrorText = Boolean(errorText);
|
|
5816
5782
|
var eventId = getQueryVariable('event_id') || _get(reviewData, 'cart[0].product_id') || '';
|
|
@@ -5899,7 +5865,7 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5899
5865
|
};
|
|
5900
5866
|
}();
|
|
5901
5867
|
if (isSinglePageCheckout) {
|
|
5902
|
-
if (!
|
|
5868
|
+
if (!(orderData != null && orderData.total)) {
|
|
5903
5869
|
setOrderData(function (current) {
|
|
5904
5870
|
return _extends({}, current, {
|
|
5905
5871
|
pay_now: 1,
|
|
@@ -5907,14 +5873,11 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5907
5873
|
});
|
|
5908
5874
|
});
|
|
5909
5875
|
setPaymentDataIsLoading(false);
|
|
5910
|
-
setHasInitializedOrderData(true);
|
|
5911
5876
|
}
|
|
5912
5877
|
} else {
|
|
5913
|
-
|
|
5914
|
-
fetchPaymentData();
|
|
5915
|
-
}
|
|
5878
|
+
fetchPaymentData();
|
|
5916
5879
|
}
|
|
5917
|
-
}, [hash, isSinglePageCheckout,
|
|
5880
|
+
}, [orderData, hash, isSinglePageCheckout, onGetPaymentDataError, onGetPaymentDataSuccess]);
|
|
5918
5881
|
//just once
|
|
5919
5882
|
React.useEffect(function () {
|
|
5920
5883
|
// fetch conditions data
|
|
@@ -5954,7 +5917,7 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5954
5917
|
}, [eventId]);
|
|
5955
5918
|
var showPaymentForm = function showPaymentForm() {
|
|
5956
5919
|
var _paymentPlanConfig$sa;
|
|
5957
|
-
if (hidePaymentForm
|
|
5920
|
+
if (hidePaymentForm) {
|
|
5958
5921
|
return false;
|
|
5959
5922
|
}
|
|
5960
5923
|
var showPaymentForm = !isFreeTickets;
|
|
@@ -5964,48 +5927,17 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5964
5927
|
return showPaymentForm;
|
|
5965
5928
|
};
|
|
5966
5929
|
var getPublishableKey = function getPublishableKey() {
|
|
5967
|
-
return
|
|
5930
|
+
return stripePublishableKey || _get(reviewData, 'payment_method.stripe_publishable_key');
|
|
5968
5931
|
};
|
|
5969
5932
|
var getStripePromise = React.useCallback(function () {
|
|
5970
5933
|
var stripePublishableKey = getPublishableKey();
|
|
5971
|
-
var stripeAccount =
|
|
5934
|
+
var stripeAccount = stripeAccountId || _get(reviewData, 'payment_method.stripe_connected_account');
|
|
5972
5935
|
var options = {};
|
|
5973
5936
|
if (stripeAccount) {
|
|
5974
5937
|
options.stripeAccount = stripeAccount;
|
|
5975
5938
|
}
|
|
5976
5939
|
return stripeJs.loadStripe(stripePublishableKey, options);
|
|
5977
|
-
}, [reviewData,
|
|
5978
|
-
var _useMemo = React.useMemo(function () {
|
|
5979
|
-
if (paymentTypeConfigs.type !== PaymentType.MERCADO_PAGO_PRO) {
|
|
5980
|
-
return {
|
|
5981
|
-
paymentType: paymentTypeConfigs.type,
|
|
5982
|
-
mercadoPagoPublicKey: null,
|
|
5983
|
-
mercadoPagoPreferenceId: null
|
|
5984
|
-
};
|
|
5985
|
-
}
|
|
5986
|
-
var mercadoPagoTypeConfigs = paymentTypeConfigs;
|
|
5987
|
-
if (!isSinglePageCheckout) {
|
|
5988
|
-
return {
|
|
5989
|
-
paymentType: _get(reviewData, 'payment_method.type', PaymentType.STRIPE_INTENTS),
|
|
5990
|
-
mercadoPagoPublicKey: _get(reviewData, 'payment_method.public_key', null),
|
|
5991
|
-
mercadoPagoPreferenceId: _get(reviewData, 'payment_method.preference_id', null)
|
|
5992
|
-
};
|
|
5993
|
-
} else {
|
|
5994
|
-
var _mercadoPagoTypeConfi, _mercadoPagoTypeConfi2;
|
|
5995
|
-
return {
|
|
5996
|
-
paymentType: mercadoPagoTypeConfigs == null ? void 0 : mercadoPagoTypeConfigs.type,
|
|
5997
|
-
mercadoPagoPublicKey: (_mercadoPagoTypeConfi = mercadoPagoTypeConfigs == null ? void 0 : mercadoPagoTypeConfigs.publicKey) != null ? _mercadoPagoTypeConfi : null,
|
|
5998
|
-
mercadoPagoPreferenceId: (_mercadoPagoTypeConfi2 = mercadoPagoTypeConfigs == null ? void 0 : mercadoPagoTypeConfigs.preferenceId) != null ? _mercadoPagoTypeConfi2 : null
|
|
5999
|
-
};
|
|
6000
|
-
}
|
|
6001
|
-
}, [reviewData, paymentTypeConfigs, isSinglePageCheckout]),
|
|
6002
|
-
paymentType = _useMemo.paymentType,
|
|
6003
|
-
mercadoPagoPublicKey = _useMemo.mercadoPagoPublicKey,
|
|
6004
|
-
mercadoPagoPreferenceId = _useMemo.mercadoPagoPreferenceId;
|
|
6005
|
-
if (paymentType === PaymentType.MERCADO_PAGO_PRO && mercadoPagoPublicKey && !isSinglePageCheckout && !isMercadoPagoLoaded) {
|
|
6006
|
-
sdkReact.initMercadoPago(mercadoPagoPublicKey);
|
|
6007
|
-
setIsMercadoPagoLoaded(true);
|
|
6008
|
-
}
|
|
5940
|
+
}, [reviewData, stripePublishableKey]);
|
|
6009
5941
|
var themeMui = styles.createTheme(themeOptions);
|
|
6010
5942
|
var hasTableTypes = Boolean(Number(orderData.guest_count));
|
|
6011
5943
|
var paymentFieldsData = hasTableTypes ? [{
|
|
@@ -6158,11 +6090,13 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
6158
6090
|
className: "add-on-container"
|
|
6159
6091
|
}, React__default.createElement("span", null, item.quantity), React__default.createElement("span", {
|
|
6160
6092
|
className: "add-on-x"
|
|
6161
|
-
}, ' x '), React__default.createElement("span", null, item.groupName ? item.groupName + ' - ' : ''), React__default.createElement("span", null, item.name), React__default.createElement("span", null, ' - '), React__default.createElement("span", null, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency) + ' (incl. fees)', CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency)), React__default.createElement("span", {
|
|
6093
|
+
}, ' x '), React__default.createElement("span", null, item.groupName ? item.groupName + ' - ' : ''), React__default.createElement("span", null, item.name), React__default.createElement("span", null, ' - '), React__default.createElement("span", null, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency) + ' (incl. fees)', CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency), CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency)), React__default.createElement("span", {
|
|
6162
6094
|
className: "add-on-each"
|
|
6163
6095
|
}, ' each')), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && React__default.createElement("p", {
|
|
6164
6096
|
className: "fees"
|
|
6165
|
-
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(String(item.price))), currency) + " with fees)"))
|
|
6097
|
+
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(String(item.price))), currency) + " with fees)"), CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && parseFloat(item.price) - parseFloat(item.cost) > 0 && React__default.createElement("p", {
|
|
6098
|
+
className: "fees"
|
|
6099
|
+
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency) + " + " + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price) - parseFloat(item.cost)), currency) + " fee)"));
|
|
6166
6100
|
})));
|
|
6167
6101
|
})), !isFreeTickets && paymentPlanIsAvailable && React__default.createElement("div", {
|
|
6168
6102
|
className: "payment_toggle"
|
|
@@ -6186,19 +6120,15 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
6186
6120
|
className: "payment_info_label"
|
|
6187
6121
|
}, paymentInfoLabel), showErrorText && React__default.createElement("p", {
|
|
6188
6122
|
className: "payment_info__error"
|
|
6189
|
-
}, errorText), React__default.createElement("div", null,
|
|
6123
|
+
}, errorText), React__default.createElement("div", null, elementsOptions && React__default.createElement(reactStripeJs.Elements, {
|
|
6190
6124
|
stripe: getStripePromise(),
|
|
6191
|
-
options:
|
|
6125
|
+
options: elementsOptions
|
|
6192
6126
|
}, React__default.createElement(StripeWrapper, {
|
|
6193
|
-
onStripeReady:
|
|
6194
|
-
options:
|
|
6127
|
+
onStripeReady: onStripeReady,
|
|
6128
|
+
options: paymentElementOptions
|
|
6195
6129
|
})))) : displayPaymentButton ? React__default.createElement("div", {
|
|
6196
6130
|
className: "payment_button " + (paymentIsLoading ? 'disabled-payment-button' : '')
|
|
6197
|
-
},
|
|
6198
|
-
initialization: {
|
|
6199
|
-
preferenceId: mercadoPagoPreferenceId != null ? mercadoPagoPreferenceId : ''
|
|
6200
|
-
}
|
|
6201
|
-
}), paymentType !== PaymentType.MERCADO_PAGO_PRO && React__default.createElement("button", {
|
|
6131
|
+
}, React__default.createElement("button", {
|
|
6202
6132
|
disabled: paymentIsLoading,
|
|
6203
6133
|
type: "button",
|
|
6204
6134
|
onClick: function onClick() {
|
|
@@ -6616,23 +6546,16 @@ var useStripePayment = function useStripePayment(_ref) {
|
|
|
6616
6546
|
};
|
|
6617
6547
|
};
|
|
6618
6548
|
|
|
6619
|
-
|
|
6620
|
-
var
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
setFieldValue = _ref2.setFieldValue,
|
|
6630
|
-
setValues = _ref2.setValues,
|
|
6631
|
-
setUserValues = _ref2.setUserValues,
|
|
6632
|
-
onGetStatesSuccess = _ref2.onGetStatesSuccess,
|
|
6633
|
-
onGetStatesError = _ref2.onGetStatesError,
|
|
6634
|
-
shouldFetchCountries = _ref2.shouldFetchCountries,
|
|
6635
|
-
brandOptIn = _ref2.brandOptIn;
|
|
6549
|
+
var LogicRunner = function LogicRunner(_ref) {
|
|
6550
|
+
var values = _ref.values,
|
|
6551
|
+
setStates = _ref.setStates,
|
|
6552
|
+
setFieldValue = _ref.setFieldValue,
|
|
6553
|
+
setValues = _ref.setValues,
|
|
6554
|
+
setUserValues = _ref.setUserValues,
|
|
6555
|
+
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
6556
|
+
onGetStatesError = _ref.onGetStatesError,
|
|
6557
|
+
shouldFetchCountries = _ref.shouldFetchCountries,
|
|
6558
|
+
brandOptIn = _ref.brandOptIn;
|
|
6636
6559
|
var prevCountry = React.useRef(values.country);
|
|
6637
6560
|
var prevBuyerData = React.useRef({
|
|
6638
6561
|
firstName: '',
|
|
@@ -6643,8 +6566,8 @@ var LogicRunner = function LogicRunner(_ref2) {
|
|
|
6643
6566
|
var hasLoadedUserData = React.useRef(false);
|
|
6644
6567
|
React.useEffect(function () {
|
|
6645
6568
|
var fetchStates = /*#__PURE__*/function () {
|
|
6646
|
-
var
|
|
6647
|
-
var res, mappedStates, _mappedStates$find,
|
|
6569
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
6570
|
+
var res, mappedStates, _mappedStates$find, _ref3, _mappedStates$, stateExists;
|
|
6648
6571
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6649
6572
|
while (1) switch (_context.prev = _context.next) {
|
|
6650
6573
|
case 0:
|
|
@@ -6664,7 +6587,7 @@ var LogicRunner = function LogicRunner(_ref2) {
|
|
|
6664
6587
|
stateExists = (_mappedStates$find = mappedStates.find(function (state) {
|
|
6665
6588
|
return state.value === values.state;
|
|
6666
6589
|
})) == null ? void 0 : _mappedStates$find.value;
|
|
6667
|
-
setFieldValue('state', (
|
|
6590
|
+
setFieldValue('state', (_ref3 = stateExists != null ? stateExists : (_mappedStates$ = mappedStates[0]) == null ? void 0 : _mappedStates$.value) != null ? _ref3 : '');
|
|
6668
6591
|
prevCountry.current = values.country;
|
|
6669
6592
|
}
|
|
6670
6593
|
onGetStatesSuccess(res.data);
|
|
@@ -6683,7 +6606,7 @@ var LogicRunner = function LogicRunner(_ref2) {
|
|
|
6683
6606
|
}, _callee, null, [[0, 10]]);
|
|
6684
6607
|
}));
|
|
6685
6608
|
return function fetchStates() {
|
|
6686
|
-
return
|
|
6609
|
+
return _ref2.apply(this, arguments);
|
|
6687
6610
|
};
|
|
6688
6611
|
}();
|
|
6689
6612
|
shouldFetchCountries && fetchStates();
|
|
@@ -6775,14 +6698,14 @@ var LogicRunner = function LogicRunner(_ref2) {
|
|
|
6775
6698
|
* - Automatically returns false if user is logged in
|
|
6776
6699
|
* - Returns null as it's a logic-only component with no UI
|
|
6777
6700
|
*/
|
|
6778
|
-
var EmailExistenceChecker = function EmailExistenceChecker(
|
|
6779
|
-
var email =
|
|
6780
|
-
confirmEmail =
|
|
6781
|
-
isLoggedIn =
|
|
6782
|
-
setEmailExists =
|
|
6701
|
+
var EmailExistenceChecker = function EmailExistenceChecker(_ref4) {
|
|
6702
|
+
var email = _ref4.email,
|
|
6703
|
+
confirmEmail = _ref4.confirmEmail,
|
|
6704
|
+
isLoggedIn = _ref4.isLoggedIn,
|
|
6705
|
+
setEmailExists = _ref4.setEmailExists;
|
|
6783
6706
|
React.useEffect(function () {
|
|
6784
6707
|
var checkEmail = /*#__PURE__*/function () {
|
|
6785
|
-
var
|
|
6708
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
6786
6709
|
var result;
|
|
6787
6710
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6788
6711
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -6820,7 +6743,7 @@ var EmailExistenceChecker = function EmailExistenceChecker(_ref5) {
|
|
|
6820
6743
|
}, _callee2, null, [[6, 13]]);
|
|
6821
6744
|
}));
|
|
6822
6745
|
return function checkEmail() {
|
|
6823
|
-
return
|
|
6746
|
+
return _ref5.apply(this, arguments);
|
|
6824
6747
|
};
|
|
6825
6748
|
}();
|
|
6826
6749
|
// Debounce the check
|
|
@@ -6833,108 +6756,108 @@ var EmailExistenceChecker = function EmailExistenceChecker(_ref5) {
|
|
|
6833
6756
|
}, [email, confirmEmail, isLoggedIn, setEmailExists]);
|
|
6834
6757
|
return null;
|
|
6835
6758
|
};
|
|
6836
|
-
var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (
|
|
6837
|
-
var
|
|
6838
|
-
var
|
|
6839
|
-
data =
|
|
6840
|
-
|
|
6841
|
-
ticketHoldersFields =
|
|
6759
|
+
var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref6) {
|
|
6760
|
+
var _reviewData$payment_m, _checkoutUpdateData$a, _checkoutUpdateData$a2, _reviewData$payment_m2, _checkoutUpdateData$a3, _checkoutUpdateData$a4, _checkoutUpdateData$a5;
|
|
6761
|
+
var _ref6$data = _ref6.data,
|
|
6762
|
+
data = _ref6$data === void 0 ? [] : _ref6$data,
|
|
6763
|
+
_ref6$ticketHoldersFi = _ref6.ticketHoldersFields,
|
|
6764
|
+
ticketHoldersFields = _ref6$ticketHoldersFi === void 0 ? {
|
|
6842
6765
|
id: 1,
|
|
6843
6766
|
fields: []
|
|
6844
|
-
} :
|
|
6845
|
-
|
|
6846
|
-
initialValues =
|
|
6847
|
-
|
|
6848
|
-
buttonName =
|
|
6849
|
-
|
|
6850
|
-
freeOrderButtonName =
|
|
6851
|
-
|
|
6852
|
-
handleSubmit =
|
|
6853
|
-
|
|
6854
|
-
theme =
|
|
6855
|
-
|
|
6856
|
-
onRegisterSuccess =
|
|
6857
|
-
|
|
6858
|
-
onRegisterError =
|
|
6859
|
-
|
|
6860
|
-
onSubmitError =
|
|
6861
|
-
|
|
6862
|
-
onGetCartSuccess =
|
|
6863
|
-
|
|
6864
|
-
onGetCartError =
|
|
6865
|
-
|
|
6866
|
-
onGetCountriesSuccess =
|
|
6867
|
-
|
|
6868
|
-
onGetCountriesError =
|
|
6869
|
-
|
|
6870
|
-
onGetStatesSuccess =
|
|
6871
|
-
|
|
6872
|
-
onGetStatesError =
|
|
6873
|
-
|
|
6874
|
-
_onGetProfileDataSuccess =
|
|
6875
|
-
|
|
6876
|
-
onGetProfileDataError =
|
|
6877
|
-
onLogin =
|
|
6878
|
-
|
|
6879
|
-
onLoginSuccess =
|
|
6880
|
-
|
|
6881
|
-
onCheckoutUpdateSuccess =
|
|
6882
|
-
|
|
6883
|
-
onCheckoutUpdateError =
|
|
6884
|
-
|
|
6885
|
-
pIsLoggedIn =
|
|
6886
|
-
|
|
6887
|
-
accountInfoTitle =
|
|
6888
|
-
hideLogo =
|
|
6889
|
-
themeOptions =
|
|
6890
|
-
|
|
6891
|
-
onErrorClose =
|
|
6892
|
-
|
|
6893
|
-
hideErrorsAlertSection =
|
|
6894
|
-
|
|
6895
|
-
onSkipBillingPage =
|
|
6896
|
-
|
|
6897
|
-
skipPage =
|
|
6898
|
-
|
|
6899
|
-
canSkipHolderNames =
|
|
6900
|
-
|
|
6901
|
-
onForgotPasswordSuccess =
|
|
6902
|
-
|
|
6903
|
-
onForgotPasswordError =
|
|
6904
|
-
|
|
6905
|
-
shouldFetchCountries =
|
|
6906
|
-
|
|
6907
|
-
onCountdownFinish =
|
|
6908
|
-
|
|
6909
|
-
enableTimer =
|
|
6910
|
-
logo =
|
|
6911
|
-
|
|
6912
|
-
showForgotPasswordButton =
|
|
6913
|
-
|
|
6914
|
-
showSignUpButton =
|
|
6915
|
-
|
|
6916
|
-
brandOptIn =
|
|
6917
|
-
|
|
6918
|
-
showPoweredByImage =
|
|
6919
|
-
customFieldsOrderKeys =
|
|
6920
|
-
customFieldsTicketHolderKeys =
|
|
6921
|
-
|
|
6922
|
-
isCountryCodeEditable =
|
|
6923
|
-
|
|
6924
|
-
onPendingVerification =
|
|
6925
|
-
|
|
6926
|
-
onGetCheckoutConfigsSuccess =
|
|
6927
|
-
|
|
6928
|
-
onGetCheckoutConfigsError =
|
|
6929
|
-
|
|
6930
|
-
includeAddons =
|
|
6931
|
-
addonsProps =
|
|
6932
|
-
addOnDataWithCustomFields =
|
|
6933
|
-
|
|
6934
|
-
isSinglePageCheckout =
|
|
6935
|
-
|
|
6936
|
-
paymentProps =
|
|
6937
|
-
paymentSectionAddon =
|
|
6767
|
+
} : _ref6$ticketHoldersFi,
|
|
6768
|
+
_ref6$initialValues = _ref6.initialValues,
|
|
6769
|
+
initialValues = _ref6$initialValues === void 0 ? {} : _ref6$initialValues,
|
|
6770
|
+
_ref6$buttonName = _ref6.buttonName,
|
|
6771
|
+
buttonName = _ref6$buttonName === void 0 ? 'Submit' : _ref6$buttonName,
|
|
6772
|
+
_ref6$freeOrderButton = _ref6.freeOrderButtonName,
|
|
6773
|
+
freeOrderButtonName = _ref6$freeOrderButton === void 0 ? 'Complete Registration' : _ref6$freeOrderButton,
|
|
6774
|
+
_ref6$handleSubmit = _ref6.handleSubmit,
|
|
6775
|
+
handleSubmit = _ref6$handleSubmit === void 0 ? _identity : _ref6$handleSubmit,
|
|
6776
|
+
_ref6$theme = _ref6.theme,
|
|
6777
|
+
theme = _ref6$theme === void 0 ? 'light' : _ref6$theme,
|
|
6778
|
+
_ref6$onRegisterSucce = _ref6.onRegisterSuccess,
|
|
6779
|
+
onRegisterSuccess = _ref6$onRegisterSucce === void 0 ? _identity : _ref6$onRegisterSucce,
|
|
6780
|
+
_ref6$onRegisterError = _ref6.onRegisterError,
|
|
6781
|
+
onRegisterError = _ref6$onRegisterError === void 0 ? _identity : _ref6$onRegisterError,
|
|
6782
|
+
_ref6$onSubmitError = _ref6.onSubmitError,
|
|
6783
|
+
onSubmitError = _ref6$onSubmitError === void 0 ? _identity : _ref6$onSubmitError,
|
|
6784
|
+
_ref6$onGetCartSucces = _ref6.onGetCartSuccess,
|
|
6785
|
+
onGetCartSuccess = _ref6$onGetCartSucces === void 0 ? _identity : _ref6$onGetCartSucces,
|
|
6786
|
+
_ref6$onGetCartError = _ref6.onGetCartError,
|
|
6787
|
+
onGetCartError = _ref6$onGetCartError === void 0 ? _identity : _ref6$onGetCartError,
|
|
6788
|
+
_ref6$onGetCountriesS = _ref6.onGetCountriesSuccess,
|
|
6789
|
+
onGetCountriesSuccess = _ref6$onGetCountriesS === void 0 ? _identity : _ref6$onGetCountriesS,
|
|
6790
|
+
_ref6$onGetCountriesE = _ref6.onGetCountriesError,
|
|
6791
|
+
onGetCountriesError = _ref6$onGetCountriesE === void 0 ? _identity : _ref6$onGetCountriesE,
|
|
6792
|
+
_ref6$onGetStatesSucc = _ref6.onGetStatesSuccess,
|
|
6793
|
+
onGetStatesSuccess = _ref6$onGetStatesSucc === void 0 ? _identity : _ref6$onGetStatesSucc,
|
|
6794
|
+
_ref6$onGetStatesErro = _ref6.onGetStatesError,
|
|
6795
|
+
onGetStatesError = _ref6$onGetStatesErro === void 0 ? _identity : _ref6$onGetStatesErro,
|
|
6796
|
+
_ref6$onGetProfileDat = _ref6.onGetProfileDataSuccess,
|
|
6797
|
+
_onGetProfileDataSuccess = _ref6$onGetProfileDat === void 0 ? _identity : _ref6$onGetProfileDat,
|
|
6798
|
+
_ref6$onGetProfileDat2 = _ref6.onGetProfileDataError,
|
|
6799
|
+
onGetProfileDataError = _ref6$onGetProfileDat2 === void 0 ? _identity : _ref6$onGetProfileDat2,
|
|
6800
|
+
onLogin = _ref6.onLogin,
|
|
6801
|
+
_ref6$onLoginSuccess = _ref6.onLoginSuccess,
|
|
6802
|
+
onLoginSuccess = _ref6$onLoginSuccess === void 0 ? _identity : _ref6$onLoginSuccess,
|
|
6803
|
+
_ref6$onCheckoutUpdat = _ref6.onCheckoutUpdateSuccess,
|
|
6804
|
+
onCheckoutUpdateSuccess = _ref6$onCheckoutUpdat === void 0 ? _identity : _ref6$onCheckoutUpdat,
|
|
6805
|
+
_ref6$onCheckoutUpdat2 = _ref6.onCheckoutUpdateError,
|
|
6806
|
+
onCheckoutUpdateError = _ref6$onCheckoutUpdat2 === void 0 ? _identity : _ref6$onCheckoutUpdat2,
|
|
6807
|
+
_ref6$isLoggedIn = _ref6.isLoggedIn,
|
|
6808
|
+
pIsLoggedIn = _ref6$isLoggedIn === void 0 ? false : _ref6$isLoggedIn,
|
|
6809
|
+
_ref6$accountInfoTitl = _ref6.accountInfoTitle,
|
|
6810
|
+
accountInfoTitle = _ref6$accountInfoTitl === void 0 ? '' : _ref6$accountInfoTitl,
|
|
6811
|
+
hideLogo = _ref6.hideLogo,
|
|
6812
|
+
themeOptions = _ref6.themeOptions,
|
|
6813
|
+
_ref6$onErrorClose = _ref6.onErrorClose,
|
|
6814
|
+
onErrorClose = _ref6$onErrorClose === void 0 ? _identity : _ref6$onErrorClose,
|
|
6815
|
+
_ref6$hideErrorsAlert = _ref6.hideErrorsAlertSection,
|
|
6816
|
+
hideErrorsAlertSection = _ref6$hideErrorsAlert === void 0 ? false : _ref6$hideErrorsAlert,
|
|
6817
|
+
_ref6$onSkipBillingPa = _ref6.onSkipBillingPage,
|
|
6818
|
+
onSkipBillingPage = _ref6$onSkipBillingPa === void 0 ? _identity : _ref6$onSkipBillingPa,
|
|
6819
|
+
_ref6$skipPage = _ref6.skipPage,
|
|
6820
|
+
skipPage = _ref6$skipPage === void 0 ? false : _ref6$skipPage,
|
|
6821
|
+
_ref6$canSkipHolderNa = _ref6.canSkipHolderNames,
|
|
6822
|
+
canSkipHolderNames = _ref6$canSkipHolderNa === void 0 ? false : _ref6$canSkipHolderNa,
|
|
6823
|
+
_ref6$onForgotPasswor = _ref6.onForgotPasswordSuccess,
|
|
6824
|
+
onForgotPasswordSuccess = _ref6$onForgotPasswor === void 0 ? _identity : _ref6$onForgotPasswor,
|
|
6825
|
+
_ref6$onForgotPasswor2 = _ref6.onForgotPasswordError,
|
|
6826
|
+
onForgotPasswordError = _ref6$onForgotPasswor2 === void 0 ? _identity : _ref6$onForgotPasswor2,
|
|
6827
|
+
_ref6$shouldFetchCoun = _ref6.shouldFetchCountries,
|
|
6828
|
+
shouldFetchCountries = _ref6$shouldFetchCoun === void 0 ? true : _ref6$shouldFetchCoun,
|
|
6829
|
+
_ref6$onCountdownFini = _ref6.onCountdownFinish,
|
|
6830
|
+
onCountdownFinish = _ref6$onCountdownFini === void 0 ? _identity : _ref6$onCountdownFini,
|
|
6831
|
+
_ref6$enableTimer = _ref6.enableTimer,
|
|
6832
|
+
enableTimer = _ref6$enableTimer === void 0 ? false : _ref6$enableTimer,
|
|
6833
|
+
logo = _ref6.logo,
|
|
6834
|
+
_ref6$showForgotPassw = _ref6.showForgotPasswordButton,
|
|
6835
|
+
showForgotPasswordButton = _ref6$showForgotPassw === void 0 ? true : _ref6$showForgotPassw,
|
|
6836
|
+
_ref6$showSignUpButto = _ref6.showSignUpButton,
|
|
6837
|
+
showSignUpButton = _ref6$showSignUpButto === void 0 ? false : _ref6$showSignUpButto,
|
|
6838
|
+
_ref6$brandOptIn = _ref6.brandOptIn,
|
|
6839
|
+
brandOptIn = _ref6$brandOptIn === void 0 ? false : _ref6$brandOptIn,
|
|
6840
|
+
_ref6$showPoweredByIm = _ref6.showPoweredByImage,
|
|
6841
|
+
showPoweredByImage = _ref6$showPoweredByIm === void 0 ? false : _ref6$showPoweredByIm,
|
|
6842
|
+
customFieldsOrderKeys = _ref6.customFieldsOrderKeys,
|
|
6843
|
+
customFieldsTicketHolderKeys = _ref6.customFieldsTicketHolderKeys,
|
|
6844
|
+
_ref6$isCountryCodeEd = _ref6.isCountryCodeEditable,
|
|
6845
|
+
isCountryCodeEditable = _ref6$isCountryCodeEd === void 0 ? true : _ref6$isCountryCodeEd,
|
|
6846
|
+
_ref6$onPendingVerifi = _ref6.onPendingVerification,
|
|
6847
|
+
onPendingVerification = _ref6$onPendingVerifi === void 0 ? _identity : _ref6$onPendingVerifi,
|
|
6848
|
+
_ref6$onGetCheckoutCo = _ref6.onGetCheckoutConfigsSuccess,
|
|
6849
|
+
onGetCheckoutConfigsSuccess = _ref6$onGetCheckoutCo === void 0 ? _identity : _ref6$onGetCheckoutCo,
|
|
6850
|
+
_ref6$onGetCheckoutCo2 = _ref6.onGetCheckoutConfigsError,
|
|
6851
|
+
onGetCheckoutConfigsError = _ref6$onGetCheckoutCo2 === void 0 ? _identity : _ref6$onGetCheckoutCo2,
|
|
6852
|
+
_ref6$includeAddons = _ref6.includeAddons,
|
|
6853
|
+
includeAddons = _ref6$includeAddons === void 0 ? false : _ref6$includeAddons,
|
|
6854
|
+
addonsProps = _ref6.addonsProps,
|
|
6855
|
+
addOnDataWithCustomFields = _ref6.addOnDataWithCustomFields,
|
|
6856
|
+
_ref6$isSinglePageChe = _ref6.isSinglePageCheckout,
|
|
6857
|
+
isSinglePageCheckout = _ref6$isSinglePageChe === void 0 ? false : _ref6$isSinglePageChe,
|
|
6858
|
+
_ref6$paymentProps = _ref6.paymentProps,
|
|
6859
|
+
paymentProps = _ref6$paymentProps === void 0 ? {} : _ref6$paymentProps,
|
|
6860
|
+
paymentSectionAddon = _ref6.paymentSectionAddon;
|
|
6938
6861
|
var _useState = React.useState(null),
|
|
6939
6862
|
extraData = _useState[0],
|
|
6940
6863
|
setExtraData = _useState[1];
|
|
@@ -7025,36 +6948,6 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7025
6948
|
var _useState15 = React.useState(true),
|
|
7026
6949
|
loading = _useState15[0],
|
|
7027
6950
|
setLoading = _useState15[1];
|
|
7028
|
-
// Ref to store Formik helpers for stable Wallet callback
|
|
7029
|
-
var formikHelpersRef = React.useRef(null);
|
|
7030
|
-
// Stable callback for Wallet onSubmit to prevent re-renders
|
|
7031
|
-
var handleWalletSubmit = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
7032
|
-
var referenceId;
|
|
7033
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
7034
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
7035
|
-
case 0:
|
|
7036
|
-
if (!formikHelpersRef.current) {
|
|
7037
|
-
_context3.next = 10;
|
|
7038
|
-
break;
|
|
7039
|
-
}
|
|
7040
|
-
formikHelpersRef.current.setSubmitting(true);
|
|
7041
|
-
_context3.next = 4;
|
|
7042
|
-
return formikHelpersRef.current.submitForm();
|
|
7043
|
-
case 4:
|
|
7044
|
-
referenceId = _context3.sent;
|
|
7045
|
-
if (!referenceId) {
|
|
7046
|
-
_context3.next = 9;
|
|
7047
|
-
break;
|
|
7048
|
-
}
|
|
7049
|
-
return _context3.abrupt("return", referenceId);
|
|
7050
|
-
case 9:
|
|
7051
|
-
throw 'Invalid Form';
|
|
7052
|
-
case 10:
|
|
7053
|
-
case "end":
|
|
7054
|
-
return _context3.stop();
|
|
7055
|
-
}
|
|
7056
|
-
}, _callee3);
|
|
7057
|
-
})), []);
|
|
7058
6951
|
var _useState16 = React.useState(false),
|
|
7059
6952
|
cardLoading = _useState16[0],
|
|
7060
6953
|
setCardLoading = _useState16[1];
|
|
@@ -7101,26 +6994,18 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7101
6994
|
var collectOptionalBusinessCategory = configs == null ? void 0 : configs.collect_optional_business_category;
|
|
7102
6995
|
var eventHasAddons = configs == null ? void 0 : configs.has_add_on;
|
|
7103
6996
|
var hideBusinessCategoryField = !collectMandatoryBusinessCategory && !collectOptionalBusinessCategory;
|
|
7104
|
-
var _useState21 = React.useState(
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
reviewData = _useState24[0],
|
|
7117
|
-
setReviewData = _useState24[1];
|
|
7118
|
-
var _useState25 = React.useState({}),
|
|
7119
|
-
checkoutData = _useState25[0],
|
|
7120
|
-
setCheckoutData = _useState25[1];
|
|
7121
|
-
var _useState26 = React.useState(null),
|
|
7122
|
-
checkoutUpdateData = _useState26[0],
|
|
7123
|
-
setCheckoutUpdateData = _useState26[1];
|
|
6997
|
+
var _useState21 = React.useState(),
|
|
6998
|
+
pendingVerificationMessage = _useState21[0],
|
|
6999
|
+
setPendingVerificationMessage = _useState21[1];
|
|
7000
|
+
var _useState22 = React.useState({}),
|
|
7001
|
+
reviewData = _useState22[0],
|
|
7002
|
+
setReviewData = _useState22[1];
|
|
7003
|
+
var _useState23 = React.useState({}),
|
|
7004
|
+
checkoutData = _useState23[0],
|
|
7005
|
+
setCheckoutData = _useState23[1];
|
|
7006
|
+
var _useState24 = React.useState(null),
|
|
7007
|
+
checkoutUpdateData = _useState24[0],
|
|
7008
|
+
setCheckoutUpdateData = _useState24[1];
|
|
7124
7009
|
var prevData = React.useRef(data);
|
|
7125
7010
|
var addAddOnsInAttributes = React.useCallback(function (checkoutBody) {
|
|
7126
7011
|
var selectedAddOns = window.localStorage.getItem('add_ons') || '{}';
|
|
@@ -7128,9 +7013,9 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7128
7013
|
checkoutBody.attributes.add_ons = JSON.parse(selectedAddOns);
|
|
7129
7014
|
checkoutBody.attributes.add_on_data_capture = JSON.parse(addOnDataCapture);
|
|
7130
7015
|
}, []);
|
|
7131
|
-
var
|
|
7132
|
-
singleCheckoutAddons =
|
|
7133
|
-
setSingleCheckoutAddOns =
|
|
7016
|
+
var _useState25 = React.useState({}),
|
|
7017
|
+
singleCheckoutAddons = _useState25[0],
|
|
7018
|
+
setSingleCheckoutAddOns = _useState25[1];
|
|
7134
7019
|
var orderIsFree = !Number(checkoutData == null ? void 0 : checkoutData.total);
|
|
7135
7020
|
React.useEffect(function () {
|
|
7136
7021
|
var hasUniqueId = _get(dataWithUniqueIds, '[0].uniqueId');
|
|
@@ -7161,37 +7046,37 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7161
7046
|
React.useEffect(function () {
|
|
7162
7047
|
// fetch countries data
|
|
7163
7048
|
var fetchCountries = /*#__PURE__*/function () {
|
|
7164
|
-
var
|
|
7049
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
7165
7050
|
var res;
|
|
7166
|
-
return _regeneratorRuntime().wrap(function
|
|
7167
|
-
while (1) switch (
|
|
7051
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
7052
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
7168
7053
|
case 0:
|
|
7169
|
-
|
|
7170
|
-
|
|
7054
|
+
_context3.prev = 0;
|
|
7055
|
+
_context3.next = 3;
|
|
7171
7056
|
return getCountries();
|
|
7172
7057
|
case 3:
|
|
7173
|
-
res =
|
|
7058
|
+
res = _context3.sent;
|
|
7174
7059
|
setCustomHeader(res);
|
|
7175
7060
|
setCountries(res.data);
|
|
7176
7061
|
setIsCountriesLoading(false);
|
|
7177
7062
|
onGetCountriesSuccess(res.data);
|
|
7178
|
-
|
|
7063
|
+
_context3.next = 14;
|
|
7179
7064
|
break;
|
|
7180
7065
|
case 10:
|
|
7181
|
-
|
|
7182
|
-
|
|
7183
|
-
if (axios.isAxiosError(
|
|
7184
|
-
onGetCountriesError(
|
|
7066
|
+
_context3.prev = 10;
|
|
7067
|
+
_context3.t0 = _context3["catch"](0);
|
|
7068
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
7069
|
+
onGetCountriesError(_context3.t0);
|
|
7185
7070
|
}
|
|
7186
7071
|
setIsCountriesLoading(false);
|
|
7187
7072
|
case 14:
|
|
7188
7073
|
case "end":
|
|
7189
|
-
return
|
|
7074
|
+
return _context3.stop();
|
|
7190
7075
|
}
|
|
7191
|
-
},
|
|
7076
|
+
}, _callee3, null, [[0, 10]]);
|
|
7192
7077
|
}));
|
|
7193
7078
|
return function fetchCountries() {
|
|
7194
|
-
return
|
|
7079
|
+
return _ref7.apply(this, arguments);
|
|
7195
7080
|
};
|
|
7196
7081
|
}();
|
|
7197
7082
|
shouldFetchCountries && fetchCountries();
|
|
@@ -7207,17 +7092,17 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7207
7092
|
}, [eventId, isSinglePageCheckout, shouldFetchCountries, onGetCountriesSuccess, onGetCountriesError]);
|
|
7208
7093
|
// fetch cart data
|
|
7209
7094
|
var fetchCart = /*#__PURE__*/function () {
|
|
7210
|
-
var
|
|
7095
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
7211
7096
|
var res, cartInfo, _cartInfo$cart, cart;
|
|
7212
|
-
return _regeneratorRuntime().wrap(function
|
|
7213
|
-
while (1) switch (
|
|
7097
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
7098
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
7214
7099
|
case 0:
|
|
7215
|
-
|
|
7100
|
+
_context4.prev = 0;
|
|
7216
7101
|
setCardLoading(true);
|
|
7217
|
-
|
|
7102
|
+
_context4.next = 4;
|
|
7218
7103
|
return getCart();
|
|
7219
7104
|
case 4:
|
|
7220
|
-
res =
|
|
7105
|
+
res = _context4.sent;
|
|
7221
7106
|
setCustomHeader(res);
|
|
7222
7107
|
cartInfo = res.data.attributes;
|
|
7223
7108
|
setCartInfo(cartInfo);
|
|
@@ -7226,44 +7111,44 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7226
7111
|
return nanoid.nanoid();
|
|
7227
7112
|
}));
|
|
7228
7113
|
onGetCartSuccess(res.data);
|
|
7229
|
-
|
|
7114
|
+
_context4.next = 16;
|
|
7230
7115
|
break;
|
|
7231
7116
|
case 13:
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
if (axios.isAxiosError(
|
|
7235
|
-
onGetCartError(
|
|
7117
|
+
_context4.prev = 13;
|
|
7118
|
+
_context4.t0 = _context4["catch"](0);
|
|
7119
|
+
if (axios.isAxiosError(_context4.t0)) {
|
|
7120
|
+
onGetCartError(_context4.t0);
|
|
7236
7121
|
}
|
|
7237
7122
|
case 16:
|
|
7238
|
-
|
|
7123
|
+
_context4.prev = 16;
|
|
7239
7124
|
setCardLoading(false);
|
|
7240
|
-
return
|
|
7125
|
+
return _context4.finish(16);
|
|
7241
7126
|
case 19:
|
|
7242
7127
|
case "end":
|
|
7243
|
-
return
|
|
7128
|
+
return _context4.stop();
|
|
7244
7129
|
}
|
|
7245
|
-
},
|
|
7130
|
+
}, _callee4, null, [[0, 13, 16, 19]]);
|
|
7246
7131
|
}));
|
|
7247
7132
|
return function fetchCart() {
|
|
7248
|
-
return
|
|
7133
|
+
return _ref8.apply(this, arguments);
|
|
7249
7134
|
};
|
|
7250
7135
|
}();
|
|
7251
7136
|
// fetch user data
|
|
7252
7137
|
var fetchUserData = /*#__PURE__*/function () {
|
|
7253
|
-
var
|
|
7138
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
7254
7139
|
var userDataResponse, profileSpecifiedData, profileDataObj;
|
|
7255
|
-
return _regeneratorRuntime().wrap(function
|
|
7256
|
-
while (1) switch (
|
|
7140
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
7141
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
7257
7142
|
case 0:
|
|
7258
|
-
|
|
7143
|
+
_context5.prev = 0;
|
|
7259
7144
|
if (!isLoggedIn) {
|
|
7260
|
-
|
|
7145
|
+
_context5.next = 10;
|
|
7261
7146
|
break;
|
|
7262
7147
|
}
|
|
7263
|
-
|
|
7148
|
+
_context5.next = 4;
|
|
7264
7149
|
return getProfileData();
|
|
7265
7150
|
case 4:
|
|
7266
|
-
userDataResponse =
|
|
7151
|
+
userDataResponse = _context5.sent;
|
|
7267
7152
|
profileSpecifiedData = _get(userDataResponse, 'data');
|
|
7268
7153
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
7269
7154
|
setUserValues(_extends({}, profileDataObj, {
|
|
@@ -7273,22 +7158,22 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7273
7158
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
7274
7159
|
_onGetProfileDataSuccess(userDataResponse.data);
|
|
7275
7160
|
case 10:
|
|
7276
|
-
|
|
7161
|
+
_context5.next = 15;
|
|
7277
7162
|
break;
|
|
7278
7163
|
case 12:
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
if (axios.isAxiosError(
|
|
7282
|
-
onGetProfileDataError(
|
|
7164
|
+
_context5.prev = 12;
|
|
7165
|
+
_context5.t0 = _context5["catch"](0);
|
|
7166
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
7167
|
+
onGetProfileDataError(_context5.t0);
|
|
7283
7168
|
}
|
|
7284
7169
|
case 15:
|
|
7285
7170
|
case "end":
|
|
7286
|
-
return
|
|
7171
|
+
return _context5.stop();
|
|
7287
7172
|
}
|
|
7288
|
-
},
|
|
7173
|
+
}, _callee5, null, [[0, 12]]);
|
|
7289
7174
|
}));
|
|
7290
7175
|
return function fetchUserData() {
|
|
7291
|
-
return
|
|
7176
|
+
return _ref9.apply(this, arguments);
|
|
7292
7177
|
};
|
|
7293
7178
|
}();
|
|
7294
7179
|
React.useEffect(function () {
|
|
@@ -7297,19 +7182,19 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7297
7182
|
}, [isLoggedIn]);
|
|
7298
7183
|
React.useEffect(function () {
|
|
7299
7184
|
var fetchCheckoutUpdate = /*#__PURE__*/function () {
|
|
7300
|
-
var
|
|
7185
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
7301
7186
|
var checkoutUpdateResponse, checkoutAttributes, cartPriceBreakdown;
|
|
7302
|
-
return _regeneratorRuntime().wrap(function
|
|
7303
|
-
while (1) switch (
|
|
7187
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
7188
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
7304
7189
|
case 0:
|
|
7305
7190
|
if (eventId) {
|
|
7306
|
-
|
|
7191
|
+
_context6.next = 2;
|
|
7307
7192
|
break;
|
|
7308
7193
|
}
|
|
7309
|
-
return
|
|
7194
|
+
return _context6.abrupt("return");
|
|
7310
7195
|
case 2:
|
|
7311
|
-
|
|
7312
|
-
|
|
7196
|
+
_context6.prev = 2;
|
|
7197
|
+
_context6.next = 5;
|
|
7313
7198
|
return updateCheckout({
|
|
7314
7199
|
attributes: {
|
|
7315
7200
|
event_id: eventId,
|
|
@@ -7317,7 +7202,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7317
7202
|
}
|
|
7318
7203
|
});
|
|
7319
7204
|
case 5:
|
|
7320
|
-
checkoutUpdateResponse =
|
|
7205
|
+
checkoutUpdateResponse = _context6.sent;
|
|
7321
7206
|
console.log('Stripe in [useEffect] fetchCheckoutUpdate', checkoutUpdateResponse);
|
|
7322
7207
|
if (checkoutUpdateResponse.success) {
|
|
7323
7208
|
checkoutAttributes = checkoutUpdateResponse.data.attributes;
|
|
@@ -7332,71 +7217,71 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7332
7217
|
expires_at: expirationTime
|
|
7333
7218
|
}, cartPriceBreakdown));
|
|
7334
7219
|
}
|
|
7335
|
-
|
|
7220
|
+
_context6.next = 13;
|
|
7336
7221
|
break;
|
|
7337
7222
|
case 10:
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
console.error('Failed to fetch checkout update:',
|
|
7223
|
+
_context6.prev = 10;
|
|
7224
|
+
_context6.t0 = _context6["catch"](2);
|
|
7225
|
+
console.error('Failed to fetch checkout update:', _context6.t0);
|
|
7341
7226
|
case 13:
|
|
7342
7227
|
case "end":
|
|
7343
|
-
return
|
|
7228
|
+
return _context6.stop();
|
|
7344
7229
|
}
|
|
7345
|
-
},
|
|
7230
|
+
}, _callee6, null, [[2, 10]]);
|
|
7346
7231
|
}));
|
|
7347
7232
|
return function fetchCheckoutUpdate() {
|
|
7348
|
-
return
|
|
7233
|
+
return _ref10.apply(this, arguments);
|
|
7349
7234
|
};
|
|
7350
7235
|
}();
|
|
7351
7236
|
fetchCheckoutUpdate();
|
|
7352
7237
|
}, [eventId, additionalConfigs == null ? void 0 : additionalConfigs.resale]);
|
|
7353
7238
|
React.useEffect(function () {
|
|
7354
7239
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
7355
|
-
var
|
|
7240
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
7356
7241
|
var checkoutBody, checkoutResponse;
|
|
7357
|
-
return _regeneratorRuntime().wrap(function
|
|
7358
|
-
while (1) switch (
|
|
7242
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
7243
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
7359
7244
|
case 0:
|
|
7360
7245
|
if (!(skipPage && !_isEmpty(ticketsQuantity) && !showDOB && !loading && !isNewUser)) {
|
|
7361
|
-
|
|
7246
|
+
_context7.next = 20;
|
|
7362
7247
|
break;
|
|
7363
7248
|
}
|
|
7364
7249
|
setLoading(true);
|
|
7365
7250
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, userData);
|
|
7366
|
-
|
|
7251
|
+
_context7.prev = 3;
|
|
7367
7252
|
if (isBrowser) {
|
|
7368
7253
|
addAddOnsInAttributes(checkoutBody);
|
|
7369
7254
|
}
|
|
7370
|
-
|
|
7255
|
+
_context7.next = 7;
|
|
7371
7256
|
return postOnCheckout(checkoutBody, flagFreeTicket);
|
|
7372
7257
|
case 7:
|
|
7373
|
-
checkoutResponse =
|
|
7258
|
+
checkoutResponse = _context7.sent;
|
|
7374
7259
|
removeReferralKey();
|
|
7375
7260
|
removeAdditionalConfigs();
|
|
7376
7261
|
onSkipBillingPage(checkoutResponse.data.attributes);
|
|
7377
7262
|
setLoading(false);
|
|
7378
|
-
|
|
7263
|
+
_context7.next = 18;
|
|
7379
7264
|
break;
|
|
7380
7265
|
case 14:
|
|
7381
|
-
|
|
7382
|
-
|
|
7383
|
-
onSubmitError(
|
|
7384
|
-
if (_get(
|
|
7385
|
-
setPendingVerificationMessage(_get(
|
|
7266
|
+
_context7.prev = 14;
|
|
7267
|
+
_context7.t0 = _context7["catch"](3);
|
|
7268
|
+
onSubmitError(_context7.t0);
|
|
7269
|
+
if (_get(_context7.t0, 'response.data.data.hasUnverifiedOrder')) {
|
|
7270
|
+
setPendingVerificationMessage(_get(_context7.t0, 'response.data.message'));
|
|
7386
7271
|
}
|
|
7387
7272
|
case 18:
|
|
7388
|
-
|
|
7273
|
+
_context7.next = 21;
|
|
7389
7274
|
break;
|
|
7390
7275
|
case 20:
|
|
7391
7276
|
setLoading(false);
|
|
7392
7277
|
case 21:
|
|
7393
7278
|
case "end":
|
|
7394
|
-
return
|
|
7279
|
+
return _context7.stop();
|
|
7395
7280
|
}
|
|
7396
|
-
},
|
|
7281
|
+
}, _callee7, null, [[3, 14]]);
|
|
7397
7282
|
}));
|
|
7398
7283
|
return function collectPaymentData() {
|
|
7399
|
-
return
|
|
7284
|
+
return _ref11.apply(this, arguments);
|
|
7400
7285
|
};
|
|
7401
7286
|
}();
|
|
7402
7287
|
collectPaymentData();
|
|
@@ -7506,50 +7391,6 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7506
7391
|
expires_at: expirationTime
|
|
7507
7392
|
}, checkoutData));
|
|
7508
7393
|
}, [checkoutData, cartInfoData]);
|
|
7509
|
-
React.useEffect(function () {
|
|
7510
|
-
var _checkoutUpdateData$c, _checkoutUpdateData$c2, _checkoutUpdateData$a, _checkoutUpdateData$a2, _checkoutUpdateData$a3;
|
|
7511
|
-
var total = (_checkoutUpdateData$c = checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$c2 = checkoutUpdateData.cart_price_breakdown) == null ? void 0 : _checkoutUpdateData$c2.total) != null ? _checkoutUpdateData$c : 0;
|
|
7512
|
-
if (total <= 0) {
|
|
7513
|
-
setPaymentType(PaymentType.STRIPE_INTENTS);
|
|
7514
|
-
setPaymentTypeConfig({
|
|
7515
|
-
type: PaymentType.STRIPE_INTENTS,
|
|
7516
|
-
elementsOptions: undefined
|
|
7517
|
-
});
|
|
7518
|
-
return;
|
|
7519
|
-
}
|
|
7520
|
-
setPaymentType((_checkoutUpdateData$a = checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a2 = checkoutUpdateData.additional_payment_information) == null ? void 0 : _checkoutUpdateData$a2.type) != null ? _checkoutUpdateData$a : PaymentType.STRIPE_INTENTS);
|
|
7521
|
-
if ((checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a3 = checkoutUpdateData.additional_payment_information) == null ? void 0 : _checkoutUpdateData$a3.type) === PaymentType.MERCADO_PAGO_PRO) {
|
|
7522
|
-
var mercadoPagoAdditionalData = checkoutUpdateData == null ? void 0 : checkoutUpdateData.additional_payment_information;
|
|
7523
|
-
setPaymentTypeConfig({
|
|
7524
|
-
type: PaymentType.MERCADO_PAGO_PRO,
|
|
7525
|
-
publicKey: mercadoPagoAdditionalData == null ? void 0 : mercadoPagoAdditionalData.public_key
|
|
7526
|
-
});
|
|
7527
|
-
} else {
|
|
7528
|
-
var _stripeAdditionalData, _stripeAdditionalData2, _stripeAdditionalData3, _stripeAdditionalData4, _stripeAdditionalData5;
|
|
7529
|
-
var stripeAdditionalData = checkoutUpdateData == null ? void 0 : checkoutUpdateData.additional_payment_information;
|
|
7530
|
-
setPaymentTypeConfig({
|
|
7531
|
-
type: PaymentType.STRIPE_INTENTS,
|
|
7532
|
-
publishableKey: stripeAdditionalData == null ? void 0 : (_stripeAdditionalData = stripeAdditionalData.basic_config) == null ? void 0 : _stripeAdditionalData.apiKey,
|
|
7533
|
-
accountId: (_stripeAdditionalData2 = stripeAdditionalData == null ? void 0 : (_stripeAdditionalData3 = stripeAdditionalData.basic_config) == null ? void 0 : _stripeAdditionalData3.accountId) != null ? _stripeAdditionalData2 : null,
|
|
7534
|
-
onReady: function onReady(stripe, elements) {
|
|
7535
|
-
stripeRef.current = stripe;
|
|
7536
|
-
elementsRef.current = elements;
|
|
7537
|
-
},
|
|
7538
|
-
elementsOptions: stripeAdditionalData == null ? void 0 : stripeAdditionalData.elements_config,
|
|
7539
|
-
paymentElementOptions: {
|
|
7540
|
-
wallets: {
|
|
7541
|
-
applePay: (stripeAdditionalData == null ? void 0 : (_stripeAdditionalData4 = stripeAdditionalData.stripe_wallets) == null ? void 0 : _stripeAdditionalData4.applePay) || 'never',
|
|
7542
|
-
googlePay: (stripeAdditionalData == null ? void 0 : (_stripeAdditionalData5 = stripeAdditionalData.stripe_wallets) == null ? void 0 : _stripeAdditionalData5.googlePay) || 'never'
|
|
7543
|
-
}
|
|
7544
|
-
}
|
|
7545
|
-
});
|
|
7546
|
-
}
|
|
7547
|
-
}, [checkoutUpdateData]);
|
|
7548
|
-
React.useEffect(function () {
|
|
7549
|
-
if ((paymentTypeConfig == null ? void 0 : paymentTypeConfig.type) === PaymentType.MERCADO_PAGO_PRO) {
|
|
7550
|
-
sdkReact.initMercadoPago(paymentTypeConfig == null ? void 0 : paymentTypeConfig.publicKey);
|
|
7551
|
-
}
|
|
7552
|
-
}, [paymentTypeConfig == null ? void 0 : paymentTypeConfig.type, paymentTypeConfig == null ? void 0 : paymentTypeConfig.publicKey]);
|
|
7553
7394
|
// Initialize payment hooks
|
|
7554
7395
|
usePaymentRedirect({
|
|
7555
7396
|
stripeRef: stripeRef,
|
|
@@ -7568,24 +7409,24 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7568
7409
|
}),
|
|
7569
7410
|
processPayment = _useStripePayment.processPayment;
|
|
7570
7411
|
var updateCheckoutWithAddOns = React.useCallback( /*#__PURE__*/function () {
|
|
7571
|
-
var
|
|
7412
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(addOns) {
|
|
7572
7413
|
var mergedAddOns, _checkoutUpdateData, checkoutResponse, checkoutDataObj, errorMessage;
|
|
7573
|
-
return _regeneratorRuntime().wrap(function
|
|
7574
|
-
while (1) switch (
|
|
7414
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
7415
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
7575
7416
|
case 0:
|
|
7576
7417
|
if (addOns === void 0) {
|
|
7577
7418
|
addOns = {};
|
|
7578
7419
|
}
|
|
7579
7420
|
if (isSinglePageCheckout) {
|
|
7580
|
-
|
|
7421
|
+
_context8.next = 3;
|
|
7581
7422
|
break;
|
|
7582
7423
|
}
|
|
7583
|
-
return
|
|
7424
|
+
return _context8.abrupt("return");
|
|
7584
7425
|
case 3:
|
|
7585
7426
|
mergedAddOns = _extends({}, singleCheckoutAddons); // Update existing entries and add new ones
|
|
7586
|
-
Object.entries(addOns).forEach(function (
|
|
7587
|
-
var key =
|
|
7588
|
-
value =
|
|
7427
|
+
Object.entries(addOns).forEach(function (_ref13) {
|
|
7428
|
+
var key = _ref13[0],
|
|
7429
|
+
value = _ref13[1];
|
|
7589
7430
|
var amount = Number(value);
|
|
7590
7431
|
if (amount) {
|
|
7591
7432
|
mergedAddOns[key] = amount;
|
|
@@ -7593,7 +7434,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7593
7434
|
delete mergedAddOns[key];
|
|
7594
7435
|
}
|
|
7595
7436
|
});
|
|
7596
|
-
|
|
7437
|
+
_context8.prev = 5;
|
|
7597
7438
|
_checkoutUpdateData = {
|
|
7598
7439
|
attributes: {
|
|
7599
7440
|
event_id: eventId,
|
|
@@ -7601,52 +7442,51 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7601
7442
|
is_from_resale: additionalConfigs == null ? void 0 : additionalConfigs.resale
|
|
7602
7443
|
}
|
|
7603
7444
|
};
|
|
7604
|
-
|
|
7445
|
+
_context8.next = 9;
|
|
7605
7446
|
return updateCheckout(_checkoutUpdateData);
|
|
7606
7447
|
case 9:
|
|
7607
|
-
checkoutResponse =
|
|
7448
|
+
checkoutResponse = _context8.sent;
|
|
7608
7449
|
if (checkoutResponse.success) {
|
|
7609
7450
|
checkoutDataObj = _get(checkoutResponse, 'data.attributes.cart_price_breakdown', {});
|
|
7610
|
-
setCheckoutUpdateData(checkoutResponse.data.attributes);
|
|
7611
7451
|
setCheckoutData(checkoutDataObj);
|
|
7612
7452
|
setSingleCheckoutAddOns(mergedAddOns);
|
|
7613
7453
|
}
|
|
7614
|
-
|
|
7454
|
+
_context8.next = 18;
|
|
7615
7455
|
break;
|
|
7616
7456
|
case 13:
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
errorMessage = _get(
|
|
7457
|
+
_context8.prev = 13;
|
|
7458
|
+
_context8.t0 = _context8["catch"](5);
|
|
7459
|
+
errorMessage = _get(_context8.t0, 'response.data.message', 'Failed to update add-ons');
|
|
7620
7460
|
setError(errorMessage);
|
|
7621
|
-
onCheckoutUpdateError(
|
|
7461
|
+
onCheckoutUpdateError(_context8.t0);
|
|
7622
7462
|
case 18:
|
|
7623
7463
|
case "end":
|
|
7624
|
-
return
|
|
7464
|
+
return _context8.stop();
|
|
7625
7465
|
}
|
|
7626
|
-
},
|
|
7466
|
+
}, _callee8, null, [[5, 13]]);
|
|
7627
7467
|
}));
|
|
7628
7468
|
return function (_x) {
|
|
7629
|
-
return
|
|
7469
|
+
return _ref12.apply(this, arguments);
|
|
7630
7470
|
};
|
|
7631
7471
|
}(), [eventId, isSinglePageCheckout, onCheckoutUpdateError, onCheckoutUpdateSuccess]);
|
|
7632
7472
|
console.log({
|
|
7633
7473
|
checkoutData: checkoutData
|
|
7634
7474
|
});
|
|
7635
7475
|
var handleAddOnSelect = React.useCallback( /*#__PURE__*/function () {
|
|
7636
|
-
var
|
|
7637
|
-
return _regeneratorRuntime().wrap(function
|
|
7638
|
-
while (1) switch (
|
|
7476
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(selectedAddOns) {
|
|
7477
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
7478
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
7639
7479
|
case 0:
|
|
7640
|
-
|
|
7480
|
+
_context9.next = 2;
|
|
7641
7481
|
return updateCheckoutWithAddOns(selectedAddOns);
|
|
7642
7482
|
case 2:
|
|
7643
7483
|
case "end":
|
|
7644
|
-
return
|
|
7484
|
+
return _context9.stop();
|
|
7645
7485
|
}
|
|
7646
|
-
},
|
|
7486
|
+
}, _callee9);
|
|
7647
7487
|
}));
|
|
7648
7488
|
return function (_x2) {
|
|
7649
|
-
return
|
|
7489
|
+
return _ref14.apply(this, arguments);
|
|
7650
7490
|
};
|
|
7651
7491
|
}(), [updateCheckoutWithAddOns]);
|
|
7652
7492
|
var onAddOnSelect = React.useCallback(function (id, value, addon, fieldUpdates) {
|
|
@@ -7684,7 +7524,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7684
7524
|
var selectedCountry = _find(countries, function (item) {
|
|
7685
7525
|
return item.code.toLowerCase() === defaultCountry;
|
|
7686
7526
|
}) || {};
|
|
7687
|
-
var initialCountry = selectedCountry.id || _get(userData, 'countryId', '') ||
|
|
7527
|
+
var initialCountry = selectedCountry.id || _get(userData, 'countryId', '') || '1';
|
|
7688
7528
|
var pageUrl = isBrowser ? window.location.href.split('?')[0] : '';
|
|
7689
7529
|
usePixel(eventId || (cartInfoData == null ? void 0 : cartInfoData.eventId), {
|
|
7690
7530
|
page: 'billing',
|
|
@@ -7693,7 +7533,10 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7693
7533
|
if (isTable) {
|
|
7694
7534
|
dataWithUniqueIds[0].label = 'Get Your Tables';
|
|
7695
7535
|
}
|
|
7536
|
+
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);
|
|
7537
|
+
var stripeAccountId = (reviewData == null ? void 0 : (_reviewData$payment_m2 = reviewData.payment_method) == null ? void 0 : _reviewData$payment_m2.stripe_connected_account) || (checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a3 = checkoutUpdateData.additional_payment_information) == null ? void 0 : (_checkoutUpdateData$a4 = _checkoutUpdateData$a3.basic_config) == null ? void 0 : _checkoutUpdateData$a4.accountId);
|
|
7696
7538
|
var addOnsIncludedOnInvitation = additionalConfigs.resale && additionalConfigs.resaleWithAddons;
|
|
7539
|
+
var elementsOptions = _extends({}, checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a5 = checkoutUpdateData.additional_payment_information) == null ? void 0 : _checkoutUpdateData$a5.elements_config);
|
|
7697
7540
|
if (loading || cardLoading || isCountriesLoading || isConfigLoading || !eventId) {
|
|
7698
7541
|
return React__default.createElement(Backdrop, {
|
|
7699
7542
|
sx: {
|
|
@@ -7706,7 +7549,6 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7706
7549
|
color: "inherit"
|
|
7707
7550
|
}));
|
|
7708
7551
|
}
|
|
7709
|
-
var isMercadoPagoPayment = paymentType === PaymentType.MERCADO_PAGO_PRO && isSinglePageCheckout && !orderIsFree;
|
|
7710
7552
|
return React__default.createElement(styles.ThemeProvider, {
|
|
7711
7553
|
theme: themeMui
|
|
7712
7554
|
}, !!expirationTime && enableTimer && React__default.createElement(TimerWidget$1, {
|
|
@@ -7716,7 +7558,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7716
7558
|
}), !isCountriesLoading && !isConfigLoading && React__default.createElement(formik.Formik, {
|
|
7717
7559
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({
|
|
7718
7560
|
country: initialCountry,
|
|
7719
|
-
state: _get(userData, 'stateId', '') || _get(userData, 'state', '') ||
|
|
7561
|
+
state: _get(userData, 'stateId', '') || _get(userData, 'state', '') || '1',
|
|
7720
7562
|
brand_opt_in: Boolean(optedInFieldValue),
|
|
7721
7563
|
ttf_opt_in: ttfOptIn,
|
|
7722
7564
|
data_capture: {
|
|
@@ -7728,16 +7570,16 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7728
7570
|
}, initialValues), userValues, ticketHoldersFields, ticketsQuantity),
|
|
7729
7571
|
enableReinitialize: false,
|
|
7730
7572
|
onSubmit: function () {
|
|
7731
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
7732
|
-
var _checkoutBody$attribu2, _checkoutBody$attribu3, flagRequirePhoneLocal, holdersCount, hasHolderPhoneError, i, fieldName, value, userDataObj, profileData, profileSpecifiedData, checkoutBody, storedAddOnDataCapture, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$,
|
|
7733
|
-
return _regeneratorRuntime().wrap(function
|
|
7734
|
-
while (1) switch (
|
|
7573
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(values, formikHelpers) {
|
|
7574
|
+
var _checkoutBody$attribu2, _checkoutBody$attribu3, flagRequirePhoneLocal, holdersCount, hasHolderPhoneError, i, fieldName, value, userDataObj, profileData, profileSpecifiedData, checkoutBody, storedAddOnDataCapture, checkoutResponse, checkoutUpdateResponse, paymentResponse, _checkoutResponse$dat, hash, total, paymentDataResponse, _cart$, attributes, order_details, cart, _order_details$ticket, ticket, updatedOrderData, isFreeTickets, paymentMethod, paymentPlanAvailable, hasUnverifiedOrder, message, _e$response, event;
|
|
7575
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
7576
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
7735
7577
|
case 0:
|
|
7736
|
-
|
|
7578
|
+
_context10.prev = 0;
|
|
7737
7579
|
// Validation: if phone is required for ticket holders, mark errors and stop submit
|
|
7738
7580
|
flagRequirePhoneLocal = Boolean(configs == null ? void 0 : configs.phone_required);
|
|
7739
7581
|
if (!flagRequirePhoneLocal) {
|
|
7740
|
-
|
|
7582
|
+
_context10.next = 8;
|
|
7741
7583
|
break;
|
|
7742
7584
|
}
|
|
7743
7585
|
holdersCount = ticketsQuantity.length;
|
|
@@ -7752,17 +7594,17 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7752
7594
|
}
|
|
7753
7595
|
}
|
|
7754
7596
|
if (!hasHolderPhoneError) {
|
|
7755
|
-
|
|
7597
|
+
_context10.next = 8;
|
|
7756
7598
|
break;
|
|
7757
7599
|
}
|
|
7758
|
-
return
|
|
7600
|
+
return _context10.abrupt("return");
|
|
7759
7601
|
case 8:
|
|
7760
|
-
if (!((!elementsRef.current || !stripeRef.current) && !orderIsFree
|
|
7761
|
-
|
|
7602
|
+
if (!((!elementsRef.current || !stripeRef.current) && !orderIsFree)) {
|
|
7603
|
+
_context10.next = 11;
|
|
7762
7604
|
break;
|
|
7763
7605
|
}
|
|
7764
7606
|
setError('Fill in the payment details');
|
|
7765
|
-
return
|
|
7607
|
+
return _context10.abrupt("return");
|
|
7766
7608
|
case 11:
|
|
7767
7609
|
if (isBrowser) {
|
|
7768
7610
|
window.localStorage.setItem('extraData', JSON.stringify({
|
|
@@ -7777,21 +7619,21 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7777
7619
|
// Guest checkout: no need to register, just get profile if logged in
|
|
7778
7620
|
userDataObj = userData;
|
|
7779
7621
|
if (!isLoggedIn) {
|
|
7780
|
-
|
|
7622
|
+
_context10.next = 28;
|
|
7781
7623
|
break;
|
|
7782
7624
|
}
|
|
7783
|
-
|
|
7784
|
-
|
|
7625
|
+
_context10.prev = 15;
|
|
7626
|
+
_context10.next = 18;
|
|
7785
7627
|
return getProfileData();
|
|
7786
7628
|
case 18:
|
|
7787
|
-
profileData =
|
|
7629
|
+
profileData = _context10.sent;
|
|
7788
7630
|
profileSpecifiedData = _get(profileData, 'data');
|
|
7789
7631
|
userDataObj = setLoggedUserData(profileSpecifiedData);
|
|
7790
|
-
|
|
7632
|
+
_context10.next = 26;
|
|
7791
7633
|
break;
|
|
7792
7634
|
case 23:
|
|
7793
|
-
|
|
7794
|
-
|
|
7635
|
+
_context10.prev = 23;
|
|
7636
|
+
_context10.t0 = _context10["catch"](15);
|
|
7795
7637
|
// If profile fetch fails, use values from form
|
|
7796
7638
|
userDataObj = {
|
|
7797
7639
|
email: values.email,
|
|
@@ -7800,7 +7642,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7800
7642
|
phone: values.phone
|
|
7801
7643
|
};
|
|
7802
7644
|
case 26:
|
|
7803
|
-
|
|
7645
|
+
_context10.next = 29;
|
|
7804
7646
|
break;
|
|
7805
7647
|
case 28:
|
|
7806
7648
|
// For guest checkout, use form values
|
|
@@ -7826,11 +7668,11 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7826
7668
|
checkoutBody.attributes.add_on_data_capture = JSON.parse(storedAddOnDataCapture);
|
|
7827
7669
|
}
|
|
7828
7670
|
}
|
|
7829
|
-
|
|
7671
|
+
_context10.next = 35;
|
|
7830
7672
|
return postOnCheckout(checkoutBody, flagFreeTicket);
|
|
7831
7673
|
case 35:
|
|
7832
|
-
checkoutResponse =
|
|
7833
|
-
|
|
7674
|
+
checkoutResponse = _context10.sent;
|
|
7675
|
+
_context10.next = 38;
|
|
7834
7676
|
return updateCheckout({
|
|
7835
7677
|
attributes: {
|
|
7836
7678
|
event_id: eventId,
|
|
@@ -7839,12 +7681,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7839
7681
|
}
|
|
7840
7682
|
});
|
|
7841
7683
|
case 38:
|
|
7842
|
-
checkoutUpdateResponse =
|
|
7684
|
+
checkoutUpdateResponse = _context10.sent;
|
|
7843
7685
|
console.log('Stripe checkoutUpdateResponse in billing-info-container', checkoutUpdateResponse);
|
|
7844
7686
|
setCheckoutUpdateData(checkoutUpdateResponse.data.attributes);
|
|
7845
7687
|
paymentResponse = null;
|
|
7846
7688
|
if (!isSinglePageCheckout) {
|
|
7847
|
-
|
|
7689
|
+
_context10.next = 64;
|
|
7848
7690
|
break;
|
|
7849
7691
|
}
|
|
7850
7692
|
_checkoutResponse$dat = checkoutResponse.data.attributes, hash = _checkoutResponse$dat.hash, total = _checkoutResponse$dat.total;
|
|
@@ -7852,12 +7694,12 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7852
7694
|
hash: hash,
|
|
7853
7695
|
total: total
|
|
7854
7696
|
}));
|
|
7855
|
-
|
|
7697
|
+
_context10.next = 47;
|
|
7856
7698
|
return getPaymentData(String(hash));
|
|
7857
7699
|
case 47:
|
|
7858
|
-
paymentDataResponse =
|
|
7700
|
+
paymentDataResponse = _context10.sent;
|
|
7859
7701
|
if (!paymentDataResponse.success) {
|
|
7860
|
-
|
|
7702
|
+
_context10.next = 64;
|
|
7861
7703
|
break;
|
|
7862
7704
|
}
|
|
7863
7705
|
attributes = paymentDataResponse.data.attributes;
|
|
@@ -7883,47 +7725,42 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7883
7725
|
};
|
|
7884
7726
|
isFreeTickets = !Number(total) && !Number(updatedOrderData.total) || !Number((updatedOrderData == null ? void 0 : updatedOrderData.pay_now) || 0);
|
|
7885
7727
|
paymentMethod = attributes.payment_method || {};
|
|
7886
|
-
paymentPlanAvailable =
|
|
7728
|
+
paymentPlanAvailable = paymentMethod.stripe_payment_plan_enabled;
|
|
7887
7729
|
console.log({
|
|
7888
7730
|
paymentPlanAvailable: paymentPlanAvailable
|
|
7889
7731
|
});
|
|
7890
|
-
|
|
7891
|
-
|
|
7892
|
-
break;
|
|
7893
|
-
}
|
|
7894
|
-
return _context11.abrupt("return", (_paymentMethod$prefer = paymentMethod == null ? void 0 : paymentMethod.preference_id) != null ? _paymentMethod$prefer : null);
|
|
7895
|
-
case 61:
|
|
7896
|
-
_context11.next = 63;
|
|
7732
|
+
// Process payment using the hook
|
|
7733
|
+
_context10.next = 61;
|
|
7897
7734
|
return processPayment(paymentDataResponse, values, formikHelpers, checkoutResponse, checkoutUpdateResponse, {
|
|
7898
7735
|
attributes: attributes,
|
|
7899
7736
|
isFreeTickets: isFreeTickets,
|
|
7900
7737
|
updatedOrderData: updatedOrderData,
|
|
7901
7738
|
eventId: eventId
|
|
7902
7739
|
});
|
|
7903
|
-
case
|
|
7904
|
-
paymentResponse =
|
|
7740
|
+
case 61:
|
|
7741
|
+
paymentResponse = _context10.sent;
|
|
7905
7742
|
if (!(!paymentResponse && !isFreeTickets)) {
|
|
7906
|
-
|
|
7743
|
+
_context10.next = 64;
|
|
7907
7744
|
break;
|
|
7908
7745
|
}
|
|
7909
|
-
return
|
|
7910
|
-
case
|
|
7746
|
+
return _context10.abrupt("return");
|
|
7747
|
+
case 64:
|
|
7911
7748
|
removeReferralKey();
|
|
7912
7749
|
removeAdditionalConfigs();
|
|
7913
7750
|
handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse, paymentResponse);
|
|
7914
|
-
|
|
7751
|
+
_context10.next = 77;
|
|
7915
7752
|
break;
|
|
7916
|
-
case
|
|
7917
|
-
|
|
7918
|
-
|
|
7753
|
+
case 69:
|
|
7754
|
+
_context10.prev = 69;
|
|
7755
|
+
_context10.t1 = _context10["catch"](0);
|
|
7919
7756
|
setLoading(false);
|
|
7920
|
-
onSubmitError(
|
|
7921
|
-
hasUnverifiedOrder = _get(
|
|
7922
|
-
message = _get(
|
|
7757
|
+
onSubmitError(_context10.t1);
|
|
7758
|
+
hasUnverifiedOrder = _get(_context10.t1, 'response.data.data.hasUnverifiedOrder');
|
|
7759
|
+
message = _get(_context10.t1, 'response.data.message', {});
|
|
7923
7760
|
if (hasUnverifiedOrder && typeof message === 'string') {
|
|
7924
7761
|
setPendingVerificationMessage(message);
|
|
7925
|
-
} else if (axios.isAxiosError(
|
|
7926
|
-
if (((_e$response =
|
|
7762
|
+
} else if (axios.isAxiosError(_context10.t1)) {
|
|
7763
|
+
if (((_e$response = _context10.t1.response) == null ? void 0 : _e$response.status) === 401 || _get(_context10.t1, 'response.data.error') === 'invalid_token') {
|
|
7927
7764
|
if (isBrowser) {
|
|
7928
7765
|
window.localStorage.removeItem('user_data');
|
|
7929
7766
|
setUserExpired(true);
|
|
@@ -7939,19 +7776,19 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7939
7776
|
if (message && !hideErrorsAlertSection && typeof message === 'string') {
|
|
7940
7777
|
setError(message);
|
|
7941
7778
|
}
|
|
7942
|
-
onSubmitError(
|
|
7779
|
+
onSubmitError(_context10.t1);
|
|
7943
7780
|
}
|
|
7944
7781
|
// Keep form values intact - don't reset
|
|
7945
7782
|
formikHelpers.setSubmitting(false);
|
|
7946
|
-
case
|
|
7947
|
-
|
|
7783
|
+
case 77:
|
|
7784
|
+
_context10.prev = 77;
|
|
7948
7785
|
setLoading(false);
|
|
7949
|
-
return
|
|
7950
|
-
case
|
|
7786
|
+
return _context10.finish(77);
|
|
7787
|
+
case 80:
|
|
7951
7788
|
case "end":
|
|
7952
|
-
return
|
|
7789
|
+
return _context10.stop();
|
|
7953
7790
|
}
|
|
7954
|
-
},
|
|
7791
|
+
}, _callee10, null, [[0, 69, 77, 80], [15, 23]]);
|
|
7955
7792
|
}));
|
|
7956
7793
|
function onSubmit(_x3, _x4) {
|
|
7957
7794
|
return _onSubmit.apply(this, arguments);
|
|
@@ -7959,11 +7796,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
7959
7796
|
return onSubmit;
|
|
7960
7797
|
}()
|
|
7961
7798
|
}, function (props) {
|
|
7962
|
-
|
|
7963
|
-
formikHelpersRef.current = {
|
|
7964
|
-
setSubmitting: props.setSubmitting,
|
|
7965
|
-
submitForm: props.submitForm
|
|
7966
|
-
};
|
|
7799
|
+
var _checkoutUpdateData$a6, _checkoutUpdateData$a7, _checkoutUpdateData$a8, _checkoutUpdateData$a9;
|
|
7967
7800
|
return React__default.createElement(formik.Form, {
|
|
7968
7801
|
onSubmit: props.handleSubmit
|
|
7969
7802
|
}, React__default.createElement(ErrorFocus, null), React__default.createElement(LogicRunner, {
|
|
@@ -8065,7 +7898,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
8065
7898
|
className: element.className + " " + ((props == null ? void 0 : props.errors[element.name]) || '')
|
|
8066
7899
|
}, element.component ? typeof element.component === 'function' ? renderComponentWithProps(element.component, element.name === 'payment_info' ? {
|
|
8067
7900
|
reviewData: reviewData
|
|
8068
|
-
} : {}) : element.component : React__default.createElement(formik.
|
|
7901
|
+
} : {}) : element.component : React__default.createElement(formik.Field, Object.assign({}, element, {
|
|
8069
7902
|
type: element.type === 'radio' || element.type === 'checkbox' ? undefined : element.type,
|
|
8070
7903
|
setPhoneValidationIsLoading: element.type === 'phone' ? setPhoneValidationIsLoading : undefined,
|
|
8071
7904
|
fill: element.type === 'phone' ? true : undefined,
|
|
@@ -8125,7 +7958,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
8125
7958
|
return React__default.createElement("div", {
|
|
8126
7959
|
className: element.className,
|
|
8127
7960
|
key: element.name
|
|
8128
|
-
}, React__default.createElement(formik.
|
|
7961
|
+
}, React__default.createElement(formik.Field, Object.assign({}, element, {
|
|
8129
7962
|
type: element.type === 'radio' || element.type === 'checkbox' ? undefined : element.type,
|
|
8130
7963
|
name: element.name + "-" + index,
|
|
8131
7964
|
label: getFieldLabel(element, configs),
|
|
@@ -8140,12 +7973,24 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
8140
7973
|
}));
|
|
8141
7974
|
})), React__default.createElement("div", {
|
|
8142
7975
|
className: "payment-section"
|
|
8143
|
-
}, isSinglePageCheckout && !orderIsFree &&
|
|
8144
|
-
|
|
7976
|
+
}, isSinglePageCheckout && !orderIsFree && stripePublishableKey && React__default.createElement(PaymentContainer, {
|
|
7977
|
+
stripePublishableKey: stripePublishableKey,
|
|
7978
|
+
stripeAccountId: stripeAccountId,
|
|
8145
7979
|
formTitle: "Payment Information",
|
|
8146
7980
|
orderInfoLabel: "",
|
|
8147
7981
|
enableTimer: false,
|
|
8148
7982
|
checkoutData: checkoutData,
|
|
7983
|
+
elementsOptions: elementsOptions,
|
|
7984
|
+
paymentElementOptions: {
|
|
7985
|
+
wallets: {
|
|
7986
|
+
applePay: (checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a6 = checkoutUpdateData.additional_payment_information) == null ? void 0 : (_checkoutUpdateData$a7 = _checkoutUpdateData$a6.stripe_wallets) == null ? void 0 : _checkoutUpdateData$a7.applePay) || 'never',
|
|
7987
|
+
googlePay: (checkoutUpdateData == null ? void 0 : (_checkoutUpdateData$a8 = checkoutUpdateData.additional_payment_information) == null ? void 0 : (_checkoutUpdateData$a9 = _checkoutUpdateData$a8.stripe_wallets) == null ? void 0 : _checkoutUpdateData$a9.googlePay) || 'never'
|
|
7988
|
+
}
|
|
7989
|
+
},
|
|
7990
|
+
onStripeReady: function onStripeReady(stripe, elements) {
|
|
7991
|
+
stripeRef.current = stripe;
|
|
7992
|
+
elementsRef.current = elements;
|
|
7993
|
+
},
|
|
8149
7994
|
paymentFields: paymentProps.paymentFields || [],
|
|
8150
7995
|
onPaymentError: paymentProps.onPaymentError || _identity,
|
|
8151
7996
|
handlePayment: paymentProps.handlePayment || _identity,
|
|
@@ -8159,9 +8004,7 @@ var BillingInfoContainer = /*#__PURE__*/React__default.memo(function (_ref7) {
|
|
|
8159
8004
|
isSinglePageCheckout: true
|
|
8160
8005
|
}), paymentSectionAddon), React__default.createElement("div", {
|
|
8161
8006
|
className: "button-container"
|
|
8162
|
-
},
|
|
8163
|
-
onSubmit: handleWalletSubmit
|
|
8164
|
-
}), !isMercadoPagoPayment && React__default.createElement(Button, {
|
|
8007
|
+
}, React__default.createElement(Button, {
|
|
8165
8008
|
type: "submit",
|
|
8166
8009
|
variant: "contained",
|
|
8167
8010
|
className: "login-register-button",
|
|
@@ -10431,6 +10274,12 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
10431
10274
|
var ticketPriceWithFees = priceSymbol + " " + (+ticket.basePrice).toFixed(2);
|
|
10432
10275
|
var ticketOldPriceWithFees = priceSymbol + " " + (+ticket.oldBasePrice).toFixed(2);
|
|
10433
10276
|
var ticketOldPriceWithoutFees = priceSymbol + " " + (+ticket.oldCost).toFixed(2);
|
|
10277
|
+
var ticketFinalPrice = ticket.feeIncluded && !ticket.isForward ? +(ticket.x_face_value || ticket.basePrice) : ticket.feeIncluded ? +ticket.basePrice : +ticket.cost;
|
|
10278
|
+
var ticketFinalPriceFormatted = priceSymbol + " " + Math.round(ticketFinalPrice);
|
|
10279
|
+
var ticketOldFinalPrice = ticket.feeIncluded && !ticket.isForward ? +(ticket.x_face_value || ticket.basePrice) : ticket.feeIncluded ? +ticket.oldBasePrice : +ticket.oldCost;
|
|
10280
|
+
var ticketOldFinalPriceFormatted = priceSymbol + " " + Math.round(ticketOldFinalPrice);
|
|
10281
|
+
var ticketFeeAmount = (+ticket.basePrice - +ticket.cost).toFixed(2);
|
|
10282
|
+
var ticketBreakdown = !ticket.feeIncluded ? '(+ fees at checkout)' : !ticket.isForward ? null : parseFloat(ticketFeeAmount) > 0 ? "(" + priceSymbol + " " + (+ticket.cost).toFixed(2) + " + " + priceSymbol + " " + ticketFeeAmount + " fee)" : null;
|
|
10434
10283
|
var isSoldOut = ticket.sold_out || !(ticket.displayTicket || ticket.slotGroupId) || ticket.soldOut;
|
|
10435
10284
|
var ticketSelect = function ticketSelect(event) {
|
|
10436
10285
|
var value = event.target.value;
|
|
@@ -10441,8 +10290,8 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
10441
10290
|
ticketIsDiscounted = true;
|
|
10442
10291
|
}
|
|
10443
10292
|
var ticketIsFree = +ticket.price === 0;
|
|
10444
|
-
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10445
|
-
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10293
|
+
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN ? ticketOldFinalPriceFormatted : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10294
|
+
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN ? ticketFinalPriceFormatted : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10446
10295
|
var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr = arr[i - 1]) == null ? void 0 : _arr.groupName);
|
|
10447
10296
|
return React__default.createElement(React__default.Fragment, {
|
|
10448
10297
|
key: ticket.id || ticket.name
|
|
@@ -10485,7 +10334,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
10485
10334
|
className: isSoldOut ? 'sold-out' : ''
|
|
10486
10335
|
}, ticketPriceElem), !isSoldOut && !ticketIsFree && React__default.createElement("p", {
|
|
10487
10336
|
className: "fees"
|
|
10488
|
-
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)")), React__default.createElement("div", {
|
|
10337
|
+
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)", CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && ticketBreakdown)), React__default.createElement("div", {
|
|
10489
10338
|
className: "event-detail__tier-state",
|
|
10490
10339
|
style: {
|
|
10491
10340
|
minWidth: 55
|
|
@@ -10509,6 +10358,12 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
10509
10358
|
var ticketPriceWithFees = priceSymbol + " " + (+ticket.basePrice).toFixed(2);
|
|
10510
10359
|
var ticketOldPriceWithFees = priceSymbol + " " + (+ticket.oldBasePrice).toFixed(2);
|
|
10511
10360
|
var ticketOldPriceWithoutFees = priceSymbol + " " + (+ticket.oldCost).toFixed(2);
|
|
10361
|
+
var ticketFinalPrice = ticket.feeIncluded && !ticket.isForward ? +(ticket.x_face_value || ticket.basePrice) : ticket.feeIncluded ? +ticket.basePrice : +ticket.cost;
|
|
10362
|
+
var ticketFinalPriceFormatted = priceSymbol + " " + Math.round(ticketFinalPrice);
|
|
10363
|
+
var ticketOldFinalPrice = ticket.feeIncluded && !ticket.isForward ? +(ticket.x_face_value || ticket.basePrice) : ticket.feeIncluded ? +ticket.oldBasePrice : +ticket.oldCost;
|
|
10364
|
+
var ticketOldFinalPriceFormatted = priceSymbol + " " + Math.round(ticketOldFinalPrice);
|
|
10365
|
+
var ticketFeeAmount = (+ticket.basePrice - +ticket.cost).toFixed(2);
|
|
10366
|
+
var ticketBreakdown = !ticket.feeIncluded ? '(+ fees at checkout)' : !ticket.isForward ? null : parseFloat(ticketFeeAmount) > 0 ? "(" + priceSymbol + " " + (+ticket.cost).toFixed(2) + " + " + priceSymbol + " " + ticketFeeAmount + " fee)" : null;
|
|
10512
10367
|
var isSoldOut = ticket.sold_out || !(ticket.displayTicket || ticket.slotGroupId) || ticket.soldOut;
|
|
10513
10368
|
var ticketSelect = function ticketSelect(event) {
|
|
10514
10369
|
var value = event.target.value;
|
|
@@ -10519,8 +10374,8 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
10519
10374
|
ticketIsDiscounted = true;
|
|
10520
10375
|
}
|
|
10521
10376
|
var ticketIsFree = +ticket.price === 0;
|
|
10522
|
-
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10523
|
-
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10377
|
+
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN ? ticketOldFinalPriceFormatted : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10378
|
+
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN ? ticketFinalPriceFormatted : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10524
10379
|
var isNewGroupTicket = (ticket == null ? void 0 : ticket.groupName) !== ((_arr2 = arr[i - 1]) == null ? void 0 : _arr2.groupName);
|
|
10525
10380
|
return React__default.createElement(React__default.Fragment, {
|
|
10526
10381
|
key: ticket.id || ticket.name
|
|
@@ -10563,7 +10418,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
10563
10418
|
className: isSoldOut ? 'sold-out' : ''
|
|
10564
10419
|
}, ticketPriceElem), !isSoldOut && !ticketIsFree && React__default.createElement("p", {
|
|
10565
10420
|
className: "fees"
|
|
10566
|
-
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)"), ticket.depositPercent && React__default.createElement("p", {
|
|
10421
|
+
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)", CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && ticketBreakdown), ticket.depositPercent && React__default.createElement("p", {
|
|
10567
10422
|
className: "deposits"
|
|
10568
10423
|
}, ticket.depositPercent + '% DEPOSIT')), React__default.createElement("div", {
|
|
10569
10424
|
className: "event-detail__tier-state",
|
|
@@ -10621,13 +10476,19 @@ var TimeSlotTicketRow = function TimeSlotTicketRow(_ref) {
|
|
|
10621
10476
|
var ticketPriceWithFees = priceSymbol + " " + (+ticket.basePrice).toFixed(2);
|
|
10622
10477
|
var ticketOldPriceWithFees = priceSymbol + " " + (+ticket.oldBasePrice).toFixed(2);
|
|
10623
10478
|
var ticketOldPriceWithoutFees = priceSymbol + " " + (+ticket.oldCost).toFixed(2);
|
|
10479
|
+
var ticketFinalPrice = ticket.feeIncluded && !ticket.isForward ? +(ticket.x_face_value || ticket.basePrice) : ticket.feeIncluded ? +ticket.basePrice : +ticket.cost;
|
|
10480
|
+
var ticketFinalPriceFormatted = priceSymbol + " " + Math.round(ticketFinalPrice);
|
|
10481
|
+
var ticketOldFinalPrice = ticket.feeIncluded && !ticket.isForward ? +(ticket.x_face_value || ticket.basePrice) : ticket.feeIncluded ? +ticket.oldBasePrice : +ticket.oldCost;
|
|
10482
|
+
var ticketOldFinalPriceFormatted = priceSymbol + " " + Math.round(ticketOldFinalPrice);
|
|
10483
|
+
var ticketFeeAmount = (+ticket.basePrice - +ticket.cost).toFixed(2);
|
|
10484
|
+
var ticketBreakdown = !ticket.feeIncluded ? '(+ fees at checkout)' : !ticket.isForward ? null : parseFloat(ticketFeeAmount) > 0 ? "(" + priceSymbol + " " + (+ticket.cost).toFixed(2) + " + " + priceSymbol + " " + ticketFeeAmount + " fee)" : null;
|
|
10624
10485
|
var ticketIsDiscounted = false;
|
|
10625
10486
|
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
10626
10487
|
ticketIsDiscounted = true;
|
|
10627
10488
|
}
|
|
10628
10489
|
var ticketIsFree = +ticket.price === 0;
|
|
10629
|
-
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10630
|
-
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10490
|
+
var discountTicketPriceElem = CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN ? ticketOldFinalPriceFormatted : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketOldPriceWithoutFees : ticketOldPriceWithFees;
|
|
10491
|
+
var ticketPriceElem = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN ? ticketFinalPriceFormatted : CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH || !ticket.feeIncluded ? ticketPriceWithoutFees : ticketPriceWithFees;
|
|
10631
10492
|
var handleTimeChange = function handleTimeChange(event) {
|
|
10632
10493
|
var selectedTimeKey = event.target.value;
|
|
10633
10494
|
var selectedOption = availableTimeSlots.find(function (slot) {
|
|
@@ -10681,7 +10542,7 @@ var TimeSlotTicketRow = function TimeSlotTicketRow(_ref) {
|
|
|
10681
10542
|
className: isSoldOut ? 'sold-out' : ''
|
|
10682
10543
|
}, ticketPriceElem), !isSoldOut && !ticketIsFree && React__default.createElement("p", {
|
|
10683
10544
|
className: "fees"
|
|
10684
|
-
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)")), !isSoldOut && React__default.createElement("div", {
|
|
10545
|
+
}, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && (ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)'), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && "(" + ticketPriceWithFees + " with fees)", CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && ticketBreakdown)), !isSoldOut && React__default.createElement("div", {
|
|
10685
10546
|
className: "event-detail__tier-state time-slot-selectors-container"
|
|
10686
10547
|
}, React__default.createElement(Box, {
|
|
10687
10548
|
sx: {
|
|
@@ -15733,183 +15594,6 @@ var IDVerification = function IDVerification(props) {
|
|
|
15733
15594
|
})));
|
|
15734
15595
|
};
|
|
15735
15596
|
|
|
15736
|
-
var PaymentStatuses;
|
|
15737
|
-
(function (PaymentStatuses) {
|
|
15738
|
-
PaymentStatuses["INCOMPLETE"] = "incomplete";
|
|
15739
|
-
PaymentStatuses["COMPLETE"] = "complete";
|
|
15740
|
-
PaymentStatuses["PENDING"] = "pending";
|
|
15741
|
-
PaymentStatuses["CANCELLED"] = "cancelled";
|
|
15742
|
-
})(PaymentStatuses || (PaymentStatuses = {}));
|
|
15743
|
-
var ProcessRedirectContainer = function ProcessRedirectContainer(_ref) {
|
|
15744
|
-
var _ref$orderHash = _ref.orderHash,
|
|
15745
|
-
orderHashProp = _ref$orderHash === void 0 ? undefined : _ref$orderHash,
|
|
15746
|
-
_ref$onPaymentProcess = _ref.onPaymentProcessed,
|
|
15747
|
-
onPaymentProcessed = _ref$onPaymentProcess === void 0 ? _identity : _ref$onPaymentProcess,
|
|
15748
|
-
_ref$onProcessError = _ref.onProcessError,
|
|
15749
|
-
onProcessError = _ref$onProcessError === void 0 ? _identity : _ref$onProcessError,
|
|
15750
|
-
_ref$loadingMessage = _ref.loadingMessage,
|
|
15751
|
-
loadingMessage = _ref$loadingMessage === void 0 ? 'Processing your payment...' : _ref$loadingMessage,
|
|
15752
|
-
renderProcessing = _ref.renderProcessing,
|
|
15753
|
-
renderCompleted = _ref.renderCompleted;
|
|
15754
|
-
var _useState = React.useState(true),
|
|
15755
|
-
isProcessing = _useState[0],
|
|
15756
|
-
setIsProcessing = _useState[1];
|
|
15757
|
-
var _useState2 = React.useState(null),
|
|
15758
|
-
error = _useState2[0],
|
|
15759
|
-
setError = _useState2[1];
|
|
15760
|
-
var _useState3 = React.useState(null),
|
|
15761
|
-
completedData = _useState3[0],
|
|
15762
|
-
setCompletedData = _useState3[1];
|
|
15763
|
-
React.useEffect(function () {
|
|
15764
|
-
var processRedirect = /*#__PURE__*/function () {
|
|
15765
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
15766
|
-
var orderHash, pathParts, orderHashIndex, urlParams, params, paymentData, axiosError;
|
|
15767
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
15768
|
-
while (1) switch (_context.prev = _context.next) {
|
|
15769
|
-
case 0:
|
|
15770
|
-
if (isBrowser) {
|
|
15771
|
-
_context.next = 2;
|
|
15772
|
-
break;
|
|
15773
|
-
}
|
|
15774
|
-
return _context.abrupt("return");
|
|
15775
|
-
case 2:
|
|
15776
|
-
_context.prev = 2;
|
|
15777
|
-
// Extract order hash from URL path if not provided as prop
|
|
15778
|
-
// Expected URL format: /processing-payment/:order_hash
|
|
15779
|
-
orderHash = orderHashProp;
|
|
15780
|
-
if (!orderHash) {
|
|
15781
|
-
pathParts = window.location.pathname.split('/');
|
|
15782
|
-
orderHashIndex = pathParts.indexOf('processing-payment');
|
|
15783
|
-
if (orderHashIndex !== -1 && pathParts[orderHashIndex + 1]) {
|
|
15784
|
-
orderHash = pathParts[orderHashIndex + 1];
|
|
15785
|
-
}
|
|
15786
|
-
}
|
|
15787
|
-
if (orderHash) {
|
|
15788
|
-
_context.next = 7;
|
|
15789
|
-
break;
|
|
15790
|
-
}
|
|
15791
|
-
throw new Error('Order hash not found in URL or props');
|
|
15792
|
-
case 7:
|
|
15793
|
-
// Extract all query parameters from the URL
|
|
15794
|
-
urlParams = new URLSearchParams(window.location.search);
|
|
15795
|
-
params = {};
|
|
15796
|
-
urlParams.forEach(function (value, key) {
|
|
15797
|
-
params[key] = value;
|
|
15798
|
-
});
|
|
15799
|
-
// Call the processPayment API with orderHash and query params
|
|
15800
|
-
_context.next = 12;
|
|
15801
|
-
return processPayment(orderHash, params);
|
|
15802
|
-
case 12:
|
|
15803
|
-
paymentData = _context.sent;
|
|
15804
|
-
// Store completed data for rendering
|
|
15805
|
-
setCompletedData({
|
|
15806
|
-
status: paymentData.status,
|
|
15807
|
-
paymentData: paymentData,
|
|
15808
|
-
orderHash: orderHash
|
|
15809
|
-
});
|
|
15810
|
-
// Trigger the callback with payment status, data, and orderHash
|
|
15811
|
-
onPaymentProcessed(paymentData.status, paymentData, orderHash);
|
|
15812
|
-
_context.next = 22;
|
|
15813
|
-
break;
|
|
15814
|
-
case 17:
|
|
15815
|
-
_context.prev = 17;
|
|
15816
|
-
_context.t0 = _context["catch"](2);
|
|
15817
|
-
axiosError = _context.t0;
|
|
15818
|
-
setError(axiosError.message || 'Failed to process payment');
|
|
15819
|
-
onProcessError(axiosError);
|
|
15820
|
-
case 22:
|
|
15821
|
-
_context.prev = 22;
|
|
15822
|
-
setIsProcessing(false);
|
|
15823
|
-
return _context.finish(22);
|
|
15824
|
-
case 25:
|
|
15825
|
-
case "end":
|
|
15826
|
-
return _context.stop();
|
|
15827
|
-
}
|
|
15828
|
-
}, _callee, null, [[2, 17, 22, 25]]);
|
|
15829
|
-
}));
|
|
15830
|
-
return function processRedirect() {
|
|
15831
|
-
return _ref2.apply(this, arguments);
|
|
15832
|
-
};
|
|
15833
|
-
}();
|
|
15834
|
-
processRedirect();
|
|
15835
|
-
}, [orderHashProp, onPaymentProcessed, onProcessError]);
|
|
15836
|
-
if (error) {
|
|
15837
|
-
return React__default.createElement("div", {
|
|
15838
|
-
style: {
|
|
15839
|
-
padding: '20px',
|
|
15840
|
-
textAlign: 'center'
|
|
15841
|
-
}
|
|
15842
|
-
}, React__default.createElement("p", {
|
|
15843
|
-
style: {
|
|
15844
|
-
color: 'red'
|
|
15845
|
-
}
|
|
15846
|
-
}, "Error: ", error));
|
|
15847
|
-
}
|
|
15848
|
-
if (isProcessing) {
|
|
15849
|
-
// Use custom processing render if provided
|
|
15850
|
-
if (renderProcessing) {
|
|
15851
|
-
return React__default.createElement(React__default.Fragment, null, renderProcessing());
|
|
15852
|
-
}
|
|
15853
|
-
// Default processing UI
|
|
15854
|
-
return React__default.createElement("div", {
|
|
15855
|
-
style: {
|
|
15856
|
-
display: 'flex',
|
|
15857
|
-
flexDirection: 'column',
|
|
15858
|
-
alignItems: 'center',
|
|
15859
|
-
justifyContent: 'center',
|
|
15860
|
-
padding: '40px'
|
|
15861
|
-
}
|
|
15862
|
-
}, React__default.createElement(CircularProgress, null), loadingMessage && React__default.createElement("p", {
|
|
15863
|
-
style: {
|
|
15864
|
-
marginTop: '20px',
|
|
15865
|
-
fontSize: '16px'
|
|
15866
|
-
}
|
|
15867
|
-
}, loadingMessage));
|
|
15868
|
-
}
|
|
15869
|
-
// Payment processing completed
|
|
15870
|
-
if (completedData) {
|
|
15871
|
-
var _paymentData$mercadoP, _paymentData$mercadoP2, _statusMessages;
|
|
15872
|
-
var status = completedData.status,
|
|
15873
|
-
paymentData = completedData.paymentData,
|
|
15874
|
-
orderHash = completedData.orderHash;
|
|
15875
|
-
// Use custom completed render if provided
|
|
15876
|
-
if (renderCompleted) {
|
|
15877
|
-
var customContent = renderCompleted(status, paymentData, orderHash);
|
|
15878
|
-
if (customContent) {
|
|
15879
|
-
return React__default.createElement(React__default.Fragment, null, customContent);
|
|
15880
|
-
}
|
|
15881
|
-
}
|
|
15882
|
-
// Check if it's a Mercado Pago payment
|
|
15883
|
-
var isMercadoPago = paymentData.paymentType === PaymentType.MERCADO_PAGO_PRO;
|
|
15884
|
-
if (isMercadoPago && (_paymentData$mercadoP = paymentData.mercadoPagoInformation) != null && _paymentData$mercadoP.paymentId && (_paymentData$mercadoP2 = paymentData.mercadoPagoInformation) != null && _paymentData$mercadoP2.publicKey) {
|
|
15885
|
-
var _paymentData$mercadoP3;
|
|
15886
|
-
// Show StatusScreen for Mercado Pago payments
|
|
15887
|
-
sdkReact.initMercadoPago((_paymentData$mercadoP3 = paymentData.mercadoPagoInformation) == null ? void 0 : _paymentData$mercadoP3.publicKey);
|
|
15888
|
-
return React__default.createElement(sdkReact.StatusScreen, {
|
|
15889
|
-
initialization: {
|
|
15890
|
-
paymentId: paymentData.mercadoPagoInformation.paymentId
|
|
15891
|
-
}
|
|
15892
|
-
});
|
|
15893
|
-
}
|
|
15894
|
-
// Default: Show simple text with payment status
|
|
15895
|
-
var statusMessages = (_statusMessages = {}, _statusMessages[PaymentStatuses.COMPLETE] = 'Your payment has been completed successfully!', _statusMessages[PaymentStatuses.PENDING] = 'Your payment is being processed.', _statusMessages[PaymentStatuses.INCOMPLETE] = 'Your payment is incomplete. Please try again.', _statusMessages[PaymentStatuses.CANCELLED] = 'Your payment has been cancelled.', _statusMessages);
|
|
15896
|
-
var message = statusMessages[status] || "Payment status: " + status;
|
|
15897
|
-
return React__default.createElement("div", {
|
|
15898
|
-
style: {
|
|
15899
|
-
padding: '40px',
|
|
15900
|
-
textAlign: 'center'
|
|
15901
|
-
}
|
|
15902
|
-
}, React__default.createElement("h2", null, message), React__default.createElement("p", {
|
|
15903
|
-
style: {
|
|
15904
|
-
marginTop: '20px',
|
|
15905
|
-
fontSize: '14px',
|
|
15906
|
-
color: '#666'
|
|
15907
|
-
}
|
|
15908
|
-
}, "Order: ", orderHash));
|
|
15909
|
-
}
|
|
15910
|
-
return null;
|
|
15911
|
-
};
|
|
15912
|
-
|
|
15913
15597
|
var style$6 = {
|
|
15914
15598
|
position: 'absolute',
|
|
15915
15599
|
top: '10%',
|
|
@@ -16224,19 +15908,23 @@ var OrderDetails = function OrderDetails(_ref3) {
|
|
|
16224
15908
|
className: "add-on-container"
|
|
16225
15909
|
}, React__default.createElement("span", null, item.quantity), React__default.createElement("span", {
|
|
16226
15910
|
className: "add-on-x"
|
|
16227
|
-
}, ' x '), React__default.createElement("span", null, item.groupName ? item.groupName + ' - ' : ''), React__default.createElement("span", null, item.name), React__default.createElement("span", null, ' - '), React__default.createElement("span", null, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency) + ' (incl. fees)', CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency)), React__default.createElement("span", {
|
|
15911
|
+
}, ' x '), React__default.createElement("span", null, item.groupName ? item.groupName + ' - ' : ''), React__default.createElement("span", null, item.name), React__default.createElement("span", null, ' - '), React__default.createElement("span", null, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency) + ' (incl. fees)', CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency), CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency)), React__default.createElement("span", {
|
|
16228
15912
|
className: "add-on-each"
|
|
16229
15913
|
}, ' each')), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && React__default.createElement("p", {
|
|
16230
15914
|
className: "fees"
|
|
16231
|
-
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(String(item.price))), currency) + " with fees)"))
|
|
15915
|
+
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(String(item.price))), currency) + " with fees)"), CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && parseFloat(item.price) - parseFloat(item.cost) > 0 && React__default.createElement("p", {
|
|
15916
|
+
className: "fees"
|
|
15917
|
+
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency) + " + " + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price) - parseFloat(item.cost)), currency) + " fee)"));
|
|
16232
15918
|
};
|
|
16233
15919
|
var defaultTableRenderer = function defaultTableRenderer(item) {
|
|
16234
15920
|
return React__default.createElement("div", null, React__default.createElement("div", {
|
|
16235
15921
|
key: item.id,
|
|
16236
15922
|
className: "table-type-container"
|
|
16237
|
-
}, React__default.createElement("span", null, item.groupName ? item.groupName + ' - ' : ''), React__default.createElement("span", null, item.name), React__default.createElement("span", null, ' - '), React__default.createElement("span", null, "Guest Count", ': '), React__default.createElement("span", null, item.guestCount)), React__default.createElement("div", null, React__default.createElement("span", null, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency) + ' (incl. fees)', CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency)), React__default.createElement("br", null), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && React__default.createElement("p", {
|
|
15923
|
+
}, React__default.createElement("span", null, item.groupName ? item.groupName + ' - ' : ''), React__default.createElement("span", null, item.name), React__default.createElement("span", null, ' - '), React__default.createElement("span", null, "Guest Count", ': '), React__default.createElement("span", null, item.guestCount)), React__default.createElement("div", null, React__default.createElement("span", null, CONFIGS.FEES_STYLE === FEES_STYLES.TRADITIONAL && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency) + ' (incl. fees)', CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency), CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price)), currency)), React__default.createElement("br", null), CONFIGS.FEES_STYLE === FEES_STYLES.DISPLAY_BOTH && React__default.createElement("p", {
|
|
15924
|
+
className: "fees"
|
|
15925
|
+
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(String(item.price))), currency) + " with fees)"), CONFIGS.FEES_STYLE === FEES_STYLES.FINAL_WITH_BREAKDOWN && parseFloat(item.price) - parseFloat(item.cost) > 0 && React__default.createElement("p", {
|
|
16238
15926
|
className: "fees"
|
|
16239
|
-
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(
|
|
15927
|
+
}, "(" + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.cost)), currency) + " + " + currencyNormalizerCreator(createFixedFloatNormalizer(2)(parseFloat(item.price) - parseFloat(item.cost)), currency) + " fee)")));
|
|
16240
15928
|
};
|
|
16241
15929
|
return React__default.createElement("div", {
|
|
16242
15930
|
className: "payment_page payment_page_single"
|
|
@@ -16342,7 +16030,6 @@ exports.PoweredBy = PoweredBy;
|
|
|
16342
16030
|
exports.PreRegistration = PreRegistration;
|
|
16343
16031
|
exports.PreRegistrationComplete = PreRegistrationComplete;
|
|
16344
16032
|
exports.PreRegistrationInformations = PreRegistrationInformations;
|
|
16345
|
-
exports.ProcessRedirectContainer = ProcessRedirectContainer;
|
|
16346
16033
|
exports.RedirectModal = RedirectModal;
|
|
16347
16034
|
exports.ResetPasswordContainer = ResetPasswordContainer;
|
|
16348
16035
|
exports.RsvpContainer = RsvpContainer;
|