@finspringinnovations/fixeddepositsdk 1.0.0

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 (311) hide show
  1. package/README.md +128 -0
  2. package/lib/api/applicationApi.d.ts +1 -0
  3. package/lib/api/applicationApi.js +11 -0
  4. package/lib/api/bankApi.d.ts +352 -0
  5. package/lib/api/bankApi.js +54 -0
  6. package/lib/api/baseApi.d.ts +6 -0
  7. package/lib/api/baseApi.js +406 -0
  8. package/lib/api/customerApi.d.ts +855 -0
  9. package/lib/api/customerApi.js +241 -0
  10. package/lib/api/fdApi.d.ts +979 -0
  11. package/lib/api/fdApi.js +112 -0
  12. package/lib/api/fdCalculatorApi.d.ts +179 -0
  13. package/lib/api/fdCalculatorApi.js +36 -0
  14. package/lib/api/index.d.ts +14 -0
  15. package/lib/api/index.js +45 -0
  16. package/lib/api/interestRateApi.d.ts +585 -0
  17. package/lib/api/interestRateApi.js +101 -0
  18. package/lib/api/kycApi.d.ts +486 -0
  19. package/lib/api/kycApi.js +71 -0
  20. package/lib/api/masterDataApi.d.ts +158 -0
  21. package/lib/api/masterDataApi.js +35 -0
  22. package/lib/api/nomineeApi.d.ts +325 -0
  23. package/lib/api/nomineeApi.js +46 -0
  24. package/lib/api/onboardingApi.d.ts +192 -0
  25. package/lib/api/onboardingApi.js +41 -0
  26. package/lib/api/panApi.d.ts +0 -0
  27. package/lib/api/panApi.js +23 -0
  28. package/lib/api/paymentApi.d.ts +325 -0
  29. package/lib/api/paymentApi.js +46 -0
  30. package/lib/api/workflowApi.d.ts +654 -0
  31. package/lib/api/workflowApi.js +90 -0
  32. package/lib/assets/images/images.d.ts +6 -0
  33. package/lib/assets/images/images.js +12 -0
  34. package/lib/components/AadhaarInput.d.ts +13 -0
  35. package/lib/components/AadhaarInput.js +47 -0
  36. package/lib/components/ActionButton.d.ts +12 -0
  37. package/lib/components/ActionButton.js +87 -0
  38. package/lib/components/ActiveFDCard.d.ts +18 -0
  39. package/lib/components/ActiveFDCard.js +116 -0
  40. package/lib/components/AmountInput.d.ts +20 -0
  41. package/lib/components/AmountInput.js +142 -0
  42. package/lib/components/CheckboxOption.d.ts +11 -0
  43. package/lib/components/CheckboxOption.js +41 -0
  44. package/lib/components/CompanyHeader.d.ts +7 -0
  45. package/lib/components/CompanyHeader.js +59 -0
  46. package/lib/components/DropdownSelector.d.ts +9 -0
  47. package/lib/components/DropdownSelector.js +49 -0
  48. package/lib/components/EmptyState.d.ts +17 -0
  49. package/lib/components/EmptyState.js +44 -0
  50. package/lib/components/ErrorDisplay.d.ts +17 -0
  51. package/lib/components/ErrorDisplay.js +69 -0
  52. package/lib/components/FAQItem.d.ts +9 -0
  53. package/lib/components/FAQItem.js +52 -0
  54. package/lib/components/FDCard.d.ts +23 -0
  55. package/lib/components/FDCard.js +116 -0
  56. package/lib/components/FormDropdown.d.ts +18 -0
  57. package/lib/components/FormDropdown.js +155 -0
  58. package/lib/components/FormSection.d.ts +14 -0
  59. package/lib/components/FormSection.js +38 -0
  60. package/lib/components/Header.d.ts +14 -0
  61. package/lib/components/Header.js +52 -0
  62. package/lib/components/IFSCSearchResultCard.d.ts +13 -0
  63. package/lib/components/IFSCSearchResultCard.js +70 -0
  64. package/lib/components/InfoBox.d.ts +8 -0
  65. package/lib/components/InfoBox.js +39 -0
  66. package/lib/components/InterestRateCard.d.ts +8 -0
  67. package/lib/components/InterestRateCard.js +46 -0
  68. package/lib/components/LoadingIndicator.d.ts +12 -0
  69. package/lib/components/LoadingIndicator.js +30 -0
  70. package/lib/components/OTPInput.d.ts +17 -0
  71. package/lib/components/OTPInput.js +144 -0
  72. package/lib/components/PaymentDetailsCard.d.ts +20 -0
  73. package/lib/components/PaymentDetailsCard.js +68 -0
  74. package/lib/components/PendingFDBottomSheet.d.ts +19 -0
  75. package/lib/components/PendingFDBottomSheet.js +122 -0
  76. package/lib/components/SafeAreaWrapper.d.ts +13 -0
  77. package/lib/components/SafeAreaWrapper.js +41 -0
  78. package/lib/components/ScreenHeader.d.ts +11 -0
  79. package/lib/components/ScreenHeader.js +46 -0
  80. package/lib/components/StatusDisplay.d.ts +15 -0
  81. package/lib/components/StatusDisplay.js +88 -0
  82. package/lib/components/TextFieldWithLabel.d.ts +46 -0
  83. package/lib/components/TextFieldWithLabel.js +326 -0
  84. package/lib/components/TrustBox.d.ts +8 -0
  85. package/lib/components/TrustBox.js +46 -0
  86. package/lib/components/ValidationErrorAlert.d.ts +23 -0
  87. package/lib/components/ValidationErrorAlert.js +39 -0
  88. package/lib/components/ValidationMessage.d.ts +9 -0
  89. package/lib/components/ValidationMessage.js +98 -0
  90. package/lib/components/index.d.ts +35 -0
  91. package/lib/components/index.js +64 -0
  92. package/lib/config/apiConfig.d.ts +34 -0
  93. package/lib/config/apiConfig.js +158 -0
  94. package/lib/config/appDataConfig.d.ts +159 -0
  95. package/lib/config/appDataConfig.js +310 -0
  96. package/lib/config/encryptionConfig.d.ts +21 -0
  97. package/lib/config/encryptionConfig.js +61 -0
  98. package/lib/config/workflowConstants.d.ts +62 -0
  99. package/lib/config/workflowConstants.js +63 -0
  100. package/lib/constants/strings/bank.d.ts +72 -0
  101. package/lib/constants/strings/bank.js +86 -0
  102. package/lib/constants/strings/base64Images.d.ts +26 -0
  103. package/lib/constants/strings/base64Images.js +29 -0
  104. package/lib/constants/strings/common.d.ts +53 -0
  105. package/lib/constants/strings/common.js +62 -0
  106. package/lib/constants/strings/employee.d.ts +61 -0
  107. package/lib/constants/strings/employee.js +77 -0
  108. package/lib/constants/strings/faq.d.ts +14 -0
  109. package/lib/constants/strings/faq.js +20 -0
  110. package/lib/constants/strings/fd.d.ts +122 -0
  111. package/lib/constants/strings/fd.js +151 -0
  112. package/lib/constants/strings/home.d.ts +49 -0
  113. package/lib/constants/strings/home.js +62 -0
  114. package/lib/constants/strings/index.d.ts +16 -0
  115. package/lib/constants/strings/index.js +44 -0
  116. package/lib/constants/strings/kyc.d.ts +80 -0
  117. package/lib/constants/strings/kyc.js +94 -0
  118. package/lib/constants/strings/nominee.d.ts +64 -0
  119. package/lib/constants/strings/nominee.js +81 -0
  120. package/lib/hooks/useAuth.d.ts +25 -0
  121. package/lib/hooks/useAuth.js +39 -0
  122. package/lib/hooks/useFDData.d.ts +11 -0
  123. package/lib/hooks/useFDData.js +40 -0
  124. package/lib/index.d.ts +48 -0
  125. package/lib/index.js +161 -0
  126. package/lib/navigation/RootNavigator.d.ts +9 -0
  127. package/lib/navigation/RootNavigator.js +459 -0
  128. package/lib/navigation/SimpleNavigator.d.ts +11 -0
  129. package/lib/navigation/SimpleNavigator.js +114 -0
  130. package/lib/navigation/helpers.d.ts +11 -0
  131. package/lib/navigation/helpers.js +83 -0
  132. package/lib/navigation/index.d.ts +17 -0
  133. package/lib/navigation/index.js +42 -0
  134. package/lib/navigation/types.d.ts +139 -0
  135. package/lib/navigation/types.js +2 -0
  136. package/lib/navigation/workflowNavigator.d.ts +22 -0
  137. package/lib/navigation/workflowNavigator.js +104 -0
  138. package/lib/providers/ApiProvider.d.ts +7 -0
  139. package/lib/providers/ApiProvider.js +16 -0
  140. package/lib/providers/MasterDataProvider.d.ts +10 -0
  141. package/lib/providers/MasterDataProvider.js +54 -0
  142. package/lib/screens/AadhaarVerification.d.ts +7 -0
  143. package/lib/screens/AadhaarVerification.js +627 -0
  144. package/lib/screens/AddBankAccount.d.ts +22 -0
  145. package/lib/screens/AddBankAccount.js +381 -0
  146. package/lib/screens/BankDetail.d.ts +16 -0
  147. package/lib/screens/BankDetail.js +596 -0
  148. package/lib/screens/Employee.d.ts +18 -0
  149. package/lib/screens/Employee.js +594 -0
  150. package/lib/screens/FDCalculator.d.ts +18 -0
  151. package/lib/screens/FDCalculator.js +767 -0
  152. package/lib/screens/FDList.d.ts +28 -0
  153. package/lib/screens/FDList.js +1853 -0
  154. package/lib/screens/FindIFSC.d.ts +16 -0
  155. package/lib/screens/FindIFSC.js +248 -0
  156. package/lib/screens/NomineeDetail.d.ts +17 -0
  157. package/lib/screens/NomineeDetail.js +592 -0
  158. package/lib/screens/PayNow.d.ts +14 -0
  159. package/lib/screens/PayNow.js +230 -0
  160. package/lib/screens/Payment.d.ts +11 -0
  161. package/lib/screens/Payment.js +191 -0
  162. package/lib/screens/PaymentStatus.d.ts +16 -0
  163. package/lib/screens/PaymentStatus.js +431 -0
  164. package/lib/screens/ReviewKYC.d.ts +23 -0
  165. package/lib/screens/ReviewKYC.js +727 -0
  166. package/lib/state/paymentSession.d.ts +8 -0
  167. package/lib/state/paymentSession.js +13 -0
  168. package/lib/store/fdListSelectedSlice.d.ts +21 -0
  169. package/lib/store/fdListSelectedSlice.js +26 -0
  170. package/lib/store/hooks.d.ts +8 -0
  171. package/lib/store/hooks.js +8 -0
  172. package/lib/store/index.d.ts +3 -0
  173. package/lib/store/index.js +8 -0
  174. package/lib/store/onboardingSlice.d.ts +12 -0
  175. package/lib/store/onboardingSlice.js +32 -0
  176. package/lib/store/store.d.ts +13 -0
  177. package/lib/store/store.js +27 -0
  178. package/lib/theme/ThemeContext.d.ts +210 -0
  179. package/lib/theme/ThemeContext.js +92 -0
  180. package/lib/theme/colors.d.ts +80 -0
  181. package/lib/theme/colors.js +85 -0
  182. package/lib/theme/index.d.ts +35 -0
  183. package/lib/theme/index.js +78 -0
  184. package/lib/theme/shadows.d.ts +53 -0
  185. package/lib/theme/shadows.js +58 -0
  186. package/lib/theme/typography.d.ts +134 -0
  187. package/lib/theme/typography.js +143 -0
  188. package/lib/types/dataTypes.d.ts +34 -0
  189. package/lib/types/dataTypes.js +2 -0
  190. package/lib/types/workflowTypes.d.ts +2 -0
  191. package/lib/types/workflowTypes.js +2 -0
  192. package/lib/utils/apiLogger.d.ts +48 -0
  193. package/lib/utils/apiLogger.js +105 -0
  194. package/lib/utils/encryption.d.ts +28 -0
  195. package/lib/utils/encryption.js +113 -0
  196. package/lib/utils/getFDData.d.ts +48 -0
  197. package/lib/utils/getFDData.js +145 -0
  198. package/lib/utils/globalData.d.ts +2 -0
  199. package/lib/utils/globalData.js +10 -0
  200. package/package.json +51 -0
  201. package/src/api/applicationApi.ts +12 -0
  202. package/src/api/bankApi.ts +42 -0
  203. package/src/api/baseApi.ts +463 -0
  204. package/src/api/customerApi.ts +324 -0
  205. package/src/api/fdApi.ts +150 -0
  206. package/src/api/fdCalculatorApi.ts +41 -0
  207. package/src/api/index.ts +29 -0
  208. package/src/api/interestRateApi.ts +143 -0
  209. package/src/api/kycApi.ts +63 -0
  210. package/src/api/masterDataApi.ts +37 -0
  211. package/src/api/nomineeApi.ts +34 -0
  212. package/src/api/onboardingApi.ts +64 -0
  213. package/src/api/panApi.ts +25 -0
  214. package/src/api/paymentApi.ts +34 -0
  215. package/src/api/workflowApi.ts +94 -0
  216. package/src/assets/images/Mahindra.png +0 -0
  217. package/src/assets/images/arrow-filled.png +0 -0
  218. package/src/assets/images/arrow-left.png +0 -0
  219. package/src/assets/images/backicon.png +0 -0
  220. package/src/assets/images/calendar.png +0 -0
  221. package/src/assets/images/chevron-down.png +0 -0
  222. package/src/assets/images/chevron-down@2x.png +0 -0
  223. package/src/assets/images/chevron-down@3x.png +0 -0
  224. package/src/assets/images/images.js +10 -0
  225. package/src/assets/images/shriram_logo.png +0 -0
  226. package/src/components/AadhaarInput.tsx +91 -0
  227. package/src/components/ActionButton.tsx +129 -0
  228. package/src/components/ActiveFDCard.tsx +188 -0
  229. package/src/components/AmountInput.tsx +217 -0
  230. package/src/components/CheckboxOption.tsx +93 -0
  231. package/src/components/CompanyHeader.tsx +80 -0
  232. package/src/components/DropdownSelector.tsx +77 -0
  233. package/src/components/EmptyState.tsx +109 -0
  234. package/src/components/ErrorDisplay.tsx +135 -0
  235. package/src/components/FAQItem.tsx +90 -0
  236. package/src/components/FDCard.tsx +186 -0
  237. package/src/components/FormDropdown.tsx +214 -0
  238. package/src/components/FormSection.tsx +86 -0
  239. package/src/components/Header.tsx +110 -0
  240. package/src/components/IFSCSearchResultCard.tsx +139 -0
  241. package/src/components/InfoBox.tsx +55 -0
  242. package/src/components/InterestRateCard.tsx +77 -0
  243. package/src/components/LoadingIndicator.tsx +63 -0
  244. package/src/components/OTPInput.tsx +213 -0
  245. package/src/components/PaymentDetailsCard.tsx +120 -0
  246. package/src/components/PendingFDBottomSheet.tsx +237 -0
  247. package/src/components/README.md +210 -0
  248. package/src/components/SafeAreaWrapper.tsx +68 -0
  249. package/src/components/ScreenHeader.tsx +83 -0
  250. package/src/components/StatusDisplay.tsx +139 -0
  251. package/src/components/TextFieldWithLabel.tsx +502 -0
  252. package/src/components/TrustBox.tsx +63 -0
  253. package/src/components/ValidationErrorAlert.tsx +57 -0
  254. package/src/components/ValidationMessage.tsx +134 -0
  255. package/src/components/index.tsx +47 -0
  256. package/src/config/apiConfig.ts +217 -0
  257. package/src/config/appDataConfig.ts +358 -0
  258. package/src/config/encryptionConfig.ts +65 -0
  259. package/src/config/workflowConstants.ts +70 -0
  260. package/src/constants/strings/README.md +146 -0
  261. package/src/constants/strings/bank.ts +92 -0
  262. package/src/constants/strings/base64Images.ts +31 -0
  263. package/src/constants/strings/common.ts +63 -0
  264. package/src/constants/strings/employee.ts +85 -0
  265. package/src/constants/strings/faq.ts +23 -0
  266. package/src/constants/strings/fd.ts +172 -0
  267. package/src/constants/strings/home.ts +67 -0
  268. package/src/constants/strings/index.ts +21 -0
  269. package/src/constants/strings/kyc.ts +100 -0
  270. package/src/constants/strings/nominee.ts +90 -0
  271. package/src/hooks/useAuth.ts +42 -0
  272. package/src/hooks/useFDData.ts +48 -0
  273. package/src/index.tsx +139 -0
  274. package/src/navigation/RootNavigator.tsx +687 -0
  275. package/src/navigation/SimpleNavigator.tsx +123 -0
  276. package/src/navigation/helpers.ts +85 -0
  277. package/src/navigation/index.tsx +84 -0
  278. package/src/navigation/types.ts +146 -0
  279. package/src/navigation/workflowNavigator.ts +131 -0
  280. package/src/providers/ApiProvider.tsx +23 -0
  281. package/src/providers/MasterDataProvider.tsx +30 -0
  282. package/src/screens/AadhaarVerification.tsx +809 -0
  283. package/src/screens/AddBankAccount.tsx +541 -0
  284. package/src/screens/BankDetail.tsx +826 -0
  285. package/src/screens/Employee.tsx +822 -0
  286. package/src/screens/FDCalculator.tsx +1002 -0
  287. package/src/screens/FDList.tsx +2199 -0
  288. package/src/screens/FindIFSC.tsx +332 -0
  289. package/src/screens/NomineeDetail.tsx +800 -0
  290. package/src/screens/PayNow.tsx +282 -0
  291. package/src/screens/Payment.tsx +224 -0
  292. package/src/screens/PaymentStatus.tsx +595 -0
  293. package/src/screens/ReviewKYC.tsx +1062 -0
  294. package/src/state/paymentSession.ts +13 -0
  295. package/src/store/fdListSelectedSlice.ts +42 -0
  296. package/src/store/hooks.ts +6 -0
  297. package/src/store/index.ts +3 -0
  298. package/src/store/onboardingSlice.ts +37 -0
  299. package/src/store/store.ts +27 -0
  300. package/src/theme/ThemeContext.tsx +84 -0
  301. package/src/theme/colors.ts +90 -0
  302. package/src/theme/index.ts +85 -0
  303. package/src/theme/shadows.ts +61 -0
  304. package/src/theme/typography.ts +151 -0
  305. package/src/types/dataTypes.ts +37 -0
  306. package/src/types/env.d.ts +93 -0
  307. package/src/types/workflowTypes.ts +12 -0
  308. package/src/utils/apiLogger.ts +166 -0
  309. package/src/utils/encryption.ts +159 -0
  310. package/src/utils/getFDData.ts +165 -0
  311. package/src/utils/globalData.ts +7 -0
@@ -0,0 +1,431 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ const react_1 = __importStar(require("react"));
40
+ const react_native_1 = require("react-native");
41
+ const Ionicons_1 = __importDefault(require("react-native-vector-icons/Ionicons"));
42
+ const base64Images_1 = require("../constants/strings/base64Images");
43
+ const SafeAreaWrapper_1 = __importDefault(require("../components/SafeAreaWrapper"));
44
+ const components_1 = require("../components");
45
+ const ActionButton_1 = __importDefault(require("../components/ActionButton"));
46
+ const ThemeContext_1 = require("../theme/ThemeContext");
47
+ const fdApi_1 = require("../api/fdApi");
48
+ const customerApi_1 = require("../api/customerApi");
49
+ const store_1 = require("../store");
50
+ const appDataConfig_1 = require("../config/appDataConfig");
51
+ const helpers_1 = require("../navigation/helpers");
52
+ const paymentSession_1 = require("../state/paymentSession");
53
+ const native_1 = require("@react-navigation/native");
54
+ const bank_1 = require("../constants/strings/bank");
55
+ const common_1 = require("../constants/strings/common");
56
+ const apiConfig_1 = require("../config/apiConfig");
57
+ const PaymentStatus = ({ onRetry, onContinue, status, transactionId, fdData }) => {
58
+ var _a;
59
+ const colors = (0, ThemeContext_1.useColors)();
60
+ const typography = (0, ThemeContext_1.useTypography)();
61
+ const { themeName } = (0, ThemeContext_1.useTheme)();
62
+ // Local state to track current status (can be updated from API responses)
63
+ const [currentStatus, setCurrentStatus] = (0, react_1.useState)(status);
64
+ const styles = createStyles(colors, typography, currentStatus);
65
+ const route = (0, native_1.useRoute)();
66
+ // Get transaction ID from navigation props (route params)
67
+ const navigationTransactionId = (_a = route.params) === null || _a === void 0 ? void 0 : _a.transactionId;
68
+ // Fallback: Get transaction ID from payment session if not in navigation params
69
+ const paymentSession = (0, paymentSession_1.getPaymentSession)();
70
+ const sessionTransactionId = paymentSession.transactionId;
71
+ const finalTransactionId = navigationTransactionId || sessionTransactionId || transactionId || "";
72
+ // Redux selectors
73
+ const workflowInstanceId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.workflowInstanceId; });
74
+ const applicationId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.applicationId; });
75
+ const entityId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.entityid; });
76
+ const providerId = (0, store_1.useAppSelector)((state) => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.onboarding) === null || _a === void 0 ? void 0 : _a.providerId; });
77
+ // Payment Reverse Feed API
78
+ const [paymentReverseFeed, { data: paymentReverseFeedResponse, error: paymentReverseFeedError, isLoading: isLoadingPaymentReverseFeed, }] = (0, fdApi_1.usePaymentReverseFeedMutation)();
79
+ // Payment Retry API
80
+ const [paymentRetry, { data: paymentRetryResponse, error: paymentRetryError, isLoading: isLoadingPaymentRetry, }] = (0, fdApi_1.usePaymentRetryMutation)();
81
+ // Get Customer Applications API
82
+ const [getCustomerApplications, { isLoading: isLoadingCustomerApplications, }] = (0, customerApi_1.useGetCustomerApplicationsMutation)();
83
+ // Pull FD data: fdListSelected > fdData prop > default
84
+ const fdListSelectedData = (0, store_1.useAppSelector)((state) => state === null || state === void 0 ? void 0 : state.fdListSelected);
85
+ const displayData = fdListSelectedData ? {
86
+ companyName: fdListSelectedData.companyName,
87
+ amount: fdListSelectedData.amount,
88
+ fdRate: fdListSelectedData.fdRate,
89
+ tenure: fdListSelectedData.tenure,
90
+ interestPayout: fdListSelectedData.interestPayout,
91
+ } : fdData || {
92
+ companyName: '',
93
+ amount: 0,
94
+ fdRate: '',
95
+ tenure: '',
96
+ interestPayout: '',
97
+ };
98
+ const displayTransactionId = finalTransactionId || '';
99
+ const formatAmount = (amount) => {
100
+ return amount.toLocaleString('en-IN');
101
+ };
102
+ // Handle payment reverse feed API call for pending status
103
+ const handlePaymentReverseFeed = async () => {
104
+ var _a, _b, _c, _d;
105
+ try {
106
+ // Get user info from app data
107
+ const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
108
+ // Prepare the API request
109
+ const paymentReverseFeedRequest = {
110
+ // Headers
111
+ providerId: providerId,
112
+ workflowInstanceId: workflowInstanceId,
113
+ userreferenceid: userInfo.id,
114
+ applicationid: applicationId,
115
+ entityid: entityId,
116
+ // Body
117
+ transactionId: finalTransactionId,
118
+ };
119
+ const response = await paymentReverseFeed(paymentReverseFeedRequest).unwrap();
120
+ // Handle the response based on payment status
121
+ if (((_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.paymentStatus) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'success') {
122
+ setCurrentStatus('success');
123
+ }
124
+ else if (((_d = (_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.paymentStatus) === null || _d === void 0 ? void 0 : _d.toLowerCase()) === 'failed') {
125
+ setCurrentStatus('failed');
126
+ }
127
+ }
128
+ catch (error) {
129
+ // Alert.alert(COMMON_STRINGS.ERROR, BANK_STRINGS.PAYMENT_GATEWAY_ERROR, [
130
+ // { text: COMMON_STRINGS.OK }
131
+ // ]);
132
+ }
133
+ };
134
+ // Handle payment retry when status is failed
135
+ const handlePaymentRetry = async () => {
136
+ var _a, _b, _c, _d;
137
+ if (!finalTransactionId) {
138
+ react_native_1.Alert.alert(common_1.COMMON_STRINGS.ERROR, bank_1.BANK_STRINGS.PAYMENT_GATEWAY_ERROR);
139
+ return;
140
+ }
141
+ const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
142
+ const userRefId = (_a = userInfo === null || userInfo === void 0 ? void 0 : userInfo.userReferenceId) !== null && _a !== void 0 ? _a : userInfo === null || userInfo === void 0 ? void 0 : userInfo.id;
143
+ const paymentRetryRequest = {
144
+ providerId,
145
+ workflowInstanceId,
146
+ userreferenceid: userRefId,
147
+ applicationid: applicationId,
148
+ entityid: entityId,
149
+ transactionId: finalTransactionId,
150
+ };
151
+ try {
152
+ console.log('[FDSDK][PaymentStatus] Retry API calling...');
153
+ const response = await paymentRetry(paymentRetryRequest).unwrap();
154
+ console.log('[FDSDK][PaymentStatus] Retry API success, parsing response');
155
+ const payload = Array.isArray(response === null || response === void 0 ? void 0 : response.data)
156
+ ? response.data[0]
157
+ : (_b = response === null || response === void 0 ? void 0 : response.data) !== null && _b !== void 0 ? _b : response;
158
+ const newPaymentUrl = (payload === null || payload === void 0 ? void 0 : payload.PaymentUrl) || (payload === null || payload === void 0 ? void 0 : payload.paymentUrl) || (payload === null || payload === void 0 ? void 0 : payload.payment_url);
159
+ const newTransactionId = (payload === null || payload === void 0 ? void 0 : payload.Transactionid) || (payload === null || payload === void 0 ? void 0 : payload.transactionId) || (payload === null || payload === void 0 ? void 0 : payload.transaction_id) || finalTransactionId;
160
+ console.log('[FDSDK][PaymentStatus] Retry response:', {
161
+ hasPaymentUrl: Boolean(newPaymentUrl),
162
+ paymentUrlLength: (_c = newPaymentUrl === null || newPaymentUrl === void 0 ? void 0 : newPaymentUrl.length) !== null && _c !== void 0 ? _c : 0,
163
+ applicationId: (applicationId === null || applicationId === void 0 ? void 0 : applicationId.slice(0, 8)) + '...',
164
+ });
165
+ if (newPaymentUrl) {
166
+ (0, paymentSession_1.setPaymentSession)({ paymentUrl: newPaymentUrl, transactionId: newTransactionId });
167
+ console.log('[FDSDK][PaymentStatus] NAV_TO_PAYMENT: success_with_new_url');
168
+ (0, helpers_1.navigate)('Payment', {
169
+ paymentUrl: newPaymentUrl,
170
+ transactionId: newTransactionId,
171
+ applicationId,
172
+ workflowInstanceId,
173
+ entityId,
174
+ providerId,
175
+ });
176
+ }
177
+ else {
178
+ console.log('[FDSDK][PaymentStatus] No payment URL in response, showing alert');
179
+ react_native_1.Alert.alert(bank_1.BANK_STRINGS.PAYMENT_FAILED, bank_1.BANK_STRINGS.PAYMENT_GATEWAY_ERROR);
180
+ }
181
+ }
182
+ catch (error) {
183
+ console.log('[FDSDK][PaymentStatus] Retry catch:', (_d = error === null || error === void 0 ? void 0 : error.message) !== null && _d !== void 0 ? _d : String(error));
184
+ const session = (0, paymentSession_1.getPaymentSession)();
185
+ if (session.paymentUrl) {
186
+ console.log('[FDSDK][PaymentStatus] NAV_TO_PAYMENT: catch_with_session');
187
+ (0, helpers_1.navigate)('Payment', {
188
+ paymentUrl: session.paymentUrl,
189
+ transactionId: session.transactionId,
190
+ applicationId,
191
+ workflowInstanceId,
192
+ entityId,
193
+ providerId,
194
+ });
195
+ }
196
+ else if (onRetry) {
197
+ console.log('[FDSDK][PaymentStatus] NAV_TO_PAYMENT: catch_calling_onRetry');
198
+ onRetry();
199
+ }
200
+ else {
201
+ console.log('[FDSDK][PaymentStatus] NAV_TO_PAYMENT: catch_navigate_no_params');
202
+ (0, helpers_1.navigate)('Payment');
203
+ }
204
+ }
205
+ };
206
+ // Handle exit button click - fetch FD details and pass to main app
207
+ const handleExit = async () => {
208
+ try {
209
+ // Get user info from app data
210
+ const userInfo = (0, appDataConfig_1.getUserInfoForAPI)();
211
+ // Get API configuration
212
+ const apiConfig = (0, apiConfig_1.getApiConfig)();
213
+ // Prepare request payload
214
+ const requestPayload = {
215
+ userReferenceId: userInfo.id
216
+ };
217
+ // Call API to get customer applications
218
+ const response = await getCustomerApplications(requestPayload).unwrap();
219
+ // Extract applications from response (handle different response structures)
220
+ let applications = [];
221
+ if (Array.isArray(response)) {
222
+ applications = response;
223
+ }
224
+ else if ((response === null || response === void 0 ? void 0 : response.data) && Array.isArray(response.data)) {
225
+ applications = response.data;
226
+ }
227
+ else if ((response === null || response === void 0 ? void 0 : response.applications) && Array.isArray(response.applications)) {
228
+ applications = response.applications;
229
+ }
230
+ // Find the currently booked FD - search by transaction_id first (most specific)
231
+ let bookedFD = null;
232
+ // Priority 1: Match by transaction_id from payment
233
+ if (finalTransactionId) {
234
+ bookedFD = applications.find((app) => (app === null || app === void 0 ? void 0 : app.transactionId) === finalTransactionId ||
235
+ (app === null || app === void 0 ? void 0 : app.transaction_id) === finalTransactionId ||
236
+ (app === null || app === void 0 ? void 0 : app.Transactionid) === finalTransactionId ||
237
+ (app === null || app === void 0 ? void 0 : app.TransactionId) === finalTransactionId);
238
+ if (__DEV__ && bookedFD) {
239
+ console.log('═══════════════════════════════════════════════════════════════');
240
+ console.log('✅ [PaymentStatus] Found FD by Transaction ID');
241
+ console.log('───────────────────────────────────────────────────────────────');
242
+ console.log('🔍 Searched Transaction ID:', finalTransactionId);
243
+ console.log('📋 Found Application:', bookedFD);
244
+ console.log('═══════════════════════════════════════════════════════════════');
245
+ }
246
+ }
247
+ // Priority 2: Match by applicationId (fallback)
248
+ if (!bookedFD && applicationId) {
249
+ bookedFD = applications.find((app) => (app === null || app === void 0 ? void 0 : app.applicationId) === applicationId ||
250
+ (app === null || app === void 0 ? void 0 : app.applicationid) === applicationId ||
251
+ (app === null || app === void 0 ? void 0 : app.id) === applicationId);
252
+ if (__DEV__ && bookedFD) {
253
+ console.log('═══════════════════════════════════════════════════════════════');
254
+ console.log('✅ [PaymentStatus] Found FD by Application ID');
255
+ console.log('───────────────────────────────────────────────────────────────');
256
+ console.log('🔍 Searched Application ID:', applicationId);
257
+ console.log('📋 Found Application:', bookedFD);
258
+ console.log('═══════════════════════════════════════════════════════════════');
259
+ }
260
+ }
261
+ // Priority 3: Get the most recent one (last resort)
262
+ if (!bookedFD && applications.length > 0) {
263
+ const sortedApps = [...applications].sort((a, b) => {
264
+ const dateA = (a === null || a === void 0 ? void 0 : a.createdDate) || (a === null || a === void 0 ? void 0 : a.created_date) || (a === null || a === void 0 ? void 0 : a.createdAt) || 0;
265
+ const dateB = (b === null || b === void 0 ? void 0 : b.createdDate) || (b === null || b === void 0 ? void 0 : b.created_date) || (b === null || b === void 0 ? void 0 : b.createdAt) || 0;
266
+ return new Date(dateB).getTime() - new Date(dateA).getTime();
267
+ });
268
+ bookedFD = sortedApps[0];
269
+ if (__DEV__ && bookedFD) {
270
+ console.log('═══════════════════════════════════════════════════════════════');
271
+ console.log('⚠️ [PaymentStatus] Using Most Recent FD (fallback)');
272
+ console.log('───────────────────────────────────────────────────────────────');
273
+ console.log('📋 Found Application:', bookedFD);
274
+ console.log('═══════════════════════════════════════════════════════════════');
275
+ }
276
+ }
277
+ if (__DEV__) {
278
+ console.log('═══════════════════════════════════════════════════════════════');
279
+ console.log('📤 [PaymentStatus] Passing FD Data to Main App');
280
+ console.log('───────────────────────────────────────────────────────────────');
281
+ console.log('💳 Transaction ID:', finalTransactionId);
282
+ console.log('📋 FD Data:', bookedFD);
283
+ console.log('═══════════════════════════════════════════════════════════════');
284
+ }
285
+ // Pass FD details to main app via onContinue callback
286
+ if (onContinue) {
287
+ onContinue(bookedFD || null);
288
+ }
289
+ }
290
+ catch (error) {
291
+ if (__DEV__) {
292
+ console.log('═══════════════════════════════════════════════════════════════');
293
+ console.log('❌ [PaymentStatus] Error Fetching FD Data');
294
+ console.log('───────────────────────────────────────────────────────────────');
295
+ console.log('⚠️ Error:', error);
296
+ console.log('═══════════════════════════════════════════════════════════════');
297
+ }
298
+ // If API call fails, still call onContinue but without FD details
299
+ if (onContinue) {
300
+ onContinue(null);
301
+ }
302
+ }
303
+ };
304
+ // Disable hardware back button on PaymentStatus screen
305
+ (0, react_1.useEffect)(() => {
306
+ if (react_native_1.Platform.OS !== 'android')
307
+ return;
308
+ const onBackPress = () => {
309
+ // Return true to prevent default behavior (block back button)
310
+ return true;
311
+ };
312
+ const backHandler = react_native_1.BackHandler.addEventListener('hardwareBackPress', onBackPress);
313
+ return () => backHandler.remove();
314
+ }, []);
315
+ return (react_1.default.createElement(SafeAreaWrapper_1.default, { includeTop: true, bottomPadding: 0, statusBarColor: "#000000", statusBarStyle: "light-content" },
316
+ react_native_1.Platform.OS === 'ios' && react_1.default.createElement(react_native_1.StatusBar, { barStyle: "light-content" }),
317
+ react_1.default.createElement(react_native_1.View, { style: styles.container },
318
+ react_1.default.createElement(react_native_1.ScrollView, { showsVerticalScrollIndicator: false, contentContainerStyle: styles.scrollContent },
319
+ react_1.default.createElement(react_native_1.View, { style: styles.iconContainer },
320
+ react_1.default.createElement(react_native_1.View, { style: styles.iconCircleOuter },
321
+ react_1.default.createElement(react_native_1.View, { style: styles.iconCircleInner },
322
+ currentStatus === 'success' && (react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.successBig }, style: { width: 60, height: 60 }, resizeMode: "contain" })),
323
+ currentStatus === 'failed' && (react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.error }, style: { width: 48, height: 48 }, resizeMode: "contain" })),
324
+ currentStatus === 'pending' && (react_1.default.createElement(react_native_1.Image, { source: { uri: base64Images_1.base64Images.pending }, style: { width: 48, height: 48 }, resizeMode: "contain" }))))),
325
+ react_1.default.createElement(react_native_1.Text, { style: styles.statusTitle },
326
+ currentStatus === 'success' && bank_1.BANK_STRINGS.PAYMENT_STATUS_SUCCESS,
327
+ currentStatus === 'failed' && bank_1.BANK_STRINGS.PAYMENT_STATUS_FAILED,
328
+ currentStatus === 'pending' && bank_1.BANK_STRINGS.PAYMENT_STATUS_PENDING),
329
+ currentStatus === 'pending' && (react_1.default.createElement(react_native_1.Text, { style: styles.pendingSubtitle }, bank_1.BANK_STRINGS.PAYMENT_STATUS_PROCESSING)),
330
+ react_1.default.createElement(react_native_1.Text, { style: styles.transactionLabel }, "Transaction ID"),
331
+ react_1.default.createElement(react_native_1.Text, { style: styles.transactionId }, displayTransactionId),
332
+ react_1.default.createElement(components_1.PaymentDetailsCard, { companyName: displayData.companyName, amount: displayData.amount, fdRate: displayData.fdRate, tenure: displayData.tenure, interestPayout: displayData.interestPayout }),
333
+ currentStatus === 'success' && (react_1.default.createElement(react_native_1.View, { style: styles.disclaimerContainer },
334
+ react_native_1.Platform.OS === 'android' && (react_1.default.createElement(Ionicons_1.default, { name: "information-circle-outline", size: 20, color: colors.textSecondary, style: styles.disclaimerIcon })),
335
+ react_1.default.createElement(react_native_1.Text, { style: styles.disclaimerText }, bank_1.BANK_STRINGS.PAYMENT_SUCCESS_DISCLAIMER)))),
336
+ react_1.default.createElement(react_native_1.View, { style: styles.footer },
337
+ currentStatus === 'success' && (react_1.default.createElement(ActionButton_1.default, { title: isLoadingCustomerApplications ? common_1.COMMON_STRINGS.LOADING : common_1.COMMON_STRINGS.EXIT, onPress: handleExit, disabled: isLoadingCustomerApplications })),
338
+ currentStatus === 'failed' && (react_1.default.createElement(ActionButton_1.default, { title: isLoadingPaymentRetry ? common_1.COMMON_STRINGS.RETRYING : bank_1.BANK_STRINGS.RETRY_PAYMENT_BUTTON, onPress: handlePaymentRetry, disabled: isLoadingPaymentRetry })),
339
+ currentStatus === 'pending' && (react_1.default.createElement(ActionButton_1.default, { title: isLoadingPaymentReverseFeed ? common_1.COMMON_STRINGS.CHECKING : bank_1.BANK_STRINGS.REFRESH_STATUS_BUTTON, onPress: handlePaymentReverseFeed, disabled: isLoadingPaymentReverseFeed }))))));
340
+ };
341
+ const createStyles = (colors, typography, status) => {
342
+ const statusColor = status === 'success' ? '#4CAF50' : status === 'failed' ? '#F44336' : '#FF9800';
343
+ const cardBgColor = status === 'success' ? '#E8F5F0' : status === 'failed' ? '#FFF3F3' : '#FFF8E1';
344
+ return react_native_1.StyleSheet.create({
345
+ container: {
346
+ flex: 1,
347
+ backgroundColor: colors.background,
348
+ },
349
+ headerTitle: {
350
+ fontSize: 14,
351
+ fontWeight: '600',
352
+ color: colors.textLight,
353
+ textAlign: 'center',
354
+ paddingVertical: 16,
355
+ letterSpacing: 1,
356
+ },
357
+ scrollContent: {
358
+ flexGrow: 1,
359
+ paddingHorizontal: 24,
360
+ paddingBottom: 120,
361
+ },
362
+ iconContainer: {
363
+ alignItems: 'center',
364
+ marginTop: 40,
365
+ marginBottom: 32,
366
+ },
367
+ iconCircleOuter: {
368
+ width: 120,
369
+ height: 120,
370
+ borderRadius: 60,
371
+ backgroundColor: status === 'success' ? '#e8f5e9' : status === 'failed' ? 'rgba(244, 67, 54, 0.1)' : 'rgba(255, 152, 0, 0.1)',
372
+ alignItems: 'center',
373
+ justifyContent: 'center',
374
+ },
375
+ iconCircleInner: {
376
+ width: 60,
377
+ height: 60,
378
+ borderRadius: 30,
379
+ backgroundColor: status === 'success' ? '#ffffff' : status === 'failed' ? 'rgba(244, 67, 54, 0.0)' : 'rgba(255, 152, 0, 0.2)',
380
+ alignItems: 'center',
381
+ justifyContent: 'center',
382
+ },
383
+ statusTitle: Object.assign(Object.assign({}, typography.styles.h1), { color: colors.text, textAlign: 'center', marginBottom: 32, letterSpacing: 0.5 }),
384
+ pendingSubtitle: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: colors.textSecondary, textAlign: 'center', marginBottom: 30, marginTop: -30 }),
385
+ transactionLabel: Object.assign(Object.assign({}, typography.styles.bodyMedium), { color: colors.textLight, textAlign: 'center', marginBottom: 8 }),
386
+ transactionId: Object.assign(Object.assign({}, typography.styles.h2), { color: colors.text, textAlign: 'center', marginBottom: 32, letterSpacing: 1 }),
387
+ avatarContainer: {
388
+ alignItems: 'center',
389
+ marginTop: -28,
390
+ marginBottom: 24,
391
+ },
392
+ avatar: {
393
+ width: 56,
394
+ height: 56,
395
+ borderRadius: 28,
396
+ backgroundColor: '#5F9E8F',
397
+ alignItems: 'center',
398
+ justifyContent: 'center',
399
+ borderWidth: 4,
400
+ borderColor: colors.background,
401
+ },
402
+ avatarText: {
403
+ fontSize: 24,
404
+ fontWeight: '600',
405
+ color: 'white',
406
+ },
407
+ footer: {
408
+ position: 'absolute',
409
+ bottom: 0,
410
+ left: 0,
411
+ right: 0,
412
+ backgroundColor: colors.background,
413
+ paddingTop: 16,
414
+ },
415
+ disclaimerContainer: {
416
+ flexDirection: 'row',
417
+ backgroundColor: 'transparent',
418
+ borderRadius: 8,
419
+ padding: 16,
420
+ marginTop: 24,
421
+ marginBottom: 16,
422
+ alignItems: 'flex-start',
423
+ },
424
+ disclaimerIcon: {
425
+ marginRight: 12,
426
+ marginTop: 2,
427
+ },
428
+ disclaimerText: Object.assign(Object.assign({}, typography.styles.bodySmall), { color: colors.textSecondary, flex: 1, lineHeight: 18 }),
429
+ });
430
+ };
431
+ exports.default = PaymentStatus;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ export interface ReviewKYCProps {
3
+ onGoBack?: () => void;
4
+ onContinue?: (kycData: KYCData) => void;
5
+ initialData?: Partial<KYCData>;
6
+ }
7
+ export interface KYCData {
8
+ panCard: string;
9
+ dateOfBirth: string;
10
+ maritalStatus: string;
11
+ kycRelation: string;
12
+ kycRelationName: string;
13
+ area: string;
14
+ city: string;
15
+ addressLine1: string;
16
+ addressLine2: string;
17
+ pincode: string;
18
+ state: string;
19
+ country: string;
20
+ useExistingAddress: boolean;
21
+ }
22
+ declare const ReviewKYC: React.FC<ReviewKYCProps>;
23
+ export default ReviewKYC;