tf-checkout-react 1.6.0 → 1.6.1
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/idVerificationContainer/constants.d.ts +4 -0
- package/dist/components/idVerificationContainer/index.d.ts +1 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +159 -98
- 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 +159 -98
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/types/verification.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/idVerificationContainer/constants.ts +5 -0
- package/src/components/idVerificationContainer/index.tsx +81 -29
- package/src/components/ticketsContainer/index.tsx +3 -0
- package/src/types/verification.ts +2 -1
|
@@ -4,6 +4,10 @@ export declare const VERIFICATION_STATUSES: {
|
|
|
4
4
|
FAILED: string;
|
|
5
5
|
WRONG_CUSTOMER: string;
|
|
6
6
|
};
|
|
7
|
+
export declare const VERIFICATION_PROVIDERS: {
|
|
8
|
+
JUMIO: string;
|
|
9
|
+
STRIPE: string;
|
|
10
|
+
};
|
|
7
11
|
export declare const TRANSACTION_STATUSES: {
|
|
8
12
|
ERROR: string;
|
|
9
13
|
SUCCESS: string;
|
|
@@ -10,7 +10,7 @@ interface IDVerificationProps {
|
|
|
10
10
|
onGetVerificationStatusError?: (error: AxiosError) => void;
|
|
11
11
|
onVerificationMessageModalClose?: (status: string | null) => void;
|
|
12
12
|
onPassVerificationStepsSuccess?: () => void;
|
|
13
|
-
onPassVerificationStepsError?: (error: AxiosError) => void;
|
|
13
|
+
onPassVerificationStepsError?: (error: AxiosError | null) => void;
|
|
14
14
|
}
|
|
15
15
|
export declare const IDVerification: (props: IDVerificationProps) => JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -17,6 +17,7 @@ export interface IGetTickets {
|
|
|
17
17
|
contentStyle?: React.CSSProperties;
|
|
18
18
|
onAddToCartError: (e: AxiosError) => void;
|
|
19
19
|
onGetTicketsSuccess: (response: any) => void;
|
|
20
|
+
onGetTicketsPress: () => void;
|
|
20
21
|
onGetTicketsError: (e: AxiosError) => void;
|
|
21
22
|
onLogoutSuccess: () => void;
|
|
22
23
|
onLogoutError: (e: AxiosError) => void;
|
|
@@ -64,5 +65,5 @@ export interface ISelectedTickets {
|
|
|
64
65
|
isTable: boolean;
|
|
65
66
|
[key: string]: string | number | boolean;
|
|
66
67
|
}
|
|
67
|
-
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, onGetProfileDataSuccess, onGetProfileDataError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, tableTicketsHeaderComponent, hideTableTicketsHeader, enableInfluencersSection, enableAddOns, handleNotInvitedModalClose, handleInvalidLinkModalClose, ordersPath, showPoweredByImage, promoText, showGroupNameBlock, currencySybmol, onReserveButtonClick, onPendingVerification, showAlertIcons, }: IGetTickets) => JSX.Element;
|
|
68
|
+
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, onLogoutSuccess, onLogoutError, onGetProfileDataSuccess, onGetProfileDataError, onGetTicketsPress, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, enableBillingInfoAutoCreate, isButtonScrollable, sortBySoldOut, disableCountdownLeadingZero, isLoggedIn, actionsSectionComponent: ActionsSectionComponent, ticketsHeaderComponent, hideTicketsHeader, tableTicketsHeaderComponent, hideTableTicketsHeader, enableInfluencersSection, enableAddOns, handleNotInvitedModalClose, handleInvalidLinkModalClose, ordersPath, showPoweredByImage, promoText, showGroupNameBlock, currencySybmol, onReserveButtonClick, onPendingVerification, showAlertIcons, }: IGetTickets) => JSX.Element;
|
|
68
69
|
export {};
|
|
@@ -6905,6 +6905,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6905
6905
|
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
6906
6906
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
6907
6907
|
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
6908
|
+
_ref$onGetTicketsPres = _ref.onGetTicketsPress,
|
|
6909
|
+
onGetTicketsPress = _ref$onGetTicketsPres === void 0 ? _identity : _ref$onGetTicketsPres,
|
|
6908
6910
|
_ref$theme = _ref.theme,
|
|
6909
6911
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
6910
6912
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
@@ -7263,31 +7265,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
7263
7265
|
}
|
|
7264
7266
|
};
|
|
7265
7267
|
_context2.prev = 8;
|
|
7266
|
-
|
|
7268
|
+
onGetTicketsPress();
|
|
7269
|
+
_context2.next = 12;
|
|
7267
7270
|
return addToCart(eventId, data);
|
|
7268
|
-
case
|
|
7271
|
+
case 12:
|
|
7269
7272
|
result = _context2.sent;
|
|
7270
7273
|
if (!enableAddOns) {
|
|
7271
|
-
_context2.next =
|
|
7274
|
+
_context2.next = 19;
|
|
7272
7275
|
break;
|
|
7273
7276
|
}
|
|
7274
|
-
_context2.next =
|
|
7277
|
+
_context2.next = 16;
|
|
7275
7278
|
return getCheckoutPageConfigs();
|
|
7276
|
-
case
|
|
7279
|
+
case 16:
|
|
7277
7280
|
_context2.t0 = _context2.sent;
|
|
7278
|
-
_context2.next =
|
|
7281
|
+
_context2.next = 20;
|
|
7279
7282
|
break;
|
|
7280
|
-
case
|
|
7283
|
+
case 19:
|
|
7281
7284
|
_context2.t0 = {
|
|
7282
7285
|
status: 200,
|
|
7283
7286
|
data: {
|
|
7284
7287
|
attributes: _get(result, 'data.attributes')
|
|
7285
7288
|
}
|
|
7286
7289
|
};
|
|
7287
|
-
case
|
|
7290
|
+
case 20:
|
|
7288
7291
|
pageConfigsDataResponse = _context2.t0;
|
|
7289
7292
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
7290
|
-
_context2.next =
|
|
7293
|
+
_context2.next = 43;
|
|
7291
7294
|
break;
|
|
7292
7295
|
}
|
|
7293
7296
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -7298,29 +7301,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
7298
7301
|
total = '';
|
|
7299
7302
|
isBrowser && window.localStorage.removeItem('add_ons');
|
|
7300
7303
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
7301
|
-
_context2.next =
|
|
7304
|
+
_context2.next = 42;
|
|
7302
7305
|
break;
|
|
7303
7306
|
}
|
|
7304
7307
|
// Get user data for checkout data
|
|
7305
7308
|
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
7306
7309
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
7307
7310
|
if (!enableBillingInfoAutoCreate) {
|
|
7308
|
-
_context2.next =
|
|
7311
|
+
_context2.next = 38;
|
|
7309
7312
|
break;
|
|
7310
7313
|
}
|
|
7311
|
-
_context2.next =
|
|
7314
|
+
_context2.next = 35;
|
|
7312
7315
|
return postOnCheckout(checkoutBody, freeTicket);
|
|
7313
|
-
case
|
|
7316
|
+
case 35:
|
|
7314
7317
|
_context2.t1 = _context2.sent;
|
|
7315
|
-
_context2.next =
|
|
7318
|
+
_context2.next = 39;
|
|
7316
7319
|
break;
|
|
7317
|
-
case 37:
|
|
7318
|
-
_context2.t1 = null;
|
|
7319
7320
|
case 38:
|
|
7321
|
+
_context2.t1 = null;
|
|
7322
|
+
case 39:
|
|
7320
7323
|
checkoutResponse = _context2.t1;
|
|
7321
7324
|
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
7322
7325
|
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
7323
|
-
case
|
|
7326
|
+
case 42:
|
|
7324
7327
|
onAddToCartSuccess({
|
|
7325
7328
|
skip_billing_page: skipBillingPage,
|
|
7326
7329
|
event_id: String(eventId),
|
|
@@ -7328,11 +7331,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
7328
7331
|
total: total,
|
|
7329
7332
|
hasAddOn: hasAddOn
|
|
7330
7333
|
});
|
|
7331
|
-
case
|
|
7332
|
-
_context2.next =
|
|
7334
|
+
case 43:
|
|
7335
|
+
_context2.next = 48;
|
|
7333
7336
|
break;
|
|
7334
|
-
case
|
|
7335
|
-
_context2.prev =
|
|
7337
|
+
case 45:
|
|
7338
|
+
_context2.prev = 45;
|
|
7336
7339
|
_context2.t2 = _context2["catch"](8);
|
|
7337
7340
|
if ((_e$response = _context2.t2.response) != null && (_e$response$data = _e$response.data) != null && (_e$response$data$data = _e$response$data.data) != null && _e$response$data$data.hasUnverifiedOrder) {
|
|
7338
7341
|
setPendingVerificationMessage((_e$response2 = _context2.t2.response) == null ? void 0 : (_e$response2$data = _e$response2.data) == null ? void 0 : _e$response2$data.message);
|
|
@@ -7349,15 +7352,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
7349
7352
|
setError(message);
|
|
7350
7353
|
}
|
|
7351
7354
|
}
|
|
7352
|
-
case
|
|
7353
|
-
_context2.prev =
|
|
7355
|
+
case 48:
|
|
7356
|
+
_context2.prev = 48;
|
|
7354
7357
|
setHandleBookIsLoading(false);
|
|
7355
|
-
return _context2.finish(
|
|
7356
|
-
case
|
|
7358
|
+
return _context2.finish(48);
|
|
7359
|
+
case 51:
|
|
7357
7360
|
case "end":
|
|
7358
7361
|
return _context2.stop();
|
|
7359
7362
|
}
|
|
7360
|
-
}, _callee2, null, [[8,
|
|
7363
|
+
}, _callee2, null, [[8, 45, 48, 51]]);
|
|
7361
7364
|
}));
|
|
7362
7365
|
return function handleBook() {
|
|
7363
7366
|
return _ref4.apply(this, arguments);
|
|
@@ -10350,6 +10353,10 @@ var VERIFICATION_STATUSES = {
|
|
|
10350
10353
|
FAILED: 'FAILED',
|
|
10351
10354
|
WRONG_CUSTOMER: 'WRONG_CUSTOMER'
|
|
10352
10355
|
};
|
|
10356
|
+
var VERIFICATION_PROVIDERS = {
|
|
10357
|
+
JUMIO: 'jumio',
|
|
10358
|
+
STRIPE: 'stripe'
|
|
10359
|
+
};
|
|
10353
10360
|
var VERIFICATION_MESSAGES = {
|
|
10354
10361
|
PENDING: 'Your ID verification is currently being processed. We will notify you as soon as it is completed. Thank you for your patience.',
|
|
10355
10362
|
APPROVED: 'Your ID verification is approved!',
|
|
@@ -11745,13 +11752,22 @@ var IDVerification = function IDVerification(props) {
|
|
|
11745
11752
|
var _useState4 = React.useState(null),
|
|
11746
11753
|
netverifyUrl = _useState4[0],
|
|
11747
11754
|
setNetverifyUrl = _useState4[1];
|
|
11748
|
-
var _useState5 = React.useState(
|
|
11755
|
+
var _useState5 = React.useState(null),
|
|
11756
|
+
provider = _useState5[0],
|
|
11757
|
+
setProvider = _useState5[1];
|
|
11758
|
+
var _useState6 = React.useState(false),
|
|
11759
|
+
hasError = _useState6[0],
|
|
11760
|
+
setHasError = _useState6[1];
|
|
11761
|
+
var _useState7 = React.useState(null),
|
|
11762
|
+
lastError = _useState7[0],
|
|
11763
|
+
setLastError = _useState7[1];
|
|
11764
|
+
var _useState8 = React.useState({
|
|
11749
11765
|
message: '',
|
|
11750
11766
|
hideCancelBtn: true,
|
|
11751
11767
|
displaModal: false
|
|
11752
11768
|
}),
|
|
11753
|
-
modalData =
|
|
11754
|
-
setModalData =
|
|
11769
|
+
modalData = _useState8[0],
|
|
11770
|
+
setModalData = _useState8[1];
|
|
11755
11771
|
var isAccountVerifiedOrPending = (verificationStatus === VERIFICATION_STATUSES.APPROVED || verificationStatus === VERIFICATION_STATUSES.PENDING) && verificationStatus !== VERIFICATION_STATUSES.WRONG_CUSTOMER;
|
|
11756
11772
|
var handleClose = function handleClose() {
|
|
11757
11773
|
setModalData({
|
|
@@ -11764,43 +11780,71 @@ var IDVerification = function IDVerification(props) {
|
|
|
11764
11780
|
React.useEffect(function () {
|
|
11765
11781
|
var callbackNetVerify = /*#__PURE__*/function () {
|
|
11766
11782
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
|
|
11767
|
-
var result;
|
|
11783
|
+
var data, result;
|
|
11768
11784
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11769
11785
|
while (1) switch (_context.prev = _context.next) {
|
|
11770
11786
|
case 0:
|
|
11787
|
+
if (!(e.data && e.origin === 'https://verify.stripe.com')) {
|
|
11788
|
+
_context.next = 10;
|
|
11789
|
+
break;
|
|
11790
|
+
}
|
|
11791
|
+
data = e.data;
|
|
11792
|
+
if (!(data.type === 'STRIPE_IDENTITY_CLOSE')) {
|
|
11793
|
+
_context.next = 9;
|
|
11794
|
+
break;
|
|
11795
|
+
}
|
|
11796
|
+
_context.next = 5;
|
|
11797
|
+
return getUrl();
|
|
11798
|
+
case 5:
|
|
11799
|
+
setShowModal(false);
|
|
11800
|
+
if (hasError) {
|
|
11801
|
+
setHasError(false);
|
|
11802
|
+
onPassVerificationStepsError(lastError);
|
|
11803
|
+
} else {
|
|
11804
|
+
setHasError(false);
|
|
11805
|
+
onPassVerificationStepsSuccess();
|
|
11806
|
+
}
|
|
11807
|
+
_context.next = 10;
|
|
11808
|
+
break;
|
|
11809
|
+
case 9:
|
|
11810
|
+
if (data.type === 'STRIPE_IDENTITY_ERROR') {
|
|
11811
|
+
setHasError(true);
|
|
11812
|
+
setLastError(data);
|
|
11813
|
+
}
|
|
11814
|
+
case 10:
|
|
11771
11815
|
if (!(e.data && isJson(e.data))) {
|
|
11772
|
-
_context.next =
|
|
11816
|
+
_context.next = 25;
|
|
11773
11817
|
break;
|
|
11774
11818
|
}
|
|
11775
|
-
_context.prev =
|
|
11819
|
+
_context.prev = 11;
|
|
11776
11820
|
result = JSON.parse(e.data);
|
|
11777
11821
|
if (!(result.payload && (result.payload.value === 'success' || result.payload.transactionStatus === 'SUCCESS'))) {
|
|
11778
|
-
_context.next =
|
|
11822
|
+
_context.next = 19;
|
|
11779
11823
|
break;
|
|
11780
11824
|
}
|
|
11781
|
-
_context.next =
|
|
11825
|
+
_context.next = 16;
|
|
11782
11826
|
return updateVerificationStatus();
|
|
11783
|
-
case
|
|
11827
|
+
case 16:
|
|
11784
11828
|
onPassVerificationStepsSuccess();
|
|
11785
|
-
_context.next =
|
|
11829
|
+
_context.next = 20;
|
|
11786
11830
|
break;
|
|
11787
|
-
case
|
|
11831
|
+
case 19:
|
|
11788
11832
|
if (result.payload && (result.payload.value === 'error' || result.payload.transactionStatus === 'ERROR')) {
|
|
11789
11833
|
setShowModal(false);
|
|
11790
11834
|
onPassVerificationStepsError(result.payload);
|
|
11791
11835
|
}
|
|
11792
|
-
case
|
|
11793
|
-
_context.next =
|
|
11836
|
+
case 20:
|
|
11837
|
+
_context.next = 25;
|
|
11794
11838
|
break;
|
|
11795
|
-
case
|
|
11796
|
-
_context.prev =
|
|
11797
|
-
_context.t0 = _context["catch"](
|
|
11839
|
+
case 22:
|
|
11840
|
+
_context.prev = 22;
|
|
11841
|
+
_context.t0 = _context["catch"](11);
|
|
11798
11842
|
onPassVerificationStepsError(_context.t0);
|
|
11799
|
-
case
|
|
11843
|
+
case 25:
|
|
11800
11844
|
case "end":
|
|
11801
11845
|
return _context.stop();
|
|
11802
11846
|
}
|
|
11803
|
-
}, _callee, null, [[
|
|
11847
|
+
}, _callee, null, [[11, 22]]);
|
|
11804
11848
|
}));
|
|
11805
11849
|
return function callbackNetVerify(_x) {
|
|
11806
11850
|
return _ref.apply(this, arguments);
|
|
@@ -11811,74 +11855,94 @@ var IDVerification = function IDVerification(props) {
|
|
|
11811
11855
|
window.removeEventListener('message', callbackNetVerify);
|
|
11812
11856
|
};
|
|
11813
11857
|
}, []);
|
|
11858
|
+
var getUrl = /*#__PURE__*/function () {
|
|
11859
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
11860
|
+
var urlResponse;
|
|
11861
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11862
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11863
|
+
case 0:
|
|
11864
|
+
_context2.prev = 0;
|
|
11865
|
+
_context2.next = 3;
|
|
11866
|
+
return getNetverifyUrl();
|
|
11867
|
+
case 3:
|
|
11868
|
+
urlResponse = _context2.sent;
|
|
11869
|
+
setNetverifyUrl(urlResponse.netverifyUrl);
|
|
11870
|
+
setProvider(urlResponse.provider);
|
|
11871
|
+
onGetVerifyUrlSuccess(urlResponse);
|
|
11872
|
+
_context2.next = 12;
|
|
11873
|
+
break;
|
|
11874
|
+
case 9:
|
|
11875
|
+
_context2.prev = 9;
|
|
11876
|
+
_context2.t0 = _context2["catch"](0);
|
|
11877
|
+
onGetVerifyUrlError(_context2.t0);
|
|
11878
|
+
case 12:
|
|
11879
|
+
case "end":
|
|
11880
|
+
return _context2.stop();
|
|
11881
|
+
}
|
|
11882
|
+
}, _callee2, null, [[0, 9]]);
|
|
11883
|
+
}));
|
|
11884
|
+
return function getUrl() {
|
|
11885
|
+
return _ref2.apply(this, arguments);
|
|
11886
|
+
};
|
|
11887
|
+
}();
|
|
11814
11888
|
React.useEffect(function () {
|
|
11815
11889
|
var intervalId = null;
|
|
11816
11890
|
var orderHash = getQueryVariable('order_hash') || '';
|
|
11817
|
-
var getUrl = /*#__PURE__*/function () {
|
|
11818
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
11819
|
-
var urlResponse;
|
|
11820
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11821
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
11822
|
-
case 0:
|
|
11823
|
-
_context2.prev = 0;
|
|
11824
|
-
_context2.next = 3;
|
|
11825
|
-
return getNetverifyUrl();
|
|
11826
|
-
case 3:
|
|
11827
|
-
urlResponse = _context2.sent;
|
|
11828
|
-
setNetverifyUrl(urlResponse.netverifyUrl);
|
|
11829
|
-
onGetVerifyUrlSuccess(urlResponse);
|
|
11830
|
-
_context2.next = 11;
|
|
11831
|
-
break;
|
|
11832
|
-
case 8:
|
|
11833
|
-
_context2.prev = 8;
|
|
11834
|
-
_context2.t0 = _context2["catch"](0);
|
|
11835
|
-
onGetVerifyUrlError(_context2.t0);
|
|
11836
|
-
case 11:
|
|
11837
|
-
case "end":
|
|
11838
|
-
return _context2.stop();
|
|
11839
|
-
}
|
|
11840
|
-
}, _callee2, null, [[0, 8]]);
|
|
11841
|
-
}));
|
|
11842
|
-
return function getUrl() {
|
|
11843
|
-
return _ref2.apply(this, arguments);
|
|
11844
|
-
};
|
|
11845
|
-
}();
|
|
11846
11891
|
var getVerificationStatus = /*#__PURE__*/function () {
|
|
11847
11892
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
11848
|
-
var statusResponse, status;
|
|
11893
|
+
var _verificationStatus, _provider, verifyUrl, statusResponse, status, isApproved;
|
|
11849
11894
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11850
11895
|
while (1) switch (_context3.prev = _context3.next) {
|
|
11851
11896
|
case 0:
|
|
11852
11897
|
_context3.prev = 0;
|
|
11853
|
-
|
|
11898
|
+
_verificationStatus = null; // Gets te current status of the variable without modifying it
|
|
11899
|
+
setVerificationStatus(function (status) {
|
|
11900
|
+
_verificationStatus = status;
|
|
11901
|
+
return status;
|
|
11902
|
+
});
|
|
11903
|
+
_provider = null; // Gets te current status of the variable without modifying it
|
|
11904
|
+
setProvider(function (state) {
|
|
11905
|
+
_provider = state;
|
|
11906
|
+
return _provider;
|
|
11907
|
+
});
|
|
11908
|
+
verifyUrl = null; // Gets te current status of the variable without modifying it
|
|
11909
|
+
setNetverifyUrl(function (state) {
|
|
11910
|
+
verifyUrl = state;
|
|
11911
|
+
return state;
|
|
11912
|
+
});
|
|
11913
|
+
_context3.next = 9;
|
|
11854
11914
|
return checkVerificationStatus();
|
|
11855
|
-
case
|
|
11915
|
+
case 9:
|
|
11856
11916
|
statusResponse = _context3.sent;
|
|
11857
11917
|
status = statusResponse.data.attributes.status;
|
|
11858
|
-
|
|
11918
|
+
isApproved = status === VERIFICATION_STATUSES.APPROVED;
|
|
11919
|
+
if (_verificationStatus !== status) {
|
|
11859
11920
|
setVerificationStatus(status);
|
|
11860
11921
|
setModalData({
|
|
11861
|
-
displaModal:
|
|
11922
|
+
displaModal: isApproved || status === VERIFICATION_STATUSES.FAILED,
|
|
11862
11923
|
hideCancelBtn: true,
|
|
11863
|
-
message:
|
|
11924
|
+
message: isApproved ? VERIFICATION_MESSAGES.APPROVED : status === VERIFICATION_STATUSES.FAILED ? VERIFICATION_MESSAGES.FAILED : status
|
|
11864
11925
|
});
|
|
11865
11926
|
}
|
|
11927
|
+
if (_provider === VERIFICATION_PROVIDERS.STRIPE && verifyUrl === null && !isApproved) {
|
|
11928
|
+
getUrl();
|
|
11929
|
+
}
|
|
11866
11930
|
onGetVerificationStatusSuccess(statusResponse);
|
|
11867
|
-
_context3.next =
|
|
11931
|
+
_context3.next = 20;
|
|
11868
11932
|
break;
|
|
11869
|
-
case
|
|
11870
|
-
_context3.prev =
|
|
11933
|
+
case 17:
|
|
11934
|
+
_context3.prev = 17;
|
|
11871
11935
|
_context3.t0 = _context3["catch"](0);
|
|
11872
11936
|
onGetVerificationStatusError(_context3.t0);
|
|
11873
|
-
case
|
|
11874
|
-
_context3.prev =
|
|
11937
|
+
case 20:
|
|
11938
|
+
_context3.prev = 20;
|
|
11875
11939
|
setLoadingStatus(false);
|
|
11876
|
-
return _context3.finish(
|
|
11877
|
-
case
|
|
11940
|
+
return _context3.finish(20);
|
|
11941
|
+
case 23:
|
|
11878
11942
|
case "end":
|
|
11879
11943
|
return _context3.stop();
|
|
11880
11944
|
}
|
|
11881
|
-
}, _callee3, null, [[0,
|
|
11945
|
+
}, _callee3, null, [[0, 17, 20, 23]]);
|
|
11882
11946
|
}));
|
|
11883
11947
|
return function getVerificationStatus() {
|
|
11884
11948
|
return _ref3.apply(this, arguments);
|
|
@@ -11890,21 +11954,16 @@ var IDVerification = function IDVerification(props) {
|
|
|
11890
11954
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
11891
11955
|
while (1) switch (_context4.prev = _context4.next) {
|
|
11892
11956
|
case 0:
|
|
11893
|
-
_context4.
|
|
11894
|
-
_context4.next = 3;
|
|
11957
|
+
_context4.next = 2;
|
|
11895
11958
|
return checkCustomerOrder(orderHash);
|
|
11896
|
-
case
|
|
11959
|
+
case 2:
|
|
11897
11960
|
customerOrderResponse = _context4.sent;
|
|
11898
11961
|
return _context4.abrupt("return", customerOrderResponse);
|
|
11899
|
-
case
|
|
11900
|
-
_context4.prev = 7;
|
|
11901
|
-
_context4.t0 = _context4["catch"](0);
|
|
11902
|
-
throw _context4.t0;
|
|
11903
|
-
case 10:
|
|
11962
|
+
case 4:
|
|
11904
11963
|
case "end":
|
|
11905
11964
|
return _context4.stop();
|
|
11906
11965
|
}
|
|
11907
|
-
}, _callee4
|
|
11966
|
+
}, _callee4);
|
|
11908
11967
|
}));
|
|
11909
11968
|
return function getCustomerOrderStatus() {
|
|
11910
11969
|
return _ref4.apply(this, arguments);
|
|
@@ -11981,9 +12040,11 @@ var IDVerification = function IDVerification(props) {
|
|
|
11981
12040
|
className: "page-header"
|
|
11982
12041
|
}, "Account Verification"), loadingStatus ? null : React__default.createElement(React__default.Fragment, null, !isAccountVerifiedOrPending && React__default.createElement("div", {
|
|
11983
12042
|
className: "verify-message"
|
|
11984
|
-
}, "To complete the purchase, please verify your identity."), verificationStatus === VERIFICATION_STATUSES.
|
|
12043
|
+
}, "To complete the purchase, please verify your identity."), verificationStatus === VERIFICATION_STATUSES.APPROVED && React__default.createElement("div", {
|
|
12044
|
+
className: "verify-message"
|
|
12045
|
+
}, VERIFICATION_MESSAGES.APPROVED), (verificationStatus === VERIFICATION_STATUSES.PENDING || provider === VERIFICATION_PROVIDERS.STRIPE && netverifyUrl === null && verificationStatus !== VERIFICATION_STATUSES.APPROVED) && React__default.createElement("div", {
|
|
11985
12046
|
className: "verify-message"
|
|
11986
|
-
}, VERIFICATION_MESSAGES.PENDING), !isAccountVerifiedOrPending && React__default.createElement(Button, {
|
|
12047
|
+
}, VERIFICATION_MESSAGES.PENDING), !isAccountVerifiedOrPending && netverifyUrl !== null && React__default.createElement(Button, {
|
|
11987
12048
|
type: "button",
|
|
11988
12049
|
variant: "contained",
|
|
11989
12050
|
className: "verify-button",
|