@os1-platform/dispatch-mobile 2.1.24 → 2.1.26
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 +4 -4
- 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
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
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); }
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
/* eslint-disable react-native/no-inline-styles */
|
|
4
|
-
import { BackHandler,
|
|
4
|
+
import { AppState, BackHandler, ImageBackground, KeyboardAvoidingView, Platform, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';
|
|
5
5
|
import React, { useState, useLayoutEffect, useEffect, useContext, useCallback, useRef } from 'react';
|
|
6
6
|
import { getBaseETResponse, onClickEvent } from '../../../../utils/ExecTaskUtils';
|
|
7
7
|
import { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';
|
|
8
8
|
import { EntityCode, ExecutionTaskID } from '../../../../models/execTasks/ETConfig';
|
|
9
9
|
import { PaymentStyles } from '../PaymentStyles';
|
|
10
10
|
import { CommonStyles, Fonts } from '../../../../styles/executionTasks/CommonStyles';
|
|
11
|
-
import { getPaymentDataMO, getPaymentLink, getPaymentType, removeSharedPrefPaymentData, setSharedPrefPaymentData, setSharedPrefPaymentSelection
|
|
11
|
+
import { formatExpiryTime, getPaymentDataMO, getPaymentLink, getPaymentType, removeSharedPrefPaymentData, setSharedPrefPaymentData, setSharedPrefPaymentSelection
|
|
12
|
+
// useQRExpiryTimer,
|
|
13
|
+
} from '../PaymentUtils';
|
|
12
14
|
import { ActivityIndicator, Button, Modal, Portal, Provider } from 'react-native-paper';
|
|
13
15
|
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
14
16
|
import { PAYMENT_NOTIFICATION } from '../../../../constants/constants';
|
|
@@ -30,6 +32,9 @@ import { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue
|
|
|
30
32
|
import Logger, { LOG_TYPE } from '../../../../utils/Logger';
|
|
31
33
|
const styles = PaymentStyles;
|
|
32
34
|
let storage = Storage.getInstance();
|
|
35
|
+
const DEFAULT_STATUS_BTN_DEFAULT_TIMER = 5; // Default timer value in seconds
|
|
36
|
+
const DEFAULT_MIN_SEC_TO_SHOW_TIMER = 600; // Default timer value in seconds to show expire time (current is 10min )
|
|
37
|
+
|
|
33
38
|
const ProcessPayment = props => {
|
|
34
39
|
var _props$route$params$R, _paymentConfigContext;
|
|
35
40
|
const paymentConfigContext = useContext(PaymentContext);
|
|
@@ -39,6 +44,7 @@ const ProcessPayment = props => {
|
|
|
39
44
|
const [backDisable, setBackDisable] = useState(true);
|
|
40
45
|
const timerRef = useRef();
|
|
41
46
|
const paymentRefId = (_props$route$params$R = props.route.params[RouteParams.ROOT_META_DATA].paymentConfig) === null || _props$route$params$R === void 0 ? void 0 : _props$route$params$R.paymentRefId;
|
|
47
|
+
// For back button timer
|
|
42
48
|
const useTimer = (timerDuration, onTimerEnd) => {
|
|
43
49
|
const [counter, setCounter] = useState(timerDuration);
|
|
44
50
|
const [hasTimerEnded, setHasTimerEnded] = useState(false);
|
|
@@ -59,14 +65,14 @@ const ProcessPayment = props => {
|
|
|
59
65
|
}, [counter, hasTimerEnded]);
|
|
60
66
|
|
|
61
67
|
// Function to reset the timer
|
|
62
|
-
const
|
|
68
|
+
const resetModalTimer = () => {
|
|
63
69
|
setCounter(timerDuration);
|
|
64
70
|
setHasTimerEnded(false);
|
|
65
71
|
setBackDisable(true);
|
|
66
72
|
};
|
|
67
73
|
return {
|
|
68
74
|
counter,
|
|
69
|
-
|
|
75
|
+
resetModalTimer
|
|
70
76
|
};
|
|
71
77
|
};
|
|
72
78
|
const {
|
|
@@ -319,16 +325,93 @@ const ProcessPayment = props => {
|
|
|
319
325
|
}, props))));
|
|
320
326
|
};
|
|
321
327
|
export default ProcessPayment;
|
|
328
|
+
const useQRExpiryTimer = (initialTimerValue, onTimerEnd) => {
|
|
329
|
+
const [timer, setTimer] = useState(initialTimerValue);
|
|
330
|
+
const timerRef = useRef(null);
|
|
331
|
+
const appState = useRef(AppState.currentState);
|
|
332
|
+
const initialTimeRef = useRef(Date.now());
|
|
333
|
+
const resetTimer = useCallback(() => {
|
|
334
|
+
initialTimeRef.current = Date.now();
|
|
335
|
+
setTimer(initialTimerValue);
|
|
336
|
+
}, [initialTimerValue]);
|
|
337
|
+
const updateTimer = useCallback(() => {
|
|
338
|
+
const currentTime = Date.now();
|
|
339
|
+
const elapsedTimeInSeconds = Math.floor((currentTime - initialTimeRef.current) / 1000);
|
|
340
|
+
const remainingTime = Math.max(0, initialTimerValue - elapsedTimeInSeconds);
|
|
341
|
+
if (remainingTime !== timer) {
|
|
342
|
+
setTimer(remainingTime);
|
|
343
|
+
}
|
|
344
|
+
if (remainingTime === 0 && onTimerEnd) {
|
|
345
|
+
onTimerEnd();
|
|
346
|
+
}
|
|
347
|
+
}, [initialTimerValue, onTimerEnd, timer]);
|
|
348
|
+
useEffect(() => {
|
|
349
|
+
resetTimer();
|
|
350
|
+
}, [initialTimerValue, resetTimer]);
|
|
351
|
+
useEffect(() => {
|
|
352
|
+
// Update the timer immediately on mount
|
|
353
|
+
updateTimer();
|
|
354
|
+
const intervalId = setInterval(updateTimer, 1000);
|
|
355
|
+
return () => clearInterval(intervalId);
|
|
356
|
+
}, [updateTimer]);
|
|
357
|
+
useEffect(() => {
|
|
358
|
+
const handleAppStateChange = nextAppState => {
|
|
359
|
+
if (appState.current.match(/inactive|background/) && nextAppState === 'active') {
|
|
360
|
+
// Calculate elapsed time and adjust the initial time reference
|
|
361
|
+
const currentTime = Date.now();
|
|
362
|
+
const elapsedTimeInSeconds = Math.floor((currentTime - initialTimeRef.current) / 1000);
|
|
363
|
+
const newRemainingTime = Math.max(0, initialTimerValue - elapsedTimeInSeconds);
|
|
364
|
+
|
|
365
|
+
// Update initial time ref based on new remaining time
|
|
366
|
+
initialTimeRef.current = currentTime - (initialTimerValue - newRemainingTime) * 1000;
|
|
367
|
+
|
|
368
|
+
// Update the timer
|
|
369
|
+
setTimer(newRemainingTime);
|
|
370
|
+
updateTimer();
|
|
371
|
+
}
|
|
372
|
+
appState.current = nextAppState;
|
|
373
|
+
};
|
|
374
|
+
const subscription = AppState.addEventListener('change', handleAppStateChange);
|
|
375
|
+
return () => {
|
|
376
|
+
subscription.remove();
|
|
377
|
+
};
|
|
378
|
+
}, [updateTimer, initialTimerValue]);
|
|
379
|
+
return {
|
|
380
|
+
formattedTime: formatExpiryTime(timer),
|
|
381
|
+
timerValue: timer,
|
|
382
|
+
resetTimer
|
|
383
|
+
};
|
|
384
|
+
};
|
|
322
385
|
const RenderQR = props => {
|
|
323
386
|
var _paymentConfigContext11;
|
|
387
|
+
const [initialTimer, setInitialTimer] = useState(0); //initial timer to start qr expiry hook
|
|
388
|
+
const [isQRExpired, setIsQRExpired] = useState(false);
|
|
389
|
+
const {
|
|
390
|
+
timerValue,
|
|
391
|
+
formattedTime,
|
|
392
|
+
resetTimer
|
|
393
|
+
} = useQRExpiryTimer(initialTimer, () => {
|
|
394
|
+
setIsQRExpired(true);
|
|
395
|
+
});
|
|
324
396
|
const paymentConfigContext = useContext(PaymentContext);
|
|
325
397
|
const [qrData, setQrData] = useState(null);
|
|
326
398
|
const [showStatusModal, setStatusModal] = useState(false);
|
|
327
399
|
const [showRetryModal, setRetryModal] = useState(false);
|
|
328
400
|
const [disableStatusBtn, setDisableStatusBtn] = useState(true);
|
|
329
401
|
const [fetchQR, setFetchQR] = useState(true);
|
|
330
|
-
const
|
|
331
|
-
|
|
402
|
+
const [snackBar, setSnackBar] = useState({
|
|
403
|
+
show: false,
|
|
404
|
+
type: SnackBarType.SUCCESS,
|
|
405
|
+
message: ''
|
|
406
|
+
});
|
|
407
|
+
const onDismissSnackBar = () => {
|
|
408
|
+
setSnackBar({
|
|
409
|
+
show: false,
|
|
410
|
+
message: '',
|
|
411
|
+
type: SnackBarType.SUCCESS
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
const statusTimerRef = useRef(null);
|
|
332
415
|
const paymentConfig = props.route.params[RouteParams.ROOT_META_DATA].paymentConfig;
|
|
333
416
|
const paymentRefId = paymentConfig === null || paymentConfig === void 0 ? void 0 : paymentConfig.paymentRefId;
|
|
334
417
|
useEffect(() => {
|
|
@@ -347,6 +430,7 @@ const RenderQR = props => {
|
|
|
347
430
|
const fetchQrCode = async () => {
|
|
348
431
|
var _paymentConfigContext6;
|
|
349
432
|
sendClickEvent('QR_CODE');
|
|
433
|
+
setQrData(null);
|
|
350
434
|
setFetchQR(true);
|
|
351
435
|
let qrParams = {
|
|
352
436
|
refId: paymentRefId,
|
|
@@ -373,10 +457,15 @@ const RenderQR = props => {
|
|
|
373
457
|
// };
|
|
374
458
|
setFetchQR(false);
|
|
375
459
|
const _qrData = paymentResp === null || paymentResp === void 0 ? void 0 : paymentResp.data;
|
|
376
|
-
console.log('_qrData
|
|
460
|
+
console.log('_qrData ', _qrData);
|
|
377
461
|
if (_qrData.data.qrCode) {
|
|
378
|
-
var _paymentConfigContext7;
|
|
462
|
+
var _qrData$data, _paymentConfigContext7;
|
|
379
463
|
setQrData(_qrData);
|
|
464
|
+
if (_qrData !== null && _qrData !== void 0 && (_qrData$data = _qrData.data) !== null && _qrData$data !== void 0 && _qrData$data.expiresIn) {
|
|
465
|
+
var _qrData$data2;
|
|
466
|
+
setInitialTimer(_qrData === null || _qrData === void 0 || (_qrData$data2 = _qrData.data) === null || _qrData$data2 === void 0 ? void 0 : _qrData$data2.expiresIn);
|
|
467
|
+
resetTimer();
|
|
468
|
+
}
|
|
380
469
|
setRetryModal(false);
|
|
381
470
|
await setSharedPrefPaymentData(paymentRefId,
|
|
382
471
|
// props.mergedObjectiveId,
|
|
@@ -412,11 +501,38 @@ const RenderQR = props => {
|
|
|
412
501
|
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));
|
|
413
502
|
setFetchQR(false);
|
|
414
503
|
setRetryModal(true);
|
|
504
|
+
} finally {
|
|
505
|
+
setIsQRExpired(false);
|
|
415
506
|
}
|
|
416
507
|
};
|
|
417
508
|
useEffect(() => {
|
|
418
509
|
fetchQrCode();
|
|
419
510
|
}, []);
|
|
511
|
+
|
|
512
|
+
// re-enabling check status button once its completed checking status after 3 seconds
|
|
513
|
+
// using this useEffect because now 'Timer' hook in check status button has been removed
|
|
514
|
+
useEffect(() => {
|
|
515
|
+
// Clear any existing timeout before setting a new one
|
|
516
|
+
if (statusTimerRef.current) {
|
|
517
|
+
clearTimeout(statusTimerRef.current);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
// Only set a new timeout if `disableStatusBtn` is true
|
|
521
|
+
if (disableStatusBtn) {
|
|
522
|
+
statusTimerRef.current = setTimeout(() => {
|
|
523
|
+
onDismissSnackBar();
|
|
524
|
+
setDisableStatusBtn(false);
|
|
525
|
+
statusTimerRef.current = null; // Reset the ref after timeout
|
|
526
|
+
}, DEFAULT_STATUS_BTN_DEFAULT_TIMER * 1000);
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// Clean up the timeout on component unmount
|
|
530
|
+
return () => {
|
|
531
|
+
if (statusTimerRef.current) {
|
|
532
|
+
clearTimeout(statusTimerRef.current);
|
|
533
|
+
}
|
|
534
|
+
};
|
|
535
|
+
}, [disableStatusBtn]);
|
|
420
536
|
const checkStatus = async () => {
|
|
421
537
|
sendClickEvent('CHECK_STATUS');
|
|
422
538
|
setStatusModal(true);
|
|
@@ -463,6 +579,11 @@ const RenderQR = props => {
|
|
|
463
579
|
}
|
|
464
580
|
setStatusModal(false);
|
|
465
581
|
setDisableStatusBtn(true);
|
|
582
|
+
setSnackBar({
|
|
583
|
+
show: true,
|
|
584
|
+
message: `Payment not confirmed. Check again in ${DEFAULT_STATUS_BTN_DEFAULT_TIMER} sec.`,
|
|
585
|
+
type: SnackBarType.PAYMENT_WARNING
|
|
586
|
+
});
|
|
466
587
|
} catch (err) {
|
|
467
588
|
var _err$response3, _err$response4;
|
|
468
589
|
Logger.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), LOG_TYPE.SDK_ERROR);
|
|
@@ -470,19 +591,19 @@ const RenderQR = props => {
|
|
|
470
591
|
setStatusModal(false);
|
|
471
592
|
}
|
|
472
593
|
};
|
|
473
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProgressDialog, {
|
|
594
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, showStatusModal ? /*#__PURE__*/React.createElement(ProgressDialog, {
|
|
474
595
|
customModalContentStyle: {
|
|
475
596
|
paddingVertical: 40
|
|
476
597
|
},
|
|
477
598
|
visible: showStatusModal,
|
|
478
|
-
label: "
|
|
599
|
+
label: "",
|
|
479
600
|
labelStyle: {
|
|
480
601
|
fontWeight: '400',
|
|
481
602
|
marginTop: 16,
|
|
482
603
|
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
483
604
|
color: '#525B7A'
|
|
484
605
|
}
|
|
485
|
-
})
|
|
606
|
+
}) : fetchQR ? /*#__PURE__*/React.createElement(ProgressDialog, {
|
|
486
607
|
visible: qrData ? false : true,
|
|
487
608
|
customModalContentStyle: {
|
|
488
609
|
paddingVertical: 40
|
|
@@ -532,6 +653,12 @@ const RenderQR = props => {
|
|
|
532
653
|
alignItems: 'center',
|
|
533
654
|
paddingTop: 25
|
|
534
655
|
}
|
|
656
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
657
|
+
style: {
|
|
658
|
+
flexDirection: 'column',
|
|
659
|
+
marginBottom: 24,
|
|
660
|
+
alignItems: 'center'
|
|
661
|
+
}
|
|
535
662
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
536
663
|
style: [CommonStyles.titleText, {
|
|
537
664
|
fontSize: 18
|
|
@@ -543,23 +670,44 @@ const RenderQR = props => {
|
|
|
543
670
|
}]
|
|
544
671
|
}, "Total payable amount"), /*#__PURE__*/React.createElement(Text, {
|
|
545
672
|
style: [CommonStyles.titleText, {
|
|
546
|
-
|
|
547
|
-
|
|
673
|
+
fontWeight: 'bold',
|
|
674
|
+
marginTop: 0
|
|
548
675
|
}]
|
|
549
|
-
}, (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.createElement(
|
|
550
|
-
style: {
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
676
|
+
}, (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.createElement(Text, {
|
|
677
|
+
style: [styles.textStyle1, {
|
|
678
|
+
color: isQRExpired ? '#DC2626' : '#D97706',
|
|
679
|
+
// Red color for expired, yellow for active
|
|
680
|
+
marginTop: 12,
|
|
681
|
+
textAlign: 'center',
|
|
682
|
+
fontSize: 16,
|
|
683
|
+
lineHeight: 24
|
|
684
|
+
}]
|
|
685
|
+
}, isQRExpired ? 'QR code expired. Tap to refresh.' : timerValue <= DEFAULT_MIN_SEC_TO_SHOW_TIMER ? `QR code expires in ${formattedTime}` : null)), /*#__PURE__*/React.createElement(ImageBackground, {
|
|
686
|
+
style: styles.qrImage,
|
|
687
|
+
source: isQRExpired ? require('../../../../icons/blurQRCode.png') : {
|
|
688
|
+
uri: qrData === null || qrData === void 0 ? void 0 : qrData.data.qrCode // The actual QR code image
|
|
554
689
|
},
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
690
|
+
resizeMode: "cover" // Ensures the image fills the container
|
|
691
|
+
}, isQRExpired && /*#__PURE__*/React.createElement(View, {
|
|
692
|
+
style: styles.overlay
|
|
693
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
694
|
+
style: [CommonStyles.nextButton, {
|
|
695
|
+
marginEnd: 5,
|
|
696
|
+
marginTop: 5,
|
|
697
|
+
paddingBottom: 3
|
|
698
|
+
}],
|
|
699
|
+
labelStyle: {
|
|
700
|
+
...CommonStyles.nextButtonLabel,
|
|
701
|
+
fontSize: 14,
|
|
702
|
+
textTransform: 'none'
|
|
703
|
+
},
|
|
704
|
+
mode: 'outlined',
|
|
705
|
+
onPress: fetchQrCode
|
|
706
|
+
}, "Refresh QR Code"))), !isQRExpired && /*#__PURE__*/React.createElement(View, {
|
|
559
707
|
style: {
|
|
560
708
|
marginTop: 24
|
|
561
709
|
}
|
|
562
|
-
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
710
|
+
}, !(props !== null && props !== void 0 && props.showGoBackModal || showStatusModal) && /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
563
711
|
size: "small",
|
|
564
712
|
color: "rgba(107, 142, 255, 1)",
|
|
565
713
|
style: {
|
|
@@ -568,27 +716,33 @@ const RenderQR = props => {
|
|
|
568
716
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
569
717
|
style: CommonStyles.subText
|
|
570
718
|
}, "Waiting for the payment confirmation"))))), /*#__PURE__*/React.createElement(View, {
|
|
719
|
+
style: styles.snackBarContainer
|
|
720
|
+
}, /*#__PURE__*/React.createElement(SnackBarCustom, {
|
|
721
|
+
type: snackBar.type,
|
|
722
|
+
message: `${snackBar.message}`,
|
|
723
|
+
visible: snackBar.show,
|
|
724
|
+
onDismiss: onDismissSnackBar
|
|
725
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
571
726
|
style: {
|
|
572
|
-
padding:
|
|
727
|
+
padding: 16,
|
|
573
728
|
borderWidth: 1,
|
|
574
729
|
borderColor: '#E0E3EB'
|
|
575
730
|
}
|
|
576
|
-
}, /*#__PURE__*/React.createElement(
|
|
577
|
-
style: CommonStyles.subText
|
|
578
|
-
}, "Customer payment successful?"), /*#__PURE__*/React.createElement(View, {
|
|
731
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
579
732
|
style: {
|
|
580
733
|
flexDirection: 'row',
|
|
581
734
|
marginStart: 10,
|
|
582
735
|
marginEnd: 10
|
|
583
736
|
}
|
|
584
737
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
585
|
-
style: [CommonStyles.
|
|
738
|
+
style: [CommonStyles.cancelButton, {
|
|
586
739
|
marginEnd: 5,
|
|
587
740
|
flex: 1
|
|
588
741
|
}, disableStatusBtn ? {
|
|
589
|
-
backgroundColor: '#E0E3EB'
|
|
742
|
+
backgroundColor: '#E0E3EB',
|
|
743
|
+
borderColor: '#E0E3EB'
|
|
590
744
|
} : {}],
|
|
591
|
-
labelStyle: [CommonStyles.
|
|
745
|
+
labelStyle: [CommonStyles.cancelButtonLabel, {
|
|
592
746
|
textTransform: 'capitalize'
|
|
593
747
|
}, disableStatusBtn ? {
|
|
594
748
|
color: '#A3AAC2'
|
|
@@ -596,12 +750,7 @@ const RenderQR = props => {
|
|
|
596
750
|
mode: 'outlined',
|
|
597
751
|
onPress: checkStatus,
|
|
598
752
|
disabled: disableStatusBtn
|
|
599
|
-
},
|
|
600
|
-
ref: statusTimerRef,
|
|
601
|
-
singleValue: true,
|
|
602
|
-
timer: 5,
|
|
603
|
-
onTimerEnd: () => setDisableStatusBtn(false)
|
|
604
|
-
}), ' sec)') : 'Check Status')))));
|
|
753
|
+
}, "Check Payment Status")))));
|
|
605
754
|
};
|
|
606
755
|
const PaymentLink = props => {
|
|
607
756
|
var _props$route$params$R2, _paymentConfigContext16;
|
|
@@ -746,7 +895,7 @@ const PaymentLink = props => {
|
|
|
746
895
|
paddingVertical: 40
|
|
747
896
|
},
|
|
748
897
|
visible: showStatusModal,
|
|
749
|
-
label: "Please wait while we are checking the
|
|
898
|
+
label: "Please wait while we are checking the status",
|
|
750
899
|
labelStyle: {
|
|
751
900
|
fontWeight: '400',
|
|
752
901
|
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
@@ -843,7 +992,7 @@ const PaymentLink = props => {
|
|
|
843
992
|
singleValue: true,
|
|
844
993
|
timer: 5,
|
|
845
994
|
onTimerEnd: () => setDisableStatusBtn(false)
|
|
846
|
-
}), ' sec)') : 'Check Status')))));
|
|
995
|
+
}), ' sec)') : 'Check Payment Status')))));
|
|
847
996
|
};
|
|
848
997
|
const modalStyles = StyleSheet.create({
|
|
849
998
|
modalContent: {
|