tf-checkout-react 1.2.7 → 1.2.10
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/components/paymentContainer/index.d.ts +4 -5
- package/dist/tf-checkout-react.cjs.development.js +25 -18
- 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 +25 -18
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/api/index.ts +7 -8
- package/src/components/.DS_Store +0 -0
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/myTicketsContainer/index.tsx +2 -1
- package/src/components/orderDetailsContainer/index.tsx +5 -8
- package/src/components/paymentContainer/index.tsx +53 -49
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { AxiosError } from 'axios';
|
|
3
|
-
import { StripeElementsOptions } from '@stripe/stripe-js';
|
|
4
2
|
import './style.css';
|
|
5
|
-
import { IPaymentField } from '../../types';
|
|
6
|
-
import { StripeCardNumberElementOptions } from '@stripe/stripe-js';
|
|
7
3
|
import { ThemeOptions } from '@mui/material';
|
|
8
4
|
import { CSSProperties } from '@mui/styles';
|
|
5
|
+
import { StripeCardNumberElementOptions, StripeElementsOptions } from '@stripe/stripe-js';
|
|
6
|
+
import { AxiosError } from 'axios';
|
|
7
|
+
import { IPaymentField } from '../../types';
|
|
9
8
|
export interface IPaymentPage {
|
|
10
9
|
paymentFields: IPaymentField[];
|
|
11
10
|
handlePayment: any;
|
|
@@ -28,4 +27,4 @@ export interface IPaymentPage {
|
|
|
28
27
|
enablePaymentPlan?: boolean;
|
|
29
28
|
paymentButtonText?: string;
|
|
30
29
|
}
|
|
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;
|
|
30
|
+
export declare const PaymentContainer: ({ paymentFields, handlePayment, formTitle, errorText, checkoutData, onErrorClose, onGetPaymentDataSuccess, onGetPaymentDataError, onPaymentError, stripeCardOptions, disableZipSection, themeOptions, elementsOptions, onCountdownFinish, enableTimer, enablePaymentPlan, paymentButtonText, }: IPaymentPage) => JSX.Element;
|
|
@@ -40,8 +40,8 @@ var _isNumber = _interopDefault(require('lodash/isNumber'));
|
|
|
40
40
|
var SVG = _interopDefault(require('react-inlinesvg'));
|
|
41
41
|
var _flatMapDeep = _interopDefault(require('lodash/flatMapDeep'));
|
|
42
42
|
var _isArray = _interopDefault(require('lodash/isArray'));
|
|
43
|
-
var Container = _interopDefault(require('@mui/material/Container'));
|
|
44
43
|
var Alert = _interopDefault(require('@mui/material/Alert'));
|
|
44
|
+
var Container = _interopDefault(require('@mui/material/Container'));
|
|
45
45
|
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
46
46
|
var stripeJs = require('@stripe/stripe-js');
|
|
47
47
|
var reactShare = require('react-share');
|
|
@@ -1166,8 +1166,8 @@ var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWit
|
|
|
1166
1166
|
return body;
|
|
1167
1167
|
};
|
|
1168
1168
|
|
|
1169
|
-
var isWindowDefined = typeof window !== 'undefined';
|
|
1170
|
-
|
|
1169
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
1170
|
+
var isDocumentDefined = typeof document !== 'undefined';
|
|
1171
1171
|
var ttfHeaders = {
|
|
1172
1172
|
Accept: 'application/vnd.api+json',
|
|
1173
1173
|
'Content-Type': 'application/vnd.api+json'
|
|
@@ -1327,11 +1327,13 @@ function getEvent(id) {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
|
|
1329
1329
|
referralValue = referralId || referralIdlocal;
|
|
1330
|
-
console.log(referralValue);
|
|
1331
1330
|
}
|
|
1332
1331
|
|
|
1333
1332
|
var response = publicRequest.get("v1/event/" + id, {
|
|
1334
|
-
headers: _extends({}, ttfHeaders
|
|
1333
|
+
headers: _extends({}, ttfHeaders, {
|
|
1334
|
+
'Referer-Url': isDocumentDefined ? document.referrer : '',
|
|
1335
|
+
'Referrer-Id': isWindowDefined ? referralValue : ''
|
|
1336
|
+
})
|
|
1335
1337
|
})["catch"](function (error) {
|
|
1336
1338
|
throw error;
|
|
1337
1339
|
});
|
|
@@ -1352,7 +1354,8 @@ var addToCart = function addToCart(id, data) {
|
|
|
1352
1354
|
var res = publicRequest.post("v1/event/" + id + "/add-to-cart/", {
|
|
1353
1355
|
data: data
|
|
1354
1356
|
}, {
|
|
1355
|
-
headers: {
|
|
1357
|
+
headers: {
|
|
1358
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1356
1359
|
}
|
|
1357
1360
|
});
|
|
1358
1361
|
return res;
|
|
@@ -1379,7 +1382,8 @@ var register = function register(data) {
|
|
|
1379
1382
|
};
|
|
1380
1383
|
var getPaymentData = function getPaymentData(hash) {
|
|
1381
1384
|
var response = publicRequest.get("v1/order/" + hash + "/review/", {
|
|
1382
|
-
headers: {
|
|
1385
|
+
headers: {
|
|
1386
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1383
1387
|
}
|
|
1384
1388
|
})["catch"](function (error) {
|
|
1385
1389
|
throw error;
|
|
@@ -1388,7 +1392,8 @@ var getPaymentData = function getPaymentData(hash) {
|
|
|
1388
1392
|
};
|
|
1389
1393
|
var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
|
|
1390
1394
|
var res = publicRequest.post("v1/order/" + orderHash + "/success", undefined, {
|
|
1391
|
-
headers: {
|
|
1395
|
+
headers: {
|
|
1396
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1392
1397
|
}
|
|
1393
1398
|
})["catch"](function (error) {
|
|
1394
1399
|
throw error;
|
|
@@ -1397,7 +1402,8 @@ var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
|
|
|
1397
1402
|
};
|
|
1398
1403
|
var handleFreeSuccess = function handleFreeSuccess(orderHash) {
|
|
1399
1404
|
var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", undefined, {
|
|
1400
|
-
headers: {
|
|
1405
|
+
headers: {
|
|
1406
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1401
1407
|
}
|
|
1402
1408
|
})["catch"](function (error) {
|
|
1403
1409
|
throw error;
|
|
@@ -3951,11 +3957,11 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3951
3957
|
_ref$onErrorClose = _ref.onErrorClose,
|
|
3952
3958
|
onErrorClose = _ref$onErrorClose === void 0 ? _identity : _ref$onErrorClose,
|
|
3953
3959
|
_ref$onGetPaymentData = _ref.onGetPaymentDataSuccess,
|
|
3954
|
-
onGetPaymentDataSuccess = _ref$onGetPaymentData === void 0 ?
|
|
3960
|
+
onGetPaymentDataSuccess = _ref$onGetPaymentData === void 0 ? _identity : _ref$onGetPaymentData,
|
|
3955
3961
|
_ref$onGetPaymentData2 = _ref.onGetPaymentDataError,
|
|
3956
|
-
onGetPaymentDataError = _ref$onGetPaymentData2 === void 0 ?
|
|
3962
|
+
onGetPaymentDataError = _ref$onGetPaymentData2 === void 0 ? _identity : _ref$onGetPaymentData2,
|
|
3957
3963
|
_ref$onPaymentError = _ref.onPaymentError,
|
|
3958
|
-
onPaymentError = _ref$onPaymentError === void 0 ?
|
|
3964
|
+
onPaymentError = _ref$onPaymentError === void 0 ? _identity : _ref$onPaymentError,
|
|
3959
3965
|
_ref$stripeCardOption = _ref.stripeCardOptions,
|
|
3960
3966
|
stripeCardOptions = _ref$stripeCardOption === void 0 ? {} : _ref$stripeCardOption,
|
|
3961
3967
|
_ref$disableZipSectio = _ref.disableZipSection,
|
|
@@ -3963,7 +3969,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3963
3969
|
themeOptions = _ref.themeOptions,
|
|
3964
3970
|
elementsOptions = _ref.elementsOptions,
|
|
3965
3971
|
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3966
|
-
onCountdownFinish = _ref$onCountdownFinis === void 0 ?
|
|
3972
|
+
onCountdownFinish = _ref$onCountdownFinis === void 0 ? _identity : _ref$onCountdownFinis,
|
|
3967
3973
|
_ref$enableTimer = _ref.enableTimer,
|
|
3968
3974
|
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
|
|
3969
3975
|
_ref$enablePaymentPla = _ref.enablePaymentPlan,
|
|
@@ -4003,6 +4009,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4003
4009
|
var eventId = getQueryVariable('event_id');
|
|
4004
4010
|
var hash = checkoutData.hash,
|
|
4005
4011
|
total = checkoutData.total;
|
|
4012
|
+
var isFreeTickets = !Number(total) && !Number(orderData.total);
|
|
4006
4013
|
React.useEffect(function () {
|
|
4007
4014
|
_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
4008
4015
|
var response, _cart$, attributes, cart, order_details, _order_details$ticket, ticket, _orderData;
|
|
@@ -4230,7 +4237,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4230
4237
|
className: "plan_block"
|
|
4231
4238
|
}, React__default.createElement("h3", null, "Mbrand Payment Plan Terms"), React__default.createElement("p", null, "By clicking on the \u201CConfirm Payment Plan\u201D button, you are starting your payment plan of 2 payments of $115.00, which will be drawn from your account every 2 weeks, with the first payment taken later today."), React__default.createElement("p", null, "This includes a non-refundable admin fee of $3.00 per payment."), React__default.createElement("p", {
|
|
4232
4239
|
className: "payment_note"
|
|
4233
|
-
}, "NOTE: If today\u2019s payment fails, your payment plan will not activate, and your tickets will not be issued until you complete your final payment."), React__default.createElement("p", null, "If you do not complete your payements, your order will be canceled. Your first payment of $115.00, plus the non-refundable admin fee of $3.00 will not be refunded."), React__default.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))),
|
|
4240
|
+
}, "NOTE: If today\u2019s payment fails, your payment plan will not activate, and your tickets will not be issued until you complete your final payment."), React__default.createElement("p", null, "If you do not complete your payements, your order will be canceled. Your first payment of $115.00, plus the non-refundable admin fee of $3.00 will not be refunded."), React__default.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))), !isFreeTickets ? React__default.createElement("div", {
|
|
4234
4241
|
className: "payment_info"
|
|
4235
4242
|
}, React__default.createElement("div", {
|
|
4236
4243
|
className: "payment_info_label"
|
|
@@ -5767,7 +5774,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5767
5774
|
|
|
5768
5775
|
var isWindowDefined = typeof window !== 'undefined';
|
|
5769
5776
|
|
|
5770
|
-
var _useState5 = React.useState(isWindowDefined ? !!
|
|
5777
|
+
var _useState5 = React.useState(isWindowDefined ? !!getCookieByName('X-TF-ECOMMERCE') : false),
|
|
5771
5778
|
isLogged = _useState5[0],
|
|
5772
5779
|
setIsLogged = _useState5[1];
|
|
5773
5780
|
|
|
@@ -6505,11 +6512,11 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
6505
6512
|
}, Boolean(personalLinkIcon) && React__default.createElement("img", {
|
|
6506
6513
|
src: personalLinkIcon,
|
|
6507
6514
|
alt: "Icon"
|
|
6508
|
-
}), data == null ? void 0 : data.personal_share_link)), React__default.createElement("div", {
|
|
6515
|
+
}), data == null ? void 0 : data.personal_share_link)), data != null && data.sales_referred ? React__default.createElement("div", {
|
|
6509
6516
|
className: "link-item"
|
|
6510
|
-
}, React__default.createElement("p",
|
|
6517
|
+
}, React__default.createElement("p", {
|
|
6511
6518
|
className: "total-referrer"
|
|
6512
|
-
},
|
|
6519
|
+
}, "So far, you\u2019ve referred " + data.sales_referred + " tickets")) : null), React__default.createElement(TableContainer, {
|
|
6513
6520
|
component: Paper
|
|
6514
6521
|
}, React__default.createElement(Table, {
|
|
6515
6522
|
className: "tt-type",
|