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.
Files changed (108) hide show
  1. package/lib/module/components/checkboxContainer.js +3 -2
  2. package/lib/module/components/checkboxContainer.js.map +1 -1
  3. package/lib/module/components/header.js +1 -1
  4. package/lib/module/components/header.js.map +1 -1
  5. package/lib/module/components/paymentSelector.js +1 -1
  6. package/lib/module/components/paymentSelector.js.map +1 -1
  7. package/lib/module/components/paymentSuccess.js +2 -7
  8. package/lib/module/components/paymentSuccess.js.map +1 -1
  9. package/lib/module/components/savedCardComponent.js +1 -1
  10. package/lib/module/components/savedCardComponent.js.map +1 -1
  11. package/lib/module/components/subscriptionRow.js +33 -0
  12. package/lib/module/components/subscriptionRow.js.map +1 -0
  13. package/lib/module/interface.js +2 -0
  14. package/lib/module/interface.js.map +1 -1
  15. package/lib/module/screens/addressScreen.js +11 -60
  16. package/lib/module/screens/addressScreen.js.map +1 -1
  17. package/lib/module/screens/bnplScreen.js +3 -2
  18. package/lib/module/screens/bnplScreen.js.map +1 -1
  19. package/lib/module/screens/cardScreen.js +491 -450
  20. package/lib/module/screens/cardScreen.js.map +1 -1
  21. package/lib/module/screens/emiScreen.js +5 -9
  22. package/lib/module/screens/emiScreen.js.map +1 -1
  23. package/lib/module/screens/instantOfferList.js +2 -6
  24. package/lib/module/screens/instantOfferList.js.map +1 -1
  25. package/lib/module/screens/mainScreen.js +54 -6
  26. package/lib/module/screens/mainScreen.js.map +1 -1
  27. package/lib/module/screens/netBankingScreen.js +5 -8
  28. package/lib/module/screens/netBankingScreen.js.map +1 -1
  29. package/lib/module/screens/upiScreen.js +2 -6
  30. package/lib/module/screens/upiScreen.js.map +1 -1
  31. package/lib/module/screens/walletScreen.js +5 -8
  32. package/lib/module/screens/walletScreen.js.map +1 -1
  33. package/lib/module/sdk-version.json +1 -1
  34. package/lib/module/sharedContext/checkoutDetailsHandler.js +8 -2
  35. package/lib/module/sharedContext/checkoutDetailsHandler.js.map +1 -1
  36. package/lib/module/sharedContext/getTextInputTheme.js +15 -0
  37. package/lib/module/sharedContext/getTextInputTheme.js.map +1 -0
  38. package/lib/module/sharedContext/handleAutoNavigation.js +3 -2
  39. package/lib/module/sharedContext/handleAutoNavigation.js.map +1 -1
  40. package/lib/module/styles/indexStyles.js +1 -1
  41. package/lib/module/styles/indexStyles.js.map +1 -1
  42. package/lib/module/styles/screens/bnplScreenStyles.js +2 -3
  43. package/lib/module/styles/screens/bnplScreenStyles.js.map +1 -1
  44. package/lib/module/styles/screens/cardScreenStyles.js +9 -4
  45. package/lib/module/styles/screens/cardScreenStyles.js.map +1 -1
  46. package/lib/module/styles/screens/netBankingScreenStyles.js +2 -3
  47. package/lib/module/styles/screens/netBankingScreenStyles.js.map +1 -1
  48. package/lib/module/styles/screens/walletScreenStyles.js +2 -3
  49. package/lib/module/styles/screens/walletScreenStyles.js.map +1 -1
  50. package/lib/module/utility.js +16 -0
  51. package/lib/module/utility.js.map +1 -1
  52. package/lib/typescript/src/components/checkboxContainer.d.ts.map +1 -1
  53. package/lib/typescript/src/components/subscriptionRow.d.ts +9 -0
  54. package/lib/typescript/src/components/subscriptionRow.d.ts.map +1 -0
  55. package/lib/typescript/src/interface.d.ts +27 -2
  56. package/lib/typescript/src/interface.d.ts.map +1 -1
  57. package/lib/typescript/src/screens/addressScreen.d.ts.map +1 -1
  58. package/lib/typescript/src/screens/cardScreen.d.ts +1 -1
  59. package/lib/typescript/src/screens/cardScreen.d.ts.map +1 -1
  60. package/lib/typescript/src/screens/emiScreen.d.ts.map +1 -1
  61. package/lib/typescript/src/screens/instantOfferList.d.ts.map +1 -1
  62. package/lib/typescript/src/screens/mainScreen.d.ts.map +1 -1
  63. package/lib/typescript/src/screens/netBankingScreen.d.ts.map +1 -1
  64. package/lib/typescript/src/screens/upiScreen.d.ts.map +1 -1
  65. package/lib/typescript/src/screens/walletScreen.d.ts.map +1 -1
  66. package/lib/typescript/src/sharedContext/checkoutDetailsHandler.d.ts.map +1 -1
  67. package/lib/typescript/src/sharedContext/getTextInputTheme.d.ts +7 -0
  68. package/lib/typescript/src/sharedContext/getTextInputTheme.d.ts.map +1 -0
  69. package/lib/typescript/src/sharedContext/handleAutoNavigation.d.ts +1 -1
  70. package/lib/typescript/src/sharedContext/handleAutoNavigation.d.ts.map +1 -1
  71. package/lib/typescript/src/styles/indexStyles.d.ts +1 -1
  72. package/lib/typescript/src/styles/screens/bnplScreenStyles.d.ts +1 -2
  73. package/lib/typescript/src/styles/screens/bnplScreenStyles.d.ts.map +1 -1
  74. package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts +8 -3
  75. package/lib/typescript/src/styles/screens/cardScreenStyles.d.ts.map +1 -1
  76. package/lib/typescript/src/styles/screens/netBankingScreenStyles.d.ts +1 -2
  77. package/lib/typescript/src/styles/screens/netBankingScreenStyles.d.ts.map +1 -1
  78. package/lib/typescript/src/styles/screens/walletScreenStyles.d.ts +1 -2
  79. package/lib/typescript/src/styles/screens/walletScreenStyles.d.ts.map +1 -1
  80. package/lib/typescript/src/utility.d.ts +2 -0
  81. package/lib/typescript/src/utility.d.ts.map +1 -1
  82. package/package.json +2 -2
  83. package/src/components/checkboxContainer.tsx +2 -1
  84. package/src/components/header.tsx +1 -1
  85. package/src/components/paymentSelector.tsx +1 -1
  86. package/src/components/paymentSuccess.tsx +3 -5
  87. package/src/components/savedCardComponent.tsx +1 -1
  88. package/src/components/subscriptionRow.tsx +19 -0
  89. package/src/interface.ts +25 -2
  90. package/src/screens/addressScreen.tsx +11 -60
  91. package/src/screens/bnplScreen.tsx +3 -3
  92. package/src/screens/cardScreen.tsx +190 -126
  93. package/src/screens/emiScreen.tsx +6 -9
  94. package/src/screens/instantOfferList.tsx +2 -6
  95. package/src/screens/mainScreen.tsx +58 -6
  96. package/src/screens/netBankingScreen.tsx +5 -9
  97. package/src/screens/upiScreen.tsx +2 -6
  98. package/src/screens/walletScreen.tsx +5 -9
  99. package/src/sdk-version.json +1 -1
  100. package/src/sharedContext/checkoutDetailsHandler.ts +8 -2
  101. package/src/sharedContext/getTextInputTheme.ts +12 -0
  102. package/src/sharedContext/handleAutoNavigation.ts +4 -1
  103. package/src/styles/indexStyles.ts +1 -1
  104. package/src/styles/screens/bnplScreenStyles.ts +2 -3
  105. package/src/styles/screens/cardScreenStyles.ts +3 -4
  106. package/src/styles/screens/netBankingScreenStyles.ts +2 -3
  107. package/src/styles/screens/walletScreenStyles.ts +2 -3
  108. package/src/utility.ts +24 -1
@@ -15,7 +15,7 @@ import type { CheckoutStackParamList } from '../navigation';
15
15
  import { paymentHandler, setPaymentHandler } from "../sharedContext/paymentStatusHandler";
16
16
  import { loadBoxpayFonts } from '../components/fontFamily';
17
17
  import { setUserDataHandler, setUserDataHandlerToDefault, userDataHandler } from '../sharedContext/userdataHandler';
18
- import { type PaymentResultObject, type PaymentClass, type InstrumentDetails, type PaymentMethod, type OrderItem, APIStatus, AnalyticsEvents, type DeliveryAddress, type BoxpayCheckoutProps, type GetInstantOffersResponse, UIConfigurationOptions, TransactionStatus } from '../interface';
18
+ import { type PaymentResultObject, type PaymentClass, type InstrumentDetails, type PaymentMethod, type OrderItem, APIStatus, AnalyticsEvents, type DeliveryAddress, type BoxpayCheckoutProps, type GetInstantOffersResponse, UIConfigurationOptions, TransactionStatus, type SubscriptionDetails } from '../interface';
19
19
  import { checkoutDetailsHandler, setCheckoutDetailsHandler, setCheckOutDetailsHandlerToDefault } from '../sharedContext/checkoutDetailsHandler';
20
20
  import WebViewScreen from '../screens/webViewScreen';
21
21
  import styles from '../styles/indexStyles';
@@ -30,7 +30,7 @@ import fetchSessionDetails from '../postRequest/fetchSessionDetails';
30
30
  import MorePaymentMethods from '../components/morePaymentMethods';
31
31
  import { fetchSavedInstrumentsHandler, handleFetchStatusResponseHandler, handlePaymentResponse } from '../sharedContext/handlePaymentResponseHandler';
32
32
  import callUIAnalytics from '../postRequest/callUIAnalytics';
33
- import { formatAddress, getPhoneNumberCodeAndCountryName, useCountdown } from '../utility';
33
+ import { formatAddress, formatDate, getPhoneNumberCodeAndCountryName, isEmpty, useCountdown } from '../utility';
34
34
  import fetchSurCharge from '../postRequest/fetchSurcharge';
35
35
  import fetchInstantOffer from '../postRequest/fetchInstantOffer';
36
36
  import ApplyCouponCard from '../components/applyCouponCard';
@@ -55,7 +55,7 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
55
55
  shopperToken = null,
56
56
  uiConfiguration = null
57
57
  } = route.params as BoxpayCheckoutProps || {};
58
- const [status, setStatus] = useState('NOACTION');
58
+ const [status, setStatus] = useState<string>(TransactionStatus.NoAction);
59
59
  const [transactionId, setTransactionId] = useState('');
60
60
  const isScreenFocused = useIsFocused()
61
61
  const appStateListenerRef = useRef<any>(null);
@@ -309,7 +309,7 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
309
309
  setShowWebView(false);
310
310
  paymentFailedMessage.current =
311
311
  checkoutDetailsHandler.checkoutDetails.errorMessage;
312
- setStatus('Failed');
312
+ setStatus(TransactionStatus.Failed);
313
313
  setFailedModalState(true);
314
314
  setLoadingState(false);
315
315
  return true;
@@ -552,6 +552,8 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
552
552
  },
553
553
  ctaBorderRadius : uiConfiguration?.[UIConfigurationOptions.CTABorderRadius] ? uiConfiguration[UIConfigurationOptions.CTABorderRadius] : 12,
554
554
  buttonColor: response.data.merchantDetails.checkoutTheme.primaryButtonColor,
555
+ textInputFieldFocusedOutlineColor: uiConfiguration?.[UIConfigurationOptions.TextInputFields]?.focusedBorderColor ? uiConfiguration[UIConfigurationOptions.TextInputFields].focusedBorderColor : '#2D2B32',
556
+ textInputFieldUnFocusedOutlineColor : uiConfiguration?.[UIConfigurationOptions.TextInputFields]?.borderColor ? uiConfiguration[UIConfigurationOptions.TextInputFields].borderColor : '#E6E6E6',
555
557
  buttonTextColor : response.data.merchantDetails.checkoutTheme.buttonTextColor,
556
558
  headerColor : response.data.merchantDetails.checkoutTheme.headerColor,
557
559
  headerTextColor : response.data.merchantDetails.checkoutTheme.headerTextColor,
@@ -586,7 +588,8 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
586
588
  isUPIOtmQRMethodEnabled : methodFlags.isUPIOtmQRVisible,
587
589
  isOrderItemDetailsVisible : isFieldEnabled('ORDER_ITEM_DETAILS'),
588
590
  isSICheckboxVisible : configurationOptions?.SHOW_SI_CHECKBOX ? true : false,
589
- isSubscriptionCheckout : paymentDetails.subscriptionDetails != null ? true : false
591
+ isSubscriptionCheckout : paymentDetails.subscriptionDetails != null ? true : false,
592
+ subscriptionDetails : getSubscriptionDetails(paymentDetails.subscriptionDetails, paymentDetails.money.amountLocaleFull, symbol)
590
593
  },
591
594
  });
592
595
  setPaymentHandler({
@@ -614,6 +617,54 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
614
617
  loadSession()
615
618
  }, []);
616
619
 
620
+ const getSubscriptionDetails = (data: SubscriptionDetails | null, amount : string, currencySymbol : string) => {
621
+ if (isEmpty(data)) return null;
622
+
623
+ const { billingCycle } = data!;
624
+
625
+ // Frequency
626
+ let frequency: string | null = null;
627
+ if (!isEmpty(billingCycle)) {
628
+ const { billingCycleValue, count, billingTimeUnit } = billingCycle!;
629
+
630
+ if (count === 1) {
631
+ frequency = billingTimeUnit;
632
+ } else {
633
+ frequency = `Every ${count} ${billingCycleValue}`;
634
+ }
635
+ }
636
+
637
+ // Validity
638
+ let validity: string | null = null;
639
+ if (!isEmpty(data!.expiryDateLocale)) {
640
+ const date = formatDate(data!.expiryDateLocale!.split(' ')[0] ?? "");
641
+ validity = `${date}`;
642
+ } else if (!isEmpty(data!.recurringExpiryDateLocale)) {
643
+ const date = formatDate(data!.recurringExpiryDateLocale!.split(' ')[0] ?? "");
644
+ validity = `${date}`;
645
+ }
646
+
647
+ const rows = [
648
+ {
649
+ label: 'To be paid now',
650
+ value: !isEmpty(amount) ? `${currencySymbol}${amount}` : null,
651
+ },
652
+ {
653
+ label: 'Recurring Amount',
654
+ value: !isEmpty(data!.maxAmountLocaleFull) ? `Up to ${currencySymbol}${data!.maxAmountLocaleFull}` : null,
655
+ },
656
+ {
657
+ label: 'Frequency',
658
+ value: frequency,
659
+ },
660
+ {
661
+ label: 'Expiry Date',
662
+ value: validity,
663
+ },
664
+ ];
665
+ return rows.filter(row => !isEmpty(row.value));
666
+ };
667
+
617
668
  const handleSurchargeDetails = async() => {
618
669
  const response = await fetchSurCharge()
619
670
  switch (response.apiStatus) {
@@ -698,6 +749,7 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
698
749
 
699
750
  const checkAutoNavigation = () => {
700
751
  const targetScreen = handleAutoNavigation(
752
+ status,
701
753
  savedCardArray
702
754
  )
703
755
  if (!targetScreen) {
@@ -785,7 +837,7 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
785
837
  if (timerRef.current) {
786
838
  clearInterval(timerRef.current);
787
839
  }
788
- setStatus('EXPIRED');
840
+ setStatus(TransactionStatus.Expired);
789
841
  setSessionExppireModalState(true);
790
842
  }
791
843
  // const hours = Math.floor((timeDiff / (1000 * 60 * 60)) % 24);
@@ -11,7 +11,7 @@ import { checkoutDetailsHandler, setCheckOutDetailsHandlerToDefault } from '../s
11
11
  import LottieView from 'lottie-react-native';
12
12
  import Header from '../components/header';
13
13
  import { TextInput } from 'react-native-paper';
14
- import type { NetBankingScreenParams, PaymentClass, PaymentResultObject } from '../interface';
14
+ import { TransactionStatus, type NetBankingScreenParams, type PaymentClass, type PaymentResultObject } from '../interface';
15
15
  import ShimmerView from '../components/shimmerView';
16
16
  import PaymentSuccess from '../components/paymentSuccess';
17
17
  import SessionExpire from '../components/sessionExpire';
@@ -26,6 +26,7 @@ import styles from '../styles/screens/netBankingScreenStyles';
26
26
  import type { CheckoutStackParamList } from '../navigation';
27
27
  import type { NavigationProp, RouteProp } from '@react-navigation/native';
28
28
  import { setUserDataHandlerToDefault } from '../sharedContext/userdataHandler';
29
+ import { getTextInputTheme } from '../sharedContext/getTextInputTheme';
29
30
 
30
31
  type NetBankingScreenRouteProp = RouteProp<CheckoutStackParamList, 'NetBankingScreen'>;
31
32
 
@@ -76,7 +77,7 @@ const NetBankingScreen = ({ navigation, route }: Props) => {
76
77
  const [sessionExpireModalOpen, setSessionExppireModalState] = useState(false);
77
78
  const [successfulTimeStamp, setSuccessfulTimeStamp] = useState('');
78
79
 
79
- const [status, setStatus] = useState<string>("NOACTION");
80
+ const [status, setStatus] = useState<string>(TransactionStatus.NoAction);
80
81
  const [transactionId, setTransactionId] = useState<string | null>(null);
81
82
 
82
83
  const backgroundApiInterval = useRef<NodeJS.Timeout | null>(null);
@@ -104,7 +105,7 @@ const NetBankingScreen = ({ navigation, route }: Props) => {
104
105
  if (showWebView) {
105
106
  setShowWebView(false);
106
107
  paymentFailedMessage.current = checkoutDetails.errorMessage;
107
- setStatus('Failed');
108
+ setStatus(TransactionStatus.Failed);
108
109
  setFailedModalState(true);
109
110
  setLoading(false);
110
111
  return true;
@@ -314,12 +315,7 @@ const NetBankingScreen = ({ navigation, route }: Props) => {
314
315
  onChangeText={(it) => {
315
316
  handleSearchTextChange(it);
316
317
  }}
317
- theme={{
318
- colors: {
319
- primary: '#2D2B32',
320
- outline: '#E6E6E6',
321
- },
322
- }}
318
+ theme={getTextInputTheme()}
323
319
  style={[styles.searchTextInput, {fontFamily: checkoutDetails.fontFamily.regular,}]}
324
320
  left={
325
321
  <TextInput.Icon
@@ -18,6 +18,7 @@ import { formatTime, height, width } from '../utility';
18
18
  import upiPostRequest from '../postRequest/upiPostRequest';
19
19
  import { handlePaymentResponse } from '../sharedContext/handlePaymentResponseHandler';
20
20
  import callUIAnalytics from '../postRequest/callUIAnalytics';
21
+ import { getTextInputTheme } from '../sharedContext/getTextInputTheme';
21
22
 
22
23
  interface UpiScreenProps {
23
24
  handleUpiPayment: (selectedIntent: string) => void;
@@ -447,12 +448,7 @@ const UpiScreen: React.FC<UpiScreenProps> = ({
447
448
  onChangeText={(it) => {
448
449
  handleTextChange(it);
449
450
  }}
450
- theme={{
451
- colors: {
452
- primary: '#2D2B32',
453
- outline: '#E6E6E6',
454
- },
455
- }}
451
+ theme={getTextInputTheme()}
456
452
  style={[styles.textInput, {fontFamily: checkoutDetails.fontFamily.regular,}]}
457
453
  error={upiCollectError}
458
454
  right={
@@ -11,7 +11,7 @@ import { checkoutDetailsHandler, setCheckOutDetailsHandlerToDefault } from '../s
11
11
  import LottieView from 'lottie-react-native';
12
12
  import Header from '../components/header';
13
13
  import { TextInput } from 'react-native-paper';
14
- import type { PaymentClass, PaymentResultObject, WalletScreenParams } from '../interface';
14
+ import { TransactionStatus, type PaymentClass, type PaymentResultObject, type WalletScreenParams } from '../interface';
15
15
  import PaymentSelectorView from '../components/paymentSelector';
16
16
  import PaymentSuccess from '../components/paymentSuccess';
17
17
  import SessionExpire from '../components/sessionExpire';
@@ -26,6 +26,7 @@ import styles from '../styles/screens/walletScreenStyles';
26
26
  import type { CheckoutStackParamList } from '../navigation';
27
27
  import type { NavigationProp, RouteProp } from '@react-navigation/native';
28
28
  import { setUserDataHandlerToDefault } from '../sharedContext/userdataHandler';
29
+ import { getTextInputTheme } from '../sharedContext/getTextInputTheme';
29
30
 
30
31
  type WalletScreenRouteProp = RouteProp<CheckoutStackParamList, 'WalletScreen'>;
31
32
  type WalletScreenNavigationProp = NavigationProp<CheckoutStackParamList, 'WalletScreen'>;
@@ -60,7 +61,7 @@ const WalletScreen = ({ navigation, route }: Props) => {
60
61
  const [sessionExpireModalOpen, setSessionExppireModalState] = useState(false);
61
62
  const [successfulTimeStamp, setSuccessfulTimeStamp] = useState('');
62
63
 
63
- const [status, setStatus] = useState<string>("NOACTION");
64
+ const [status, setStatus] = useState<string>(TransactionStatus.NoAction);
64
65
  const [transactionId, setTransactionId] = useState<string | null>(null);
65
66
 
66
67
  const backgroundApiInterval = useRef<NodeJS.Timeout | null>(null);
@@ -91,7 +92,7 @@ const WalletScreen = ({ navigation, route }: Props) => {
91
92
  if (showWebView) {
92
93
  setShowWebView(false);
93
94
  paymentFailedMessage.current = checkoutDetails.errorMessage;
94
- setStatus('Failed');
95
+ setStatus(TransactionStatus.Failed);
95
96
  setFailedModalState(true);
96
97
  setLoading(false);
97
98
  return true;
@@ -276,12 +277,7 @@ const WalletScreen = ({ navigation, route }: Props) => {
276
277
  onChangeText={(it) => {
277
278
  handleSearchTextChange(it);
278
279
  }}
279
- theme={{
280
- colors: {
281
- primary: '#2D2B32',
282
- outline: '#E6E6E6',
283
- },
284
- }}
280
+ theme={getTextInputTheme()}
285
281
  style={[styles.textFieldStyle, {fontFamily: checkoutDetails.fontFamily.regular,}]}
286
282
  left={
287
283
  <TextInput.Icon
@@ -1 +1 @@
1
- { "version": "1.0.11-beta2" }
1
+ { "version": "1.0.11-beta4" }
@@ -13,6 +13,8 @@ export let checkoutDetailsHandler: CheckoutDetailsHandler = {
13
13
  fontFamily : {},
14
14
  ctaBorderRadius:0,
15
15
  buttonColor: '#1CA672',
16
+ textInputFieldFocusedOutlineColor : "#2D2B32",
17
+ textInputFieldUnFocusedOutlineColor: "#ADACB0",
16
18
  buttonTextColor:'white',
17
19
  headerColor : 'white',
18
20
  headerTextColor:'#363840',
@@ -46,7 +48,8 @@ export let checkoutDetailsHandler: CheckoutDetailsHandler = {
46
48
  isUPIOtmQRMethodEnabled : false,
47
49
  isOrderItemDetailsVisible : true,
48
50
  isSICheckboxVisible : false,
49
- isSubscriptionCheckout : false
51
+ isSubscriptionCheckout : false,
52
+ subscriptionDetails : null
50
53
  },
51
54
  };
52
55
 
@@ -64,6 +67,8 @@ export const setCheckOutDetailsHandlerToDefault = () => {
64
67
  fontFamily : {},
65
68
  ctaBorderRadius:0,
66
69
  buttonColor: '',
70
+ textInputFieldFocusedOutlineColor : "",
71
+ textInputFieldUnFocusedOutlineColor: "",
67
72
  buttonTextColor:'',
68
73
  headerColor : '',
69
74
  headerTextColor:'',
@@ -97,7 +102,8 @@ export const setCheckOutDetailsHandlerToDefault = () => {
97
102
  isUPIOtmQRMethodEnabled: false,
98
103
  isOrderItemDetailsVisible : true,
99
104
  isSICheckboxVisible : false,
100
- isSubscriptionCheckout : false
105
+ isSubscriptionCheckout : false,
106
+ subscriptionDetails : null
101
107
  },
102
108
  };
103
109
  };
@@ -0,0 +1,12 @@
1
+ import { checkoutDetailsHandler } from "./checkoutDetailsHandler";
2
+
3
+
4
+ export const getTextInputTheme = () => {
5
+ const { checkoutDetails } = checkoutDetailsHandler;
6
+ return {
7
+ colors: {
8
+ primary: checkoutDetails.textInputFieldFocusedOutlineColor,
9
+ outline: checkoutDetails.textInputFieldUnFocusedOutlineColor,
10
+ },
11
+ };
12
+ };
@@ -1,9 +1,10 @@
1
- import { ScreenRouteMap, type AutoNavigationScreen, type PaymentClass } from '../interface';
1
+ import { ScreenRouteMap, TransactionStatus, type AutoNavigationScreen, type PaymentClass } from '../interface';
2
2
  import { checkoutDetailsHandler } from './checkoutDetailsHandler';
3
3
  import { userDataHandler } from './userdataHandler';
4
4
 
5
5
 
6
6
  export const handleAutoNavigation = (
7
+ status : String,
7
8
  savedCardArray : PaymentClass[]
8
9
  ) : AutoNavigationScreen | null => {
9
10
  const {checkoutDetails} = checkoutDetailsHandler
@@ -13,6 +14,8 @@ export const handleAutoNavigation = (
13
14
 
14
15
  if (savedCardArray.length > 0) return null;
15
16
 
17
+ if(status !== TransactionStatus.NoAction) return null
18
+
16
19
  const isPersonalDataMissing =
17
20
  (checkoutDetails.isFullNameEnabled && (!userData.firstName || userData.firstName.trim() === "")) ||
18
21
  (checkoutDetails.isEmailEnabled && (!userData.email || userData.email.trim() === "")) ||
@@ -44,7 +44,7 @@ const styles = StyleSheet.create({
44
44
  footerText : {
45
45
  fontSize: 12,
46
46
  color: '#888888',
47
- marginBottom: 13,
47
+ paddingBottom:16,
48
48
  },
49
49
  footerImage : { height: 50, width: 50 },
50
50
  webViewScreenStyle : {
@@ -53,12 +53,11 @@ const styles = StyleSheet.create({
53
53
  },
54
54
  bottomText : {
55
55
  fontSize: 12,
56
- color: '#888888',
57
- marginBottom: 13,
56
+ color: '#888888'
58
57
  },
59
58
  bottomContainer : {
60
59
  justifyContent: 'center',
61
- alignItems: 'flex-end',
60
+ alignItems: 'center',
62
61
  backgroundColor: '#F5F6FB',
63
62
  flexDirection: 'row',
64
63
  },
@@ -15,6 +15,7 @@ const styles = StyleSheet.create({
15
15
  paddingTop: 14,
16
16
  paddingBottom: 12,
17
17
  },
18
+ subscriptionContainer : {backgroundColor:'#EFF3FA', marginHorizontal : 16, marginTop : 10, borderRadius : 6, paddingBottom : 4},
18
19
  buttonText: {
19
20
  color: 'white',
20
21
  fontSize: 16,
@@ -77,7 +78,6 @@ const styles = StyleSheet.create({
77
78
  errorText : {
78
79
  color: '#B3261E',
79
80
  fontSize: 12,
80
- marginHorizontal: 16,
81
81
  marginTop: 4,
82
82
  },
83
83
  expiryCvvContainer : {
@@ -143,13 +143,12 @@ const styles = StyleSheet.create({
143
143
  },
144
144
  footerContainer : {
145
145
  justifyContent: 'center',
146
- alignItems: 'flex-end',
146
+ alignItems: 'center',
147
147
  flexDirection: 'row',
148
148
  },
149
149
  footerText : {
150
150
  fontSize: 12,
151
- color: '#888888',
152
- marginBottom: 13,
151
+ color: '#888888'
153
152
  },
154
153
  footerImage : { height: 50, width: 50 },
155
154
  })
@@ -61,14 +61,13 @@ const styles = StyleSheet.create({
61
61
  },
62
62
  footerContainer : {
63
63
  justifyContent: 'center',
64
- alignItems: 'flex-end',
64
+ alignItems: 'center',
65
65
  backgroundColor: '#F5F6FB',
66
66
  flexDirection: 'row',
67
67
  },
68
68
  footerTextStyle : {
69
69
  fontSize: 12,
70
- color: '#888888',
71
- marginBottom: 13,
70
+ color: '#888888'
72
71
  },
73
72
  footerIcon : { height: 50, width: 50 },
74
73
  webViewContainer : {
@@ -48,14 +48,13 @@ const styles = StyleSheet.create({
48
48
  },
49
49
  bottomContainer : {
50
50
  justifyContent: 'center',
51
- alignItems: 'flex-end',
51
+ alignItems: 'center',
52
52
  backgroundColor: '#F5F6FB',
53
53
  flexDirection: 'row',
54
54
  },
55
55
  bottomText : {
56
56
  fontSize: 12,
57
- color: '#888888',
58
- marginBottom: 13,
57
+ color: '#888888'
59
58
  },
60
59
  bottomImage : {
61
60
  height: 50, width: 50
package/src/utility.ts CHANGED
@@ -198,4 +198,27 @@ export const getPhoneNumberCodeAndCountryName = (countryCodeRef : string) : Coun
198
198
  const countryDataJson = countryData as Record<string, CountryDetails>;
199
199
  return countryDataJson[countryCodeRef];
200
200
 
201
- }
201
+ }
202
+
203
+ export const formatDate = (dateStr: string) => {
204
+ const [datePart] = dateStr.split(' '); // "28/08/2027"
205
+ if (!datePart) return '';
206
+ const [day, month, year] = datePart.split('/');
207
+
208
+ const months = [
209
+ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
210
+ 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
211
+ ];
212
+
213
+ return `${day}-${months[Number(month) - 1]}-${year}`;
214
+ };
215
+
216
+ export const isEmpty = (value: unknown): boolean => {
217
+ if (value === null || value === undefined) return true;
218
+ if (typeof value === 'string') return value.trim() === '';
219
+ if (typeof value === 'number') return isNaN(value);
220
+ if (typeof value === 'boolean') return false;
221
+ if (Array.isArray(value)) return value.length === 0;
222
+ if (typeof value === 'object') return Object.keys(value).length === 0;
223
+ return false;
224
+ };