@os1-platform/dispatch-mobile 2.1.24 → 2.1.25
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/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +17 -1
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +183 -36
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +44 -21
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/icons/blurQRCode.png +0 -0
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js +6 -2
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +2 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +21 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +14 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +11 -14
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +187 -38
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js +1 -1
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +43 -21
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/icons/blurQRCode.png +0 -0
- package/lib/module/ui/screens/CollectPaymentScreen.js +6 -2
- package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -1
- package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +1 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +20 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +1 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +2 -1
- package/package.json +2 -2
- package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +2 -0
- package/src/components/executiontasks/collectPayment/PaymentStyles.ts +37 -12
- package/src/components/executiontasks/collectPayment/PaymentUtils.ts +17 -0
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +19 -18
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +5 -4
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +268 -91
- package/src/components/widgets/ProgressDialog.tsx +2 -0
- package/src/components/widgets/SnackBarCustom.tsx +59 -19
- package/src/icons/blurQRCode.png +0 -0
- package/src/ui/screens/CollectPaymentScreen.tsx +6 -3
|
@@ -37,6 +37,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
37
37
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable react-native/no-inline-styles */
|
|
38
38
|
const styles = _PaymentStyles.PaymentStyles;
|
|
39
39
|
let storage = _storage.default.getInstance();
|
|
40
|
+
const DEFAULT_STATUS_BTN_DEFAULT_TIMER = 5; // Default timer value in seconds
|
|
41
|
+
const DEFAULT_MIN_SEC_TO_SHOW_TIMER = 600; // Default timer value in seconds to show expire time (current is 10min )
|
|
42
|
+
|
|
40
43
|
const ProcessPayment = props => {
|
|
41
44
|
var _props$route$params$R, _paymentConfigContext;
|
|
42
45
|
const paymentConfigContext = (0, _react.useContext)(_paymentContext.PaymentContext);
|
|
@@ -46,6 +49,7 @@ const ProcessPayment = props => {
|
|
|
46
49
|
const [backDisable, setBackDisable] = (0, _react.useState)(true);
|
|
47
50
|
const timerRef = (0, _react.useRef)();
|
|
48
51
|
const paymentRefId = (_props$route$params$R = props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].paymentConfig) === null || _props$route$params$R === void 0 ? void 0 : _props$route$params$R.paymentRefId;
|
|
52
|
+
// For back button timer
|
|
49
53
|
const useTimer = (timerDuration, onTimerEnd) => {
|
|
50
54
|
const [counter, setCounter] = (0, _react.useState)(timerDuration);
|
|
51
55
|
const [hasTimerEnded, setHasTimerEnded] = (0, _react.useState)(false);
|
|
@@ -66,14 +70,14 @@ const ProcessPayment = props => {
|
|
|
66
70
|
}, [counter, hasTimerEnded]);
|
|
67
71
|
|
|
68
72
|
// Function to reset the timer
|
|
69
|
-
const
|
|
73
|
+
const resetModalTimer = () => {
|
|
70
74
|
setCounter(timerDuration);
|
|
71
75
|
setHasTimerEnded(false);
|
|
72
76
|
setBackDisable(true);
|
|
73
77
|
};
|
|
74
78
|
return {
|
|
75
79
|
counter,
|
|
76
|
-
|
|
80
|
+
resetModalTimer
|
|
77
81
|
};
|
|
78
82
|
};
|
|
79
83
|
const {
|
|
@@ -326,16 +330,93 @@ const ProcessPayment = props => {
|
|
|
326
330
|
}, props))));
|
|
327
331
|
};
|
|
328
332
|
var _default = exports.default = ProcessPayment;
|
|
333
|
+
const useQRExpiryTimer = (initialTimerValue, onTimerEnd) => {
|
|
334
|
+
const [timer, setTimer] = (0, _react.useState)(initialTimerValue);
|
|
335
|
+
const timerRef = (0, _react.useRef)(null);
|
|
336
|
+
const appState = (0, _react.useRef)(_reactNative.AppState.currentState);
|
|
337
|
+
const initialTimeRef = (0, _react.useRef)(Date.now());
|
|
338
|
+
const resetTimer = (0, _react.useCallback)(() => {
|
|
339
|
+
initialTimeRef.current = Date.now();
|
|
340
|
+
setTimer(initialTimerValue);
|
|
341
|
+
}, [initialTimerValue]);
|
|
342
|
+
const updateTimer = (0, _react.useCallback)(() => {
|
|
343
|
+
const currentTime = Date.now();
|
|
344
|
+
const elapsedTimeInSeconds = Math.floor((currentTime - initialTimeRef.current) / 1000);
|
|
345
|
+
const remainingTime = Math.max(0, initialTimerValue - elapsedTimeInSeconds);
|
|
346
|
+
if (remainingTime !== timer) {
|
|
347
|
+
setTimer(remainingTime);
|
|
348
|
+
}
|
|
349
|
+
if (remainingTime === 0 && onTimerEnd) {
|
|
350
|
+
onTimerEnd();
|
|
351
|
+
}
|
|
352
|
+
}, [initialTimerValue, onTimerEnd, timer]);
|
|
353
|
+
(0, _react.useEffect)(() => {
|
|
354
|
+
resetTimer();
|
|
355
|
+
}, [initialTimerValue, resetTimer]);
|
|
356
|
+
(0, _react.useEffect)(() => {
|
|
357
|
+
// Update the timer immediately on mount
|
|
358
|
+
updateTimer();
|
|
359
|
+
const intervalId = setInterval(updateTimer, 1000);
|
|
360
|
+
return () => clearInterval(intervalId);
|
|
361
|
+
}, [updateTimer]);
|
|
362
|
+
(0, _react.useEffect)(() => {
|
|
363
|
+
const handleAppStateChange = nextAppState => {
|
|
364
|
+
if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
|
|
365
|
+
// Calculate elapsed time and adjust the initial time reference
|
|
366
|
+
const currentTime = Date.now();
|
|
367
|
+
const elapsedTimeInSeconds = Math.floor((currentTime - initialTimeRef.current) / 1000);
|
|
368
|
+
const newRemainingTime = Math.max(0, initialTimerValue - elapsedTimeInSeconds);
|
|
369
|
+
|
|
370
|
+
// Update initial time ref based on new remaining time
|
|
371
|
+
initialTimeRef.current = currentTime - (initialTimerValue - newRemainingTime) * 1000;
|
|
372
|
+
|
|
373
|
+
// Update the timer
|
|
374
|
+
setTimer(newRemainingTime);
|
|
375
|
+
updateTimer();
|
|
376
|
+
}
|
|
377
|
+
appState.current = nextAppState;
|
|
378
|
+
};
|
|
379
|
+
const subscription = _reactNative.AppState.addEventListener('change', handleAppStateChange);
|
|
380
|
+
return () => {
|
|
381
|
+
subscription.remove();
|
|
382
|
+
};
|
|
383
|
+
}, [updateTimer, initialTimerValue]);
|
|
384
|
+
return {
|
|
385
|
+
formattedTime: (0, _PaymentUtils.formatExpiryTime)(timer),
|
|
386
|
+
timerValue: timer,
|
|
387
|
+
resetTimer
|
|
388
|
+
};
|
|
389
|
+
};
|
|
329
390
|
const RenderQR = props => {
|
|
330
391
|
var _paymentConfigContext11;
|
|
392
|
+
const [initialTimer, setInitialTimer] = (0, _react.useState)(0); //initial timer to start qr expiry hook
|
|
393
|
+
const [isQRExpired, setIsQRExpired] = (0, _react.useState)(false);
|
|
394
|
+
const {
|
|
395
|
+
timerValue,
|
|
396
|
+
formattedTime,
|
|
397
|
+
resetTimer
|
|
398
|
+
} = useQRExpiryTimer(initialTimer, () => {
|
|
399
|
+
setIsQRExpired(true);
|
|
400
|
+
});
|
|
331
401
|
const paymentConfigContext = (0, _react.useContext)(_paymentContext.PaymentContext);
|
|
332
402
|
const [qrData, setQrData] = (0, _react.useState)(null);
|
|
333
403
|
const [showStatusModal, setStatusModal] = (0, _react.useState)(false);
|
|
334
404
|
const [showRetryModal, setRetryModal] = (0, _react.useState)(false);
|
|
335
405
|
const [disableStatusBtn, setDisableStatusBtn] = (0, _react.useState)(true);
|
|
336
406
|
const [fetchQR, setFetchQR] = (0, _react.useState)(true);
|
|
337
|
-
const
|
|
338
|
-
|
|
407
|
+
const [snackBar, setSnackBar] = (0, _react.useState)({
|
|
408
|
+
show: false,
|
|
409
|
+
type: _SnackBarCustom.SnackBarType.SUCCESS,
|
|
410
|
+
message: ''
|
|
411
|
+
});
|
|
412
|
+
const onDismissSnackBar = () => {
|
|
413
|
+
setSnackBar({
|
|
414
|
+
show: false,
|
|
415
|
+
message: '',
|
|
416
|
+
type: _SnackBarCustom.SnackBarType.SUCCESS
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
const statusTimerRef = (0, _react.useRef)(null);
|
|
339
420
|
const paymentConfig = props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].paymentConfig;
|
|
340
421
|
const paymentRefId = paymentConfig === null || paymentConfig === void 0 ? void 0 : paymentConfig.paymentRefId;
|
|
341
422
|
(0, _react.useEffect)(() => {
|
|
@@ -354,6 +435,7 @@ const RenderQR = props => {
|
|
|
354
435
|
const fetchQrCode = async () => {
|
|
355
436
|
var _paymentConfigContext6;
|
|
356
437
|
sendClickEvent('QR_CODE');
|
|
438
|
+
setQrData(null);
|
|
357
439
|
setFetchQR(true);
|
|
358
440
|
let qrParams = {
|
|
359
441
|
refId: paymentRefId,
|
|
@@ -380,10 +462,15 @@ const RenderQR = props => {
|
|
|
380
462
|
// };
|
|
381
463
|
setFetchQR(false);
|
|
382
464
|
const _qrData = paymentResp === null || paymentResp === void 0 ? void 0 : paymentResp.data;
|
|
383
|
-
console.log('_qrData
|
|
465
|
+
console.log('_qrData ', _qrData);
|
|
384
466
|
if (_qrData.data.qrCode) {
|
|
385
|
-
var _paymentConfigContext7;
|
|
467
|
+
var _qrData$data, _paymentConfigContext7;
|
|
386
468
|
setQrData(_qrData);
|
|
469
|
+
if (_qrData !== null && _qrData !== void 0 && (_qrData$data = _qrData.data) !== null && _qrData$data !== void 0 && _qrData$data.expiresIn) {
|
|
470
|
+
var _qrData$data2;
|
|
471
|
+
setInitialTimer(_qrData === null || _qrData === void 0 || (_qrData$data2 = _qrData.data) === null || _qrData$data2 === void 0 ? void 0 : _qrData$data2.expiresIn);
|
|
472
|
+
resetTimer();
|
|
473
|
+
}
|
|
387
474
|
setRetryModal(false);
|
|
388
475
|
await (0, _PaymentUtils.setSharedPrefPaymentData)(paymentRefId,
|
|
389
476
|
// props.mergedObjectiveId,
|
|
@@ -419,11 +506,38 @@ const RenderQR = props => {
|
|
|
419
506
|
console.error('QR Gen: ', JSON.stringify((err === null || err === void 0 || (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : _err$response2.data) || err));
|
|
420
507
|
setFetchQR(false);
|
|
421
508
|
setRetryModal(true);
|
|
509
|
+
} finally {
|
|
510
|
+
setIsQRExpired(false);
|
|
422
511
|
}
|
|
423
512
|
};
|
|
424
513
|
(0, _react.useEffect)(() => {
|
|
425
514
|
fetchQrCode();
|
|
426
515
|
}, []);
|
|
516
|
+
|
|
517
|
+
// re-enabling check status button once its completed checking status after 3 seconds
|
|
518
|
+
// using this useEffect because now 'Timer' hook in check status button has been removed
|
|
519
|
+
(0, _react.useEffect)(() => {
|
|
520
|
+
// Clear any existing timeout before setting a new one
|
|
521
|
+
if (statusTimerRef.current) {
|
|
522
|
+
clearTimeout(statusTimerRef.current);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// Only set a new timeout if `disableStatusBtn` is true
|
|
526
|
+
if (disableStatusBtn) {
|
|
527
|
+
statusTimerRef.current = setTimeout(() => {
|
|
528
|
+
onDismissSnackBar();
|
|
529
|
+
setDisableStatusBtn(false);
|
|
530
|
+
statusTimerRef.current = null; // Reset the ref after timeout
|
|
531
|
+
}, DEFAULT_STATUS_BTN_DEFAULT_TIMER * 1000);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
// Clean up the timeout on component unmount
|
|
535
|
+
return () => {
|
|
536
|
+
if (statusTimerRef.current) {
|
|
537
|
+
clearTimeout(statusTimerRef.current);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
540
|
+
}, [disableStatusBtn]);
|
|
427
541
|
const checkStatus = async () => {
|
|
428
542
|
sendClickEvent('CHECK_STATUS');
|
|
429
543
|
setStatusModal(true);
|
|
@@ -470,6 +584,11 @@ const RenderQR = props => {
|
|
|
470
584
|
}
|
|
471
585
|
setStatusModal(false);
|
|
472
586
|
setDisableStatusBtn(true);
|
|
587
|
+
setSnackBar({
|
|
588
|
+
show: true,
|
|
589
|
+
message: `Payment not confirmed. Check again in ${DEFAULT_STATUS_BTN_DEFAULT_TIMER} sec.`,
|
|
590
|
+
type: _SnackBarCustom.SnackBarType.PAYMENT_WARNING
|
|
591
|
+
});
|
|
473
592
|
} catch (err) {
|
|
474
593
|
var _err$response3, _err$response4;
|
|
475
594
|
_Logger.default.getInstance().logEvent('~ checkStatus triggered ', JSON.stringify((err === null || err === void 0 || (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : _err$response3.data) || err), _Logger.LOG_TYPE.SDK_ERROR);
|
|
@@ -477,19 +596,19 @@ const RenderQR = props => {
|
|
|
477
596
|
setStatusModal(false);
|
|
478
597
|
}
|
|
479
598
|
};
|
|
480
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProgressDialog.default, {
|
|
599
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, showStatusModal ? /*#__PURE__*/_react.default.createElement(_ProgressDialog.default, {
|
|
481
600
|
customModalContentStyle: {
|
|
482
601
|
paddingVertical: 40
|
|
483
602
|
},
|
|
484
603
|
visible: showStatusModal,
|
|
485
|
-
label: "
|
|
604
|
+
label: "",
|
|
486
605
|
labelStyle: {
|
|
487
606
|
fontWeight: '400',
|
|
488
607
|
marginTop: 16,
|
|
489
608
|
fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
490
609
|
color: '#525B7A'
|
|
491
610
|
}
|
|
492
|
-
})
|
|
611
|
+
}) : fetchQR ? /*#__PURE__*/_react.default.createElement(_ProgressDialog.default, {
|
|
493
612
|
visible: qrData ? false : true,
|
|
494
613
|
customModalContentStyle: {
|
|
495
614
|
paddingVertical: 40
|
|
@@ -539,6 +658,12 @@ const RenderQR = props => {
|
|
|
539
658
|
alignItems: 'center',
|
|
540
659
|
paddingTop: 25
|
|
541
660
|
}
|
|
661
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
662
|
+
style: {
|
|
663
|
+
flexDirection: 'column',
|
|
664
|
+
marginBottom: 24,
|
|
665
|
+
alignItems: 'center'
|
|
666
|
+
}
|
|
542
667
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
543
668
|
style: [_CommonStyles.CommonStyles.titleText, {
|
|
544
669
|
fontSize: 18
|
|
@@ -550,23 +675,44 @@ const RenderQR = props => {
|
|
|
550
675
|
}]
|
|
551
676
|
}, "Total payable amount"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
552
677
|
style: [_CommonStyles.CommonStyles.titleText, {
|
|
553
|
-
|
|
554
|
-
|
|
678
|
+
fontWeight: 'bold',
|
|
679
|
+
marginTop: 0
|
|
555
680
|
}]
|
|
556
|
-
}, (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext11 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext11 === void 0 || (_paymentConfigContext11 = _paymentConfigContext11.etConfig) === null || _paymentConfigContext11 === void 0 ? void 0 : _paymentConfigContext11.currencyCode) + ' ' + props.expectedAmount), /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
557
|
-
style: {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
681
|
+
}, (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext11 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext11 === void 0 || (_paymentConfigContext11 = _paymentConfigContext11.etConfig) === null || _paymentConfigContext11 === void 0 ? void 0 : _paymentConfigContext11.currencyCode) + ' ' + props.expectedAmount), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
682
|
+
style: [styles.textStyle1, {
|
|
683
|
+
color: isQRExpired ? '#DC2626' : '#D97706',
|
|
684
|
+
// Red color for expired, yellow for active
|
|
685
|
+
marginTop: 12,
|
|
686
|
+
textAlign: 'center',
|
|
687
|
+
fontSize: 16,
|
|
688
|
+
lineHeight: 24
|
|
689
|
+
}]
|
|
690
|
+
}, isQRExpired ? 'QR code expired. Tap to refresh.' : timerValue <= DEFAULT_MIN_SEC_TO_SHOW_TIMER ? `QR code expires in ${formattedTime}` : null)), /*#__PURE__*/_react.default.createElement(_reactNative.ImageBackground, {
|
|
691
|
+
style: styles.qrImage,
|
|
692
|
+
source: isQRExpired ? require('../../../../icons/blurQRCode.png') : {
|
|
693
|
+
uri: qrData === null || qrData === void 0 ? void 0 : qrData.data.qrCode // The actual QR code image
|
|
561
694
|
},
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
695
|
+
resizeMode: "cover" // Ensures the image fills the container
|
|
696
|
+
}, isQRExpired && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
697
|
+
style: styles.overlay
|
|
698
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
699
|
+
style: [_CommonStyles.CommonStyles.nextButton, {
|
|
700
|
+
marginEnd: 5,
|
|
701
|
+
marginTop: 5,
|
|
702
|
+
paddingBottom: 3
|
|
703
|
+
}],
|
|
704
|
+
labelStyle: {
|
|
705
|
+
..._CommonStyles.CommonStyles.nextButtonLabel,
|
|
706
|
+
fontSize: 14,
|
|
707
|
+
textTransform: 'none'
|
|
708
|
+
},
|
|
709
|
+
mode: 'outlined',
|
|
710
|
+
onPress: fetchQrCode
|
|
711
|
+
}, "Refresh QR Code"))), !isQRExpired && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
566
712
|
style: {
|
|
567
713
|
marginTop: 24
|
|
568
714
|
}
|
|
569
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNativePaper.ActivityIndicator, {
|
|
715
|
+
}, !(props !== null && props !== void 0 && props.showGoBackModal || showStatusModal) && /*#__PURE__*/_react.default.createElement(_reactNativePaper.ActivityIndicator, {
|
|
570
716
|
size: "small",
|
|
571
717
|
color: "rgba(107, 142, 255, 1)",
|
|
572
718
|
style: {
|
|
@@ -575,27 +721,33 @@ const RenderQR = props => {
|
|
|
575
721
|
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
576
722
|
style: _CommonStyles.CommonStyles.subText
|
|
577
723
|
}, "Waiting for the payment confirmation"))))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
724
|
+
style: styles.snackBarContainer
|
|
725
|
+
}, /*#__PURE__*/_react.default.createElement(_SnackBarCustom.default, {
|
|
726
|
+
type: snackBar.type,
|
|
727
|
+
message: `${snackBar.message}`,
|
|
728
|
+
visible: snackBar.show,
|
|
729
|
+
onDismiss: onDismissSnackBar
|
|
730
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
578
731
|
style: {
|
|
579
|
-
padding:
|
|
732
|
+
padding: 16,
|
|
580
733
|
borderWidth: 1,
|
|
581
734
|
borderColor: '#E0E3EB'
|
|
582
735
|
}
|
|
583
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
584
|
-
style: _CommonStyles.CommonStyles.subText
|
|
585
|
-
}, "Customer payment successful?"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
736
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
586
737
|
style: {
|
|
587
738
|
flexDirection: 'row',
|
|
588
739
|
marginStart: 10,
|
|
589
740
|
marginEnd: 10
|
|
590
741
|
}
|
|
591
742
|
}, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
|
|
592
|
-
style: [_CommonStyles.CommonStyles.
|
|
743
|
+
style: [_CommonStyles.CommonStyles.cancelButton, {
|
|
593
744
|
marginEnd: 5,
|
|
594
745
|
flex: 1
|
|
595
746
|
}, disableStatusBtn ? {
|
|
596
|
-
backgroundColor: '#E0E3EB'
|
|
747
|
+
backgroundColor: '#E0E3EB',
|
|
748
|
+
borderColor: '#E0E3EB'
|
|
597
749
|
} : {}],
|
|
598
|
-
labelStyle: [_CommonStyles.CommonStyles.
|
|
750
|
+
labelStyle: [_CommonStyles.CommonStyles.cancelButtonLabel, {
|
|
599
751
|
textTransform: 'capitalize'
|
|
600
752
|
}, disableStatusBtn ? {
|
|
601
753
|
color: '#A3AAC2'
|
|
@@ -603,12 +755,7 @@ const RenderQR = props => {
|
|
|
603
755
|
mode: 'outlined',
|
|
604
756
|
onPress: checkStatus,
|
|
605
757
|
disabled: disableStatusBtn
|
|
606
|
-
},
|
|
607
|
-
ref: statusTimerRef,
|
|
608
|
-
singleValue: true,
|
|
609
|
-
timer: 5,
|
|
610
|
-
onTimerEnd: () => setDisableStatusBtn(false)
|
|
611
|
-
}), ' sec)') : 'Check Status')))));
|
|
758
|
+
}, "Check Payment Status")))));
|
|
612
759
|
};
|
|
613
760
|
const PaymentLink = props => {
|
|
614
761
|
var _props$route$params$R2, _paymentConfigContext16;
|
|
@@ -753,7 +900,7 @@ const PaymentLink = props => {
|
|
|
753
900
|
paddingVertical: 40
|
|
754
901
|
},
|
|
755
902
|
visible: showStatusModal,
|
|
756
|
-
label: "Please wait while we are checking the
|
|
903
|
+
label: "Please wait while we are checking the status",
|
|
757
904
|
labelStyle: {
|
|
758
905
|
fontWeight: '400',
|
|
759
906
|
fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
@@ -850,7 +997,7 @@ const PaymentLink = props => {
|
|
|
850
997
|
singleValue: true,
|
|
851
998
|
timer: 5,
|
|
852
999
|
onTimerEnd: () => setDisableStatusBtn(false)
|
|
853
|
-
}), ' sec)') : 'Check Status')))));
|
|
1000
|
+
}), ' sec)') : 'Check Payment Status')))));
|
|
854
1001
|
};
|
|
855
1002
|
const modalStyles = _reactNative.StyleSheet.create({
|
|
856
1003
|
modalContent: {
|