tf-checkout-react 1.3.48-beta.26 → 1.3.48-beta.27
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/idVerificationContainer/constants.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +94 -9
- 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 +94 -9
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/api/index.ts +9 -0
- package/src/components/idVerificationContainer/constants.ts +2 -0
- package/src/components/idVerificationContainer/index.tsx +51 -12
package/dist/api/index.d.ts
CHANGED
|
@@ -56,4 +56,5 @@ export declare const checkVerificationStatus: () => Promise<{
|
|
|
56
56
|
export declare const updateVerificationStatus: () => Promise<{
|
|
57
57
|
data: UpdateVerificationStatusResponseData;
|
|
58
58
|
}>;
|
|
59
|
+
export declare const checkCustomerOrder: (orderHash: string) => Promise<any>;
|
|
59
60
|
export {};
|
|
@@ -2,6 +2,7 @@ export declare const VERIFICATION_STATUSES: {
|
|
|
2
2
|
PENDING: string;
|
|
3
3
|
APPROVED: string;
|
|
4
4
|
FAILED: string;
|
|
5
|
+
WRONG_CUSTOMER: string;
|
|
5
6
|
};
|
|
6
7
|
export declare const TRANSACTION_STATUSES: {
|
|
7
8
|
ERROR: string;
|
|
@@ -11,4 +12,5 @@ export declare const VERIFICATION_MESSAGES: {
|
|
|
11
12
|
PENDING: string;
|
|
12
13
|
APPROVED: string;
|
|
13
14
|
FAILED: string;
|
|
15
|
+
WRONG_CUSTOMER: string;
|
|
14
16
|
};
|
|
@@ -1253,6 +1253,27 @@ var updateVerificationStatus = /*#__PURE__*/function () {
|
|
|
1253
1253
|
return _ref10.apply(this, arguments);
|
|
1254
1254
|
};
|
|
1255
1255
|
}();
|
|
1256
|
+
var checkCustomerOrder = /*#__PURE__*/function () {
|
|
1257
|
+
var _ref11 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(orderHash) {
|
|
1258
|
+
var response;
|
|
1259
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
1260
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
1261
|
+
case 0:
|
|
1262
|
+
_context11.next = 2;
|
|
1263
|
+
return publicRequest.get("v1/order/" + orderHash + "/verify-customer-order");
|
|
1264
|
+
case 2:
|
|
1265
|
+
response = _context11.sent;
|
|
1266
|
+
return _context11.abrupt("return", response.data);
|
|
1267
|
+
case 4:
|
|
1268
|
+
case "end":
|
|
1269
|
+
return _context11.stop();
|
|
1270
|
+
}
|
|
1271
|
+
}, _callee11);
|
|
1272
|
+
}));
|
|
1273
|
+
return function checkCustomerOrder(_x11) {
|
|
1274
|
+
return _ref11.apply(this, arguments);
|
|
1275
|
+
};
|
|
1276
|
+
}();
|
|
1256
1277
|
|
|
1257
1278
|
function appendScriptsToHeader(code) {
|
|
1258
1279
|
if (isBrowser && code) {
|
|
@@ -8564,12 +8585,14 @@ var SeatMapContainer = function SeatMapContainer(props) {
|
|
|
8564
8585
|
var VERIFICATION_STATUSES = {
|
|
8565
8586
|
PENDING: 'PENDING',
|
|
8566
8587
|
APPROVED: 'APPROVED_VERIFIED',
|
|
8567
|
-
FAILED: 'FAILED'
|
|
8588
|
+
FAILED: 'FAILED',
|
|
8589
|
+
WRONG_CUSTOMER: 'WRONG_CUSTOMER'
|
|
8568
8590
|
};
|
|
8569
8591
|
var VERIFICATION_MESSAGES = {
|
|
8570
8592
|
PENDING: 'Your ID verification is currently being processed. We will notify you as soon as it is completed. Thank you for your patience.',
|
|
8571
8593
|
APPROVED: 'Your ID verification is approved!',
|
|
8572
|
-
FAILED: 'Unfortunately your ID verification has failed. Please try again.'
|
|
8594
|
+
FAILED: 'Unfortunately your ID verification has failed. Please try again.',
|
|
8595
|
+
WRONG_CUSTOMER: 'The order does not belong to the customer.'
|
|
8573
8596
|
};
|
|
8574
8597
|
|
|
8575
8598
|
var IDVerification = function IDVerification(props) {
|
|
@@ -8606,7 +8629,7 @@ var IDVerification = function IDVerification(props) {
|
|
|
8606
8629
|
}),
|
|
8607
8630
|
modalData = _useState5[0],
|
|
8608
8631
|
setModalData = _useState5[1];
|
|
8609
|
-
var isAccountVerifiedOrPending = verificationStatus === VERIFICATION_STATUSES.APPROVED || verificationStatus === VERIFICATION_STATUSES.PENDING;
|
|
8632
|
+
var isAccountVerifiedOrPending = (verificationStatus === VERIFICATION_STATUSES.APPROVED || verificationStatus === VERIFICATION_STATUSES.PENDING) && verificationStatus !== VERIFICATION_STATUSES.WRONG_CUSTOMER;
|
|
8610
8633
|
var handleClose = function handleClose() {
|
|
8611
8634
|
setModalData({
|
|
8612
8635
|
message: '',
|
|
@@ -8666,6 +8689,7 @@ var IDVerification = function IDVerification(props) {
|
|
|
8666
8689
|
};
|
|
8667
8690
|
}, []);
|
|
8668
8691
|
React.useEffect(function () {
|
|
8692
|
+
var intervalId = null;
|
|
8669
8693
|
var getUrl = /*#__PURE__*/function () {
|
|
8670
8694
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
8671
8695
|
var urlResponse;
|
|
@@ -8736,12 +8760,73 @@ var IDVerification = function IDVerification(props) {
|
|
|
8736
8760
|
return _ref3.apply(this, arguments);
|
|
8737
8761
|
};
|
|
8738
8762
|
}();
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8763
|
+
var getCustomerOrderStatus = /*#__PURE__*/function () {
|
|
8764
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
8765
|
+
var orderHash, customerOrderResponse;
|
|
8766
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8767
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
8768
|
+
case 0:
|
|
8769
|
+
_context4.prev = 0;
|
|
8770
|
+
orderHash = getQueryVariable('order_hash') || '';
|
|
8771
|
+
_context4.next = 4;
|
|
8772
|
+
return checkCustomerOrder(orderHash);
|
|
8773
|
+
case 4:
|
|
8774
|
+
customerOrderResponse = _context4.sent;
|
|
8775
|
+
return _context4.abrupt("return", customerOrderResponse);
|
|
8776
|
+
case 8:
|
|
8777
|
+
_context4.prev = 8;
|
|
8778
|
+
_context4.t0 = _context4["catch"](0);
|
|
8779
|
+
throw _context4.t0;
|
|
8780
|
+
case 11:
|
|
8781
|
+
case "end":
|
|
8782
|
+
return _context4.stop();
|
|
8783
|
+
}
|
|
8784
|
+
}, _callee4, null, [[0, 8]]);
|
|
8785
|
+
}));
|
|
8786
|
+
return function getCustomerOrderStatus() {
|
|
8787
|
+
return _ref4.apply(this, arguments);
|
|
8788
|
+
};
|
|
8789
|
+
}();
|
|
8790
|
+
var makeRequests = /*#__PURE__*/function () {
|
|
8791
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
8792
|
+
var _error$response, _error$response$data;
|
|
8793
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8794
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
8795
|
+
case 0:
|
|
8796
|
+
_context5.prev = 0;
|
|
8797
|
+
_context5.next = 3;
|
|
8798
|
+
return getCustomerOrderStatus();
|
|
8799
|
+
case 3:
|
|
8800
|
+
getUrl();
|
|
8801
|
+
getVerificationStatus();
|
|
8802
|
+
// Check the verification status every 30 seconds
|
|
8803
|
+
intervalId = setInterval(function () {
|
|
8804
|
+
getVerificationStatus();
|
|
8805
|
+
}, 10000);
|
|
8806
|
+
_context5.next = 11;
|
|
8807
|
+
break;
|
|
8808
|
+
case 8:
|
|
8809
|
+
_context5.prev = 8;
|
|
8810
|
+
_context5.t0 = _context5["catch"](0);
|
|
8811
|
+
if (((_error$response = _context5.t0.response) == null ? void 0 : (_error$response$data = _error$response.data) == null ? void 0 : _error$response$data.message) === VERIFICATION_MESSAGES.WRONG_CUSTOMER) {
|
|
8812
|
+
setVerificationStatus(VERIFICATION_STATUSES.WRONG_CUSTOMER);
|
|
8813
|
+
setModalData({
|
|
8814
|
+
displaModal: true,
|
|
8815
|
+
hideCancelBtn: true,
|
|
8816
|
+
message: VERIFICATION_MESSAGES.WRONG_CUSTOMER
|
|
8817
|
+
});
|
|
8818
|
+
}
|
|
8819
|
+
case 11:
|
|
8820
|
+
case "end":
|
|
8821
|
+
return _context5.stop();
|
|
8822
|
+
}
|
|
8823
|
+
}, _callee5, null, [[0, 8]]);
|
|
8824
|
+
}));
|
|
8825
|
+
return function makeRequests() {
|
|
8826
|
+
return _ref5.apply(this, arguments);
|
|
8827
|
+
};
|
|
8828
|
+
}();
|
|
8829
|
+
makeRequests();
|
|
8745
8830
|
// Clear the interval when the component unmounts
|
|
8746
8831
|
return function () {
|
|
8747
8832
|
return clearInterval(intervalId);
|