boxpay-checkout-reactnative-sdk 1.0.11-beta2 → 1.0.11-beta4
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/components/checkboxContainer.js +3 -2
- package/lib/module/components/checkboxContainer.js.map +1 -1
- package/lib/module/components/header.js +1 -1
- package/lib/module/components/header.js.map +1 -1
- package/lib/module/components/paymentSelector.js +1 -1
- package/lib/module/components/paymentSelector.js.map +1 -1
- package/lib/module/components/paymentSuccess.js +2 -7
- package/lib/module/components/paymentSuccess.js.map +1 -1
- package/lib/module/components/savedCardComponent.js +1 -1
- package/lib/module/components/savedCardComponent.js.map +1 -1
- package/lib/module/components/subscriptionRow.js +33 -0
- package/lib/module/components/subscriptionRow.js.map +1 -0
- package/lib/module/interface.js +2 -0
- package/lib/module/interface.js.map +1 -1
- package/lib/module/screens/addressScreen.js +11 -60
- package/lib/module/screens/addressScreen.js.map +1 -1
- package/lib/module/screens/bnplScreen.js +3 -2
- package/lib/module/screens/bnplScreen.js.map +1 -1
- package/lib/module/screens/cardScreen.js +491 -450
- package/lib/module/screens/cardScreen.js.map +1 -1
- package/lib/module/screens/emiScreen.js +5 -9
- package/lib/module/screens/emiScreen.js.map +1 -1
- package/lib/module/screens/instantOfferList.js +2 -6
- package/lib/module/screens/instantOfferList.js.map +1 -1
- package/lib/module/screens/mainScreen.js +54 -6
- package/lib/module/screens/mainScreen.js.map +1 -1
- package/lib/module/screens/netBankingScreen.js +5 -8
- package/lib/module/screens/netBankingScreen.js.map +1 -1
- package/lib/module/screens/upiScreen.js +2 -6
- package/lib/module/screens/upiScreen.js.map +1 -1
- package/lib/module/screens/walletScreen.js +5 -8
- package/lib/module/screens/walletScreen.js.map +1 -1
- package/lib/module/sdk-version.json +1 -1
- package/lib/module/sharedContext/checkoutDetailsHandler.js +8 -2
- package/lib/module/sharedContext/checkoutDetailsHandler.js.map +1 -1
- package/lib/module/sharedContext/getTextInputTheme.js +15 -0
- package/lib/module/sharedContext/getTextInputTheme.js.map +1 -0
- package/lib/module/sharedContext/handleAutoNavigation.js +3 -2
- package/lib/module/sharedContext/handleAutoNavigation.js.map +1 -1
- package/lib/module/styles/indexStyles.js +1 -1
- package/lib/module/styles/indexStyles.js.map +1 -1
- package/lib/module/styles/screens/bnplScreenStyles.js +2 -3
- package/lib/module/styles/screens/bnplScreenStyles.js.map +1 -1
- package/lib/module/styles/screens/cardScreenStyles.js +9 -4
- package/lib/module/styles/screens/cardScreenStyles.js.map +1 -1
- package/lib/module/styles/screens/netBankingScreenStyles.js +2 -3
- package/lib/module/styles/screens/netBankingScreenStyles.js.map +1 -1
- package/lib/module/styles/screens/walletScreenStyles.js +2 -3
- package/lib/module/styles/screens/walletScreenStyles.js.map +1 -1
- package/lib/module/utility.js +16 -0
- package/lib/module/utility.js.map +1 -1
- package/lib/typescript/src/components/checkboxContainer.d.ts.map +1 -1
- package/lib/typescript/src/components/subscriptionRow.d.ts +9 -0
- package/lib/typescript/src/components/subscriptionRow.d.ts.map +1 -0
- package/lib/typescript/src/interface.d.ts +27 -2
- package/lib/typescript/src/interface.d.ts.map +1 -1
- package/lib/typescript/src/screens/addressScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/cardScreen.d.ts +1 -1
- package/lib/typescript/src/screens/cardScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/emiScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/instantOfferList.d.ts.map +1 -1
- package/lib/typescript/src/screens/mainScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/netBankingScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/upiScreen.d.ts.map +1 -1
- package/lib/typescript/src/screens/walletScreen.d.ts.map +1 -1
- package/lib/typescript/src/sharedContext/checkoutDetailsHandler.d.ts.map +1 -1
- package/lib/typescript/src/sharedContext/getTextInputTheme.d.ts +7 -0
- package/lib/typescript/src/sharedContext/getTextInputTheme.d.ts.map +1 -0
- package/lib/typescript/src/sharedContext/handleAutoNavigation.d.ts +1 -1
- package/lib/typescript/src/sharedContext/handleAutoNavigation.d.ts.map +1 -1
- package/lib/typescript/src/styles/indexStyles.d.ts +1 -1
- package/lib/typescript/src/styles/screens/bnplScreenStyles.d.ts +1 -2
- package/lib/typescript/src/styles/screens/bnplScreenStyles.d.ts.map +1 -1
- package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts +8 -3
- package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts.map +1 -1
- package/lib/typescript/src/styles/screens/netBankingScreenStyles.d.ts +1 -2
- package/lib/typescript/src/styles/screens/netBankingScreenStyles.d.ts.map +1 -1
- package/lib/typescript/src/styles/screens/walletScreenStyles.d.ts +1 -2
- package/lib/typescript/src/styles/screens/walletScreenStyles.d.ts.map +1 -1
- package/lib/typescript/src/utility.d.ts +2 -0
- package/lib/typescript/src/utility.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/checkboxContainer.tsx +2 -1
- package/src/components/header.tsx +1 -1
- package/src/components/paymentSelector.tsx +1 -1
- package/src/components/paymentSuccess.tsx +3 -5
- package/src/components/savedCardComponent.tsx +1 -1
- package/src/components/subscriptionRow.tsx +19 -0
- package/src/interface.ts +25 -2
- package/src/screens/addressScreen.tsx +11 -60
- package/src/screens/bnplScreen.tsx +3 -3
- package/src/screens/cardScreen.tsx +190 -126
- package/src/screens/emiScreen.tsx +6 -9
- package/src/screens/instantOfferList.tsx +2 -6
- package/src/screens/mainScreen.tsx +58 -6
- package/src/screens/netBankingScreen.tsx +5 -9
- package/src/screens/upiScreen.tsx +2 -6
- package/src/screens/walletScreen.tsx +5 -9
- package/src/sdk-version.json +1 -1
- package/src/sharedContext/checkoutDetailsHandler.ts +8 -2
- package/src/sharedContext/getTextInputTheme.ts +12 -0
- package/src/sharedContext/handleAutoNavigation.ts +4 -1
- package/src/styles/indexStyles.ts +1 -1
- package/src/styles/screens/bnplScreenStyles.ts +2 -3
- package/src/styles/screens/cardScreenStyles.ts +3 -4
- package/src/styles/screens/netBankingScreenStyles.ts +2 -3
- package/src/styles/screens/walletScreenStyles.ts +2 -3
- package/src/utility.ts +24 -1
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import LottieView from 'lottie-react-native';
|
|
4
4
|
import { useEffect, useRef, useState } from 'react';
|
|
5
|
-
import
|
|
5
|
+
import { BackHandler, Image, InputAccessoryView, Keyboard, Platform, Pressable, ScrollView, Text, TouchableOpacity, View } from 'react-native';
|
|
6
6
|
import { TextInput } from 'react-native-paper';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import ShimmerPlaceHolder from 'react-native-shimmer-placeholder';
|
|
8
|
+
import { SvgUri } from 'react-native-svg';
|
|
9
|
+
import Toast from 'react-native-toast-message';
|
|
10
|
+
import CheckBoxContainer from "../components/checkboxContainer.js";
|
|
11
|
+
import CvvInfoBottomSheet from "../components/cvvInfoBottomSheet.js";
|
|
12
|
+
import Header from "../components/header.js";
|
|
13
|
+
import KnowMoreBottomSheet from "../components/knowMoreBottomSheet.js";
|
|
11
14
|
import PaymentFailed from "../components/paymentFailed.js";
|
|
12
15
|
import PaymentSuccess from "../components/paymentSuccess.js";
|
|
13
16
|
import SessionExpire from "../components/sessionExpire.js";
|
|
14
|
-
import { APIStatus } from "../interface.js";
|
|
15
|
-
import
|
|
16
|
-
import CvvInfoBottomSheet from "../components/cvvInfoBottomSheet.js";
|
|
17
|
-
import WebViewScreen from "./webViewScreen.js";
|
|
18
|
-
import fetchStatus from "../postRequest/fetchStatus.js";
|
|
19
|
-
import { SvgUri } from 'react-native-svg';
|
|
20
|
-
import ShimmerPlaceHolder from 'react-native-shimmer-placeholder';
|
|
17
|
+
import { APIStatus, TransactionStatus } from "../interface.js";
|
|
18
|
+
import cardPostRequest from "../postRequest/cardPostRequest.js";
|
|
21
19
|
import emiPostRequest from "../postRequest/emiPostRequest.js";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
20
|
+
import fetchCardDetails from "../postRequest/fetchCardDetails.js";
|
|
21
|
+
import fetchStatus from "../postRequest/fetchStatus.js";
|
|
22
|
+
import { checkoutDetailsHandler, setCheckOutDetailsHandlerToDefault } from "../sharedContext/checkoutDetailsHandler.js";
|
|
25
23
|
import { handleFetchStatusResponseHandler, handlePaymentResponse } from "../sharedContext/handlePaymentResponseHandler.js";
|
|
24
|
+
import { paymentHandler } from "../sharedContext/paymentStatusHandler.js";
|
|
26
25
|
import { setUserDataHandlerToDefault } from "../sharedContext/userdataHandler.js";
|
|
27
|
-
import
|
|
26
|
+
import styles from "../styles/screens/cardScreenStyles.js";
|
|
27
|
+
import WebViewScreen from "./webViewScreen.js";
|
|
28
|
+
import SubscriptionRow from "../components/subscriptionRow.js";
|
|
29
|
+
import { getTextInputTheme } from "../sharedContext/getTextInputTheme.js";
|
|
28
30
|
|
|
29
31
|
// Define the screen's navigation properties
|
|
30
32
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -58,7 +60,7 @@ const CardScreen = ({
|
|
|
58
60
|
const [cardCvvText, setCardCvvText] = useState(null);
|
|
59
61
|
const [cardHolderNameText, setCardHolderNameText] = useState(null);
|
|
60
62
|
const [cardNickNameText, setCardNickNameText] = useState(null);
|
|
61
|
-
const [cardSelectedIcon, setCardSelectedIcon] = useState(require('../../assets/images/
|
|
63
|
+
const [cardSelectedIcon, setCardSelectedIcon] = useState(require('../../assets/images/ic_card.png'));
|
|
62
64
|
const [maxCvvLength, setMaxCvvLength] = useState(4);
|
|
63
65
|
const [maxCardNumberLength, setMaxCardNumberLength] = useState(19);
|
|
64
66
|
const [loading, setLoading] = useState(false);
|
|
@@ -91,7 +93,7 @@ const CardScreen = ({
|
|
|
91
93
|
const paymentFailedMessage = useRef('You may have cancelled the payment or there was a delay in response. Please retry.');
|
|
92
94
|
const [sessionExpireModalOpen, setSessionExppireModalState] = useState(false);
|
|
93
95
|
const [successfulTimeStamp, setSuccessfulTimeStamp] = useState('');
|
|
94
|
-
const [status, setStatus] = useState(
|
|
96
|
+
const [status, setStatus] = useState(TransactionStatus.NoAction);
|
|
95
97
|
const [transactionId, setTransactionId] = useState(null);
|
|
96
98
|
const backgroundApiInterval = useRef(null);
|
|
97
99
|
const [imageLoad, setImageLoad] = useState(true);
|
|
@@ -99,6 +101,11 @@ const CardScreen = ({
|
|
|
99
101
|
const [emiIssuerExist, setEmiIssuerExist] = useState(true);
|
|
100
102
|
const [emiIssuer, setEmiIssuer] = useState('');
|
|
101
103
|
const [shopperToken, setShopperToken] = useState(null);
|
|
104
|
+
const cardNumberAccessoryID = "cardNumberAccessoryID";
|
|
105
|
+
const cardExpiryAccessoryID = "cardExpiryAccessoryID";
|
|
106
|
+
const cardCvvAccessoryID = "cardCvvAccessoryID";
|
|
107
|
+
const cardHolderNameAccessoryID = "cardHolderNameAccessoryID";
|
|
108
|
+
const cardNickNameAccessoryID = "cardNickNameAccessoryID";
|
|
102
109
|
const handleCardNumberTextChange = async text => {
|
|
103
110
|
if (text == '') {
|
|
104
111
|
setCardNumberText(text);
|
|
@@ -149,7 +156,7 @@ const CardScreen = ({
|
|
|
149
156
|
setMaxCvvLength(3);
|
|
150
157
|
setMaxCardNumberLength(19);
|
|
151
158
|
} else {
|
|
152
|
-
setCardSelectedIcon(require('../../assets/images/
|
|
159
|
+
setCardSelectedIcon(require('../../assets/images/ic_card.png'));
|
|
153
160
|
setMaxCvvLength(3);
|
|
154
161
|
setMaxCardNumberLength(19);
|
|
155
162
|
}
|
|
@@ -173,12 +180,13 @@ const CardScreen = ({
|
|
|
173
180
|
});
|
|
174
181
|
}
|
|
175
182
|
} else {
|
|
176
|
-
setCardSelectedIcon(require('../../assets/images/
|
|
183
|
+
setCardSelectedIcon(require('../../assets/images/ic_card.png'));
|
|
177
184
|
setMaxCvvLength(3);
|
|
178
185
|
setMaxCardNumberLength(19);
|
|
179
186
|
}
|
|
180
187
|
}
|
|
181
188
|
};
|
|
189
|
+
const isSubscriptionDetailsVisible = checkoutDetails.isSubscriptionCheckout && (isSICheckBoxClicked || !checkoutDetails.isSICheckboxVisible);
|
|
182
190
|
const isValidCardNumberByLuhn = stringInputCardNumber => {
|
|
183
191
|
const minCardLength = 13;
|
|
184
192
|
if (stringInputCardNumber.length < minCardLength) {
|
|
@@ -201,7 +209,7 @@ const CardScreen = ({
|
|
|
201
209
|
const handleCardNumberBlur = () => {
|
|
202
210
|
const cleaned = cardNumberText?.replace(/ /g, '') || '';
|
|
203
211
|
const cleanedLength = maxCardNumberLength == 19 ? 16 : 15;
|
|
204
|
-
setCardNumberErrorText(cleaned.length < 1 ? '
|
|
212
|
+
setCardNumberErrorText(cleaned.length < 1 ? 'Card Number is required' : checkoutDetails.env === 'test' ? '' : cleaned.length < cleanedLength ? 'This card number is invalid' : !methodEnabled ? 'This card is not supported for the payment' : !cardNumberValid ? 'This card number is invalid' : !emiIssuerExist ? "We couldn't find any EMI plans for this card. Please try using a different card number" : emiIssuer != issuerBrand ? `The card is ${emiIssuer} ${cardType}. Please enter a card number that belongs to ${issuerBrand} ${cardType}` : '');
|
|
205
213
|
setCardNumberError(cleaned.length < 1 || checkoutDetails.env !== 'test' && (!methodEnabled || !cardNumberValid || !emiIssuerExist || emiIssuer != issuerBrand && durationNumber != undefined && durationNumber != ''));
|
|
206
214
|
setCardNumberFocused(false);
|
|
207
215
|
};
|
|
@@ -287,26 +295,26 @@ const CardScreen = ({
|
|
|
287
295
|
};
|
|
288
296
|
const handleCardExpiryBlur = () => {
|
|
289
297
|
const cleaned = cardExpiryText?.replace(/ /g, '') || '';
|
|
290
|
-
setCardExpiryErrorText(cleaned.length < 1 ? '
|
|
298
|
+
setCardExpiryErrorText(cleaned.length < 1 ? 'Expiry is required' : cleaned.length < 5 || !cardExpiryValid ? 'Expiry is invalid' : '');
|
|
291
299
|
setCardExpiryError(cleaned.length < 5 || !cardExpiryValid);
|
|
292
300
|
setCardExpiryFocused(false);
|
|
293
301
|
};
|
|
294
302
|
const handleCardCvvBlur = () => {
|
|
295
303
|
const cleaned = cardCvvText?.replace(/ /g, '') || '';
|
|
296
|
-
setCardCvvErrorText(cleaned.length < 1 ? '
|
|
304
|
+
setCardCvvErrorText(cleaned.length < 1 ? 'CVV is required' : cleaned.length < maxCvvLength ? 'CVV is invalid' : '');
|
|
297
305
|
setCardCvvError(cleaned.length < maxCvvLength);
|
|
298
306
|
setCardCvvFocused(false);
|
|
299
307
|
};
|
|
300
308
|
const handleCardHolderNameBlur = () => {
|
|
301
309
|
const cleaned = cardHolderNameText?.replace(/ /g, '') || '';
|
|
302
|
-
setCardHolderNameErrorText(cleaned.length < 1 ? '
|
|
310
|
+
setCardHolderNameErrorText(cleaned.length < 1 ? 'Name is required' : '');
|
|
303
311
|
setCardHolderNameFocused(false);
|
|
304
312
|
setCardHolderNameError(cleaned.length < 1);
|
|
305
313
|
};
|
|
306
314
|
const handleCardCvvTextChange = text => {
|
|
307
315
|
setCardCvvText(text);
|
|
308
316
|
if (text == '') {
|
|
309
|
-
setCardCvvErrorText('
|
|
317
|
+
setCardCvvErrorText('CVV is required');
|
|
310
318
|
setCardCvvError(true);
|
|
311
319
|
} else {
|
|
312
320
|
setCardCvvError(false);
|
|
@@ -405,7 +413,7 @@ const CardScreen = ({
|
|
|
405
413
|
if (showWebView) {
|
|
406
414
|
setShowWebView(false);
|
|
407
415
|
paymentFailedMessage.current = checkoutDetails.errorMessage;
|
|
408
|
-
setStatus(
|
|
416
|
+
setStatus(TransactionStatus.Failed);
|
|
409
417
|
setFailedModalState(true);
|
|
410
418
|
setLoading(false);
|
|
411
419
|
return true;
|
|
@@ -436,477 +444,510 @@ const CardScreen = ({
|
|
|
436
444
|
setShowWebView(true);
|
|
437
445
|
}
|
|
438
446
|
}, [paymentHtml]);
|
|
439
|
-
return /*#__PURE__*/_jsxs(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
style: {
|
|
469
|
-
flexDirection: 'row',
|
|
470
|
-
alignItems: 'center'
|
|
471
|
-
},
|
|
447
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
448
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
449
|
+
style: styles.screenView,
|
|
450
|
+
children: [loading ? /*#__PURE__*/_jsxs(View, {
|
|
451
|
+
style: styles.loadingContainer,
|
|
452
|
+
children: [/*#__PURE__*/_jsx(LottieView, {
|
|
453
|
+
source: require('../../assets/animations/boxpayLogo.json'),
|
|
454
|
+
autoPlay: true,
|
|
455
|
+
loop: true,
|
|
456
|
+
style: styles.lottieStyle
|
|
457
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
458
|
+
children: "Loading..."
|
|
459
|
+
})]
|
|
460
|
+
}) : /*#__PURE__*/_jsxs(View, {
|
|
461
|
+
style: {
|
|
462
|
+
flex: 1
|
|
463
|
+
},
|
|
464
|
+
children: [/*#__PURE__*/_jsxs(ScrollView, {
|
|
465
|
+
contentContainerStyle: styles.screenView,
|
|
466
|
+
keyboardShouldPersistTaps: "handled",
|
|
467
|
+
children: [/*#__PURE__*/_jsx(Header, {
|
|
468
|
+
onBackPress: onProceedBack,
|
|
469
|
+
showDesc: true,
|
|
470
|
+
showSecure: true,
|
|
471
|
+
text: "Pay via Card"
|
|
472
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
473
|
+
style: styles.divider
|
|
474
|
+
}), bankNameStr != '' && bankName != undefined && /*#__PURE__*/_jsxs(View, {
|
|
475
|
+
style: styles.container,
|
|
472
476
|
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."]
|
|
526
|
-
})]
|
|
527
|
-
})]
|
|
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',
|
|
533
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
534
|
-
}],
|
|
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'
|
|
545
|
-
}
|
|
546
|
-
},
|
|
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
|
|
559
|
-
}
|
|
560
|
-
})
|
|
561
|
-
}) : /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
562
|
-
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
563
|
-
source: cardSelectedIcon,
|
|
564
477
|
style: {
|
|
565
|
-
|
|
566
|
-
|
|
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'
|
|
593
|
-
},
|
|
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);
|
|
478
|
+
flexDirection: 'row',
|
|
479
|
+
alignItems: 'center'
|
|
606
480
|
},
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
},
|
|
613
|
-
style: [styles.textInput, {
|
|
614
|
-
fontFamily: checkoutDetails.fontFamily.regular
|
|
615
|
-
}],
|
|
616
|
-
error: cardExpiryError,
|
|
617
|
-
right: cardExpiryError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
618
|
-
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
619
|
-
source: require('../../assets/images/ic_upi_error.png'),
|
|
481
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
482
|
+
style: styles.imageContainer,
|
|
483
|
+
children: [imageLoad && !imageError && /*#__PURE__*/_jsx(ShimmerPlaceHolder, {
|
|
484
|
+
visible: false // Keep shimmer until loading is done
|
|
485
|
+
,
|
|
620
486
|
style: {
|
|
621
|
-
width:
|
|
622
|
-
height:
|
|
487
|
+
width: 32,
|
|
488
|
+
height: 32,
|
|
489
|
+
borderRadius: 8
|
|
623
490
|
}
|
|
624
|
-
})
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
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
|
|
649
|
-
},
|
|
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'
|
|
667
|
-
}
|
|
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'),
|
|
491
|
+
}), !imageError ? /*#__PURE__*/_jsx(SvgUri, {
|
|
492
|
+
uri: bankUrlStr || '',
|
|
493
|
+
width: 100 // Keep original size
|
|
494
|
+
,
|
|
495
|
+
height: 100,
|
|
676
496
|
style: {
|
|
677
|
-
|
|
678
|
-
|
|
497
|
+
transform: [{
|
|
498
|
+
scale: 0.4
|
|
499
|
+
}]
|
|
500
|
+
},
|
|
501
|
+
onLoad: () => setImageLoad(false),
|
|
502
|
+
onError: () => {
|
|
503
|
+
setImageError(true);
|
|
504
|
+
setImageLoad(false);
|
|
679
505
|
}
|
|
680
|
-
})
|
|
681
|
-
|
|
682
|
-
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
683
|
-
source: require('../../assets/images/ic_cvv_info.png'),
|
|
506
|
+
}) : /*#__PURE__*/_jsx(Image, {
|
|
507
|
+
source: require('../../assets/images/ic_netbanking_semi_bold.png'),
|
|
684
508
|
style: {
|
|
685
|
-
|
|
686
|
-
|
|
509
|
+
transform: [{
|
|
510
|
+
scale: 0.4
|
|
511
|
+
}]
|
|
687
512
|
}
|
|
688
|
-
})
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
|
|
513
|
+
})]
|
|
514
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
515
|
+
style: [styles.nameText, {
|
|
516
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
517
|
+
}],
|
|
518
|
+
children: bankNameStr
|
|
519
|
+
})]
|
|
520
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
521
|
+
style: styles.thickBorder,
|
|
522
|
+
children: [/*#__PURE__*/_jsxs(Text, {
|
|
523
|
+
style: [styles.durationText, {
|
|
524
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
525
|
+
}],
|
|
526
|
+
children: [duration, " months x", /*#__PURE__*/_jsxs(Text, {
|
|
527
|
+
style: styles.currencyText,
|
|
528
|
+
children: [' ', checkoutDetails.currencySymbol]
|
|
529
|
+
}), amountStr]
|
|
530
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
531
|
+
style: [styles.percentText, {
|
|
532
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
533
|
+
}],
|
|
534
|
+
children: ["@", percentNumber, "% p.a."]
|
|
535
|
+
})]
|
|
536
|
+
})]
|
|
537
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
538
|
+
mode: "outlined",
|
|
539
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
540
|
+
style: [styles.textFieldLabel, {
|
|
541
|
+
color: cardNumberFocused ? '#2D2B32' : cardNumberText != '' && cardNumberText != null ? '#2D2B32' : '#ADACB0',
|
|
708
542
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
709
543
|
}],
|
|
710
|
-
children:
|
|
711
|
-
})
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
544
|
+
children: "Card Number*"
|
|
545
|
+
}),
|
|
546
|
+
value: cardNumberText || '',
|
|
547
|
+
onChangeText: it => {
|
|
548
|
+
handleCardNumberTextChange(it);
|
|
549
|
+
},
|
|
550
|
+
theme: getTextInputTheme(),
|
|
551
|
+
inputAccessoryViewID: Platform.OS === 'ios' ? cardNumberAccessoryID : undefined,
|
|
552
|
+
style: [styles.textInput, {
|
|
553
|
+
marginTop: 28,
|
|
554
|
+
marginHorizontal: 16,
|
|
718
555
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
719
556
|
}],
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
}],
|
|
761
|
-
children: cardHolderNameErrorText
|
|
762
|
-
}), shopperToken != null && shopperToken != '' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
763
|
-
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
557
|
+
error: cardNumberError,
|
|
558
|
+
returnKeyType: "done",
|
|
559
|
+
right: cardNumberError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
560
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
561
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
562
|
+
style: {
|
|
563
|
+
width: 24,
|
|
564
|
+
height: 24
|
|
565
|
+
}
|
|
566
|
+
})
|
|
567
|
+
}) : /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
568
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
569
|
+
source: cardSelectedIcon,
|
|
570
|
+
style: {
|
|
571
|
+
width: 32,
|
|
572
|
+
height: 20,
|
|
573
|
+
tintColor: cardSelectedIcon === require('../../assets/images/ic_card.png') ? '#6B7280' // Cool Grey 500
|
|
574
|
+
: undefined
|
|
575
|
+
}
|
|
576
|
+
})
|
|
577
|
+
}),
|
|
578
|
+
outlineStyle: {
|
|
579
|
+
borderRadius: 8,
|
|
580
|
+
// Add this
|
|
581
|
+
borderWidth: 1.5
|
|
582
|
+
},
|
|
583
|
+
keyboardType: "number-pad",
|
|
584
|
+
maxLength: maxCardNumberLength,
|
|
585
|
+
onFocus: () => {
|
|
586
|
+
setCardNumberFocused(true);
|
|
587
|
+
setCardNumberError(false);
|
|
588
|
+
},
|
|
589
|
+
onBlur: handleCardNumberBlur
|
|
590
|
+
}), cardNumberError && /*#__PURE__*/_jsx(Text, {
|
|
591
|
+
style: [styles.errorText, {
|
|
592
|
+
fontFamily: checkoutDetails.fontFamily.regular,
|
|
593
|
+
marginHorizontal: 16
|
|
594
|
+
}],
|
|
595
|
+
children: cardNumberErrorText
|
|
596
|
+
}), /*#__PURE__*/_jsx(TextInput, {
|
|
764
597
|
mode: "outlined",
|
|
765
598
|
label: /*#__PURE__*/_jsx(Text, {
|
|
766
599
|
style: [styles.textFieldLabel, {
|
|
767
|
-
color:
|
|
600
|
+
color: cardHolderNameFocused ? '#2D2B32' : cardHolderNameText != '' && cardHolderNameText != null ? '#2D2B32' : '#ADACB0',
|
|
768
601
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
769
602
|
}],
|
|
770
|
-
children: "
|
|
603
|
+
children: "Cardholder Name*"
|
|
771
604
|
}),
|
|
772
|
-
value:
|
|
605
|
+
value: cardHolderNameText || '',
|
|
773
606
|
onChangeText: it => {
|
|
774
|
-
|
|
775
|
-
},
|
|
776
|
-
theme: {
|
|
777
|
-
colors: {
|
|
778
|
-
primary: '#2D2B32',
|
|
779
|
-
outline: '#E6E6E6'
|
|
780
|
-
}
|
|
607
|
+
handleCardHolderNameTextChange(it);
|
|
781
608
|
},
|
|
609
|
+
theme: getTextInputTheme(),
|
|
782
610
|
style: [styles.textInput, {
|
|
783
611
|
marginHorizontal: 16,
|
|
784
612
|
marginTop: 16,
|
|
785
613
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
786
614
|
}],
|
|
615
|
+
error: cardHolderNameError,
|
|
616
|
+
inputAccessoryViewID: Platform.OS === 'ios' ? cardHolderNameAccessoryID : undefined,
|
|
617
|
+
returnKeyType: "done",
|
|
618
|
+
right: cardHolderNameError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
619
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
620
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
621
|
+
style: {
|
|
622
|
+
width: 24,
|
|
623
|
+
height: 24
|
|
624
|
+
}
|
|
625
|
+
})
|
|
626
|
+
}) : null,
|
|
787
627
|
outlineStyle: {
|
|
788
628
|
borderRadius: 8,
|
|
789
629
|
// Add this
|
|
790
630
|
borderWidth: 1.5
|
|
791
631
|
},
|
|
792
|
-
onBlur:
|
|
793
|
-
setCardNickNameFocused(false);
|
|
794
|
-
},
|
|
632
|
+
onBlur: handleCardHolderNameBlur,
|
|
795
633
|
onFocus: () => {
|
|
796
|
-
|
|
634
|
+
setCardHolderNameFocused(true);
|
|
635
|
+
setCardHolderNameError(false);
|
|
797
636
|
}
|
|
637
|
+
}), cardHolderNameError && /*#__PURE__*/_jsx(Text, {
|
|
638
|
+
style: [styles.errorText, {
|
|
639
|
+
fontFamily: checkoutDetails.fontFamily.regular,
|
|
640
|
+
marginHorizontal: 16
|
|
641
|
+
}],
|
|
642
|
+
children: cardHolderNameErrorText
|
|
798
643
|
}), /*#__PURE__*/_jsxs(View, {
|
|
799
|
-
style: styles.
|
|
800
|
-
children: [/*#__PURE__*/
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
644
|
+
style: styles.expiryCvvContainer,
|
|
645
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
646
|
+
style: {
|
|
647
|
+
flex: 1,
|
|
648
|
+
flexDirection: 'column'
|
|
649
|
+
},
|
|
650
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
651
|
+
mode: "outlined",
|
|
652
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
653
|
+
style: [styles.textFieldLabel, {
|
|
654
|
+
color: cardExpiryFocused ? '#2D2B32' : cardExpiryText != '' && cardExpiryText != null ? '#2D2B32' : '#ADACB0',
|
|
655
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
656
|
+
}],
|
|
657
|
+
children: "Expiry (MM/YY)*"
|
|
658
|
+
}),
|
|
659
|
+
value: cardExpiryText || '',
|
|
660
|
+
onChangeText: it => {
|
|
661
|
+
handleCardExpiryTextChange(it);
|
|
662
|
+
},
|
|
663
|
+
theme: getTextInputTheme(),
|
|
664
|
+
inputAccessoryViewID: Platform.OS === 'ios' ? cardExpiryAccessoryID : undefined,
|
|
665
|
+
style: [styles.textInput, {
|
|
666
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
667
|
+
}],
|
|
668
|
+
error: cardExpiryError,
|
|
669
|
+
returnKeyType: "done",
|
|
670
|
+
right: cardExpiryError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
671
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
672
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
673
|
+
style: {
|
|
674
|
+
width: 24,
|
|
675
|
+
height: 24
|
|
676
|
+
}
|
|
677
|
+
})
|
|
678
|
+
}) : null,
|
|
679
|
+
outlineStyle: {
|
|
680
|
+
borderRadius: 8,
|
|
681
|
+
// Add this
|
|
682
|
+
borderWidth: 1.5
|
|
683
|
+
},
|
|
684
|
+
keyboardType: "number-pad",
|
|
685
|
+
maxLength: 5,
|
|
686
|
+
onFocus: () => {
|
|
687
|
+
setCardExpiryFocused(true);
|
|
688
|
+
setCardExpiryError(false);
|
|
689
|
+
},
|
|
690
|
+
onBlur: handleCardExpiryBlur
|
|
691
|
+
}), cardExpiryError && /*#__PURE__*/_jsx(Text, {
|
|
692
|
+
style: [styles.errorText, {
|
|
693
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
694
|
+
}],
|
|
695
|
+
children: cardExpiryErrorText
|
|
696
|
+
})]
|
|
697
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
698
|
+
style: {
|
|
699
|
+
flex: 1,
|
|
700
|
+
flexDirection: 'column',
|
|
701
|
+
marginStart: 16
|
|
702
|
+
},
|
|
703
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
704
|
+
mode: "outlined",
|
|
705
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
706
|
+
style: [styles.textFieldLabel, {
|
|
707
|
+
color: cardCvvFocused ? '#2D2B32' : cardCvvText != '' && cardCvvText != null ? '#2D2B32' : '#ADACB0',
|
|
708
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
709
|
+
}],
|
|
710
|
+
children: "CVV*"
|
|
711
|
+
}),
|
|
712
|
+
value: cardCvvText || '',
|
|
713
|
+
onChangeText: it => {
|
|
714
|
+
handleCardCvvTextChange(it);
|
|
715
|
+
},
|
|
716
|
+
theme: getTextInputTheme(),
|
|
717
|
+
inputAccessoryViewID: Platform.OS === 'ios' ? cardCvvAccessoryID : undefined,
|
|
718
|
+
style: [styles.textInput, {
|
|
719
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
720
|
+
}],
|
|
721
|
+
error: cardCvvError,
|
|
722
|
+
returnKeyType: "done",
|
|
723
|
+
right: cardCvvError ? /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
724
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
725
|
+
source: require('../../assets/images/ic_upi_error.png'),
|
|
726
|
+
style: {
|
|
727
|
+
width: 24,
|
|
728
|
+
height: 24
|
|
729
|
+
}
|
|
730
|
+
})
|
|
731
|
+
}) : /*#__PURE__*/_jsx(TextInput.Icon, {
|
|
732
|
+
icon: () => /*#__PURE__*/_jsx(Image, {
|
|
733
|
+
source: require('../../assets/images/ic_info.png'),
|
|
734
|
+
style: {
|
|
735
|
+
width: 24,
|
|
736
|
+
height: 24,
|
|
737
|
+
tintColor: checkoutDetails.buttonColor
|
|
738
|
+
}
|
|
739
|
+
}),
|
|
740
|
+
onPress: () => {
|
|
741
|
+
setShowCvvInfo(true);
|
|
742
|
+
}
|
|
743
|
+
}),
|
|
744
|
+
outlineStyle: {
|
|
745
|
+
borderRadius: 8,
|
|
746
|
+
// Add this
|
|
747
|
+
borderWidth: 1.5
|
|
748
|
+
},
|
|
749
|
+
keyboardType: "number-pad",
|
|
750
|
+
maxLength: maxCvvLength,
|
|
751
|
+
secureTextEntry: true,
|
|
752
|
+
onBlur: handleCardCvvBlur,
|
|
753
|
+
onFocus: () => {
|
|
754
|
+
setCardCvvFocused(true);
|
|
755
|
+
setCardCvvError(false);
|
|
756
|
+
}
|
|
757
|
+
}), cardCvvError && /*#__PURE__*/_jsx(Text, {
|
|
758
|
+
style: [styles.errorText, {
|
|
759
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
760
|
+
}],
|
|
761
|
+
children: cardCvvErrorText
|
|
762
|
+
})]
|
|
808
763
|
})]
|
|
809
|
-
}), /*#__PURE__*/_jsxs(
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
}, isSavedCardCheckBoxClicked && {
|
|
817
|
-
backgroundColor: checkoutDetails.buttonColor
|
|
764
|
+
}), shopperToken != null && shopperToken != '' && /*#__PURE__*/_jsxs(_Fragment, {
|
|
765
|
+
children: [/*#__PURE__*/_jsx(TextInput, {
|
|
766
|
+
mode: "outlined",
|
|
767
|
+
label: /*#__PURE__*/_jsx(Text, {
|
|
768
|
+
style: [styles.textFieldLabel, {
|
|
769
|
+
color: cardNickNameFocused ? '#2D2B32' : cardNickNameText != '' && cardNickNameText != null ? '#2D2B32' : '#ADACB0',
|
|
770
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
818
771
|
}],
|
|
819
|
-
children:
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
772
|
+
children: "Card NickName (for easy identification)"
|
|
773
|
+
}),
|
|
774
|
+
value: cardNickNameText || '',
|
|
775
|
+
onChangeText: it => {
|
|
776
|
+
setCardNickNameText(it);
|
|
777
|
+
},
|
|
778
|
+
inputAccessoryViewID: Platform.OS === 'ios' ? cardNickNameAccessoryID : undefined,
|
|
779
|
+
theme: getTextInputTheme(),
|
|
780
|
+
style: [styles.textInput, {
|
|
781
|
+
marginHorizontal: 16,
|
|
782
|
+
marginTop: 16,
|
|
826
783
|
fontFamily: checkoutDetails.fontFamily.regular
|
|
827
784
|
}],
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
785
|
+
returnKeyType: "done",
|
|
786
|
+
outlineStyle: {
|
|
787
|
+
borderRadius: 8,
|
|
788
|
+
// Add this
|
|
789
|
+
borderWidth: 1.5
|
|
832
790
|
},
|
|
833
|
-
|
|
834
|
-
|
|
791
|
+
onBlur: () => {
|
|
792
|
+
setCardNickNameFocused(false);
|
|
835
793
|
},
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
794
|
+
onFocus: () => {
|
|
795
|
+
setCardNickNameFocused(true);
|
|
796
|
+
}
|
|
797
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
798
|
+
style: styles.infoContainer,
|
|
799
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
800
|
+
source: require('../../assets/images/ic_info.png'),
|
|
801
|
+
style: styles.infoIcon
|
|
802
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
803
|
+
style: [styles.infoText, {
|
|
804
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
840
805
|
}],
|
|
841
|
-
children: "
|
|
842
|
-
})
|
|
806
|
+
children: "CVV will not be stored"
|
|
807
|
+
})]
|
|
808
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
809
|
+
style: styles.checkBoxContainer,
|
|
810
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
811
|
+
onPress: () => setIsSavedCardCheckBoxClicked(!isSavedCardCheckBoxClicked),
|
|
812
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
813
|
+
style: [styles.checkboxBox, {
|
|
814
|
+
borderColor: checkoutDetails.buttonColor
|
|
815
|
+
}, isSavedCardCheckBoxClicked && {
|
|
816
|
+
backgroundColor: checkoutDetails.buttonColor
|
|
817
|
+
}],
|
|
818
|
+
children: isSavedCardCheckBoxClicked && /*#__PURE__*/_jsx(Text, {
|
|
819
|
+
style: styles.checkmark,
|
|
820
|
+
children: "\u2713"
|
|
821
|
+
})
|
|
822
|
+
})
|
|
823
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
824
|
+
style: [styles.checkBoxText, {
|
|
825
|
+
fontFamily: checkoutDetails.fontFamily.regular
|
|
826
|
+
}],
|
|
827
|
+
children: "Save this card as per RBI guidelines."
|
|
828
|
+
}), /*#__PURE__*/_jsx(Pressable, {
|
|
829
|
+
onPress: () => {
|
|
830
|
+
setKnowMoreDialog(true);
|
|
831
|
+
},
|
|
832
|
+
style: {
|
|
833
|
+
marginLeft: 4
|
|
834
|
+
},
|
|
835
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
836
|
+
style: [styles.clickableText, {
|
|
837
|
+
color: checkoutDetails.buttonColor,
|
|
838
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
839
|
+
}],
|
|
840
|
+
children: "Know more"
|
|
841
|
+
})
|
|
842
|
+
})]
|
|
843
843
|
})]
|
|
844
|
+
}), checkoutDetails.isSICheckboxVisible && checkoutDetails.isSubscriptionCheckout && /*#__PURE__*/_jsx(CheckBoxContainer, {
|
|
845
|
+
text: "Set up Standing Instructions (SI) for this payment.",
|
|
846
|
+
isCheckBoxSelected: isSICheckBoxClicked,
|
|
847
|
+
onCheckBoxClicked: () => {
|
|
848
|
+
setIsSICheckBoxClicked(!isSICheckBoxClicked);
|
|
849
|
+
}
|
|
850
|
+
}), isSubscriptionDetailsVisible && /*#__PURE__*/_jsx(View, {
|
|
851
|
+
style: styles.subscriptionContainer,
|
|
852
|
+
children: checkoutDetails.subscriptionDetails && checkoutDetails.subscriptionDetails.map(item => item.value && /*#__PURE__*/_jsx(SubscriptionRow, {
|
|
853
|
+
checkoutDetails: checkoutDetails,
|
|
854
|
+
heading: item.label,
|
|
855
|
+
value: item.value
|
|
856
|
+
}, item.label))
|
|
844
857
|
})]
|
|
845
|
-
}),
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
}
|
|
851
|
-
})]
|
|
852
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
853
|
-
children: cardValid ? /*#__PURE__*/_jsx(Pressable, {
|
|
854
|
-
style: [styles.buttonContainer, {
|
|
855
|
-
backgroundColor: checkoutDetails.buttonColor,
|
|
856
|
-
borderRadius: checkoutDetails.ctaBorderRadius
|
|
857
|
-
}],
|
|
858
|
-
onPress: () => {
|
|
859
|
-
onProceedForward();
|
|
860
|
-
},
|
|
861
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
862
|
-
style: [styles.buttonText, {
|
|
863
|
-
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
858
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
859
|
+
children: cardValid ? /*#__PURE__*/_jsx(Pressable, {
|
|
860
|
+
style: [styles.buttonContainer, {
|
|
861
|
+
backgroundColor: checkoutDetails.buttonColor,
|
|
862
|
+
borderRadius: checkoutDetails.ctaBorderRadius
|
|
864
863
|
}],
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
864
|
+
onPress: () => {
|
|
865
|
+
onProceedForward();
|
|
866
|
+
},
|
|
867
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
868
|
+
style: [styles.buttonText, {
|
|
869
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
870
|
+
}],
|
|
871
|
+
children: ["Pay", ' ', /*#__PURE__*/_jsxs(Text, {
|
|
872
|
+
style: {
|
|
873
|
+
fontFamily: 'Inter-SemiBold',
|
|
874
|
+
fontSize: 16,
|
|
875
|
+
color: 'white'
|
|
876
|
+
},
|
|
877
|
+
children: [' ', checkoutDetails.currencySymbol]
|
|
878
|
+
}), checkoutDetails.amount]
|
|
879
|
+
})
|
|
880
|
+
}) : /*#__PURE__*/_jsx(Pressable, {
|
|
881
|
+
style: [styles.buttonContainer, {
|
|
882
|
+
backgroundColor: '#E6E6E6',
|
|
883
|
+
borderRadius: checkoutDetails.ctaBorderRadius
|
|
876
884
|
}],
|
|
877
|
-
children:
|
|
885
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
886
|
+
style: [styles.buttonText, {
|
|
887
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
888
|
+
}],
|
|
889
|
+
children: ["Pay", ' ', /*#__PURE__*/_jsxs(Text, {
|
|
890
|
+
style: {
|
|
891
|
+
fontFamily: 'Inter-SemiBold',
|
|
892
|
+
fontSize: 16,
|
|
893
|
+
color: 'white'
|
|
894
|
+
},
|
|
895
|
+
children: [' ', checkoutDetails.currencySymbol]
|
|
896
|
+
}), checkoutDetails.amount]
|
|
897
|
+
})
|
|
878
898
|
})
|
|
899
|
+
})]
|
|
900
|
+
}), failedModalOpen && /*#__PURE__*/_jsx(PaymentFailed, {
|
|
901
|
+
onClick: () => setFailedModalState(false),
|
|
902
|
+
errorMessage: paymentFailedMessage.current
|
|
903
|
+
}), successModalOpen && /*#__PURE__*/_jsx(PaymentSuccess, {
|
|
904
|
+
onClick: onExitCheckout,
|
|
905
|
+
transactionId: transactionId || '',
|
|
906
|
+
method: "Card",
|
|
907
|
+
localDateTime: successfulTimeStamp
|
|
908
|
+
}), sessionExpireModalOpen && /*#__PURE__*/_jsx(SessionExpire, {
|
|
909
|
+
onClick: onExitCheckout
|
|
910
|
+
}), showCvvInfo && /*#__PURE__*/_jsx(CvvInfoBottomSheet, {
|
|
911
|
+
onClick: () => {
|
|
912
|
+
setShowCvvInfo(false);
|
|
913
|
+
}
|
|
914
|
+
}), showKnowMoreDialog && /*#__PURE__*/_jsx(KnowMoreBottomSheet, {
|
|
915
|
+
onClick: () => {
|
|
916
|
+
setKnowMoreDialog(false);
|
|
917
|
+
}
|
|
918
|
+
}), showWebView && /*#__PURE__*/_jsx(View, {
|
|
919
|
+
style: styles.webViewContainer,
|
|
920
|
+
children: /*#__PURE__*/_jsx(WebViewScreen, {
|
|
921
|
+
url: paymentUrl,
|
|
922
|
+
html: paymentHtml,
|
|
923
|
+
onBackPress: () => {
|
|
924
|
+
startBackgroundApiTask();
|
|
925
|
+
setLoading(true);
|
|
926
|
+
setShowWebView(false);
|
|
927
|
+
}
|
|
879
928
|
})
|
|
880
929
|
})]
|
|
881
|
-
}),
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
url: paymentUrl,
|
|
903
|
-
html: paymentHtml,
|
|
904
|
-
onBackPress: () => {
|
|
905
|
-
startBackgroundApiTask();
|
|
906
|
-
setLoading(true);
|
|
907
|
-
setShowWebView(false);
|
|
908
|
-
}
|
|
909
|
-
})
|
|
930
|
+
}), Platform.OS === 'ios' && /*#__PURE__*/_jsx(_Fragment, {
|
|
931
|
+
children: [cardNumberAccessoryID, cardExpiryAccessoryID, cardCvvAccessoryID, cardHolderNameAccessoryID, cardNickNameAccessoryID].map(id => /*#__PURE__*/_jsx(InputAccessoryView, {
|
|
932
|
+
nativeID: id,
|
|
933
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
934
|
+
style: {
|
|
935
|
+
backgroundColor: '#f1f1f1',
|
|
936
|
+
padding: 10,
|
|
937
|
+
alignItems: 'flex-end'
|
|
938
|
+
},
|
|
939
|
+
children: /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
940
|
+
onPress: () => Keyboard.dismiss(),
|
|
941
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
942
|
+
style: {
|
|
943
|
+
fontSize: 16,
|
|
944
|
+
fontFamily: checkoutDetails.fontFamily.semiBold
|
|
945
|
+
},
|
|
946
|
+
children: "Done"
|
|
947
|
+
})
|
|
948
|
+
})
|
|
949
|
+
})
|
|
950
|
+
}, id))
|
|
910
951
|
})]
|
|
911
952
|
});
|
|
912
953
|
};
|