tf-checkout-react 1.2.2 → 1.2.5

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.
@@ -48,4 +48,4 @@ export interface IBillingInfoPage {
48
48
  showForgotPasswordButton?: boolean;
49
49
  showSignUpButton?: boolean;
50
50
  }
51
- export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames, onForgotPasswordSuccess, onForgotPasswordError, shouldFetchCountries, onCountdownFinish, enableTimer, logo, showForgotPasswordButton, showSignUpButton }: IBillingInfoPage) => JSX.Element;
51
+ export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames, onForgotPasswordSuccess, onForgotPasswordError, shouldFetchCountries, onCountdownFinish, enableTimer, logo, showForgotPasswordButton, showSignUpButton, }: IBillingInfoPage) => JSX.Element;
@@ -7,4 +7,4 @@ export interface IPhoneNumberField {
7
7
  type: string;
8
8
  disableDropdown: boolean;
9
9
  }
10
- export declare const PhoneNumberField: ({ label, field, form: { errors, touched, setFieldError, setStatus, initialValues, setFieldValue }, disableDropdown }: IPhoneNumberField) => JSX.Element;
10
+ export declare const PhoneNumberField: ({ label, field, form: { errors, touched, setFieldError, setStatus, initialValues, setFieldValue, }, disableDropdown, }: IPhoneNumberField) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  declare const tableConfig: (key?: string | undefined) => {
2
- header: never[];
2
+ header: string[];
3
3
  body: ((row: any) => any)[];
4
4
  };
5
5
  export default tableConfig;
@@ -26,5 +26,6 @@ export interface IPaymentPage {
26
26
  onCountdownFinish?: () => void;
27
27
  enableTimer?: boolean;
28
28
  enablePaymentPlan?: boolean;
29
+ paymentButtonText?: string;
29
30
  }
30
- export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, elementsOptions, onCountdownFinish, enableTimer, enablePaymentPlan, }: IPaymentPage) => JSX.Element;
31
+ export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, elementsOptions, onCountdownFinish, enableTimer, enablePaymentPlan, paymentButtonText }: IPaymentPage) => JSX.Element;
@@ -15,6 +15,7 @@ export interface ICheckoutForm {
15
15
  handleSetLoading: (loading: any) => void;
16
16
  conditions: any;
17
17
  disableZipSection: boolean;
18
+ paymentButtonText?: string;
18
19
  }
19
- declare const CheckoutForm: ({ total, onSubmit, stripeCardOptions, error, stripe_client_secret, currency, billing_info, isLoading, handleSetLoading, conditions, disableZipSection, }: ICheckoutForm) => JSX.Element;
20
+ declare const CheckoutForm: ({ total, onSubmit, stripeCardOptions, error, stripe_client_secret, currency, billing_info, isLoading, handleSetLoading, conditions, disableZipSection, paymentButtonText }: ICheckoutForm) => JSX.Element;
20
21
  export default CheckoutForm;
@@ -1313,15 +1313,16 @@ var handleSetAccessToken = function handleSetAccessToken(token) {
1313
1313
  }
1314
1314
  };
1315
1315
  function getEvent(id) {
1316
- var referralValue = "";
1316
+ var referralValue = '';
1317
1317
 
1318
1318
  if (isWindowDefined) {
1319
1319
  var params = new URL("" + window.location);
1320
1320
  var referralId = params.searchParams.get('ttf_r') || '';
1321
1321
  var referral_key = window.localStorage.getItem('referral_key');
1322
- var referralIdlocal = "";
1322
+ var referralIdlocal = '';
1323
1323
 
1324
1324
  if (referral_key) {
1325
+ // eslint-disable-next-line prefer-destructuring
1325
1326
  referralIdlocal = referral_key.split('.')[1];
1326
1327
  }
1327
1328
 
@@ -1330,8 +1331,8 @@ function getEvent(id) {
1330
1331
 
1331
1332
  var response = publicRequest.get("v1/event/" + id, {
1332
1333
  headers: _extends({}, ttfHeaders, {
1333
- "Referer-Url": isDocumentDefined ? document.referrer : '',
1334
- "Referrer-Id": isWindowDefined ? referralValue : ''
1334
+ 'Referer-Url': isDocumentDefined ? document.referrer : '',
1335
+ 'Referrer-Id': isWindowDefined ? referralValue : ''
1335
1336
  })
1336
1337
  })["catch"](function (error) {
1337
1338
  throw error;
@@ -1351,9 +1352,10 @@ function getTickets(id, promoCode) {
1351
1352
  }
1352
1353
  var addToCart = function addToCart(id, data) {
1353
1354
  var res = publicRequest.post("v1/event/" + id + "/add-to-cart/", {
1354
- data: data,
1355
+ data: data
1356
+ }, {
1355
1357
  headers: {
1356
- "Referer-Url": isDocumentDefined ? document.referrer : ''
1358
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1357
1359
  }
1358
1360
  });
1359
1361
  return res;
@@ -1381,7 +1383,7 @@ var register = function register(data) {
1381
1383
  var getPaymentData = function getPaymentData(hash) {
1382
1384
  var response = publicRequest.get("v1/order/" + hash + "/review/", {
1383
1385
  headers: {
1384
- "Referer-Url": isDocumentDefined ? document.referrer : ''
1386
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1385
1387
  }
1386
1388
  })["catch"](function (error) {
1387
1389
  throw error;
@@ -1389,9 +1391,9 @@ var getPaymentData = function getPaymentData(hash) {
1389
1391
  return response;
1390
1392
  };
1391
1393
  var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
1392
- var res = publicRequest.post("v1/order/" + orderHash + "/success", {
1394
+ var res = publicRequest.post("v1/order/" + orderHash + "/success", undefined, {
1393
1395
  headers: {
1394
- "Referer-Url": isDocumentDefined ? document.referrer : ''
1396
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1395
1397
  }
1396
1398
  })["catch"](function (error) {
1397
1399
  throw error;
@@ -1399,9 +1401,9 @@ var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
1399
1401
  return res;
1400
1402
  };
1401
1403
  var handleFreeSuccess = function handleFreeSuccess(orderHash) {
1402
- var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", {
1404
+ var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", undefined, {
1403
1405
  headers: {
1404
- "Referer-Url": isDocumentDefined ? document.referrer : ''
1406
+ 'Referer-Url': isDocumentDefined ? document.referrer : ''
1405
1407
  }
1406
1408
  })["catch"](function (error) {
1407
1409
  throw error;
@@ -1822,13 +1824,14 @@ var PhoneNumberField = function PhoneNumberField(_ref) {
1822
1824
  return setFieldValue(field.name, removePlusSign(e));
1823
1825
  },
1824
1826
  variant: "outlined",
1825
- defaultCountry: 'us',
1827
+ defaultCountry: "us",
1826
1828
  disableDropdown: disableDropdown,
1827
1829
  label: label,
1828
1830
  error: !!error && isTouched,
1829
1831
  helperText: isTouched && error,
1830
1832
  fullWidth: true,
1831
- autoFormat: false
1833
+ autoFormat: false,
1834
+ disableAreaCodes: true
1832
1835
  });
1833
1836
  };
1834
1837
 
@@ -3569,7 +3572,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
3569
3572
  type: element.type,
3570
3573
  required: true,
3571
3574
  component: element.type === 'checkbox' ? CheckboxField : element.type === 'phone' ? PhoneNumberField : CustomField,
3572
- validate: combineValidators(element.required ? requiredValidator : function () {}, element.onValidate ? element.onValidate : function () {}),
3575
+ validate: combineValidators(element.required ? requiredValidator : function () {
3576
+ return props.errors[element.name + "-" + index];
3577
+ }, element.onValidate ? element.onValidate : function () {
3578
+ return props.errors[element.name + "-" + index];
3579
+ }),
3573
3580
  disableDropdown: element.disableDropdown
3574
3581
  }));
3575
3582
  })));
@@ -3674,7 +3681,8 @@ var CheckoutForm = function CheckoutForm(_ref) {
3674
3681
  handleSetLoading = _ref$handleSetLoading === void 0 ? function () {} : _ref$handleSetLoading,
3675
3682
  _ref$conditions = _ref.conditions,
3676
3683
  conditions = _ref$conditions === void 0 ? [] : _ref$conditions,
3677
- disableZipSection = _ref.disableZipSection;
3684
+ disableZipSection = _ref.disableZipSection,
3685
+ paymentButtonText = _ref.paymentButtonText;
3678
3686
  var stripe = reactStripeJs.useStripe();
3679
3687
  var elements = reactStripeJs.useElements();
3680
3688
 
@@ -3905,7 +3913,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
3905
3913
  type: "submit"
3906
3914
  }, isLoading ? React__default.createElement(CircularProgress, {
3907
3915
  size: 26
3908
- }) : "Pay " + getCurrencySymbolByCurrency(currency) + total))));
3916
+ }) : (paymentButtonText ? paymentButtonText : 'Pay') + " " + getCurrencySymbolByCurrency(currency) + total))));
3909
3917
  };
3910
3918
 
3911
3919
  var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
@@ -3968,7 +3976,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
3968
3976
  _ref$enableTimer = _ref.enableTimer,
3969
3977
  enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
3970
3978
  _ref$enablePaymentPla = _ref.enablePaymentPlan,
3971
- enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla;
3979
+ enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla,
3980
+ paymentButtonText = _ref.paymentButtonText;
3972
3981
 
3973
3982
  var _useState = React.useState(initialReviewValues),
3974
3983
  reviewData = _useState[0],
@@ -4252,7 +4261,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
4252
4261
  },
4253
4262
  conditions: conditions,
4254
4263
  stripeCardOptions: stripeCardOptions,
4255
- disableZipSection: disableZipSection
4264
+ disableZipSection: disableZipSection,
4265
+ paymentButtonText: paymentButtonText
4256
4266
  })))) : React__default.createElement("div", {
4257
4267
  className: "payment_button " + (paymentIsLoading ? 'disabled-payment-button' : '')
4258
4268
  }, React__default.createElement("button", {
@@ -5676,7 +5686,7 @@ var EventInfoItem = function EventInfoItem(_ref) {
5676
5686
  var image = _ref.image,
5677
5687
  name = _ref.name;
5678
5688
  return React__default.createElement("div", {
5679
- className: 'event-info'
5689
+ className: "event-info"
5680
5690
  }, React__default.createElement("img", {
5681
5691
  src: image,
5682
5692
  alt: "event"
@@ -5689,8 +5699,10 @@ var tableConfig = function tableConfig(key) {
5689
5699
  switch (key) {
5690
5700
  default:
5691
5701
  config = {
5692
- header: [],
5702
+ header: ['Order No.', 'Date', 'Event', 'Total'],
5693
5703
  body: [function (row) {
5704
+ return row.id;
5705
+ }, function (row) {
5694
5706
  return row.date;
5695
5707
  }, function (row) {
5696
5708
  return React__default.createElement(EventInfoItem, {
@@ -5865,9 +5877,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
5865
5877
  },
5866
5878
  userExpired: userExpired,
5867
5879
  logo: logo
5868
- })), data && React__default.createElement(React__default.Fragment, null, React__default.createElement("h2", null, "My Ticket Orders"), React__default.createElement("div", {
5869
- className: "order_event"
5870
- }, React__default.createElement(Autocomplete, {
5880
+ })), data && React__default.createElement(React__default.Fragment, null, React__default.createElement("h2", null, "My Ticket Orders"), React__default.createElement(Autocomplete, {
5871
5881
  disablePortal: true,
5872
5882
  id: "combo-box-demo",
5873
5883
  getOptionLabel: function getOptionLabel(option) {
@@ -5883,10 +5893,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
5883
5893
  label: "Events"
5884
5894
  }));
5885
5895
  }
5886
- }), React__default.createElement("button", {
5887
- type: "button",
5888
- className: "clear"
5889
- }, "CLEAR")), loading ? React__default.createElement("div", {
5896
+ }), loading ? React__default.createElement("div", {
5890
5897
  className: "loading"
5891
5898
  }, React__default.createElement(CircularProgress, null)) : React__default.createElement(React__default.Fragment, null, React__default.createElement(TableContainer, {
5892
5899
  component: Paper,