tf-checkout-react 1.0.46 → 1.0.50
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/billing-info-container/index.d.ts +1 -1
- package/dist/components/common/CheckboxField.d.ts +2 -2
- package/dist/components/common/CustomField.d.ts +2 -1
- package/dist/components/paymentContainer/index.d.ts +1 -1
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.css +2 -2
- package/dist/tf-checkout-react.cjs.development.js +268 -181
- 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 +270 -183
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/types/billing-info-data.d.ts +2 -2
- package/dist/utils/getQueryVariable.d.ts +1 -0
- package/package.json +2 -1
- package/src/api/index.ts +2 -0
- package/src/components/billing-info-container/index.tsx +128 -131
- package/src/components/common/CheckboxField.tsx +7 -2
- package/src/components/common/CustomField.tsx +17 -7
- package/src/components/paymentContainer/index.tsx +31 -3
- package/src/components/paymentContainer/style.css +8 -0
- package/src/components/stripePayment/index.tsx +48 -19
- package/src/components/stripePayment/style.css +6 -0
- package/src/components/ticketsContainer/index.tsx +2 -0
- package/src/components/waitingList/index.tsx +34 -24
- package/src/types/billing-info-data.ts +2 -2
- package/src/utils/getQueryVariable.ts +13 -0
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
|
@@ -16,6 +16,7 @@ import { makeStyles } from '@mui/styles';
|
|
|
16
16
|
import FormGroup from '@mui/material/FormGroup';
|
|
17
17
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
18
18
|
import Checkbox from '@mui/material/Checkbox';
|
|
19
|
+
import { nanoid } from 'nanoid';
|
|
19
20
|
import Container from '@mui/material/Container';
|
|
20
21
|
import Alert from '@mui/material/Alert';
|
|
21
22
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
@@ -1097,6 +1098,9 @@ var getStates = function getStates(countryId) {
|
|
|
1097
1098
|
var addToWaitingList = function addToWaitingList(id, data) {
|
|
1098
1099
|
return publicRequest.post("/v1/event/" + id + "/add_to_waiting_list", data);
|
|
1099
1100
|
};
|
|
1101
|
+
var getConditions = function getConditions(eventId) {
|
|
1102
|
+
return publicRequest.get("v1/event/" + eventId + "/conditions");
|
|
1103
|
+
};
|
|
1100
1104
|
|
|
1101
1105
|
var css_248z$1 = ".style_modal-title__2sUq_{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.style_login-modal-body__2sFg5{padding:15px 25px}.style_login-modal-body__2sFg5 input{background:#fff!important}.style_login-modal-body__email__2nnEH,.style_login-modal-body__password__qS3g7{margin-bottom:20px}.style_login-action-button__1g9qt button{background-color:#212529;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:26px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.style_login-action-button__1g9qt button:hover{background-color:#505050;border-color:#505050}.style_server_auth__error__1340S{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.style_info-text-for-login__28JQf{font-size:14px;margin-bottom:4px;padding-left:10px}";
|
|
1102
1106
|
styleInject(css_248z$1);
|
|
@@ -1638,8 +1642,8 @@ var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, va
|
|
|
1638
1642
|
|
|
1639
1643
|
var useStyles = /*#__PURE__*/makeStyles({
|
|
1640
1644
|
input: {
|
|
1641
|
-
|
|
1642
|
-
color:
|
|
1645
|
+
'&::placeholder': {
|
|
1646
|
+
color: 'gray'
|
|
1643
1647
|
}
|
|
1644
1648
|
}
|
|
1645
1649
|
});
|
|
@@ -1652,7 +1656,8 @@ var CustomField = function CustomField(_ref) {
|
|
|
1652
1656
|
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1653
1657
|
_ref$form = _ref.form,
|
|
1654
1658
|
touched = _ref$form.touched,
|
|
1655
|
-
errors = _ref$form.errors
|
|
1659
|
+
errors = _ref$form.errors,
|
|
1660
|
+
theme = _ref.theme;
|
|
1656
1661
|
var isSelectField = type === 'select';
|
|
1657
1662
|
var isShrink = Boolean(field.value) || type === 'date' || type === 'select';
|
|
1658
1663
|
var isTouched = Boolean(_get(touched, field.name));
|
|
@@ -1677,7 +1682,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1677
1682
|
}
|
|
1678
1683
|
},
|
|
1679
1684
|
SelectProps: {
|
|
1680
|
-
"native": true
|
|
1685
|
+
"native": true,
|
|
1686
|
+
className: theme,
|
|
1687
|
+
MenuProps: {
|
|
1688
|
+
className: theme
|
|
1689
|
+
}
|
|
1681
1690
|
}
|
|
1682
1691
|
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1683
1692
|
return React.createElement("option", {
|
|
@@ -1688,7 +1697,7 @@ var CustomField = function CustomField(_ref) {
|
|
|
1688
1697
|
}) : null);
|
|
1689
1698
|
};
|
|
1690
1699
|
|
|
1691
|
-
var _excluded$1 = ["label", "field"];
|
|
1700
|
+
var _excluded$1 = ["label", "field", "selectOptions", "theme"];
|
|
1692
1701
|
var CheckboxField = function CheckboxField(_ref) {
|
|
1693
1702
|
var label = _ref.label,
|
|
1694
1703
|
field = _ref.field,
|
|
@@ -1810,55 +1819,50 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1810
1819
|
return null;
|
|
1811
1820
|
};
|
|
1812
1821
|
|
|
1813
|
-
var
|
|
1814
|
-
var
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
1819
|
-
var _ref4$data = _ref4.data,
|
|
1820
|
-
data = _ref4$data === void 0 ? [] : _ref4$data,
|
|
1821
|
-
_ref4$ticketHoldersFi = _ref4.ticketHoldersFields,
|
|
1822
|
-
ticketHoldersFields = _ref4$ticketHoldersFi === void 0 ? {
|
|
1822
|
+
var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
1823
|
+
var _ref3$data = _ref3.data,
|
|
1824
|
+
data = _ref3$data === void 0 ? [] : _ref3$data,
|
|
1825
|
+
_ref3$ticketHoldersFi = _ref3.ticketHoldersFields,
|
|
1826
|
+
ticketHoldersFields = _ref3$ticketHoldersFi === void 0 ? {
|
|
1823
1827
|
id: 1,
|
|
1824
1828
|
fields: []
|
|
1825
|
-
} :
|
|
1826
|
-
|
|
1827
|
-
initialValues =
|
|
1828
|
-
|
|
1829
|
-
buttonName =
|
|
1830
|
-
|
|
1831
|
-
handleSubmit =
|
|
1832
|
-
|
|
1833
|
-
theme =
|
|
1834
|
-
|
|
1835
|
-
onRegisterSuccess =
|
|
1836
|
-
|
|
1837
|
-
onRegisterError =
|
|
1838
|
-
|
|
1839
|
-
onSubmitError =
|
|
1840
|
-
|
|
1841
|
-
onGetCartSuccess =
|
|
1842
|
-
|
|
1843
|
-
onGetCartError =
|
|
1844
|
-
|
|
1845
|
-
onGetCountriesSuccess =
|
|
1846
|
-
|
|
1847
|
-
onGetCountriesError =
|
|
1848
|
-
|
|
1849
|
-
onGetStatesSuccess =
|
|
1850
|
-
|
|
1851
|
-
onGetStatesError =
|
|
1852
|
-
|
|
1853
|
-
onGetProfileDataSuccess =
|
|
1854
|
-
|
|
1855
|
-
onGetProfileDataError =
|
|
1856
|
-
|
|
1857
|
-
onAuthorizeSuccess =
|
|
1858
|
-
|
|
1859
|
-
onAuthorizeError =
|
|
1860
|
-
|
|
1861
|
-
onLogin =
|
|
1829
|
+
} : _ref3$ticketHoldersFi,
|
|
1830
|
+
_ref3$initialValues = _ref3.initialValues,
|
|
1831
|
+
initialValues = _ref3$initialValues === void 0 ? {} : _ref3$initialValues,
|
|
1832
|
+
_ref3$buttonName = _ref3.buttonName,
|
|
1833
|
+
buttonName = _ref3$buttonName === void 0 ? 'Submit' : _ref3$buttonName,
|
|
1834
|
+
_ref3$handleSubmit = _ref3.handleSubmit,
|
|
1835
|
+
handleSubmit = _ref3$handleSubmit === void 0 ? _identity : _ref3$handleSubmit,
|
|
1836
|
+
_ref3$theme = _ref3.theme,
|
|
1837
|
+
theme = _ref3$theme === void 0 ? 'light' : _ref3$theme,
|
|
1838
|
+
_ref3$onRegisterSucce = _ref3.onRegisterSuccess,
|
|
1839
|
+
onRegisterSuccess = _ref3$onRegisterSucce === void 0 ? function () {} : _ref3$onRegisterSucce,
|
|
1840
|
+
_ref3$onRegisterError = _ref3.onRegisterError,
|
|
1841
|
+
onRegisterError = _ref3$onRegisterError === void 0 ? function () {} : _ref3$onRegisterError,
|
|
1842
|
+
_ref3$onSubmitError = _ref3.onSubmitError,
|
|
1843
|
+
onSubmitError = _ref3$onSubmitError === void 0 ? function () {} : _ref3$onSubmitError,
|
|
1844
|
+
_ref3$onGetCartSucces = _ref3.onGetCartSuccess,
|
|
1845
|
+
onGetCartSuccess = _ref3$onGetCartSucces === void 0 ? function () {} : _ref3$onGetCartSucces,
|
|
1846
|
+
_ref3$onGetCartError = _ref3.onGetCartError,
|
|
1847
|
+
onGetCartError = _ref3$onGetCartError === void 0 ? function () {} : _ref3$onGetCartError,
|
|
1848
|
+
_ref3$onGetCountriesS = _ref3.onGetCountriesSuccess,
|
|
1849
|
+
onGetCountriesSuccess = _ref3$onGetCountriesS === void 0 ? function () {} : _ref3$onGetCountriesS,
|
|
1850
|
+
_ref3$onGetCountriesE = _ref3.onGetCountriesError,
|
|
1851
|
+
onGetCountriesError = _ref3$onGetCountriesE === void 0 ? function () {} : _ref3$onGetCountriesE,
|
|
1852
|
+
_ref3$onGetStatesSucc = _ref3.onGetStatesSuccess,
|
|
1853
|
+
onGetStatesSuccess = _ref3$onGetStatesSucc === void 0 ? function () {} : _ref3$onGetStatesSucc,
|
|
1854
|
+
_ref3$onGetStatesErro = _ref3.onGetStatesError,
|
|
1855
|
+
onGetStatesError = _ref3$onGetStatesErro === void 0 ? function () {} : _ref3$onGetStatesErro,
|
|
1856
|
+
_ref3$onGetProfileDat = _ref3.onGetProfileDataSuccess,
|
|
1857
|
+
onGetProfileDataSuccess = _ref3$onGetProfileDat === void 0 ? function () {} : _ref3$onGetProfileDat,
|
|
1858
|
+
_ref3$onGetProfileDat2 = _ref3.onGetProfileDataError,
|
|
1859
|
+
onGetProfileDataError = _ref3$onGetProfileDat2 === void 0 ? function () {} : _ref3$onGetProfileDat2,
|
|
1860
|
+
_ref3$onAuthorizeSucc = _ref3.onAuthorizeSuccess,
|
|
1861
|
+
onAuthorizeSuccess = _ref3$onAuthorizeSucc === void 0 ? function () {} : _ref3$onAuthorizeSucc,
|
|
1862
|
+
_ref3$onAuthorizeErro = _ref3.onAuthorizeError,
|
|
1863
|
+
onAuthorizeError = _ref3$onAuthorizeErro === void 0 ? function () {} : _ref3$onAuthorizeErro,
|
|
1864
|
+
_ref3$onLogin = _ref3.onLogin,
|
|
1865
|
+
onLogin = _ref3$onLogin === void 0 ? function () {} : _ref3$onLogin;
|
|
1862
1866
|
var userData = typeof window !== 'undefined' && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
1863
1867
|
var access_token = typeof window !== 'undefined' && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
1864
1868
|
|
|
@@ -1890,7 +1894,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1890
1894
|
showModalRegister = _useState7[0],
|
|
1891
1895
|
setShowModalRegister = _useState7[1];
|
|
1892
1896
|
|
|
1893
|
-
var _useState8 = useState(
|
|
1897
|
+
var _useState8 = useState([]),
|
|
1894
1898
|
ticketsQuantity = _useState8[0],
|
|
1895
1899
|
setTicketsQuantity = _useState8[1];
|
|
1896
1900
|
|
|
@@ -1922,9 +1926,12 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1922
1926
|
|
|
1923
1927
|
var showDOB = getQueryVariable('age_required') === 'true';
|
|
1924
1928
|
var showTicketHolderName = getQueryVariable('names_required') === 'true';
|
|
1929
|
+
var eventId = getQueryVariable('event_id');
|
|
1925
1930
|
|
|
1926
1931
|
var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
|
|
1927
1932
|
|
|
1933
|
+
var hideOptIn = _get(cartInfoData, 'hide_ttf_opt_in', false);
|
|
1934
|
+
|
|
1928
1935
|
var getQuantity = function getQuantity(cart) {
|
|
1929
1936
|
if (cart === void 0) {
|
|
1930
1937
|
cart = [];
|
|
@@ -1935,46 +1942,99 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1935
1942
|
qty += +item.quantity;
|
|
1936
1943
|
});
|
|
1937
1944
|
return qty;
|
|
1938
|
-
}; //
|
|
1945
|
+
}; //just once
|
|
1946
|
+
|
|
1947
|
+
|
|
1948
|
+
useEffect(function () {
|
|
1949
|
+
// fetch countries data
|
|
1950
|
+
var fetchCountries = /*#__PURE__*/function () {
|
|
1951
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
1952
|
+
var res;
|
|
1953
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1954
|
+
while (1) {
|
|
1955
|
+
switch (_context2.prev = _context2.next) {
|
|
1956
|
+
case 0:
|
|
1957
|
+
_context2.prev = 0;
|
|
1958
|
+
_context2.next = 3;
|
|
1959
|
+
return getCountries();
|
|
1960
|
+
|
|
1961
|
+
case 3:
|
|
1962
|
+
res = _context2.sent;
|
|
1963
|
+
setCustomHeader(res);
|
|
1964
|
+
setCountries(_map(_get(res, 'data.data'), function (item, key) {
|
|
1965
|
+
return {
|
|
1966
|
+
label: item,
|
|
1967
|
+
value: Number(key)
|
|
1968
|
+
};
|
|
1969
|
+
}));
|
|
1970
|
+
onGetCountriesSuccess(res.data);
|
|
1971
|
+
_context2.next = 12;
|
|
1972
|
+
break;
|
|
1973
|
+
|
|
1974
|
+
case 9:
|
|
1975
|
+
_context2.prev = 9;
|
|
1976
|
+
_context2.t0 = _context2["catch"](0);
|
|
1977
|
+
|
|
1978
|
+
if (axios.isAxiosError(_context2.t0)) {
|
|
1979
|
+
onGetCountriesError(_context2.t0);
|
|
1980
|
+
}
|
|
1939
1981
|
|
|
1982
|
+
case 12:
|
|
1983
|
+
case "end":
|
|
1984
|
+
return _context2.stop();
|
|
1985
|
+
}
|
|
1986
|
+
}
|
|
1987
|
+
}, _callee2, null, [[0, 9]]);
|
|
1988
|
+
}));
|
|
1989
|
+
|
|
1990
|
+
return function fetchCountries() {
|
|
1991
|
+
return _ref4.apply(this, arguments);
|
|
1992
|
+
};
|
|
1993
|
+
}();
|
|
1994
|
+
|
|
1995
|
+
fetchCountries();
|
|
1996
|
+
fetchCart();
|
|
1997
|
+
}, []); // fetch cart data
|
|
1940
1998
|
|
|
1941
1999
|
var fetchCart = /*#__PURE__*/function () {
|
|
1942
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2000
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
|
|
1943
2001
|
var res, cartInfo, _cartInfo$cart, cart;
|
|
1944
2002
|
|
|
1945
|
-
return runtime_1.wrap(function
|
|
2003
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1946
2004
|
while (1) {
|
|
1947
|
-
switch (
|
|
2005
|
+
switch (_context3.prev = _context3.next) {
|
|
1948
2006
|
case 0:
|
|
1949
|
-
|
|
1950
|
-
|
|
2007
|
+
_context3.prev = 0;
|
|
2008
|
+
_context3.next = 3;
|
|
1951
2009
|
return getCart();
|
|
1952
2010
|
|
|
1953
2011
|
case 3:
|
|
1954
|
-
res =
|
|
2012
|
+
res = _context3.sent;
|
|
1955
2013
|
setCustomHeader(res);
|
|
1956
2014
|
cartInfo = _get(res, 'data.data.attributes');
|
|
1957
2015
|
setCartInfo(cartInfo);
|
|
1958
2016
|
_cartInfo$cart = cartInfo.cart, cart = _cartInfo$cart === void 0 ? [] : _cartInfo$cart;
|
|
1959
|
-
setTicketsQuantity(getQuantity(cart))
|
|
2017
|
+
setTicketsQuantity(new Array(getQuantity(cart)).fill(null).map(function () {
|
|
2018
|
+
return nanoid();
|
|
2019
|
+
}));
|
|
1960
2020
|
onGetCartSuccess(res.data);
|
|
1961
|
-
|
|
2021
|
+
_context3.next = 15;
|
|
1962
2022
|
break;
|
|
1963
2023
|
|
|
1964
2024
|
case 12:
|
|
1965
|
-
|
|
1966
|
-
|
|
2025
|
+
_context3.prev = 12;
|
|
2026
|
+
_context3.t0 = _context3["catch"](0);
|
|
1967
2027
|
|
|
1968
|
-
if (axios.isAxiosError(
|
|
1969
|
-
onGetCartError(
|
|
2028
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
2029
|
+
onGetCartError(_context3.t0);
|
|
1970
2030
|
}
|
|
1971
2031
|
|
|
1972
2032
|
case 15:
|
|
1973
2033
|
case "end":
|
|
1974
|
-
return
|
|
2034
|
+
return _context3.stop();
|
|
1975
2035
|
}
|
|
1976
2036
|
}
|
|
1977
|
-
},
|
|
2037
|
+
}, _callee3, null, [[0, 12]]);
|
|
1978
2038
|
}));
|
|
1979
2039
|
|
|
1980
2040
|
return function fetchCart() {
|
|
@@ -1984,24 +2044,24 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1984
2044
|
|
|
1985
2045
|
|
|
1986
2046
|
var fetchUserData = /*#__PURE__*/function () {
|
|
1987
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
2047
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(token) {
|
|
1988
2048
|
var userDataResponse, profileSpecifiedData, profileDataObj;
|
|
1989
|
-
return runtime_1.wrap(function
|
|
2049
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
1990
2050
|
while (1) {
|
|
1991
|
-
switch (
|
|
2051
|
+
switch (_context4.prev = _context4.next) {
|
|
1992
2052
|
case 0:
|
|
1993
|
-
|
|
2053
|
+
_context4.prev = 0;
|
|
1994
2054
|
|
|
1995
2055
|
if (!(typeof window !== 'undefined' && token)) {
|
|
1996
|
-
|
|
2056
|
+
_context4.next = 10;
|
|
1997
2057
|
break;
|
|
1998
2058
|
}
|
|
1999
2059
|
|
|
2000
|
-
|
|
2060
|
+
_context4.next = 4;
|
|
2001
2061
|
return getProfileData(token);
|
|
2002
2062
|
|
|
2003
2063
|
case 4:
|
|
2004
|
-
userDataResponse =
|
|
2064
|
+
userDataResponse = _context4.sent;
|
|
2005
2065
|
profileSpecifiedData = _get(userDataResponse, 'data.data');
|
|
2006
2066
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
2007
2067
|
setUserValues(profileDataObj);
|
|
@@ -2009,23 +2069,23 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2009
2069
|
onGetProfileDataSuccess(userDataResponse.data);
|
|
2010
2070
|
|
|
2011
2071
|
case 10:
|
|
2012
|
-
|
|
2072
|
+
_context4.next = 15;
|
|
2013
2073
|
break;
|
|
2014
2074
|
|
|
2015
2075
|
case 12:
|
|
2016
|
-
|
|
2017
|
-
|
|
2076
|
+
_context4.prev = 12;
|
|
2077
|
+
_context4.t0 = _context4["catch"](0);
|
|
2018
2078
|
|
|
2019
|
-
if (axios.isAxiosError(
|
|
2020
|
-
onGetProfileDataError(
|
|
2079
|
+
if (axios.isAxiosError(_context4.t0)) {
|
|
2080
|
+
onGetProfileDataError(_context4.t0);
|
|
2021
2081
|
}
|
|
2022
2082
|
|
|
2023
2083
|
case 15:
|
|
2024
2084
|
case "end":
|
|
2025
|
-
return
|
|
2085
|
+
return _context4.stop();
|
|
2026
2086
|
}
|
|
2027
2087
|
}
|
|
2028
|
-
},
|
|
2088
|
+
}, _callee4, null, [[0, 12]]);
|
|
2029
2089
|
}));
|
|
2030
2090
|
|
|
2031
2091
|
return function fetchUserData(_x) {
|
|
@@ -2034,58 +2094,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2034
2094
|
}();
|
|
2035
2095
|
|
|
2036
2096
|
useEffect(function () {
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
var fetchCountries = /*#__PURE__*/function () {
|
|
2041
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
2042
|
-
var res;
|
|
2043
|
-
return runtime_1.wrap(function _callee4$(_context4) {
|
|
2044
|
-
while (1) {
|
|
2045
|
-
switch (_context4.prev = _context4.next) {
|
|
2046
|
-
case 0:
|
|
2047
|
-
_context4.prev = 0;
|
|
2048
|
-
_context4.next = 3;
|
|
2049
|
-
return getCountries();
|
|
2050
|
-
|
|
2051
|
-
case 3:
|
|
2052
|
-
res = _context4.sent;
|
|
2053
|
-
setCustomHeader(res);
|
|
2054
|
-
setCountries(_map(_get(res, 'data.data'), function (item, key) {
|
|
2055
|
-
return {
|
|
2056
|
-
label: item,
|
|
2057
|
-
value: Number(key)
|
|
2058
|
-
};
|
|
2059
|
-
}));
|
|
2060
|
-
onGetCountriesSuccess(res.data);
|
|
2061
|
-
_context4.next = 12;
|
|
2062
|
-
break;
|
|
2063
|
-
|
|
2064
|
-
case 9:
|
|
2065
|
-
_context4.prev = 9;
|
|
2066
|
-
_context4.t0 = _context4["catch"](0);
|
|
2067
|
-
|
|
2068
|
-
if (axios.isAxiosError(_context4.t0)) {
|
|
2069
|
-
onGetCountriesError(_context4.t0);
|
|
2070
|
-
}
|
|
2071
|
-
|
|
2072
|
-
case 12:
|
|
2073
|
-
case "end":
|
|
2074
|
-
return _context4.stop();
|
|
2075
|
-
}
|
|
2076
|
-
}
|
|
2077
|
-
}, _callee4, null, [[0, 9]]);
|
|
2078
|
-
}));
|
|
2079
|
-
|
|
2080
|
-
return function fetchCountries() {
|
|
2081
|
-
return _ref7.apply(this, arguments);
|
|
2082
|
-
};
|
|
2083
|
-
}();
|
|
2084
|
-
|
|
2085
|
-
if (!(countries && countries.length)) {
|
|
2086
|
-
fetchCountries();
|
|
2087
|
-
}
|
|
2088
|
-
}, [access_token, countries]);
|
|
2097
|
+
fetchUserData(access_token);
|
|
2098
|
+
}, [access_token]);
|
|
2089
2099
|
return React.createElement(React.Fragment, null, React.createElement(Formik, {
|
|
2090
2100
|
initialValues: getInitialValues(data, _extends({}, initialValues, {
|
|
2091
2101
|
email: emailLogged,
|
|
@@ -2128,7 +2138,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2128
2138
|
}
|
|
2129
2139
|
|
|
2130
2140
|
case 9:
|
|
2131
|
-
_checkoutBody = createCheckoutDataBody(ticketsQuantity, values, {
|
|
2141
|
+
_checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
2132
2142
|
emailLogged: emailLogged,
|
|
2133
2143
|
firstNameLogged: firstNameLogged,
|
|
2134
2144
|
lastNameLogged: lastNameLogged
|
|
@@ -2138,7 +2148,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2138
2148
|
|
|
2139
2149
|
case 12:
|
|
2140
2150
|
_res = _context5.sent;
|
|
2141
|
-
handleSubmit(values, formikHelpers, _res);
|
|
2151
|
+
handleSubmit(values, formikHelpers, eventId, _res);
|
|
2142
2152
|
return _context5.abrupt("return");
|
|
2143
2153
|
|
|
2144
2154
|
case 15:
|
|
@@ -2200,7 +2210,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2200
2210
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2201
2211
|
}
|
|
2202
2212
|
|
|
2203
|
-
checkoutBody = createCheckoutDataBody(ticketsQuantity, values, {
|
|
2213
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
2204
2214
|
emailLogged: emailLogged,
|
|
2205
2215
|
firstNameLogged: firstNameLogged,
|
|
2206
2216
|
lastNameLogged: lastNameLogged
|
|
@@ -2210,7 +2220,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2210
2220
|
|
|
2211
2221
|
case 41:
|
|
2212
2222
|
res = _context5.sent;
|
|
2213
|
-
handleSubmit(values, formikHelpers, res);
|
|
2223
|
+
handleSubmit(values, formikHelpers, eventId, res);
|
|
2214
2224
|
_context5.next = 48;
|
|
2215
2225
|
break;
|
|
2216
2226
|
|
|
@@ -2270,8 +2280,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2270
2280
|
setShowModalLogin(true);
|
|
2271
2281
|
}
|
|
2272
2282
|
}, "Login"))), _map(data, function (item) {
|
|
2273
|
-
var
|
|
2274
|
-
label = item.label,
|
|
2283
|
+
var label = item.label,
|
|
2275
2284
|
labelClassName = item.labelClassName,
|
|
2276
2285
|
fields = item.fields;
|
|
2277
2286
|
|
|
@@ -2279,8 +2288,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2279
2288
|
return null;
|
|
2280
2289
|
}
|
|
2281
2290
|
|
|
2282
|
-
return React.createElement(
|
|
2283
|
-
key:
|
|
2291
|
+
return React.createElement(React.Fragment, {
|
|
2292
|
+
key: nanoid()
|
|
2284
2293
|
}, React.createElement("p", {
|
|
2285
2294
|
className: labelClassName
|
|
2286
2295
|
}, label), _map(fields, function (group) {
|
|
@@ -2288,8 +2297,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2288
2297
|
groupItems = group.groupItems,
|
|
2289
2298
|
groupLabel = group.groupLabel,
|
|
2290
2299
|
groupLabelClassName = group.groupLabelClassName;
|
|
2291
|
-
return React.createElement(
|
|
2292
|
-
key:
|
|
2300
|
+
return React.createElement(React.Fragment, {
|
|
2301
|
+
key: nanoid()
|
|
2293
2302
|
}, !isLoggedIn && React.createElement("div", {
|
|
2294
2303
|
className: groupLabelClassName
|
|
2295
2304
|
}, groupLabel), React.createElement("div", {
|
|
@@ -2307,38 +2316,49 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2307
2316
|
return false;
|
|
2308
2317
|
}
|
|
2309
2318
|
|
|
2319
|
+
if (el.name === 'brand_opt_in' && hideOptIn) {
|
|
2320
|
+
return false;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2310
2323
|
return true;
|
|
2311
2324
|
}), function (element) {
|
|
2312
|
-
return ['password', 'confirmPassword'].includes(element.name) && isLoggedIn ? null : React.createElement(
|
|
2313
|
-
|
|
2314
|
-
|
|
2325
|
+
return ['password', 'confirmPassword'].includes(element.name) && isLoggedIn ? null : React.createElement(React.Fragment, {
|
|
2326
|
+
key: nanoid()
|
|
2327
|
+
}, element.name === 'email' ? React.createElement("div", {
|
|
2328
|
+
className: "email-checking"
|
|
2329
|
+
}, "IMPORTANT: Please double check that your email address is correct. It's where we send your confirmation and e-tickets to!") : null, React.createElement("div", {
|
|
2330
|
+
className: element.className
|
|
2315
2331
|
}, element.component ? element.component : React.createElement(Field, {
|
|
2316
2332
|
name: element.name,
|
|
2317
2333
|
label: element.label,
|
|
2318
2334
|
type: element.type,
|
|
2319
2335
|
validate: combineValidators(element.required ? requiredValidator : function () {}, element.onValidate ? element.onValidate : function () {}),
|
|
2320
2336
|
component: element.type === 'checkbox' ? CheckboxField : CustomField,
|
|
2321
|
-
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : []
|
|
2322
|
-
|
|
2337
|
+
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
2338
|
+
theme: theme
|
|
2339
|
+
})));
|
|
2323
2340
|
})));
|
|
2324
2341
|
}));
|
|
2325
|
-
}), showTicketHolderName && React.createElement(
|
|
2342
|
+
}), showTicketHolderName && React.createElement(React.Fragment, {
|
|
2343
|
+
key: nanoid()
|
|
2344
|
+
}, React.createElement("div", {
|
|
2345
|
+
className: "ticket-holders-fields"
|
|
2346
|
+
}, React.createElement("p", null, ticketHoldersFields.label), _map(ticketsQuantity, function (_item, index) {
|
|
2326
2347
|
return React.createElement("div", {
|
|
2327
|
-
key:
|
|
2348
|
+
key: nanoid()
|
|
2328
2349
|
}, React.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group) {
|
|
2329
2350
|
var groupClassname = group.groupClassname,
|
|
2330
2351
|
groupItems = group.groupItems;
|
|
2331
2352
|
return React.createElement("div", {
|
|
2332
|
-
key:
|
|
2353
|
+
key: nanoid()
|
|
2333
2354
|
}, React.createElement("div", {
|
|
2334
2355
|
className: groupClassname
|
|
2335
2356
|
}, _map(groupItems, function (element) {
|
|
2336
2357
|
return React.createElement("div", {
|
|
2337
2358
|
className: element.className,
|
|
2338
|
-
key:
|
|
2359
|
+
key: nanoid()
|
|
2339
2360
|
}, React.createElement(Field, {
|
|
2340
2361
|
name: element.name + "-" + index,
|
|
2341
|
-
key: element.name + "-" + index,
|
|
2342
2362
|
label: element.label,
|
|
2343
2363
|
type: element.type,
|
|
2344
2364
|
required: true,
|
|
@@ -2347,8 +2367,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2347
2367
|
}));
|
|
2348
2368
|
})));
|
|
2349
2369
|
}));
|
|
2350
|
-
})), React.createElement("div", {
|
|
2351
|
-
className: "button-container"
|
|
2370
|
+
}))), React.createElement("div", {
|
|
2371
|
+
className: "button-container",
|
|
2372
|
+
key: nanoid()
|
|
2352
2373
|
}, React.createElement(LoadingButton, {
|
|
2353
2374
|
type: "submit",
|
|
2354
2375
|
variant: "contained",
|
|
@@ -2386,10 +2407,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2386
2407
|
}));
|
|
2387
2408
|
};
|
|
2388
2409
|
|
|
2389
|
-
var css_248z$3 = ".style_payment_page__1PUd8{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.style_payment_page__1PUd8 .style_order_info_section__J1olw{padding:15px 0}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4{padding-bottom:15px;padding-top:15px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_field-underline__2M8Bd{border-bottom:1px solid #000;padding-bottom:15px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_order_info_title__1MBgS{font-size:14px;font-weight:700;padding-bottom:3px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_order_info_text__3gSEK{font-size:16px;line-height:1.15;outline:none}.style_payment_page__1PUd8 .style_MuiBox-root__2LeaA{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.style_payment_page__1PUd8 .style_payment_info_label__3Zmjp{padding:20px 0;text-align:center}.style_payment_page__1PUd8 .style_payment_form__2arf4{color:#fff;padding:20px}.style_payment_page__1PUd8 .style_payment_form__2arf4 input,.style_payment_page__1PUd8 .style_payment_form__2arf4 label{color:#fff}.style_payment_page__1PUd8 .style_payment_button__3WzAn{padding-top:20px;text-align:center}";
|
|
2410
|
+
var css_248z$3 = ".style_payment_page__1PUd8{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.style_payment_page__1PUd8 .style_order_info_section__J1olw{padding:15px 0}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4{padding-bottom:15px;padding-top:15px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_field-underline__2M8Bd{border-bottom:1px solid #000;padding-bottom:15px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_order_info_title__1MBgS{font-size:14px;font-weight:700;padding-bottom:3px}.style_payment_page__1PUd8 .style_order_info_section__J1olw .style_order_info_block__3kZN4 .style_order_info_text__3gSEK{font-size:16px;line-height:1.15;outline:none}.style_payment_page__1PUd8 .style_MuiBox-root__2LeaA{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.style_payment_page__1PUd8 .style_payment_info_label__3Zmjp{padding:20px 0;text-align:center}.style_payment_page__1PUd8 .style_payment_form__2arf4{color:#fff;padding:20px}.style_payment_page__1PUd8 .style_payment_form__2arf4 input,.style_payment_page__1PUd8 .style_payment_form__2arf4 label{color:#fff}.style_payment_page__1PUd8 .style_payment_button__3WzAn{padding-top:20px;text-align:center}.style_conditions-block__3XPwW{background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.05);padding:19px}";
|
|
2390
2411
|
styleInject(css_248z$3);
|
|
2391
2412
|
|
|
2392
|
-
var css_248z$4 = ".style_card_form_inner__7vzGq{background:#232323;border-radius:8px;padding:15px}.style_card_form_inner__7vzGq .style_card_label_text__F7GFa{color:#fff}.style_card_form_inner__7vzGq .style_StripeElement__jS5TJ{margin:5px 0 10px}.style_card_label_text__F7GFa{color:#fff}.style_payment_button__2rkp8{padding-top:15px;text-align:center}.style_payment_button__2rkp8 button{background-color:#212529;border-radius:8px;color:#fff;cursor:pointer;font-size:26px;padding:15px 30px;transition:opacity .5s;width:200px}.style_payment_button__2rkp8 button:hover{opacity:.7}.style_checkout_error_block__3LUN5{color:#e53935;font-weight:600;padding:15px 0}.style_zip_element__31oFa p{margin-bottom:0}.style_zip_element__31oFa input{background-color:#232323;border:none;color:#fff;font-size:18px;margin-top:5px;outline:none;width:100%}";
|
|
2413
|
+
var css_248z$4 = ".style_card_form_inner__7vzGq{background:#232323;border-radius:8px;padding:15px}.style_card_form_inner__7vzGq .style_card_label_text__F7GFa{color:#fff}.style_card_form_inner__7vzGq .style_StripeElement__jS5TJ{margin:5px 0 10px}.style_card_label_text__F7GFa{color:#fff}.style_payment_button__2rkp8{padding-top:15px;text-align:center}.style_payment_button__2rkp8 button{background-color:#212529;border-radius:8px;color:#fff;cursor:pointer;font-size:26px;padding:15px 30px;transition:opacity .5s;width:200px}.style_payment_button__2rkp8 button:hover{opacity:.7}.style_disabled-payment-button__3MiUR button{opacity:.3;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.style_checkout_error_block__3LUN5{color:#e53935;font-weight:600;padding:15px 0}.style_zip_element__31oFa p{margin-bottom:0}.style_zip_element__31oFa input{background-color:#232323;border:none;color:#fff;font-size:18px;margin-top:5px;outline:none;width:100%}";
|
|
2393
2414
|
styleInject(css_248z$4);
|
|
2394
2415
|
|
|
2395
2416
|
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
@@ -2462,6 +2483,7 @@ var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency)
|
|
|
2462
2483
|
var options = {
|
|
2463
2484
|
style: {
|
|
2464
2485
|
base: {
|
|
2486
|
+
backgroundColor: '#232323',
|
|
2465
2487
|
fontSize: '18px',
|
|
2466
2488
|
color: '#ffffff',
|
|
2467
2489
|
letterSpacing: '1px',
|
|
@@ -2489,7 +2511,9 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2489
2511
|
_ref$isLoading = _ref.isLoading,
|
|
2490
2512
|
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
2491
2513
|
_ref$handleSetLoading = _ref.handleSetLoading,
|
|
2492
|
-
handleSetLoading = _ref$handleSetLoading === void 0 ? function () {} : _ref$handleSetLoading
|
|
2514
|
+
handleSetLoading = _ref$handleSetLoading === void 0 ? function () {} : _ref$handleSetLoading,
|
|
2515
|
+
_ref$conditions = _ref.conditions,
|
|
2516
|
+
conditions = _ref$conditions === void 0 ? [] : _ref$conditions;
|
|
2493
2517
|
var stripe = useStripe();
|
|
2494
2518
|
var elements = useElements();
|
|
2495
2519
|
|
|
@@ -2518,7 +2542,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2518
2542
|
break;
|
|
2519
2543
|
}
|
|
2520
2544
|
|
|
2521
|
-
setStripeError(
|
|
2545
|
+
setStripeError('Please enter your zip code.');
|
|
2522
2546
|
handleSetLoading(false);
|
|
2523
2547
|
return _context.abrupt("return");
|
|
2524
2548
|
|
|
@@ -2619,6 +2643,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2619
2643
|
zipCode && setPostalCode(zipCode);
|
|
2620
2644
|
}
|
|
2621
2645
|
}, []);
|
|
2646
|
+
var buttonIsDiabled = !stripe || !!error || isLoading;
|
|
2622
2647
|
return React.createElement("div", {
|
|
2623
2648
|
className: "stripe_payment_container"
|
|
2624
2649
|
}, !!stripeError && React.createElement("div", {
|
|
@@ -2658,10 +2683,21 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
2658
2683
|
value: postalCode,
|
|
2659
2684
|
onChange: onChangePostalCode,
|
|
2660
2685
|
placeholder: "ZIP"
|
|
2661
|
-
}))),
|
|
2662
|
-
|
|
2686
|
+
}))), conditions == null ? void 0 : conditions.map(function (checkbox) {
|
|
2687
|
+
return React.createElement("div", {
|
|
2688
|
+
className: 'billing-info-container__singleField',
|
|
2689
|
+
key: checkbox.id
|
|
2690
|
+
}, React.createElement("div", {
|
|
2691
|
+
className: "conditions-block"
|
|
2692
|
+
}, React.createElement(CheckboxField, {
|
|
2693
|
+
name: checkbox.id,
|
|
2694
|
+
label: checkbox.text,
|
|
2695
|
+
required: true
|
|
2696
|
+
})));
|
|
2697
|
+
}), React.createElement("div", {
|
|
2698
|
+
className: "payment_button " + (buttonIsDiabled ? 'disabled-payment-button' : '')
|
|
2663
2699
|
}, React.createElement("button", {
|
|
2664
|
-
disabled:
|
|
2700
|
+
disabled: buttonIsDiabled,
|
|
2665
2701
|
type: "submit"
|
|
2666
2702
|
}, isLoading ? React.createElement(CircularProgress$1, null) : "Pay " + getCurrencySymbolByCurrency(currency) + total))));
|
|
2667
2703
|
};
|
|
@@ -2719,8 +2755,13 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2719
2755
|
paymentIsLoading = _useState4[0],
|
|
2720
2756
|
setPaymentIsLoading = _useState4[1];
|
|
2721
2757
|
|
|
2758
|
+
var _useState5 = useState([]),
|
|
2759
|
+
conditions = _useState5[0],
|
|
2760
|
+
setConditions = _useState5[1];
|
|
2761
|
+
|
|
2722
2762
|
var showFormTitle = Boolean(formTitle);
|
|
2723
2763
|
var showErrorText = Boolean(errorText);
|
|
2764
|
+
var eventId = getQueryVariable('event_id');
|
|
2724
2765
|
useEffect(function () {
|
|
2725
2766
|
var hash = checkoutData.hash;
|
|
2726
2767
|
|
|
@@ -2771,21 +2812,64 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2771
2812
|
}
|
|
2772
2813
|
}, _callee, null, [[0, 7]]);
|
|
2773
2814
|
}))();
|
|
2774
|
-
}, [checkoutData]); //
|
|
2815
|
+
}, [checkoutData]); //just once
|
|
2816
|
+
|
|
2817
|
+
useEffect(function () {
|
|
2818
|
+
// fetch conditions data
|
|
2819
|
+
var fetchConditions = /*#__PURE__*/function () {
|
|
2820
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
2821
|
+
var res, conditionsInfo;
|
|
2822
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
2823
|
+
while (1) {
|
|
2824
|
+
switch (_context2.prev = _context2.next) {
|
|
2825
|
+
case 0:
|
|
2826
|
+
if (!eventId) {
|
|
2827
|
+
_context2.next = 6;
|
|
2828
|
+
break;
|
|
2829
|
+
}
|
|
2830
|
+
|
|
2831
|
+
_context2.next = 3;
|
|
2832
|
+
return getConditions(eventId);
|
|
2833
|
+
|
|
2834
|
+
case 3:
|
|
2835
|
+
res = _context2.sent;
|
|
2836
|
+
conditionsInfo = _get(res, 'data.data.attributes');
|
|
2837
|
+
setConditions(conditionsInfo ? conditionsInfo.map(function (item) {
|
|
2838
|
+
return {
|
|
2839
|
+
id: nanoid(),
|
|
2840
|
+
text: item
|
|
2841
|
+
};
|
|
2842
|
+
}) : []);
|
|
2843
|
+
|
|
2844
|
+
case 6:
|
|
2845
|
+
case "end":
|
|
2846
|
+
return _context2.stop();
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
}, _callee2);
|
|
2850
|
+
}));
|
|
2851
|
+
|
|
2852
|
+
return function fetchConditions() {
|
|
2853
|
+
return _ref3.apply(this, arguments);
|
|
2854
|
+
};
|
|
2855
|
+
}();
|
|
2856
|
+
|
|
2857
|
+
fetchConditions();
|
|
2858
|
+
}, []); // 1. get payment data ---> v1/order/${hash}/review/ done
|
|
2775
2859
|
// 2. handle payment ---> v1/order/${orderHash}/pay/
|
|
2776
2860
|
// 3. redirect to confirmation page
|
|
2777
2861
|
|
|
2778
2862
|
var handlePaymentMiddleWare = /*#__PURE__*/function () {
|
|
2779
|
-
var
|
|
2863
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(error) {
|
|
2780
2864
|
var order_hash, paymentSuccessResponse;
|
|
2781
|
-
return runtime_1.wrap(function
|
|
2865
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
2782
2866
|
while (1) {
|
|
2783
|
-
switch (
|
|
2867
|
+
switch (_context3.prev = _context3.next) {
|
|
2784
2868
|
case 0:
|
|
2785
|
-
|
|
2869
|
+
_context3.prev = 0;
|
|
2786
2870
|
|
|
2787
2871
|
if (!error) {
|
|
2788
|
-
|
|
2872
|
+
_context3.next = 4;
|
|
2789
2873
|
break;
|
|
2790
2874
|
}
|
|
2791
2875
|
|
|
@@ -2794,36 +2878,36 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2794
2878
|
|
|
2795
2879
|
case 4:
|
|
2796
2880
|
order_hash = reviewData.order_details.order_hash;
|
|
2797
|
-
|
|
2881
|
+
_context3.next = 7;
|
|
2798
2882
|
return handlePaymentSuccess(order_hash);
|
|
2799
2883
|
|
|
2800
2884
|
case 7:
|
|
2801
|
-
paymentSuccessResponse =
|
|
2885
|
+
paymentSuccessResponse = _context3.sent;
|
|
2802
2886
|
|
|
2803
2887
|
if (paymentSuccessResponse.status === 200) {
|
|
2804
2888
|
handlePayment(paymentSuccessResponse);
|
|
2805
2889
|
setPaymentIsLoading(false);
|
|
2806
2890
|
}
|
|
2807
2891
|
|
|
2808
|
-
|
|
2892
|
+
_context3.next = 15;
|
|
2809
2893
|
break;
|
|
2810
2894
|
|
|
2811
2895
|
case 11:
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
setError(_get(
|
|
2815
|
-
onPaymentError(
|
|
2896
|
+
_context3.prev = 11;
|
|
2897
|
+
_context3.t0 = _context3["catch"](0);
|
|
2898
|
+
setError(_get(_context3.t0, 'response.data.message'));
|
|
2899
|
+
onPaymentError(_context3.t0.response);
|
|
2816
2900
|
|
|
2817
2901
|
case 15:
|
|
2818
2902
|
case "end":
|
|
2819
|
-
return
|
|
2903
|
+
return _context3.stop();
|
|
2820
2904
|
}
|
|
2821
2905
|
}
|
|
2822
|
-
},
|
|
2906
|
+
}, _callee3, null, [[0, 11]]);
|
|
2823
2907
|
}));
|
|
2824
2908
|
|
|
2825
2909
|
return function handlePaymentMiddleWare(_x) {
|
|
2826
|
-
return
|
|
2910
|
+
return _ref4.apply(this, arguments);
|
|
2827
2911
|
};
|
|
2828
2912
|
}();
|
|
2829
2913
|
|
|
@@ -2872,7 +2956,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2872
2956
|
isLoading: paymentIsLoading,
|
|
2873
2957
|
handleSetLoading: function handleSetLoading(value) {
|
|
2874
2958
|
return setPaymentIsLoading(value);
|
|
2875
|
-
}
|
|
2959
|
+
},
|
|
2960
|
+
conditions: conditions
|
|
2876
2961
|
}))))));
|
|
2877
2962
|
};
|
|
2878
2963
|
|
|
@@ -3213,6 +3298,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3213
3298
|
value: d.id
|
|
3214
3299
|
};
|
|
3215
3300
|
});
|
|
3301
|
+
var showTicketsField = Boolean(ticketTypesList.length);
|
|
3216
3302
|
|
|
3217
3303
|
var handleSubmit = /*#__PURE__*/function () {
|
|
3218
3304
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
@@ -3280,7 +3366,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3280
3366
|
email: ''
|
|
3281
3367
|
},
|
|
3282
3368
|
onSubmit: handleSubmit
|
|
3283
|
-
}, React.createElement(Form, null, React.createElement("div", {
|
|
3369
|
+
}, React.createElement(Form, null, showTicketsField && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
3284
3370
|
className: "field-item"
|
|
3285
3371
|
}, React.createElement(Field, {
|
|
3286
3372
|
name: "ticketTypeId",
|
|
@@ -3304,7 +3390,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
3304
3390
|
value: '',
|
|
3305
3391
|
disabled: true
|
|
3306
3392
|
}].concat(generateQuantity(10))
|
|
3307
|
-
})), React.createElement("div", {
|
|
3393
|
+
}))), React.createElement("div", {
|
|
3308
3394
|
className: "field-item"
|
|
3309
3395
|
}, React.createElement(Field, {
|
|
3310
3396
|
name: "firstName",
|
|
@@ -3524,7 +3610,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3524
3610
|
onAddToCartSuccess({
|
|
3525
3611
|
skip_billing_page: (_result$data$data$att = result == null ? void 0 : (_result$data = result.data) == null ? void 0 : (_result$data$data = _result$data.data) == null ? void 0 : (_result$data$data$att2 = _result$data$data.attributes) == null ? void 0 : _result$data$data$att2.skip_billing_page) != null ? _result$data$data$att : false,
|
|
3526
3612
|
names_required: (_result$data$data$att3 = result == null ? void 0 : (_result$data2 = result.data) == null ? void 0 : (_result$data2$data = _result$data2.data) == null ? void 0 : (_result$data2$data$at = _result$data2$data.attributes) == null ? void 0 : _result$data2$data$at.names_required) != null ? _result$data$data$att3 : false,
|
|
3527
|
-
age_required: (_result$data$data$att4 = result == null ? void 0 : (_result$data3 = result.data) == null ? void 0 : (_result$data3$data = _result$data3.data) == null ? void 0 : (_result$data3$data$at = _result$data3$data.attributes) == null ? void 0 : _result$data3$data$at.age_required) != null ? _result$data$data$att4 : false
|
|
3613
|
+
age_required: (_result$data$data$att4 = result == null ? void 0 : (_result$data3 = result.data) == null ? void 0 : (_result$data3$data = _result$data3.data) == null ? void 0 : (_result$data3$data$at = _result$data3$data.attributes) == null ? void 0 : _result$data3$data$at.age_required) != null ? _result$data$data$att4 : false,
|
|
3614
|
+
event_id: String(eventId)
|
|
3528
3615
|
});
|
|
3529
3616
|
}
|
|
3530
3617
|
|