tf-checkout-react 1.0.10 → 1.0.14

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.
@@ -10,9 +10,9 @@ export declare function getTickets(id: string | number): Promise<import("axios")
10
10
  export declare const addToCart: (id: string | number, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
11
11
  export declare const getCart: () => Promise<import("axios").AxiosResponse<any, any>>;
12
12
  export declare const postOnCheckout: (data: any, accessToken: string) => Promise<import("axios").AxiosResponse<any, any>>;
13
- export declare const authorize: (data: FormData) => import("axios").AxiosPromise<any>;
13
+ export declare const authorize: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
14
14
  export declare const register: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
15
- export declare const getAccessToken: (data: FormData) => import("axios").AxiosPromise<any>;
15
+ export declare const getAccessToken: (data: FormData) => Promise<import("axios").AxiosResponse<any, any>>;
16
16
  export declare const getPaymentData: (hash: string) => Promise<import("axios").AxiosResponse<any, any>>;
17
17
  export declare const handlePaymentData: (orderHash: string, data: any) => Promise<import("axios").AxiosResponse<any, any>>;
18
18
  export declare const getProfileData: (accessToken: any) => Promise<import("axios").AxiosResponse<any, any>>;
@@ -7,5 +7,6 @@ export interface IBillingInfoPage {
7
7
  handleSubmit: (values: FormikValues, formikHelpers: FormikHelpers<FormikValues>, res?: any) => void;
8
8
  initialValues?: FormikValues;
9
9
  buttonName?: string;
10
+ theme?: 'light' | 'dark';
10
11
  }
11
- export declare const BillingInfoContainer: ({ data, initialValues, buttonName, handleSubmit, }: IBillingInfoPage) => JSX.Element;
12
+ export declare const BillingInfoContainer: ({ data, initialValues, buttonName, handleSubmit, theme }: IBillingInfoPage) => JSX.Element;
@@ -1,4 +1,4 @@
1
- .style_billing-info-container__3ZE3J{margin:0 auto;max-width:800px}.style_billing-info-container__3ZE3J .style_is-half__1W_rP{width:49%}.style_billing-info-container__twoFields__2tDqt{display:flex;justify-content:space-between;margin-top:15px}.style_billing-info-container__singleField__2bcsf{margin-top:15px}button{margin-top:10px}.style_account-actions-block__16OH-{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.style_login-register-button__fGgZf{background-color:#f28051;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:1rem;font-weight:700;line-height:1.15;margin:10px 0;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.style_login-register-block__36tu5{display:flex;justify-content:space-between}
1
+ .style_billing-info-container__3ZE3J{margin:0 auto;max-width:800px}.style_billing-info-container__3ZE3J .style_is-half__1W_rP{width:49%}.style_billing-info-container__twoFields__2tDqt{display:flex;justify-content:space-between;margin-top:15px}.style_billing-info-container__singleField__2bcsf{margin-top:15px}button{margin-top:10px}.style_account-actions-block__16OH-{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.style_login-register-button__fGgZf,.style_MuiButtonBase-root__1UBk9.style_MuiButton-root__3NzEO,.style_MuiButtonBase-root__1UBk9.style_MuiButton-root__3NzEO:hover{background-color:#f28051;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:1rem;font-weight:700;line-height:1.15;margin:10px 0;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.style_login-register-block__36tu5{display:flex;justify-content:space-between}
2
2
  .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:#f28051;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:18px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.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}
3
3
  .style_register-container___s5V8{margin:0 auto;max-width:800px}.style_register-container___s5V8 .style_is-half__2XhZU{width:49%}.style_register-container__twoFields__3dAvM{display:flex;justify-content:space-between;margin-top:15px}.style_register-container__singleField__36dGU{margin-top:15px}button{margin-top:10px}
4
4
  .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}
@@ -8,6 +8,7 @@ var React = require('react');
8
8
  var React__default = _interopDefault(React);
9
9
  var formik = require('formik');
10
10
  var TextField = _interopDefault(require('@mui/material/TextField'));
11
+ var Button = _interopDefault(require('@mui/material/Button'));
11
12
  var _identity = _interopDefault(require('lodash/identity'));
12
13
  var _map = _interopDefault(require('lodash/map'));
13
14
  var _get = _interopDefault(require('lodash/get'));
@@ -867,14 +868,8 @@ var requiredValidator = function requiredValidator(value) {
867
868
 
868
869
  var ttfHeaders = {
869
870
  Accept: 'application/vnd.api+json',
870
- 'Content-Type': 'application/vnd.api+json',
871
- 'X-Source-Origin': 'https://restlessnit.es'
871
+ 'Content-Type': 'application/vnd.api+json'
872
872
  };
873
-
874
- {
875
- ttfHeaders['X-Source-Origin'] = 'https://restlessnit.es';
876
- }
877
-
878
873
  var publicRequest = /*#__PURE__*/axios.create({
879
874
  baseURL: "https://www.ticketfairy.com/api",
880
875
  headers: ttfHeaders
@@ -954,27 +949,13 @@ var postOnCheckout = function postOnCheckout(data, accessToken) {
954
949
  return res;
955
950
  };
956
951
  var authorize = function authorize(data) {
957
- return axios({
958
- method: 'post',
959
- url: 'https://www.ticketfairy.com/api/v1/oauth/authorize-rn?client_id=4792a61f2fcb49197ab4c2d2f44df570',
960
- data: data,
961
- headers: {
962
- 'Content-Type': 'multipart/form-data'
963
- }
964
- });
952
+ return publicRequest.post('/v1/oauth/authorize-rn?client_id=4792a61f2fcb49197ab4c2d2f44df570', data);
965
953
  };
966
954
  var register = function register(data) {
967
955
  return publicRequest.post('/v1/oauth/register-rn', data);
968
956
  };
969
957
  var getAccessToken = function getAccessToken(data) {
970
- return axios({
971
- method: 'post',
972
- url: 'https://www.ticketfairy.com/api/v1/oauth/access_token',
973
- data: data,
974
- headers: {
975
- 'Content-Type': 'multipart/form-data'
976
- }
977
- });
958
+ return publicRequest.post('/v1/oauth/access_token', data);
978
959
  };
979
960
  var getPaymentData = function getPaymentData(hash) {
980
961
  var response = publicRequest.get("v1/order/" + hash + "/review/")["catch"](function (error) {
@@ -1055,7 +1036,7 @@ var LoginModal = function LoginModal(_ref) {
1055
1036
  bodyFormDataToken.append('code', resAutorize.data.data.code);
1056
1037
  bodyFormDataToken.append('scope', 'profile');
1057
1038
  bodyFormDataToken.append('grant_type', 'authorization_code');
1058
- bodyFormDataToken.append('client_id', '4792a61f2fcb49197ab4c2d2f44df570');
1039
+ bodyFormDataToken.append('client_id', 'e9d8f8922797b4621e562255afe90dbf');
1059
1040
  bodyFormDataToken.append('client_secret', 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
1060
1041
  _context.next = 16;
1061
1042
  return getAccessToken(bodyFormDataToken);
@@ -1076,24 +1057,28 @@ var LoginModal = function LoginModal(_ref) {
1076
1057
  last_name: profileSpecifiedData.lastName,
1077
1058
  email: profileSpecifiedData.email
1078
1059
  };
1079
- localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1080
- localStorage.setItem('access_token', accessToken);
1060
+
1061
+ if (typeof window !== 'undefined') {
1062
+ window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1063
+ window.localStorage.setItem('access_token', accessToken);
1064
+ }
1065
+
1081
1066
  onLogin();
1082
- _context.next = 33;
1067
+ _context.next = 32;
1083
1068
  break;
1084
1069
 
1085
- case 29:
1086
- _context.prev = 29;
1070
+ case 28:
1071
+ _context.prev = 28;
1087
1072
  _context.t0 = _context["catch"](1);
1088
1073
  _error = _context.t0.response.data.message || 'Error';
1089
1074
  setError(_error);
1090
1075
 
1091
- case 33:
1076
+ case 32:
1092
1077
  case "end":
1093
1078
  return _context.stop();
1094
1079
  }
1095
1080
  }
1096
- }, _callee, null, [[1, 29]]);
1081
+ }, _callee, null, [[1, 28]]);
1097
1082
  }));
1098
1083
 
1099
1084
  function onSubmit(_x) {
@@ -1188,7 +1173,7 @@ var RegisterModal = function RegisterModal(_ref) {
1188
1173
  bodyFormData.append('email', email);
1189
1174
  bodyFormData.append('password', password);
1190
1175
  bodyFormData.append('password_confirmation', confirmPassword);
1191
- bodyFormData.append('client_id', '4792a61f2fcb49197ab4c2d2f44df570');
1176
+ bodyFormData.append('client_id', 'e9d8f8922797b4621e562255afe90dbf');
1192
1177
  bodyFormData.append('client_secret', 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
1193
1178
  _context.next = 11;
1194
1179
  return register(bodyFormData);
@@ -1209,11 +1194,15 @@ var RegisterModal = function RegisterModal(_ref) {
1209
1194
  last_name: profileSpecifiedData.lastName,
1210
1195
  email: profileSpecifiedData.email
1211
1196
  };
1212
- localStorage.setItem('access_token', access_token);
1213
- localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1197
+
1198
+ if (typeof window !== 'undefined') {
1199
+ window.localStorage.setItem('access_token', access_token);
1200
+ window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1201
+ }
1202
+
1214
1203
  onClose();
1215
1204
 
1216
- case 22:
1205
+ case 21:
1217
1206
  case "end":
1218
1207
  return _context.stop();
1219
1208
  }
@@ -1330,7 +1319,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1330
1319
  _ref$buttonName = _ref.buttonName,
1331
1320
  buttonName = _ref$buttonName === void 0 ? 'Submit' : _ref$buttonName,
1332
1321
  _ref$handleSubmit = _ref.handleSubmit,
1333
- handleSubmit = _ref$handleSubmit === void 0 ? _identity : _ref$handleSubmit;
1322
+ handleSubmit = _ref$handleSubmit === void 0 ? _identity : _ref$handleSubmit,
1323
+ _ref$theme = _ref.theme,
1324
+ theme = _ref$theme === void 0 ? 'light' : _ref$theme;
1334
1325
  var userData = typeof window !== 'undefined' && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
1335
1326
  var access_token = typeof window !== 'undefined' && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
1336
1327
 
@@ -1471,10 +1462,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1471
1462
  last_name: profileSpecifiedData.lastName,
1472
1463
  email: profileSpecifiedData.email
1473
1464
  };
1474
- localStorage.setItem('access_token', access_token_register);
1475
- localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1465
+
1466
+ if (typeof window !== 'undefined') {
1467
+ window.localStorage.setItem('access_token', access_token_register);
1468
+ window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
1469
+ }
1470
+
1476
1471
  holderAge = new Date(values.holderAge);
1477
- _context2.next = 30;
1472
+ _context2.next = 29;
1478
1473
  return postOnCheckout({
1479
1474
  attributes: {
1480
1475
  email: values.email,
@@ -1491,14 +1486,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1491
1486
  }
1492
1487
  }, access_token_register);
1493
1488
 
1494
- case 30:
1489
+ case 29:
1495
1490
  res = _context2.sent;
1496
1491
  handleSubmit(values, formikHelpers, res);
1497
- _context2.next = 38;
1492
+ _context2.next = 37;
1498
1493
  break;
1499
1494
 
1500
- case 34:
1501
- _context2.prev = 34;
1495
+ case 33:
1496
+ _context2.prev = 33;
1502
1497
  _context2.t0 = _context2["catch"](0);
1503
1498
  error = _context2.t0.response.data.message;
1504
1499
 
@@ -1507,12 +1502,12 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1507
1502
  setShowModalLogin(true);
1508
1503
  }
1509
1504
 
1510
- case 38:
1505
+ case 37:
1511
1506
  case "end":
1512
1507
  return _context2.stop();
1513
1508
  }
1514
1509
  }
1515
- }, _callee2, null, [[0, 34]]);
1510
+ }, _callee2, null, [[0, 33]]);
1516
1511
  }));
1517
1512
 
1518
1513
  function onSubmit(_x, _x2) {
@@ -1525,7 +1520,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1525
1520
  return React__default.createElement(formik.Form, {
1526
1521
  onSubmit: props.handleSubmit
1527
1522
  }, React__default.createElement("div", {
1528
- className: "billing-info-container"
1523
+ className: "billing-info-container " + theme
1529
1524
  }, !isLoggedIn && React__default.createElement("div", {
1530
1525
  className: "account-actions-block"
1531
1526
  }, React__default.createElement("div", null, "Got a Restless Nites account?"), React__default.createElement("div", null, "Login & skip ahead:"), React__default.createElement("div", {
@@ -1569,14 +1564,25 @@ var BillingInfoContainer = function BillingInfoContainer(_ref) {
1569
1564
  type: element.type,
1570
1565
  fullWidth: true,
1571
1566
  error: !!meta.error && meta.touched,
1572
- helperText: meta.touched && meta.error
1567
+ helperText: meta.touched && meta.error,
1568
+ InputLabelProps: element.type === 'date' ? {
1569
+ shrink: true
1570
+ } : {}
1573
1571
  }, field));
1574
1572
  }));
1575
1573
  }));
1576
1574
  }));
1577
- }), React__default.createElement("button", {
1578
- type: "submit"
1579
- }, buttonName)));
1575
+ }), React__default.createElement("div", {
1576
+ style: {
1577
+ display: 'flex',
1578
+ padding: 20,
1579
+ justifyContent: 'center'
1580
+ }
1581
+ }, React__default.createElement(Button, {
1582
+ type: "submit",
1583
+ variant: "contained",
1584
+ className: "login-register-button"
1585
+ }, buttonName))));
1580
1586
  }), showModalLogin && React__default.createElement(LoginModal, {
1581
1587
  onClose: function onClose() {
1582
1588
  setShowModalLogin(false);