boxpay-checkout-reactnative-sdk 1.0.10-beta1 → 1.0.11-beta2
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/module/interface.js +13 -0
- package/lib/module/interface.js.map +1 -1
- package/lib/module/navigation.js +11 -10
- package/lib/module/navigation.js.map +1 -1
- package/lib/module/postRequest/fetchPaymentMethods.js +6 -1
- package/lib/module/postRequest/fetchPaymentMethods.js.map +1 -1
- package/lib/module/screens/addressScreen.js +7 -3
- package/lib/module/screens/addressScreen.js.map +1 -1
- package/lib/module/screens/bnplScreen.js +10 -3
- package/lib/module/screens/bnplScreen.js.map +1 -1
- package/lib/module/screens/cardScreen.js +359 -348
- package/lib/module/screens/cardScreen.js.map +1 -1
- package/lib/module/screens/emiScreen.js +14 -5
- package/lib/module/screens/emiScreen.js.map +1 -1
- package/lib/module/screens/mainScreen.js +17 -5
- package/lib/module/screens/mainScreen.js.map +1 -1
- package/lib/module/screens/netBankingScreen.js +10 -3
- package/lib/module/screens/netBankingScreen.js.map +1 -1
- package/lib/module/screens/walletScreen.js +10 -3
- package/lib/module/screens/walletScreen.js.map +1 -1
- package/lib/module/sdk-version.json +1 -1
- package/lib/module/sharedContext/handleAutoNavigation.js +33 -0
- package/lib/module/sharedContext/handleAutoNavigation.js.map +1 -0
- package/lib/module/sharedContext/handlePaymentResponseHandler.js +7 -5
- package/lib/module/sharedContext/handlePaymentResponseHandler.js.map +1 -1
- package/lib/module/styles/screens/cardScreenStyles.js +14 -7
- package/lib/module/styles/screens/cardScreenStyles.js.map +1 -1
- package/lib/typescript/src/interface.d.ts +28 -0
- package/lib/typescript/src/interface.d.ts.map +1 -1
- package/lib/typescript/src/navigation.d.ts.map +1 -1
- package/lib/typescript/src/postRequest/fetchPaymentMethods.d.ts.map +1 -1
- package/lib/typescript/src/screens/addressScreen.d.ts +1 -1
- package/lib/typescript/src/screens/addressScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/bnplScreen.d.ts +4 -2
- package/lib/typescript/src/screens/bnplScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/cardScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/emiScreen.d.ts +4 -2
- package/lib/typescript/src/screens/emiScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/mainScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/netBankingScreen.d.ts +4 -2
- package/lib/typescript/src/screens/netBankingScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/walletScreen.d.ts +4 -2
- package/lib/typescript/src/screens/walletScreen.d.ts.map +1 -1
- package/lib/typescript/src/sharedContext/handleAutoNavigation.d.ts +3 -0
- package/lib/typescript/src/sharedContext/handleAutoNavigation.d.ts.map +1 -0
- package/lib/typescript/src/sharedContext/handlePaymentResponseHandler.d.ts.map +1 -1
- package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts +14 -7
- package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/interface.ts +41 -1
- package/src/navigation.tsx +11 -10
- package/src/postRequest/fetchPaymentMethods.ts +15 -4
- package/src/screens/addressScreen.tsx +10 -5
- package/src/screens/bnplScreen.tsx +12 -5
- package/src/screens/cardScreen.tsx +19 -9
- package/src/screens/emiScreen.tsx +17 -7
- package/src/screens/mainScreen.tsx +18 -5
- package/src/screens/netBankingScreen.tsx +12 -5
- package/src/screens/walletScreen.tsx +11 -5
- package/src/sdk-version.json +1 -1
- package/src/sharedContext/handleAutoNavigation.ts +50 -0
- package/src/sharedContext/handlePaymentResponseHandler.ts +10 -7
- package/src/styles/screens/cardScreenStyles.ts +11 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { View, Text, Image, BackHandler, Pressable, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { View, Text, Image, BackHandler, Pressable, TouchableOpacity, ScrollView } from 'react-native';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
5
|
import Header from "../components/header.js";
|
|
6
6
|
import { TextInput } from 'react-native-paper';
|
|
@@ -40,7 +40,8 @@ const CardScreen = ({
|
|
|
40
40
|
amount,
|
|
41
41
|
percent,
|
|
42
42
|
cardType,
|
|
43
|
-
issuerBrand
|
|
43
|
+
issuerBrand,
|
|
44
|
+
isAutoNavigationEnabled
|
|
44
45
|
} = route.params || {};
|
|
45
46
|
const durationNumber = Array.isArray(duration) ? duration[0] : duration;
|
|
46
47
|
const bankNameStr = Array.isArray(bankName) ? bankName[0] : bankName;
|
|
@@ -90,7 +91,7 @@ const CardScreen = ({
|
|
|
90
91
|
const paymentFailedMessage = useRef('You may have cancelled the payment or there was a delay in response. Please retry.');
|
|
91
92
|
const [sessionExpireModalOpen, setSessionExppireModalState] = useState(false);
|
|
92
93
|
const [successfulTimeStamp, setSuccessfulTimeStamp] = useState('');
|
|
93
|
-
const [status, setStatus] = useState(
|
|
94
|
+
const [status, setStatus] = useState("NOACTION");
|
|
94
95
|
const [transactionId, setTransactionId] = useState(null);
|
|
95
96
|
const backgroundApiInterval = useRef(null);
|
|
96
97
|
const [imageLoad, setImageLoad] = useState(true);
|
|
@@ -333,8 +334,13 @@ const CardScreen = ({
|
|
|
333
334
|
}
|
|
334
335
|
};
|
|
335
336
|
const onProceedBack = () => {
|
|
336
|
-
|
|
337
|
-
|
|
337
|
+
if (isAutoNavigationEnabled) {
|
|
338
|
+
onExitCheckout();
|
|
339
|
+
return true;
|
|
340
|
+
} else {
|
|
341
|
+
navigation.goBack();
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
338
344
|
};
|
|
339
345
|
const callFetchStatusApi = async () => {
|
|
340
346
|
const response = await fetchStatus();
|
|
@@ -443,324 +449,279 @@ const CardScreen = ({
|
|
|
443
449
|
children: "Loading..."
|
|
444
450
|
})]
|
|
445
451
|
}) : /*#__PURE__*/_jsxs(View, {
|
|
446
|
-
style:
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
452
|
+
style: {
|
|
453
|
+
flex: 1
|
|
454
|
+
},
|
|
455
|
+
children: [/*#__PURE__*/_jsxs(ScrollView, {
|
|
456
|
+
contentContainerStyle: styles.screenView,
|
|
457
|
+
keyboardShouldPersistTaps: "handled",
|
|
458
|
+
children: [/*#__PURE__*/_jsx(Header, {
|
|
459
|
+
onBackPress: onProceedBack,
|
|
460
|
+
showDesc: true,
|
|
461
|
+
showSecure: true,
|
|
462
|
+
text: "Pay via Card"
|
|
463
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
464
|
+
style: styles.divider
|
|
465
|
+
}), bankNameStr != '' && bankName != undefined && /*#__PURE__*/_jsxs(View, {
|
|
466
|
+
style: styles.container,
|
|
461
467
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
462
|
-
style:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
468
|
+
style: {
|
|
469
|
+
flexDirection: 'row',
|
|
470
|
+
alignItems: 'center'
|
|
471
|
+
},
|
|
472
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
473
|
+
style: styles.imageContainer,
|
|
474
|
+
children: [imageLoad && !imageError && /*#__PURE__*/_jsx(ShimmerPlaceHolder, {
|
|
475
|
+
visible: false // Keep shimmer until loading is done
|
|
476
|
+
,
|
|
477
|
+
style: {
|
|
478
|
+
width: 32,
|
|
479
|
+
height: 32,
|
|
480
|
+
borderRadius: 8
|
|
481
|
+
}
|
|
482
|
+
}), !imageError ? /*#__PURE__*/_jsx(SvgUri, {
|
|
483
|
+
uri: bankUrlStr || '',
|
|
484
|
+
width: 100 // Keep original size
|
|
485
|
+
,
|
|
486
|
+
height: 100,
|
|
487
|
+
style: {
|
|
488
|
+
transform: [{
|
|
489
|
+
scale: 0.4
|
|
490
|
+
}]
|
|
491
|
+
},
|
|
492
|
+
onLoad: () => setImageLoad(false),
|
|
493
|
+
onError: () => {
|
|
494
|
+
setImageError(true);
|
|
495
|
+
setImageLoad(false);
|
|
496
|
+
}
|
|
497
|
+
}) : /*#__PURE__*/_jsx(Image, {
|
|
498
|
+
source: require('../../assets/images/ic_netbanking_semi_bold.png'),
|
|
499
|
+
style: {
|
|
500
|
+
transform: [{
|
|
501
|
+
scale: 0.4
|
|
502
|
+
}]
|
|
503
|
+
}
|
|
504
|
+
})]
|
|
505
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
506
|
+
style: [styles.nameText, {
|
|
507
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
508
|
+
}],
|
|
509
|
+
children: bankNameStr
|
|
510
|
+
})]
|
|
511
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
512
|
+
style: styles.thickBorder,
|
|
513
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
514
|
+
style: [styles.durationText, {
|
|
515
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
516
|
+
}],
|
|
517
|
+
children: [duration, " months x", /*#__PURE__*/_jsxs(Text, {
|
|
518
|
+
style: styles.currencyText,
|
|
519
|
+
children: [' ', checkoutDetails.currencySymbol]
|
|
520
|
+
}), amountStr]
|
|
521
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
522
|
+
style: [styles.percentText, {
|
|
523
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
524
|
+
}],
|
|
525
|
+
children: ["@", percentNumber, "% p.a."]
|
|
493
526
|
})]
|
|
494
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
495
|
-
style: [styles.nameText, {
|
|
496
|
-
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
497
|
-
}],
|
|
498
|
-
children: bankNameStr
|
|
499
527
|
})]
|
|
500
|
-
}), /*#__PURE__*/
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
style: [styles.
|
|
504
|
-
|
|
505
|
-
}],
|
|
506
|
-
children: [duration, " months x", /*#__PURE__*/_jsxs(Text, {
|
|
507
|
-
style: styles.currencyText,
|
|
508
|
-
children: [' ', checkoutDetails.currencySymbol]
|
|
509
|
-
}), amountStr]
|
|
510
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
511
|
-
style: [styles.percentText, {
|
|
528
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
529
|
+
mode: "outlined",
|
|
530
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
531
|
+
style: [styles.textFieldLabel, {
|
|
532
|
+
color: cardNumberFocused ? '#2D2B32' : cardNumberText != '' && cardNumberText != null ? '#2D2B32' : '#ADACB0',
|
|
512
533
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
513
534
|
}],
|
|
514
|
-
children:
|
|
515
|
-
})
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
children: "Card Number"
|
|
525
|
-
}),
|
|
526
|
-
value: cardNumberText || '',
|
|
527
|
-
onChangeText: it => {
|
|
528
|
-
handleCardNumberTextChange(it);
|
|
529
|
-
},
|
|
530
|
-
theme: {
|
|
531
|
-
colors: {
|
|
532
|
-
primary: '#2D2B32',
|
|
533
|
-
outline: '#E6E6E6'
|
|
534
|
-
}
|
|
535
|
-
},
|
|
536
|
-
style: [styles.textInput, {
|
|
537
|
-
marginTop: 28,
|
|
538
|
-
marginHorizontal: 16,
|
|
539
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
540
|
-
}],
|
|
541
|
-
error: cardNumberError,
|
|
542
|
-
right: cardNumberError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
543
|
-
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
544
|
-
source: require('../../assets/images/ic_upi_error.png'),
|
|
545
|
-
style: {
|
|
546
|
-
width: 24,
|
|
547
|
-
height: 24
|
|
548
|
-
}
|
|
549
|
-
})
|
|
550
|
-
}) : /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
551
|
-
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
552
|
-
source: cardSelectedIcon,
|
|
553
|
-
style: {
|
|
554
|
-
width: 35,
|
|
555
|
-
height: 20
|
|
535
|
+
children: "Card Number"
|
|
536
|
+
}),
|
|
537
|
+
value: cardNumberText || '',
|
|
538
|
+
onChangeText: it => {
|
|
539
|
+
handleCardNumberTextChange(it);
|
|
540
|
+
},
|
|
541
|
+
theme: {
|
|
542
|
+
colors: {
|
|
543
|
+
primary: '#2D2B32',
|
|
544
|
+
outline: '#E6E6E6'
|
|
556
545
|
}
|
|
557
|
-
})
|
|
558
|
-
}),
|
|
559
|
-
outlineStyle: {
|
|
560
|
-
borderRadius: 8,
|
|
561
|
-
// Add this
|
|
562
|
-
borderWidth: 1.5
|
|
563
|
-
},
|
|
564
|
-
keyboardType: "number-pad",
|
|
565
|
-
maxLength: maxCardNumberLength,
|
|
566
|
-
onFocus: () => {
|
|
567
|
-
setCardNumberFocused(true);
|
|
568
|
-
setCardNumberError(false);
|
|
569
|
-
},
|
|
570
|
-
onBlur: handleCardNumberBlur
|
|
571
|
-
}), cardNumberError && /*#__PURE__*/_jsx(Text, {
|
|
572
|
-
style: [styles.errorText, {
|
|
573
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
574
|
-
}],
|
|
575
|
-
children: cardNumberErrorText
|
|
576
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
577
|
-
style: styles.expiryCvvContainer,
|
|
578
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
579
|
-
style: {
|
|
580
|
-
flex: 1,
|
|
581
|
-
flexDirection: 'column'
|
|
582
546
|
},
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
},
|
|
596
|
-
theme: {
|
|
597
|
-
colors: {
|
|
598
|
-
primary: '#2D2B32',
|
|
599
|
-
outline: '#E6E6E6'
|
|
547
|
+
style: [styles.textInput, {
|
|
548
|
+
marginTop: 28,
|
|
549
|
+
marginHorizontal: 16,
|
|
550
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
551
|
+
}],
|
|
552
|
+
error: cardNumberError,
|
|
553
|
+
right: cardNumberError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
554
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
555
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
556
|
+
style: {
|
|
557
|
+
width: 24,
|
|
558
|
+
height: 24
|
|
600
559
|
}
|
|
560
|
+
})
|
|
561
|
+
}) : /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
562
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
563
|
+
source: cardSelectedIcon,
|
|
564
|
+
style: {
|
|
565
|
+
width: 35,
|
|
566
|
+
height: 20
|
|
567
|
+
}
|
|
568
|
+
})
|
|
569
|
+
}),
|
|
570
|
+
outlineStyle: {
|
|
571
|
+
borderRadius: 8,
|
|
572
|
+
// Add this
|
|
573
|
+
borderWidth: 1.5
|
|
574
|
+
},
|
|
575
|
+
keyboardType: "number-pad",
|
|
576
|
+
maxLength: maxCardNumberLength,
|
|
577
|
+
onFocus: () => {
|
|
578
|
+
setCardNumberFocused(true);
|
|
579
|
+
setCardNumberError(false);
|
|
580
|
+
},
|
|
581
|
+
onBlur: handleCardNumberBlur
|
|
582
|
+
}), cardNumberError && /*#__PURE__*/_jsx(Text, {
|
|
583
|
+
style: [styles.errorText, {
|
|
584
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
585
|
+
}],
|
|
586
|
+
children: cardNumberErrorText
|
|
587
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
588
|
+
style: styles.expiryCvvContainer,
|
|
589
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
590
|
+
style: {
|
|
591
|
+
flex: 1,
|
|
592
|
+
flexDirection: 'column'
|
|
601
593
|
},
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
594
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
595
|
+
mode: "outlined",
|
|
596
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
597
|
+
style: [styles.textFieldLabel, {
|
|
598
|
+
color: cardExpiryFocused ? '#2D2B32' : cardExpiryText != '' && cardExpiryText != null ? '#2D2B32' : '#ADACB0',
|
|
599
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
600
|
+
}],
|
|
601
|
+
children: "Expiry (MM/YY)"
|
|
602
|
+
}),
|
|
603
|
+
value: cardExpiryText || '',
|
|
604
|
+
onChangeText: it => {
|
|
605
|
+
handleCardExpiryTextChange(it);
|
|
606
|
+
},
|
|
607
|
+
theme: {
|
|
608
|
+
colors: {
|
|
609
|
+
primary: '#2D2B32',
|
|
610
|
+
outline: '#E6E6E6'
|
|
612
611
|
}
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
outlineStyle: {
|
|
616
|
-
borderRadius: 8,
|
|
617
|
-
// Add this
|
|
618
|
-
borderWidth: 1.5
|
|
619
|
-
},
|
|
620
|
-
keyboardType: "number-pad",
|
|
621
|
-
maxLength: 5,
|
|
622
|
-
onFocus: () => {
|
|
623
|
-
setCardExpiryFocused(true);
|
|
624
|
-
setCardExpiryError(false);
|
|
625
|
-
},
|
|
626
|
-
onBlur: handleCardExpiryBlur
|
|
627
|
-
}), cardExpiryError && /*#__PURE__*/_jsx(Text, {
|
|
628
|
-
style: [styles.errorText, {
|
|
629
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
630
|
-
}],
|
|
631
|
-
children: cardExpiryErrorText
|
|
632
|
-
})]
|
|
633
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
634
|
-
style: {
|
|
635
|
-
flex: 1,
|
|
636
|
-
flexDirection: 'column',
|
|
637
|
-
marginStart: 16
|
|
638
|
-
},
|
|
639
|
-
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
640
|
-
mode: "outlined",
|
|
641
|
-
label: /*#__PURE__*/_jsx(Text, {
|
|
642
|
-
style: [styles.textFieldLabel, {
|
|
643
|
-
color: cardCvvFocused ? '#2D2B32' : cardCvvText != '' && cardCvvText != null ? '#2D2B32' : '#ADACB0',
|
|
612
|
+
},
|
|
613
|
+
style: [styles.textInput, {
|
|
644
614
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
645
615
|
}],
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
616
|
+
error: cardExpiryError,
|
|
617
|
+
right: cardExpiryError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
618
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
619
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
620
|
+
style: {
|
|
621
|
+
width: 24,
|
|
622
|
+
height: 24
|
|
623
|
+
}
|
|
624
|
+
})
|
|
625
|
+
}) : null,
|
|
626
|
+
outlineStyle: {
|
|
627
|
+
borderRadius: 8,
|
|
628
|
+
// Add this
|
|
629
|
+
borderWidth: 1.5
|
|
630
|
+
},
|
|
631
|
+
keyboardType: "number-pad",
|
|
632
|
+
maxLength: 5,
|
|
633
|
+
onFocus: () => {
|
|
634
|
+
setCardExpiryFocused(true);
|
|
635
|
+
setCardExpiryError(false);
|
|
636
|
+
},
|
|
637
|
+
onBlur: handleCardExpiryBlur
|
|
638
|
+
}), cardExpiryError && /*#__PURE__*/_jsx(Text, {
|
|
639
|
+
style: [styles.errorText, {
|
|
640
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
641
|
+
}],
|
|
642
|
+
children: cardExpiryErrorText
|
|
643
|
+
})]
|
|
644
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
645
|
+
style: {
|
|
646
|
+
flex: 1,
|
|
647
|
+
flexDirection: 'column',
|
|
648
|
+
marginStart: 16
|
|
657
649
|
},
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
650
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
651
|
+
mode: "outlined",
|
|
652
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
653
|
+
style: [styles.textFieldLabel, {
|
|
654
|
+
color: cardCvvFocused ? '#2D2B32' : cardCvvText != '' && cardCvvText != null ? '#2D2B32' : '#ADACB0',
|
|
655
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
656
|
+
}],
|
|
657
|
+
children: "CVV"
|
|
658
|
+
}),
|
|
659
|
+
value: cardCvvText || '',
|
|
660
|
+
onChangeText: it => {
|
|
661
|
+
handleCardCvvTextChange(it);
|
|
662
|
+
},
|
|
663
|
+
theme: {
|
|
664
|
+
colors: {
|
|
665
|
+
primary: '#2D2B32',
|
|
666
|
+
outline: '#E6E6E6'
|
|
668
667
|
}
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
668
|
+
},
|
|
669
|
+
style: [styles.textInput, {
|
|
670
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
671
|
+
}],
|
|
672
|
+
error: cardCvvError,
|
|
673
|
+
right: cardCvvError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
674
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
675
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
676
|
+
style: {
|
|
677
|
+
width: 24,
|
|
678
|
+
height: 24
|
|
679
|
+
}
|
|
680
|
+
})
|
|
681
|
+
}) : /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
682
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
683
|
+
source: require('../../assets/images/ic_cvv_info.png'),
|
|
684
|
+
style: {
|
|
685
|
+
width: 24,
|
|
686
|
+
height: 24
|
|
687
|
+
}
|
|
688
|
+
}),
|
|
689
|
+
onPress: () => {
|
|
690
|
+
setShowCvvInfo(true);
|
|
676
691
|
}
|
|
677
692
|
}),
|
|
678
|
-
|
|
679
|
-
|
|
693
|
+
outlineStyle: {
|
|
694
|
+
borderRadius: 8,
|
|
695
|
+
// Add this
|
|
696
|
+
borderWidth: 1.5
|
|
697
|
+
},
|
|
698
|
+
keyboardType: "number-pad",
|
|
699
|
+
maxLength: maxCvvLength,
|
|
700
|
+
secureTextEntry: true,
|
|
701
|
+
onBlur: handleCardCvvBlur,
|
|
702
|
+
onFocus: () => {
|
|
703
|
+
setCardCvvFocused(true);
|
|
704
|
+
setCardCvvError(false);
|
|
680
705
|
}
|
|
681
|
-
}),
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
}
|
|
687
|
-
keyboardType: "number-pad",
|
|
688
|
-
maxLength: maxCvvLength,
|
|
689
|
-
secureTextEntry: true,
|
|
690
|
-
onBlur: handleCardCvvBlur,
|
|
691
|
-
onFocus: () => {
|
|
692
|
-
setCardCvvFocused(true);
|
|
693
|
-
setCardCvvError(false);
|
|
694
|
-
}
|
|
695
|
-
}), cardCvvError && /*#__PURE__*/_jsx(Text, {
|
|
696
|
-
style: [styles.errorText, {
|
|
697
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
698
|
-
}],
|
|
699
|
-
children: cardCvvErrorText
|
|
706
|
+
}), cardCvvError && /*#__PURE__*/_jsx(Text, {
|
|
707
|
+
style: [styles.errorText, {
|
|
708
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
709
|
+
}],
|
|
710
|
+
children: cardCvvErrorText
|
|
711
|
+
})]
|
|
700
712
|
})]
|
|
701
|
-
})
|
|
702
|
-
}), /*#__PURE__*/_jsx(TextInput, {
|
|
703
|
-
mode: "outlined",
|
|
704
|
-
label: /*#__PURE__*/_jsx(Text, {
|
|
705
|
-
style: [styles.textFieldLabel, {
|
|
706
|
-
color: cardHolderNameFocused ? '#2D2B32' : cardHolderNameText != '' && cardHolderNameText != null ? '#2D2B32' : '#ADACB0',
|
|
707
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
708
|
-
}],
|
|
709
|
-
children: "Name on the Card"
|
|
710
|
-
}),
|
|
711
|
-
value: cardHolderNameText || '',
|
|
712
|
-
onChangeText: it => {
|
|
713
|
-
handleCardHolderNameTextChange(it);
|
|
714
|
-
},
|
|
715
|
-
theme: {
|
|
716
|
-
colors: {
|
|
717
|
-
primary: '#2D2B32',
|
|
718
|
-
outline: '#E6E6E6'
|
|
719
|
-
}
|
|
720
|
-
},
|
|
721
|
-
style: [styles.textInput, {
|
|
722
|
-
marginHorizontal: 16,
|
|
723
|
-
marginTop: 16,
|
|
724
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
725
|
-
}],
|
|
726
|
-
error: cardHolderNameError,
|
|
727
|
-
right: cardHolderNameError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
728
|
-
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
729
|
-
source: require('../../assets/images/ic_upi_error.png'),
|
|
730
|
-
style: {
|
|
731
|
-
width: 24,
|
|
732
|
-
height: 24
|
|
733
|
-
}
|
|
734
|
-
})
|
|
735
|
-
}) : null,
|
|
736
|
-
outlineStyle: {
|
|
737
|
-
borderRadius: 8,
|
|
738
|
-
// Add this
|
|
739
|
-
borderWidth: 1.5
|
|
740
|
-
},
|
|
741
|
-
onBlur: handleCardHolderNameBlur,
|
|
742
|
-
onFocus: () => {
|
|
743
|
-
setCardHolderNameFocused(true);
|
|
744
|
-
setCardHolderNameError(false);
|
|
745
|
-
}
|
|
746
|
-
}), cardHolderNameError && /*#__PURE__*/_jsx(Text, {
|
|
747
|
-
style: [styles.errorText, {
|
|
748
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
749
|
-
}],
|
|
750
|
-
children: cardHolderNameErrorText
|
|
751
|
-
}), shopperToken != null && shopperToken != '' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
752
|
-
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
713
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
753
714
|
mode: "outlined",
|
|
754
715
|
label: /*#__PURE__*/_jsx(Text, {
|
|
755
716
|
style: [styles.textFieldLabel, {
|
|
756
|
-
color:
|
|
717
|
+
color: cardHolderNameFocused ? '#2D2B32' : cardHolderNameText != '' && cardHolderNameText != null ? '#2D2B32' : '#ADACB0',
|
|
757
718
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
758
719
|
}],
|
|
759
|
-
children: "
|
|
720
|
+
children: "Name on the Card"
|
|
760
721
|
}),
|
|
761
|
-
value:
|
|
722
|
+
value: cardHolderNameText || '',
|
|
762
723
|
onChangeText: it => {
|
|
763
|
-
|
|
724
|
+
handleCardHolderNameTextChange(it);
|
|
764
725
|
},
|
|
765
726
|
theme: {
|
|
766
727
|
colors: {
|
|
@@ -773,72 +734,122 @@ const CardScreen = ({
|
|
|
773
734
|
marginTop: 16,
|
|
774
735
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
775
736
|
}],
|
|
737
|
+
error: cardHolderNameError,
|
|
738
|
+
right: cardHolderNameError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
739
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
740
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
741
|
+
style: {
|
|
742
|
+
width: 24,
|
|
743
|
+
height: 24
|
|
744
|
+
}
|
|
745
|
+
})
|
|
746
|
+
}) : null,
|
|
776
747
|
outlineStyle: {
|
|
777
748
|
borderRadius: 8,
|
|
778
749
|
// Add this
|
|
779
750
|
borderWidth: 1.5
|
|
780
751
|
},
|
|
781
|
-
onBlur:
|
|
782
|
-
setCardNickNameFocused(false);
|
|
783
|
-
},
|
|
752
|
+
onBlur: handleCardHolderNameBlur,
|
|
784
753
|
onFocus: () => {
|
|
785
|
-
|
|
754
|
+
setCardHolderNameFocused(true);
|
|
755
|
+
setCardHolderNameError(false);
|
|
786
756
|
}
|
|
787
|
-
}), /*#__PURE__*/
|
|
788
|
-
style: styles.
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
style: styles.checkBoxContainer,
|
|
800
|
-
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
801
|
-
onPress: () => setIsSavedCardCheckBoxClicked(!isSavedCardCheckBoxClicked),
|
|
802
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
803
|
-
style: [styles.checkboxBox, {
|
|
804
|
-
borderColor: checkoutDetails.buttonColor
|
|
805
|
-
}, isSavedCardCheckBoxClicked && {
|
|
806
|
-
backgroundColor: checkoutDetails.buttonColor
|
|
757
|
+
}), cardHolderNameError && /*#__PURE__*/_jsx(Text, {
|
|
758
|
+
style: [styles.errorText, {
|
|
759
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
760
|
+
}],
|
|
761
|
+
children: cardHolderNameErrorText
|
|
762
|
+
}), shopperToken != null && shopperToken != '' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
763
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
764
|
+
mode: "outlined",
|
|
765
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
766
|
+
style: [styles.textFieldLabel, {
|
|
767
|
+
color: cardNickNameFocused ? '#2D2B32' : cardNickNameText != '' && cardNickNameText != null ? '#2D2B32' : '#ADACB0',
|
|
768
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
807
769
|
}],
|
|
808
|
-
children:
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
770
|
+
children: "Card NickName (for easy identification)"
|
|
771
|
+
}),
|
|
772
|
+
value: cardNickNameText || '',
|
|
773
|
+
onChangeText: it => {
|
|
774
|
+
setCardNickNameText(it);
|
|
775
|
+
},
|
|
776
|
+
theme: {
|
|
777
|
+
colors: {
|
|
778
|
+
primary: '#2D2B32',
|
|
779
|
+
outline: '#E6E6E6'
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
style: [styles.textInput, {
|
|
783
|
+
marginHorizontal: 16,
|
|
784
|
+
marginTop: 16,
|
|
815
785
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
816
786
|
}],
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
787
|
+
outlineStyle: {
|
|
788
|
+
borderRadius: 8,
|
|
789
|
+
// Add this
|
|
790
|
+
borderWidth: 1.5
|
|
821
791
|
},
|
|
822
|
-
|
|
823
|
-
|
|
792
|
+
onBlur: () => {
|
|
793
|
+
setCardNickNameFocused(false);
|
|
824
794
|
},
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
795
|
+
onFocus: () => {
|
|
796
|
+
setCardNickNameFocused(true);
|
|
797
|
+
}
|
|
798
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
799
|
+
style: styles.infoContainer,
|
|
800
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
801
|
+
source: require('../../assets/images/ic_info.png'),
|
|
802
|
+
style: styles.infoIcon
|
|
803
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
804
|
+
style: [styles.infoText, {
|
|
805
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
829
806
|
}],
|
|
830
|
-
children: "
|
|
831
|
-
})
|
|
807
|
+
children: "CVV will not be stored"
|
|
808
|
+
})]
|
|
809
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
810
|
+
style: styles.checkBoxContainer,
|
|
811
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
812
|
+
onPress: () => setIsSavedCardCheckBoxClicked(!isSavedCardCheckBoxClicked),
|
|
813
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
814
|
+
style: [styles.checkboxBox, {
|
|
815
|
+
borderColor: checkoutDetails.buttonColor
|
|
816
|
+
}, isSavedCardCheckBoxClicked && {
|
|
817
|
+
backgroundColor: checkoutDetails.buttonColor
|
|
818
|
+
}],
|
|
819
|
+
children: isSavedCardCheckBoxClicked && /*#__PURE__*/_jsx(Text, {
|
|
820
|
+
style: styles.checkmark,
|
|
821
|
+
children: "\u2713"
|
|
822
|
+
})
|
|
823
|
+
})
|
|
824
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
825
|
+
style: [styles.checkBoxText, {
|
|
826
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
827
|
+
}],
|
|
828
|
+
children: "Save this card as per RBI guidelines."
|
|
829
|
+
}), /*#__PURE__*/_jsx(Pressable, {
|
|
830
|
+
onPress: () => {
|
|
831
|
+
setKnowMoreDialog(true);
|
|
832
|
+
},
|
|
833
|
+
style: {
|
|
834
|
+
marginLeft: 4
|
|
835
|
+
},
|
|
836
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
837
|
+
style: [styles.clickableText, {
|
|
838
|
+
color: checkoutDetails.buttonColor,
|
|
839
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
840
|
+
}],
|
|
841
|
+
children: "Know more"
|
|
842
|
+
})
|
|
843
|
+
})]
|
|
832
844
|
})]
|
|
845
|
+
}), checkoutDetails.isSICheckboxVisible && checkoutDetails.isSubscriptionCheckout && /*#__PURE__*/_jsx(CheckBoxContainer, {
|
|
846
|
+
text: "Set up Standing Instructions (SI) for this payment.",
|
|
847
|
+
isCheckBoxSelected: isSICheckBoxClicked,
|
|
848
|
+
onCheckBoxClicked: () => {
|
|
849
|
+
setIsSICheckBoxClicked(!isSICheckBoxClicked);
|
|
850
|
+
}
|
|
833
851
|
})]
|
|
834
|
-
}), checkoutDetails.isSICheckboxVisible && checkoutDetails.isSubscriptionCheckout && /*#__PURE__*/_jsx(CheckBoxContainer, {
|
|
835
|
-
text: "Set up Standing Instructions (SI) for this payment.",
|
|
836
|
-
isCheckBoxSelected: isSICheckBoxClicked,
|
|
837
|
-
onCheckBoxClicked: () => {
|
|
838
|
-
setIsSICheckBoxClicked(!isSICheckBoxClicked);
|
|
839
|
-
}
|
|
840
852
|
}), /*#__PURE__*/_jsx(View, {
|
|
841
|
-
style: styles.pressableContainer,
|
|
842
853
|
children: cardValid ? /*#__PURE__*/_jsx(Pressable, {
|
|
843
854
|
style: [styles.buttonContainer, {
|
|
844
855
|
backgroundColor: checkoutDetails.buttonColor,
|