tf-checkout-react 1.7.20 → 1.7.30
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/index.d.ts +1 -0
- package/dist/components/addonsContainer/AddonComponent.d.ts +3 -1
- package/dist/components/addonsContainer/SimpleAddonsContainer.d.ts +3 -1
- package/dist/components/addonsContainer/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +133 -174
- 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 +133 -174
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/types/checkoutPageConfigs.d.ts +1 -0
- package/package.json +1 -1
- package/src/api/index.ts +1 -0
- package/src/components/addonsContainer/AddonComponent.tsx +20 -4
- package/src/components/addonsContainer/SimpleAddonsContainer.tsx +39 -5
- package/src/components/addonsContainer/index.tsx +1 -0
- package/src/components/billing-info-container/hooks/usePaymentRedirect.ts +0 -2
- package/src/components/billing-info-container/index.tsx +2 -16
- package/src/components/paymentContainer/index.tsx +1 -29
- package/src/components/registerForm/index.tsx +0 -1
- package/src/types/checkoutPageConfigs.ts +1 -0
|
@@ -1730,41 +1730,6 @@ var getConfirmationData = /*#__PURE__*/function () {
|
|
|
1730
1730
|
return _ref4.apply(this, arguments);
|
|
1731
1731
|
};
|
|
1732
1732
|
}();
|
|
1733
|
-
var getConditions = /*#__PURE__*/function () {
|
|
1734
|
-
var _ref5 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(eventId) {
|
|
1735
|
-
var response, adaptedData, returnData;
|
|
1736
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1737
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
1738
|
-
case 0:
|
|
1739
|
-
_context5.next = 2;
|
|
1740
|
-
return publicRequest.get("v1/event/" + eventId + "/conditions");
|
|
1741
|
-
case 2:
|
|
1742
|
-
response = _context5.sent;
|
|
1743
|
-
adaptedData = _map(response.data.data.attributes, function (item) {
|
|
1744
|
-
return {
|
|
1745
|
-
id: nanoid(),
|
|
1746
|
-
text: item,
|
|
1747
|
-
checked: false
|
|
1748
|
-
};
|
|
1749
|
-
});
|
|
1750
|
-
returnData = _extends({}, response, {
|
|
1751
|
-
data: _extends({}, response.data, {
|
|
1752
|
-
data: _extends({}, response.data.data, {
|
|
1753
|
-
attributes: adaptedData
|
|
1754
|
-
})
|
|
1755
|
-
})
|
|
1756
|
-
});
|
|
1757
|
-
return _context5.abrupt("return", returnData.data);
|
|
1758
|
-
case 6:
|
|
1759
|
-
case "end":
|
|
1760
|
-
return _context5.stop();
|
|
1761
|
-
}
|
|
1762
|
-
}, _callee5);
|
|
1763
|
-
}));
|
|
1764
|
-
return function getConditions(_x5) {
|
|
1765
|
-
return _ref5.apply(this, arguments);
|
|
1766
|
-
};
|
|
1767
|
-
}();
|
|
1768
1733
|
|
|
1769
1734
|
var resaleTicket = /*#__PURE__*/function () {
|
|
1770
1735
|
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data, hash) {
|
|
@@ -3605,21 +3570,35 @@ var AddonStepper = function AddonStepper(_ref) {
|
|
|
3605
3570
|
handleAddonChange = _ref.handleAddonChange,
|
|
3606
3571
|
classNamePrefix = _ref.classNamePrefix,
|
|
3607
3572
|
_ref$siblingIds = _ref.siblingIds,
|
|
3608
|
-
siblingIds = _ref$siblingIds === void 0 ? [] : _ref$siblingIds
|
|
3573
|
+
siblingIds = _ref$siblingIds === void 0 ? [] : _ref$siblingIds,
|
|
3574
|
+
_ref$allAddonIds = _ref.allAddonIds,
|
|
3575
|
+
allAddonIds = _ref$allAddonIds === void 0 ? [] : _ref$allAddonIds,
|
|
3576
|
+
maxTotalQuantity = _ref.maxTotalQuantity;
|
|
3609
3577
|
var _useFormikContext = useFormikContext(),
|
|
3610
3578
|
values = _useFormikContext.values,
|
|
3611
3579
|
setFieldValue = _useFormikContext.setFieldValue;
|
|
3612
3580
|
var qty = Number((_values$id = values[id]) != null ? _values$id : 0);
|
|
3613
3581
|
var max = (selectOptions == null ? void 0 : selectOptions.length) > 0 ? selectOptions[selectOptions.length - 1].value : 0;
|
|
3582
|
+
var totalSelected = allAddonIds.length > 0 ? allAddonIds.reduce(function (sum, aid) {
|
|
3583
|
+
var _values$aid;
|
|
3584
|
+
return sum + Number((_values$aid = values[aid]) != null ? _values$aid : 0);
|
|
3585
|
+
}, 0) : 0;
|
|
3614
3586
|
var change = function change(next) {
|
|
3615
|
-
if (next >
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3587
|
+
if (next > qty) {
|
|
3588
|
+
if (maxTotalQuantity != null) {
|
|
3589
|
+
allAddonIds.forEach(function (aid) {
|
|
3590
|
+
if (aid !== id) setFieldValue(aid, 0);
|
|
3591
|
+
});
|
|
3592
|
+
} else {
|
|
3593
|
+
siblingIds.forEach(function (siblingId) {
|
|
3594
|
+
return setFieldValue(siblingId, 0);
|
|
3595
|
+
});
|
|
3596
|
+
}
|
|
3619
3597
|
}
|
|
3620
3598
|
setFieldValue(id, next);
|
|
3621
3599
|
handleAddonChange(id, next);
|
|
3622
3600
|
};
|
|
3601
|
+
var incrementDisabled = qty >= max || maxTotalQuantity != null && totalSelected >= maxTotalQuantity && qty === 0;
|
|
3623
3602
|
return React.createElement("div", {
|
|
3624
3603
|
className: classNamePrefix + "_stepper"
|
|
3625
3604
|
}, React.createElement("button", {
|
|
@@ -3638,7 +3617,7 @@ var AddonStepper = function AddonStepper(_ref) {
|
|
|
3638
3617
|
onClick: function onClick() {
|
|
3639
3618
|
return change(qty + 1);
|
|
3640
3619
|
},
|
|
3641
|
-
disabled:
|
|
3620
|
+
disabled: incrementDisabled,
|
|
3642
3621
|
"aria-label": "Increase quantity"
|
|
3643
3622
|
}, "+"));
|
|
3644
3623
|
};
|
|
@@ -3657,6 +3636,9 @@ var AddonComponent = function AddonComponent(_ref2) {
|
|
|
3657
3636
|
useStepperQty = _ref2$useStepperQty === void 0 ? false : _ref2$useStepperQty,
|
|
3658
3637
|
_ref2$siblingIds = _ref2.siblingIds,
|
|
3659
3638
|
siblingIds = _ref2$siblingIds === void 0 ? [] : _ref2$siblingIds,
|
|
3639
|
+
_ref2$allAddonIds = _ref2.allAddonIds,
|
|
3640
|
+
allAddonIds = _ref2$allAddonIds === void 0 ? [] : _ref2$allAddonIds,
|
|
3641
|
+
maxTotalQuantity = _ref2.maxTotalQuantity,
|
|
3660
3642
|
_ref2$onCustomFieldCh = _ref2.onCustomFieldChange,
|
|
3661
3643
|
onCustomFieldChange = _ref2$onCustomFieldCh === void 0 ? _identity : _ref2$onCustomFieldCh;
|
|
3662
3644
|
var id = data.id,
|
|
@@ -3690,7 +3672,9 @@ var AddonComponent = function AddonComponent(_ref2) {
|
|
|
3690
3672
|
selectOptions: selectOptions,
|
|
3691
3673
|
handleAddonChange: handleAddonChange,
|
|
3692
3674
|
classNamePrefix: classNamePrefix,
|
|
3693
|
-
siblingIds: siblingIds
|
|
3675
|
+
siblingIds: siblingIds,
|
|
3676
|
+
allAddonIds: allAddonIds,
|
|
3677
|
+
maxTotalQuantity: maxTotalQuantity
|
|
3694
3678
|
})) : React.createElement(Field, {
|
|
3695
3679
|
name: id,
|
|
3696
3680
|
selectOptions: selectOptions,
|
|
@@ -4478,6 +4462,7 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4478
4462
|
eventId = _ref.eventId,
|
|
4479
4463
|
_ref$useStepperQty = _ref.useStepperQty,
|
|
4480
4464
|
useStepperQty = _ref$useStepperQty === void 0 ? false : _ref$useStepperQty,
|
|
4465
|
+
addonMaxQuantityGroups = _ref.addonMaxQuantityGroups,
|
|
4481
4466
|
_ref$onAddOnSelect = _ref.onAddOnSelect,
|
|
4482
4467
|
onAddOnSelect = _ref$onAddOnSelect === void 0 ? _identity : _ref$onAddOnSelect,
|
|
4483
4468
|
_ref$handleConfirm = _ref.handleConfirm,
|
|
@@ -4494,12 +4479,15 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4494
4479
|
var _useState4 = useState({}),
|
|
4495
4480
|
groupsWithInitialVariantsValues = _useState4[0],
|
|
4496
4481
|
setGroupsWithInitialVariantsValues = _useState4[1];
|
|
4497
|
-
var _useState5 = useState(
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
var _useState6 = useState(
|
|
4501
|
-
|
|
4502
|
-
|
|
4482
|
+
var _useState5 = useState({}),
|
|
4483
|
+
crossGroupSelections = _useState5[0],
|
|
4484
|
+
setCrossGroupSelections = _useState5[1];
|
|
4485
|
+
var _useState6 = useState(true),
|
|
4486
|
+
loading = _useState6[0],
|
|
4487
|
+
setLoading = _useState6[1];
|
|
4488
|
+
var _useState7 = useState(null),
|
|
4489
|
+
visibleDescription = _useState7[0],
|
|
4490
|
+
setVisibleDescription = _useState7[1];
|
|
4503
4491
|
var handleDescriptionToggle = function handleDescriptionToggle(ticketId) {
|
|
4504
4492
|
setVisibleDescription(function (current) {
|
|
4505
4493
|
return current === ticketId ? null : ticketId;
|
|
@@ -4628,6 +4616,37 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4628
4616
|
recreateGroupVariantsSelectOptions(currGroupId, updatedGroupsWithSelectedVariants[currGroupId]);
|
|
4629
4617
|
}
|
|
4630
4618
|
};
|
|
4619
|
+
// Cross-group cap: when addonMaxQuantityGroups is set, limits total selections
|
|
4620
|
+
// across ALL addon groups to that number by capping each stepper's max.
|
|
4621
|
+
var effectiveAddonsOptions = useMemo(function () {
|
|
4622
|
+
if (!addonMaxQuantityGroups) return addonsOptions;
|
|
4623
|
+
var totalSelected = Object.values(crossGroupSelections).reduce(function (sum, v) {
|
|
4624
|
+
return sum + Number(v);
|
|
4625
|
+
}, 0);
|
|
4626
|
+
var globalRemaining = addonMaxQuantityGroups - totalSelected;
|
|
4627
|
+
var result = {};
|
|
4628
|
+
var _loop = function _loop() {
|
|
4629
|
+
var opts = addonsOptions[id] || [];
|
|
4630
|
+
var sdkMax = opts.length ? opts[opts.length - 1].value : 0;
|
|
4631
|
+
var currSelected = Number(crossGroupSelections[id] || 0);
|
|
4632
|
+
var allowedMax = Math.max(0, Math.min(sdkMax, globalRemaining + currSelected));
|
|
4633
|
+
result[id] = opts.filter(function (opt) {
|
|
4634
|
+
return opt.value <= allowedMax;
|
|
4635
|
+
});
|
|
4636
|
+
};
|
|
4637
|
+
for (var id in addonsOptions) {
|
|
4638
|
+
_loop();
|
|
4639
|
+
}
|
|
4640
|
+
return result;
|
|
4641
|
+
}, [addonsOptions, crossGroupSelections, addonMaxQuantityGroups]);
|
|
4642
|
+
var handleCrossGroupChange = function handleCrossGroupChange(id, value) {
|
|
4643
|
+
if (addonMaxQuantityGroups) {
|
|
4644
|
+
setCrossGroupSelections(function (prev) {
|
|
4645
|
+
var _extends6;
|
|
4646
|
+
return _extends({}, prev, (_extends6 = {}, _extends6[id] = Number(value), _extends6));
|
|
4647
|
+
});
|
|
4648
|
+
}
|
|
4649
|
+
};
|
|
4631
4650
|
var initialValues = useMemo(function () {
|
|
4632
4651
|
var _addOnDataWithCustomF2;
|
|
4633
4652
|
var addOnsData = {};
|
|
@@ -4737,7 +4756,7 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4737
4756
|
React.createElement(AddonComponent, {
|
|
4738
4757
|
key: variant.id,
|
|
4739
4758
|
data: variant,
|
|
4740
|
-
selectOptions:
|
|
4759
|
+
selectOptions: effectiveAddonsOptions[variant.id],
|
|
4741
4760
|
classNamePrefix: classNamePrefix,
|
|
4742
4761
|
siblingIds: addon.variants.filter(function (v) {
|
|
4743
4762
|
return v.id !== variant.id;
|
|
@@ -4745,7 +4764,7 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4745
4764
|
return v.id;
|
|
4746
4765
|
}),
|
|
4747
4766
|
handleAddonChange: function handleAddonChange(id, value) {
|
|
4748
|
-
|
|
4767
|
+
handleCrossGroupChange(id, value);
|
|
4749
4768
|
onFieldChange(id, value, addon);
|
|
4750
4769
|
var fieldUpdates = collectAddonFieldUpdates(addon, values);
|
|
4751
4770
|
onAddOnSelect(id, value, addon, fieldUpdates);
|
|
@@ -4763,9 +4782,10 @@ var SimpleAddonsContainer = function SimpleAddonsContainer(_ref) {
|
|
|
4763
4782
|
React.createElement(AddonComponent, {
|
|
4764
4783
|
key: addon.id,
|
|
4765
4784
|
data: addon,
|
|
4766
|
-
selectOptions:
|
|
4785
|
+
selectOptions: effectiveAddonsOptions[addon.id],
|
|
4767
4786
|
classNamePrefix: classNamePrefix,
|
|
4768
4787
|
handleAddonChange: function handleAddonChange(id, value) {
|
|
4788
|
+
handleCrossGroupChange(id, value);
|
|
4769
4789
|
onFieldChange(id, value, addon);
|
|
4770
4790
|
var fieldUpdates = collectAddonFieldUpdates(addon, values);
|
|
4771
4791
|
onAddOnSelect(id, value, addon, fieldUpdates);
|
|
@@ -5880,24 +5900,21 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5880
5900
|
var _useState5 = useState(true),
|
|
5881
5901
|
paymentDataIsLoading = _useState5[0],
|
|
5882
5902
|
setPaymentDataIsLoading = _useState5[1];
|
|
5883
|
-
var _useState6 = useState(
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
var _useState7 = useState(
|
|
5887
|
-
|
|
5888
|
-
|
|
5903
|
+
var _useState6 = useState(''),
|
|
5904
|
+
currency = _useState6[0],
|
|
5905
|
+
setCurrency = _useState6[1];
|
|
5906
|
+
var _useState7 = useState(false),
|
|
5907
|
+
showPaymentPlanSection = _useState7[0],
|
|
5908
|
+
setShowPaymentPlanSection = _useState7[1];
|
|
5889
5909
|
var _useState8 = useState(false),
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
var _useState9 = useState(
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
var _useState10 = useState(
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
var _useState11 = useState(true),
|
|
5899
|
-
paymentPlanUseSavedCard = _useState11[0],
|
|
5900
|
-
setPaymentPlanUseSavedCard = _useState11[1];
|
|
5910
|
+
paymentPlanIsAvailable = _useState8[0],
|
|
5911
|
+
setPaymentPlanIsAvailable = _useState8[1];
|
|
5912
|
+
var _useState9 = useState(initialPaymentPlanConfiguration),
|
|
5913
|
+
paymentPlanConfig = _useState9[0],
|
|
5914
|
+
setPaymentPlanConfig = _useState9[1];
|
|
5915
|
+
var _useState10 = useState(true),
|
|
5916
|
+
paymentPlanUseSavedCard = _useState10[0],
|
|
5917
|
+
setPaymentPlanUseSavedCard = _useState10[1];
|
|
5901
5918
|
var showFormTitle = Boolean(formTitle);
|
|
5902
5919
|
var showErrorText = Boolean(errorText);
|
|
5903
5920
|
var eventId = getQueryVariable('event_id') || _get(reviewData, 'cart[0].product_id') || '';
|
|
@@ -5911,9 +5928,6 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5911
5928
|
page: 'review',
|
|
5912
5929
|
pageUrl: pageUrl
|
|
5913
5930
|
});
|
|
5914
|
-
console.log({
|
|
5915
|
-
conditions: conditions
|
|
5916
|
-
});
|
|
5917
5931
|
useEffect(function () {
|
|
5918
5932
|
var fetchPaymentData = /*#__PURE__*/function () {
|
|
5919
5933
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
@@ -5999,43 +6013,6 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
5999
6013
|
fetchPaymentData();
|
|
6000
6014
|
}
|
|
6001
6015
|
}, [orderData, hash, isSinglePageCheckout, onGetPaymentDataError, onGetPaymentDataSuccess]);
|
|
6002
|
-
//just once
|
|
6003
|
-
useEffect(function () {
|
|
6004
|
-
// fetch conditions data
|
|
6005
|
-
var fetchConditions = /*#__PURE__*/function () {
|
|
6006
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
6007
|
-
var conditionsResponse, conditionsInfo;
|
|
6008
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
6009
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
6010
|
-
case 0:
|
|
6011
|
-
if (!eventId) {
|
|
6012
|
-
_context2.next = 6;
|
|
6013
|
-
break;
|
|
6014
|
-
}
|
|
6015
|
-
_context2.next = 3;
|
|
6016
|
-
return getConditions(eventId);
|
|
6017
|
-
case 3:
|
|
6018
|
-
conditionsResponse = _context2.sent;
|
|
6019
|
-
conditionsInfo = conditionsResponse.data.attributes;
|
|
6020
|
-
setConditions(conditionsInfo ? conditionsInfo.map(function (item) {
|
|
6021
|
-
return {
|
|
6022
|
-
id: nanoid(),
|
|
6023
|
-
text: item.text,
|
|
6024
|
-
checked: false
|
|
6025
|
-
};
|
|
6026
|
-
}) : []);
|
|
6027
|
-
case 6:
|
|
6028
|
-
case "end":
|
|
6029
|
-
return _context2.stop();
|
|
6030
|
-
}
|
|
6031
|
-
}, _callee2);
|
|
6032
|
-
}));
|
|
6033
|
-
return function fetchConditions() {
|
|
6034
|
-
return _ref4.apply(this, arguments);
|
|
6035
|
-
};
|
|
6036
|
-
}();
|
|
6037
|
-
fetchConditions();
|
|
6038
|
-
}, [eventId]);
|
|
6039
6016
|
var showPaymentForm = function showPaymentForm() {
|
|
6040
6017
|
var _paymentPlanConfig$sa;
|
|
6041
6018
|
if (hidePaymentForm) {
|
|
@@ -6092,10 +6069,6 @@ var PaymentContainer = function PaymentContainer(_ref2) {
|
|
|
6092
6069
|
var isTable = orderData == null ? void 0 : orderData.guest_count;
|
|
6093
6070
|
useEffect(function () {
|
|
6094
6071
|
var paymentMethod = reviewData.payment_method || {};
|
|
6095
|
-
console.log({
|
|
6096
|
-
paymentMethod: paymentMethod,
|
|
6097
|
-
enablePaymentPlan: enablePaymentPlan
|
|
6098
|
-
});
|
|
6099
6072
|
var paymentPlanAvailable = paymentMethod.stripe_payment_plan_enabled && enablePaymentPlan;
|
|
6100
6073
|
setPaymentPlanIsAvailable(paymentPlanAvailable);
|
|
6101
6074
|
if (paymentPlanAvailable) {
|
|
@@ -6458,38 +6431,36 @@ var usePaymentRedirect = function usePaymentRedirect(_ref) {
|
|
|
6458
6431
|
isPaymentReturn = urlParams.get('payment_return');
|
|
6459
6432
|
clientSecret = urlParams.get('payment_intent_client_secret');
|
|
6460
6433
|
if (!(isPaymentReturn && clientSecret && stripeRef.current)) {
|
|
6461
|
-
_context.next =
|
|
6434
|
+
_context.next = 39;
|
|
6462
6435
|
break;
|
|
6463
6436
|
}
|
|
6464
|
-
console.log('Detected payment redirect return, checking status');
|
|
6465
6437
|
setLoading(true);
|
|
6466
|
-
_context.prev =
|
|
6438
|
+
_context.prev = 5;
|
|
6467
6439
|
// Get stored payment context
|
|
6468
6440
|
storedContext = localStorage.getItem('stripe_payment_context');
|
|
6469
6441
|
if (storedContext) {
|
|
6470
|
-
_context.next =
|
|
6442
|
+
_context.next = 11;
|
|
6471
6443
|
break;
|
|
6472
6444
|
}
|
|
6473
6445
|
setError('Payment context not found');
|
|
6474
6446
|
setLoading(false);
|
|
6475
6447
|
return _context.abrupt("return");
|
|
6476
|
-
case
|
|
6448
|
+
case 11:
|
|
6477
6449
|
paymentContext = JSON.parse(storedContext);
|
|
6478
|
-
_context.next =
|
|
6450
|
+
_context.next = 14;
|
|
6479
6451
|
return stripeRef.current.retrievePaymentIntent(clientSecret);
|
|
6480
|
-
case
|
|
6452
|
+
case 14:
|
|
6481
6453
|
_yield$stripeRef$curr = _context.sent;
|
|
6482
6454
|
paymentIntent = _yield$stripeRef$curr.paymentIntent;
|
|
6483
6455
|
if (!((paymentIntent == null ? void 0 : paymentIntent.status) === 'succeeded')) {
|
|
6484
|
-
_context.next =
|
|
6456
|
+
_context.next = 27;
|
|
6485
6457
|
break;
|
|
6486
6458
|
}
|
|
6487
|
-
console.log('Payment succeeded after redirect, continuing flow');
|
|
6488
6459
|
// Clean up stored context
|
|
6489
6460
|
localStorage.removeItem('stripe_payment_context');
|
|
6490
6461
|
// Continue with the success flow using stored context
|
|
6491
6462
|
paymentResponse = null;
|
|
6492
|
-
_context.next =
|
|
6463
|
+
_context.next = 21;
|
|
6493
6464
|
return handlePaymentMiddleWare(null, {}, {
|
|
6494
6465
|
reviewData: paymentContext.attributes,
|
|
6495
6466
|
isFreeTickets: paymentContext.isFreeTickets,
|
|
@@ -6507,16 +6478,16 @@ var usePaymentRedirect = function usePaymentRedirect(_ref) {
|
|
|
6507
6478
|
throw error;
|
|
6508
6479
|
}
|
|
6509
6480
|
});
|
|
6510
|
-
case
|
|
6481
|
+
case 21:
|
|
6511
6482
|
// Complete the flow with cleanup and handleSubmit
|
|
6512
6483
|
removeReferralKey();
|
|
6513
6484
|
removeAdditionalConfigs();
|
|
6514
6485
|
handleSubmit(paymentContext.values, paymentContext.formikHelpers, paymentContext.eventId, paymentContext.checkoutResponse, paymentContext.checkoutUpdateResponse, paymentResponse);
|
|
6515
6486
|
// Clean URL parameters
|
|
6516
6487
|
window.history.replaceState({}, document.title, window.location.pathname);
|
|
6517
|
-
_context.next =
|
|
6488
|
+
_context.next = 28;
|
|
6518
6489
|
break;
|
|
6519
|
-
case
|
|
6490
|
+
case 27:
|
|
6520
6491
|
if ((paymentIntent == null ? void 0 : paymentIntent.status) === 'requires_action') {
|
|
6521
6492
|
setError('Payment requires additional action');
|
|
6522
6493
|
// Clean up stored context and URL to prevent infinite loop
|
|
@@ -6528,26 +6499,26 @@ var usePaymentRedirect = function usePaymentRedirect(_ref) {
|
|
|
6528
6499
|
localStorage.removeItem('stripe_payment_context');
|
|
6529
6500
|
window.history.replaceState({}, document.title, window.location.pathname);
|
|
6530
6501
|
}
|
|
6531
|
-
case
|
|
6532
|
-
_context.next =
|
|
6502
|
+
case 28:
|
|
6503
|
+
_context.next = 36;
|
|
6533
6504
|
break;
|
|
6534
|
-
case
|
|
6535
|
-
_context.prev =
|
|
6536
|
-
_context.t0 = _context["catch"](
|
|
6505
|
+
case 30:
|
|
6506
|
+
_context.prev = 30;
|
|
6507
|
+
_context.t0 = _context["catch"](5);
|
|
6537
6508
|
console.error('Error handling payment return:', _context.t0);
|
|
6538
6509
|
setError('Error processing payment return');
|
|
6539
6510
|
// Clean up stored context and URL to prevent infinite loop
|
|
6540
6511
|
localStorage.removeItem('stripe_payment_context');
|
|
6541
6512
|
window.history.replaceState({}, document.title, window.location.pathname);
|
|
6542
|
-
case
|
|
6543
|
-
_context.prev =
|
|
6513
|
+
case 36:
|
|
6514
|
+
_context.prev = 36;
|
|
6544
6515
|
setLoading(false);
|
|
6545
|
-
return _context.finish(
|
|
6546
|
-
case
|
|
6516
|
+
return _context.finish(36);
|
|
6517
|
+
case 39:
|
|
6547
6518
|
case "end":
|
|
6548
6519
|
return _context.stop();
|
|
6549
6520
|
}
|
|
6550
|
-
}, _callee, null, [[
|
|
6521
|
+
}, _callee, null, [[5, 30, 36, 39]]);
|
|
6551
6522
|
}));
|
|
6552
6523
|
return function handlePaymentReturn() {
|
|
6553
6524
|
return _ref2.apply(this, arguments);
|
|
@@ -6883,7 +6854,7 @@ var EmailExistenceChecker = function EmailExistenceChecker(_ref4) {
|
|
|
6883
6854
|
return null;
|
|
6884
6855
|
};
|
|
6885
6856
|
var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
6886
|
-
var _reviewData$payment_m, _checkoutUpdateData$a, _checkoutUpdateData$a2, _reviewData$payment_m2, _checkoutUpdateData$a3, _checkoutUpdateData$a4, _checkoutUpdateData$a5;
|
|
6857
|
+
var _configs$addon_max_qu, _reviewData$payment_m, _checkoutUpdateData$a, _checkoutUpdateData$a2, _reviewData$payment_m2, _checkoutUpdateData$a3, _checkoutUpdateData$a4, _checkoutUpdateData$a5;
|
|
6887
6858
|
var _ref6$data = _ref6.data,
|
|
6888
6859
|
data = _ref6$data === void 0 ? [] : _ref6$data,
|
|
6889
6860
|
_ref6$ticketHoldersFi = _ref6.ticketHoldersFields,
|
|
@@ -7119,6 +7090,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7119
7090
|
var collectMandatoryBusinessCategory = configs == null ? void 0 : configs.collect_mandatory_business_category;
|
|
7120
7091
|
var collectOptionalBusinessCategory = configs == null ? void 0 : configs.collect_optional_business_category;
|
|
7121
7092
|
var eventHasAddons = configs == null ? void 0 : configs.has_add_on;
|
|
7093
|
+
var addonMaxQuantityGroups = (_configs$addon_max_qu = configs == null ? void 0 : configs.addon_max_quantity_groups) != null ? _configs$addon_max_qu : undefined;
|
|
7122
7094
|
var hideBusinessCategoryField = !collectMandatoryBusinessCategory && !collectOptionalBusinessCategory;
|
|
7123
7095
|
var _useState21 = useState(),
|
|
7124
7096
|
pendingVerificationMessage = _useState21[0],
|
|
@@ -7329,7 +7301,6 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7329
7301
|
});
|
|
7330
7302
|
case 5:
|
|
7331
7303
|
checkoutUpdateResponse = _context6.sent;
|
|
7332
|
-
console.log('Stripe in [useEffect] fetchCheckoutUpdate', checkoutUpdateResponse);
|
|
7333
7304
|
if (checkoutUpdateResponse.success) {
|
|
7334
7305
|
checkoutAttributes = checkoutUpdateResponse.data.attributes;
|
|
7335
7306
|
cartPriceBreakdown = _get(checkoutAttributes, 'cart_price_breakdown', {});
|
|
@@ -7337,23 +7308,22 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7337
7308
|
hash: '',
|
|
7338
7309
|
total: _get(cartPriceBreakdown, 'total', 0)
|
|
7339
7310
|
}));
|
|
7340
|
-
console.log('Stripe in [useEffect] fetchCheckoutUpdate | checkoutAttributes', checkoutAttributes);
|
|
7341
7311
|
setCheckoutUpdateData(checkoutAttributes);
|
|
7342
7312
|
onCheckoutUpdateSuccess(_extends({
|
|
7343
7313
|
expires_at: expirationTime
|
|
7344
7314
|
}, cartPriceBreakdown));
|
|
7345
7315
|
}
|
|
7346
|
-
_context6.next =
|
|
7316
|
+
_context6.next = 12;
|
|
7347
7317
|
break;
|
|
7348
|
-
case
|
|
7349
|
-
_context6.prev =
|
|
7318
|
+
case 9:
|
|
7319
|
+
_context6.prev = 9;
|
|
7350
7320
|
_context6.t0 = _context6["catch"](2);
|
|
7351
7321
|
console.error('Failed to fetch checkout update:', _context6.t0);
|
|
7352
|
-
case
|
|
7322
|
+
case 12:
|
|
7353
7323
|
case "end":
|
|
7354
7324
|
return _context6.stop();
|
|
7355
7325
|
}
|
|
7356
|
-
}, _callee6, null, [[2,
|
|
7326
|
+
}, _callee6, null, [[2, 9]]);
|
|
7357
7327
|
}));
|
|
7358
7328
|
return function fetchCheckoutUpdate() {
|
|
7359
7329
|
return _ref10.apply(this, arguments);
|
|
@@ -7599,9 +7569,6 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7599
7569
|
return _ref12.apply(this, arguments);
|
|
7600
7570
|
};
|
|
7601
7571
|
}(), [eventId, isSinglePageCheckout, onCheckoutUpdateError, onCheckoutUpdateSuccess]);
|
|
7602
|
-
console.log({
|
|
7603
|
-
checkoutData: checkoutData
|
|
7604
|
-
});
|
|
7605
7572
|
var handleAddOnSelect = useCallback( /*#__PURE__*/function () {
|
|
7606
7573
|
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(selectedAddOns) {
|
|
7607
7574
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
@@ -7701,7 +7668,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7701
7668
|
enableReinitialize: false,
|
|
7702
7669
|
onSubmit: function () {
|
|
7703
7670
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(values, formikHelpers) {
|
|
7704
|
-
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,
|
|
7671
|
+
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, hasUnverifiedOrder, message, _e$response, event;
|
|
7705
7672
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
7706
7673
|
while (1) switch (_context10.prev = _context10.next) {
|
|
7707
7674
|
case 0:
|
|
@@ -7812,11 +7779,10 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7812
7779
|
});
|
|
7813
7780
|
case 38:
|
|
7814
7781
|
checkoutUpdateResponse = _context10.sent;
|
|
7815
|
-
console.log('Stripe checkoutUpdateResponse in billing-info-container', checkoutUpdateResponse);
|
|
7816
7782
|
setCheckoutUpdateData(checkoutUpdateResponse.data.attributes);
|
|
7817
7783
|
paymentResponse = null;
|
|
7818
7784
|
if (!isSinglePageCheckout) {
|
|
7819
|
-
_context10.next =
|
|
7785
|
+
_context10.next = 59;
|
|
7820
7786
|
break;
|
|
7821
7787
|
}
|
|
7822
7788
|
_checkoutResponse$dat = checkoutResponse.data.attributes, hash = _checkoutResponse$dat.hash, total = _checkoutResponse$dat.total;
|
|
@@ -7824,16 +7790,15 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7824
7790
|
hash: hash,
|
|
7825
7791
|
total: total
|
|
7826
7792
|
}));
|
|
7827
|
-
_context10.next =
|
|
7793
|
+
_context10.next = 46;
|
|
7828
7794
|
return getPaymentData(String(hash));
|
|
7829
|
-
case
|
|
7795
|
+
case 46:
|
|
7830
7796
|
paymentDataResponse = _context10.sent;
|
|
7831
7797
|
if (!paymentDataResponse.success) {
|
|
7832
|
-
_context10.next =
|
|
7798
|
+
_context10.next = 59;
|
|
7833
7799
|
break;
|
|
7834
7800
|
}
|
|
7835
7801
|
attributes = paymentDataResponse.data.attributes;
|
|
7836
|
-
console.log('Stripe confirmPayment success in billing-info-container');
|
|
7837
7802
|
setReviewData(attributes);
|
|
7838
7803
|
order_details = attributes.order_details, cart = attributes.cart;
|
|
7839
7804
|
_order_details$ticket = order_details.tickets, ticket = _order_details$ticket[0];
|
|
@@ -7853,35 +7818,29 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7853
7818
|
debt: (order_details == null ? void 0 : order_details.debt) || null,
|
|
7854
7819
|
cost: ticket == null ? void 0 : ticket.cost
|
|
7855
7820
|
};
|
|
7856
|
-
isFreeTickets = !Number(total) && !Number(updatedOrderData.total) || !Number((updatedOrderData == null ? void 0 : updatedOrderData.pay_now) || 0);
|
|
7857
|
-
|
|
7858
|
-
paymentPlanAvailable = paymentMethod.stripe_payment_plan_enabled;
|
|
7859
|
-
console.log({
|
|
7860
|
-
paymentPlanAvailable: paymentPlanAvailable
|
|
7861
|
-
});
|
|
7862
|
-
// Process payment using the hook
|
|
7863
|
-
_context10.next = 61;
|
|
7821
|
+
isFreeTickets = !Number(total) && !Number(updatedOrderData.total) || !Number((updatedOrderData == null ? void 0 : updatedOrderData.pay_now) || 0); // Process payment using the hook
|
|
7822
|
+
_context10.next = 56;
|
|
7864
7823
|
return processPayment(paymentDataResponse, values, formikHelpers, checkoutResponse, checkoutUpdateResponse, {
|
|
7865
7824
|
attributes: attributes,
|
|
7866
7825
|
isFreeTickets: isFreeTickets,
|
|
7867
7826
|
updatedOrderData: updatedOrderData,
|
|
7868
7827
|
eventId: eventId
|
|
7869
7828
|
});
|
|
7870
|
-
case
|
|
7829
|
+
case 56:
|
|
7871
7830
|
paymentResponse = _context10.sent;
|
|
7872
7831
|
if (!(!paymentResponse && !isFreeTickets)) {
|
|
7873
|
-
_context10.next =
|
|
7832
|
+
_context10.next = 59;
|
|
7874
7833
|
break;
|
|
7875
7834
|
}
|
|
7876
7835
|
return _context10.abrupt("return");
|
|
7877
|
-
case
|
|
7836
|
+
case 59:
|
|
7878
7837
|
removeReferralKey();
|
|
7879
7838
|
removeAdditionalConfigs();
|
|
7880
7839
|
handleSubmit(values, formikHelpers, eventId, checkoutResponse, checkoutUpdateResponse, paymentResponse);
|
|
7881
|
-
_context10.next =
|
|
7840
|
+
_context10.next = 72;
|
|
7882
7841
|
break;
|
|
7883
|
-
case
|
|
7884
|
-
_context10.prev =
|
|
7842
|
+
case 64:
|
|
7843
|
+
_context10.prev = 64;
|
|
7885
7844
|
_context10.t1 = _context10["catch"](0);
|
|
7886
7845
|
setLoading(false);
|
|
7887
7846
|
onSubmitError(_context10.t1);
|
|
@@ -7910,15 +7869,15 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7910
7869
|
}
|
|
7911
7870
|
// Keep form values intact - don't reset
|
|
7912
7871
|
formikHelpers.setSubmitting(false);
|
|
7913
|
-
case
|
|
7914
|
-
_context10.prev =
|
|
7872
|
+
case 72:
|
|
7873
|
+
_context10.prev = 72;
|
|
7915
7874
|
setLoading(false);
|
|
7916
|
-
return _context10.finish(
|
|
7917
|
-
case
|
|
7875
|
+
return _context10.finish(72);
|
|
7876
|
+
case 75:
|
|
7918
7877
|
case "end":
|
|
7919
7878
|
return _context10.stop();
|
|
7920
7879
|
}
|
|
7921
|
-
}, _callee10, null, [[0,
|
|
7880
|
+
}, _callee10, null, [[0, 64, 72, 75], [15, 23]]);
|
|
7922
7881
|
}));
|
|
7923
7882
|
function onSubmit(_x3, _x4) {
|
|
7924
7883
|
return _onSubmit.apply(this, arguments);
|
|
@@ -7981,7 +7940,8 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref6) {
|
|
|
7981
7940
|
eventId: eventId,
|
|
7982
7941
|
addOnDataWithCustomFields: addOnDataWithCustomFields,
|
|
7983
7942
|
configs: configs,
|
|
7984
|
-
onAddOnSelect: onAddOnSelect
|
|
7943
|
+
onAddOnSelect: onAddOnSelect,
|
|
7944
|
+
addonMaxQuantityGroups: addonMaxQuantityGroups
|
|
7985
7945
|
})) : !addOnsIncludedOnInvitation && includeAddons && !isSinglePageCheckout ? React.createElement(AddonsContainter, Object.assign({}, addonsProps != null ? addonsProps : {}, {
|
|
7986
7946
|
addOnDataWithCustomFields: addOnDataWithCustomFields,
|
|
7987
7947
|
configs: configs,
|
|
@@ -13931,7 +13891,6 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
13931
13891
|
_context3.prev = 25;
|
|
13932
13892
|
_context3.t0 = _context3["catch"](1);
|
|
13933
13893
|
if (axios.isAxiosError(_context3.t0)) {
|
|
13934
|
-
console.log(_context3.t0);
|
|
13935
13894
|
_errorMessage3 = _get(_context3.t0, 'response.data.message') || 'Error';
|
|
13936
13895
|
onRegisterAccountError(_context3.t0);
|
|
13937
13896
|
setshowErrorModal(true);
|