boxpay-checkout-reactnative-sdk 1.0.0-beta46 → 1.0.1-beta13

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 (170) hide show
  1. package/lib/module/components/savedAddressCard.js +1 -1
  2. package/lib/module/components/savedAddressCard.js.map +1 -1
  3. package/lib/module/postRequest/callUIAnalytics.js +1 -2
  4. package/lib/module/postRequest/callUIAnalytics.js.map +1 -1
  5. package/lib/module/postRequest/cardPostRequest.js +1 -2
  6. package/lib/module/postRequest/cardPostRequest.js.map +1 -1
  7. package/lib/module/postRequest/emiPostRequest.js +1 -2
  8. package/lib/module/postRequest/emiPostRequest.js.map +1 -1
  9. package/lib/module/postRequest/methodsPostRequest.js +1 -1
  10. package/lib/module/postRequest/methodsPostRequest.js.map +1 -1
  11. package/lib/module/postRequest/upiPostRequest.js +1 -1
  12. package/lib/module/postRequest/upiPostRequest.js.map +1 -1
  13. package/lib/module/screens/addressScreen.js +1 -1
  14. package/lib/module/screens/addressScreen.js.map +1 -1
  15. package/lib/module/screens/mainScreen.js +1 -4
  16. package/lib/module/screens/mainScreen.js.map +1 -1
  17. package/lib/module/screens/savedAddressScreen.js +1 -1
  18. package/lib/module/screens/savedAddressScreen.js.map +1 -1
  19. package/lib/module/screens/upiScreen.js +2 -3
  20. package/lib/module/screens/upiScreen.js.map +1 -1
  21. package/lib/module/screens/upiTimerScreen.js +19 -56
  22. package/lib/module/screens/upiTimerScreen.js.map +1 -1
  23. package/lib/module/sdk-version.json +1 -1
  24. package/lib/module/serviceRequest.js +1 -1
  25. package/lib/module/serviceRequest.js.map +1 -1
  26. package/lib/module/sharedContext/handlePaymentResponseHandler.js +1 -1
  27. package/lib/module/sharedContext/handlePaymentResponseHandler.js.map +1 -1
  28. package/lib/module/{utils/listAndObjectUtils.js → utility.js} +64 -3
  29. package/lib/module/utility.js.map +1 -0
  30. package/lib/typescript/src/postRequest/callUIAnalytics.d.ts.map +1 -1
  31. package/lib/typescript/src/postRequest/cardPostRequest.d.ts.map +1 -1
  32. package/lib/typescript/src/postRequest/emiPostRequest.d.ts.map +1 -1
  33. package/lib/typescript/src/screens/mainScreen.d.ts.map +1 -1
  34. package/lib/typescript/src/screens/upiScreen.d.ts.map +1 -1
  35. package/lib/typescript/src/screens/upiTimerScreen.d.ts.map +1 -1
  36. package/lib/typescript/src/{utils/listAndObjectUtils.d.ts → utility.d.ts} +12 -2
  37. package/lib/typescript/src/utility.d.ts.map +1 -0
  38. package/package.json +2 -2
  39. package/src/components/savedAddressCard.tsx +1 -1
  40. package/src/postRequest/callUIAnalytics.ts +1 -2
  41. package/src/postRequest/cardPostRequest.ts +1 -2
  42. package/src/postRequest/emiPostRequest.ts +1 -2
  43. package/src/postRequest/methodsPostRequest.tsx +1 -1
  44. package/src/postRequest/upiPostRequest.tsx +1 -1
  45. package/src/screens/addressScreen.tsx +1 -1
  46. package/src/screens/mainScreen.tsx +1 -4
  47. package/src/screens/savedAddressScreen.tsx +1 -1
  48. package/src/screens/upiScreen.tsx +2 -3
  49. package/src/screens/upiTimerScreen.tsx +19 -59
  50. package/src/sdk-version.json +1 -1
  51. package/src/serviceRequest.ts +1 -1
  52. package/src/sharedContext/handlePaymentResponseHandler.ts +1 -1
  53. package/src/{utils/listAndObjectUtils.ts → utility.ts} +83 -3
  54. package/android/build/.transforms/516dc569503728180fa99c1ae0c9eece/results.bin +0 -1
  55. package/android/build/.transforms/516dc569503728180fa99c1ae0c9eece/transformed/classes/classes_dex/classes.dex +0 -0
  56. package/android/build/generated/source/buildConfig/debug/com/reactnativemodule/BuildConfig.java +0 -10
  57. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -13
  58. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
  59. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
  60. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
  61. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  62. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  63. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  64. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -1
  65. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  66. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  67. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  68. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  69. package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/cross_platform_sdk_react_native_plugin_debug.kotlin_module +0 -0
  70. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactnativemodule/BuildConfig.class +0 -0
  71. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +0 -2
  72. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -20
  73. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -13
  74. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
  75. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
  76. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  77. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +0 -1
  78. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  79. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  80. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  81. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  82. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  83. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  84. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  85. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  86. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  87. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  88. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  89. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  90. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  91. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  92. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  93. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  94. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  95. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  96. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  97. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  98. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  99. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  100. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  101. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  102. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  103. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  104. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  105. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  106. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  107. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  108. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  109. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  110. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  111. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  112. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  113. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  114. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  115. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  116. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  117. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  118. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  119. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  120. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  121. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  122. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  123. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  124. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  125. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  126. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  127. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  128. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  129. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  130. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  131. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  132. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  133. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  134. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  135. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  136. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  137. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  138. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  139. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  140. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  141. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  142. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  143. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  144. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  145. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  146. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  147. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  148. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  149. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  150. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  151. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  152. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  153. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  154. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  155. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  156. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  157. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  158. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -30
  159. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  160. package/android/build/tmp/kotlin-classes/debug/META-INF/cross_platform_sdk_react_native_plugin_debug.kotlin_module +0 -0
  161. package/android/build/tmp/kotlin-classes/debug/com/reactnativemodule/CrossPlatform.class +0 -0
  162. package/android/build/tmp/kotlin-classes/debug/com/reactnativemodule/ReactNativeModulePackage.class +0 -0
  163. package/android/local.properties +0 -1
  164. package/lib/module/utils/listAndObjectUtils.js.map +0 -1
  165. package/lib/module/utils/stringUtils.js +0 -65
  166. package/lib/module/utils/stringUtils.js.map +0 -1
  167. package/lib/typescript/src/utils/listAndObjectUtils.d.ts.map +0 -1
  168. package/lib/typescript/src/utils/stringUtils.d.ts +0 -12
  169. package/lib/typescript/src/utils/stringUtils.d.ts.map +0 -1
  170. package/src/utils/stringUtils.ts +0 -82
@@ -1,6 +1,6 @@
1
1
  import api from '../serviceRequest';
2
2
  import type { InstrumentDetails, PaymentExecutedPostResponse } from '../interface';
3
- import { getBrowserData, getDeviceDetails, getShopperDetails } from '../utils/listAndObjectUtils';
3
+ import { getBrowserData, getDeviceDetails, getShopperDetails } from '../utility';
4
4
  import { AnalyticsEvents, APIStatus } from '../interface';
5
5
  import callUIAnalytics from './callUIAnalytics';
6
6
 
@@ -19,7 +19,7 @@ import {
19
19
  import styles from '../styles/screens/addressScreenStyles.';
20
20
  import type { CheckoutStackParamList } from '../navigation';
21
21
  import type { NavigationProp } from '@react-navigation/native';
22
- import { extractNames } from '../utils/stringUtils';
22
+ import { extractNames } from '../utility';
23
23
 
24
24
  type AddressScreenNavigationProp = NavigationProp<CheckoutStackParamList, 'AddressScreen'>;
25
25
 
@@ -31,8 +31,7 @@ import fetchSessionDetails from '../postRequest/fetchSessionDetails';
31
31
  import MorePaymentMethods from '../components/morePaymentMethods';
32
32
  import { fetchSavedInstrumentsHandler, handleFetchStatusResponseHandler, handlePaymentResponse } from '../sharedContext/handlePaymentResponseHandler';
33
33
  import callUIAnalytics from '../postRequest/callUIAnalytics';
34
- import { formatAddress } from '../utils/stringUtils';
35
- import { useCountdown } from '../utils/listAndObjectUtils';
34
+ import { formatAddress, useCountdown } from '../utility';
36
35
 
37
36
  type MainScreenRouteProp = RouteProp<CheckoutStackParamList, 'MainScreen'>;
38
37
 
@@ -183,10 +182,8 @@ const MainScreen = ({route, navigation} : MainScreenProps) => {
183
182
 
184
183
  useEffect(() => {
185
184
  const isQRTimerRunning = qrTimerValue < 300
186
- console.log("qr timer started")
187
185
 
188
186
  if(isQRTimerRunning && qrTimerValue > 0 && qrTimerValue % 4 === 0) {
189
- console.log("aoi called")
190
187
  callFetchStatusApi()
191
188
  }
192
189
  }, [qrTimerValue])
@@ -23,7 +23,7 @@ import SavedAddressComponent from '../components/savedAddressCard';
23
23
  import { checkoutDetailsHandler } from '../sharedContext/checkoutDetailsHandler';
24
24
  import SavedAddressBottomSheet from '../components/savedAddressBottomSheet';
25
25
  import { setUserDataHandler, userDataHandler } from '../sharedContext/userdataHandler';
26
- import { extractNames, formatAddress } from '../utils/stringUtils';
26
+ import { extractNames, formatAddress } from '../utility';
27
27
  import DeleteAddressModal from '../components/deleteAddressModal';
28
28
 
29
29
  type AddressScreenNavigationProp = NavigationProp<CheckoutStackParamList, 'AddressScreen'>;
@@ -14,8 +14,7 @@ import { AnalyticsEvents, type InstrumentDetails, type PaymentClass } from '../i
14
14
  import PaymentSelectorView from '../components/paymentSelector';
15
15
  import { getInstalledUpiApps } from '../components/getInstalledUPI';
16
16
  import styles from '../styles/screens/upiScreenStyles';
17
- import { formattedTime } from '../utils/stringUtils';
18
- import { height, width } from '../utils/listAndObjectUtils';
17
+ import { formatTime, height, width } from '../utility';
19
18
  import upiPostRequest from '../postRequest/upiPostRequest';
20
19
  import { handlePaymentResponse } from '../sharedContext/handlePaymentResponseHandler';
21
20
  import callUIAnalytics from '../postRequest/callUIAnalytics';
@@ -630,7 +629,7 @@ const UpiScreen: React.FC<UpiScreenProps> = ({
630
629
  <Text style={styles.label}>Scan & Pay with UPI Application</Text>
631
630
  <Text style={styles.label}>QR code will expire in</Text>
632
631
  <Text style={[styles.timer, { color: checkoutDetails.brandColor }]}>
633
- {formattedTime(timeRemaining)}
632
+ {formatTime(timeRemaining)}
634
633
  </Text>
635
634
  </View>
636
635
  </View>
@@ -20,6 +20,7 @@ import { checkoutDetailsHandler } from '../sharedContext/checkoutDetailsHandler'
20
20
  import { handleFetchStatusResponseHandler } from '../sharedContext/handlePaymentResponseHandler';
21
21
  import type { CheckoutStackParamList } from '../navigation';
22
22
  import type {RouteProp, NavigationProp} from '@react-navigation/native'
23
+ import { useCountdown , formatTime} from '../utility';
23
24
 
24
25
  type UpiTimerScreenRouteProp = RouteProp<CheckoutStackParamList, 'UpiTimerScreen'>;
25
26
 
@@ -39,7 +40,6 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
39
40
 
40
41
  const upiIdStr = Array.isArray(upiId) ? upiId[0] : upiId;
41
42
 
42
- const [timerValue, setTimerValue] = useState(5 * 60);
43
43
  const [cancelClicked, setCancelClicked] = useState(false);
44
44
  const [failedModalOpen, setFailedModalState] = useState(false);
45
45
  const [successModalOpen, setSuccessModalState] = useState(false);
@@ -50,36 +50,24 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
50
50
  const [successfulTimeStamp, setSuccessfulTimeStamp] = useState('');
51
51
  const [status, setStatus] = useState('');
52
52
  const [transactionId, setTransactionId] = useState('');
53
- const [isTimerRunning, setIsTimerRunning] = useState(true);
54
- const backgroundApiInterval = useRef<NodeJS.Timeout | null>(null);
55
- const timerInterval = useRef<NodeJS.Timeout | null>(null);
53
+ const {
54
+ timeRemaining: upiCollectTimerValue,
55
+ start: startCollectTimer,
56
+ stop: stopCollectTimer
57
+ } = useCountdown(300)
56
58
 
57
59
  useEffect(() => {
58
- if (isTimerRunning) {
59
- timerInterval.current = setInterval(() => {
60
- setTimerValue((prevTime) => {
61
- if (prevTime <= 1) {
62
- clearInterval(timerInterval.current!);
63
- stopBackgroundApiTask();
64
- setFailedModalState(true);
65
- return 0;
66
- }
67
- return prevTime - 1;
68
- });
69
- }, 1000);
60
+ const isUPICollectTimerRunning = upiCollectTimerValue < 300
61
+ if(isUPICollectTimerRunning && upiCollectTimerValue > 0 && upiCollectTimerValue %4 === 0) {
62
+ callFetchStatusApi();
70
63
  }
71
- return () => {
72
- if (timerInterval.current) {
73
- clearInterval(timerInterval.current);
74
- }
75
- };
76
- }, [isTimerRunning]);
64
+ },[upiCollectTimerValue]);
77
65
 
78
66
  useEffect(() => {
79
67
  if (failedModalOpen || successModalOpen || sessionExpireModalOpen) {
80
- setIsTimerRunning(false);
68
+ stopCollectTimer()
81
69
  } else {
82
- setIsTimerRunning(true);
70
+ startCollectTimer()
83
71
  }
84
72
  }, [failedModalOpen, successModalOpen, sessionExpireModalOpen]);
85
73
 
@@ -93,10 +81,7 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
93
81
 
94
82
  const onProceedBack = () => {
95
83
  if (cancelClicked) {
96
- if (timerInterval.current) {
97
- clearInterval(timerInterval.current);
98
- }
99
- stopBackgroundApiTask();
84
+ stopCollectTimer()
100
85
  navigation.goBack()
101
86
  } else {
102
87
  setCancelClicked(true);
@@ -106,10 +91,7 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
106
91
 
107
92
  const onPaymentFailed = () => {
108
93
  setFailedModalState(true);
109
- stopBackgroundApiTask();
110
- if (timerInterval.current) {
111
- clearInterval(timerInterval.current);
112
- }
94
+ stopCollectTimer()
113
95
  navigation.goBack()
114
96
  };
115
97
 
@@ -120,27 +102,6 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
120
102
  );
121
103
  }, []);
122
104
 
123
- const formatTime = () => {
124
- const minutes = Math.floor(timerValue / 60);
125
- const seconds = timerValue % 60;
126
- return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
127
- };
128
-
129
- useEffect(() => {
130
- const startBackgroundApiTask = () => {
131
- backgroundApiInterval.current = setInterval(() => {
132
- callFetchStatusApi();
133
- }, 4000);
134
- };
135
- startBackgroundApiTask();
136
- }, []);
137
-
138
- const stopBackgroundApiTask = () => {
139
- if (backgroundApiInterval.current) {
140
- clearInterval(backgroundApiInterval.current);
141
- }
142
- };
143
-
144
105
  const callFetchStatusApi = async () => {
145
106
  const response = await fetchStatus();
146
107
  handleFetchStatusResponseHandler({
@@ -160,8 +121,7 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
160
121
  },
161
122
  onShowSessionExpiredModal: () => {
162
123
  setSessionExppireModalState(true)
163
- },
164
- stopBackgroundApiTask: stopBackgroundApiTask
124
+ }
165
125
  });
166
126
  };
167
127
 
@@ -212,12 +172,12 @@ const UpiTimerScreen = ({ route, navigation }: Props) => {
212
172
  size={150}
213
173
  strokeWidth={10}
214
174
  progressColor={
215
- timerValue <= 30 ? '#FAA4A4' : checkoutDetails.brandColor
175
+ upiCollectTimerValue <= 30 ? '#FAA4A4' : checkoutDetails.brandColor
216
176
  }
217
- progress={timerValue}
218
- formatTime={formatTime()}
177
+ progress={upiCollectTimerValue}
178
+ formatTime={formatTime(upiCollectTimerValue)}
219
179
  textColor={
220
- timerValue <= 30 ? '#F53535' : checkoutDetails.brandColor
180
+ upiCollectTimerValue <= 30 ? '#F53535' : checkoutDetails.brandColor
221
181
  }
222
182
  />
223
183
  </View>
@@ -1 +1 @@
1
- { "version": "1.0.0-beta46" }
1
+ { "version": "1.0.1-beta13" }
@@ -1,5 +1,5 @@
1
1
  import axios from 'axios';
2
- import { generateRandomAlphanumericString, getEndpoint } from './utils/stringUtils'; // adjust path accordingly
2
+ import { generateRandomAlphanumericString, getEndpoint } from './utility'; // adjust path accordingly
3
3
  import { checkoutDetailsHandler } from './sharedContext/checkoutDetailsHandler';
4
4
  import sdkVersion from './sdk-version.json'
5
5
 
@@ -1,5 +1,5 @@
1
1
  import { type HandleFetchStatusOptions, type HandlePaymentOptions, type PaymentClass, type RecommendedInstruments, APIStatus, TransactionStatus } from "../interface";
2
- import { transformAndFilterList } from '../utils/listAndObjectUtils';
2
+ import { transformAndFilterList } from '../utility';
3
3
  import Toast from 'react-native-toast-message'
4
4
  import fetchPaymentMethods from '../postRequest/fetchPaymentMethods';
5
5
  import fetchRecommendedInstruments from "../postRequest/fetchRecommendedInstruments";
@@ -1,6 +1,6 @@
1
- import type { PaymentMethod, PaymentClass, DeliveryAddress } from '../interface';
1
+ import type { PaymentMethod, PaymentClass, DeliveryAddress } from './interface';
2
2
  import { Dimensions, Platform } from 'react-native';
3
- import { userDataHandler } from '../sharedContext/userdataHandler';
3
+ import { userDataHandler } from './sharedContext/userdataHandler';
4
4
  import { useState, useRef, useCallback, useEffect } from 'react';
5
5
 
6
6
  export function transformAndFilterList(
@@ -97,7 +97,6 @@ export const useCountdown = (initialSeconds: number) => {
97
97
  setTimeRemaining(initialSeconds);
98
98
  timerRef.current = setInterval(() => {
99
99
  setTimeRemaining(prevTime => {
100
- console.log(`=====${prevTime}`)
101
100
  if (prevTime <= 1) {
102
101
  stop();
103
102
  return 0;
@@ -110,4 +109,85 @@ export const useCountdown = (initialSeconds: number) => {
110
109
  return stop;
111
110
  }, [stop]);
112
111
  return { timeRemaining, start, stop };
112
+ };
113
+
114
+ const TEST_API_URL = "https://test-apis.boxpay.tech"
115
+ const PROD_API_URL = "https://apis.boxpay.in"
116
+ const ROUTE = "/v0/checkout/sessions/"
117
+
118
+ export function getEndpoint(env: string): string {
119
+ const baseUrl = env === 'test' ? TEST_API_URL : PROD_API_URL;
120
+ return `${baseUrl}${ROUTE}`;
121
+ }
122
+
123
+ export function generateRandomAlphanumericString(length: number): string {
124
+ const charPool: string[] =
125
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.split(
126
+ ''
127
+ );
128
+ let result = '';
129
+
130
+ for (let i = 0; i < length; i++) {
131
+ const randomIndex = Math.floor(Math.random() * charPool.length);
132
+ result += charPool[randomIndex];
133
+ }
134
+
135
+ return result;
136
+ }
137
+
138
+
139
+ export function getBaseURL(env: string): string {
140
+ const baseUrl = env === 'test' ? TEST_API_URL : PROD_API_URL;
141
+ return `${baseUrl}/v0`;
142
+ }
143
+
144
+ export function formatAddress(deliveryAddress : DeliveryAddress) : string {
145
+ if (deliveryAddress.address2 == null || deliveryAddress.address2 == '') {
146
+ return `${deliveryAddress.address1}, ${deliveryAddress.city}, ${deliveryAddress.state}, ${deliveryAddress.postalCode}`
147
+ } else {
148
+ return `${deliveryAddress.address1}, ${deliveryAddress.address2}, ${deliveryAddress.city}, ${deliveryAddress.state}, ${deliveryAddress.postalCode}`
149
+ }
150
+ }
151
+
152
+ export function extractNames(fullName: string): {
153
+ firstName: string;
154
+ lastName: string;
155
+ } {
156
+ const components = fullName
157
+ .trim()
158
+ .split(' ')
159
+ .filter((part) => part !== '');
160
+
161
+ if (components.length === 0) {
162
+ return { firstName: '', lastName: '' };
163
+ }
164
+
165
+ const firstName = components[0] || '';
166
+ const lastName = components.slice(1).join(' ') || '';
167
+
168
+ return { firstName, lastName };
169
+ }
170
+
171
+ export const formatTime = (timeRemaining : number) => {
172
+ const minutes = Math.floor(timeRemaining / 60);
173
+ const seconds = timeRemaining % 60;
174
+ return `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
175
+ };
176
+
177
+ export const formatExpiry = (input: string): string => {
178
+ const parts = input.split('/');
179
+ if (parts.length !== 2 || parts[0]?.length !== 2 || parts[1]?.length !== 2) {
180
+ return ''; // Return for any invalid format.
181
+ }
182
+ const [month, twoDigitYearStr] = parts;
183
+ const twoDigitYear = parseInt(twoDigitYearStr, 10);
184
+ const currentYear = new Date().getFullYear();
185
+ const century = Math.floor(currentYear / 100) * 100;
186
+ let fullYear = century + twoDigitYear;
187
+
188
+ if (fullYear < currentYear - 1) {
189
+ fullYear += 100;
190
+ }
191
+
192
+ return `${fullYear}-${month}`;
113
193
  };
@@ -1,10 +0,0 @@
1
- /**
2
- * Automatically generated file. DO NOT MODIFY
3
- */
4
- package com.reactnativemodule;
5
-
6
- public final class BuildConfig {
7
- public static final boolean DEBUG = Boolean.parseBoolean("true");
8
- public static final String LIBRARY_PACKAGE_NAME = "com.reactnativemodule";
9
- public static final String BUILD_TYPE = "debug";
10
- }
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.reactnativemodule" >
4
-
5
- <uses-sdk android:minSdkVersion="21" />
6
-
7
- <queries>
8
- <package android:name="com.google.android.apps.nbu.paisa.user" />
9
- <package android:name="com.phonepe.app" />
10
- <package android:name="net.one97.paytm" />
11
- </queries>
12
-
13
- </manifest>
@@ -1,18 +0,0 @@
1
- {
2
- "version": 3,
3
- "artifactType": {
4
- "type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
5
- "kind": "Directory"
6
- },
7
- "applicationId": "com.reactnativemodule",
8
- "variantName": "debug",
9
- "elements": [
10
- {
11
- "type": "SINGLE",
12
- "filters": [],
13
- "attributes": [],
14
- "outputFile": "AndroidManifest.xml"
15
- }
16
- ],
17
- "elementType": "File"
18
- }
@@ -1,6 +0,0 @@
1
- aarFormatVersion=1.0
2
- aarMetadataVersion=1.0
3
- minCompileSdk=1
4
- minCompileSdkExtension=0
5
- minAndroidGradlePluginVersion=1.0.0
6
- coreLibraryDesugaringEnabled=false
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="main" generated-set="main$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="debug" generated-set="debug$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/debug/res"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated$Generated" generated="true" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/build/generated/res/resValues/debug"/></dataSet><dataSet aapt-namespace="http://schemas.android.com/apk/res-auto" config="generated" generated-set="generated$Generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/build/generated/res/resValues/debug"/></dataSet><mergedItems/></merger>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/jniLibs"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/debug/jniLibs"/></dataSet></merger>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/shaders"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/debug/shaders"/></dataSet></merger>
@@ -1,2 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <merger version="3"><dataSet config="main" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/assets"/></dataSet><dataSet config="debug" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/debug/assets"/></dataSet><dataSet config="generated" ignore_pattern="!.svn:!.git:!.ds_store:!*.scc:.*:&lt;dir>_*:!CVS:!thumbs.db:!picasa.ini:!*~"><source path="/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/build/intermediates/shader_assets/debug/compileDebugShaders/out"/></dataSet></merger>
@@ -1,2 +0,0 @@
1
- R_DEF: Internal format may change without notice
2
- local
@@ -1,20 +0,0 @@
1
- 1<?xml version="1.0" encoding="utf-8"?>
2
- 2<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- 3 package="com.reactnativemodule" >
4
- 4
5
- 5 <uses-sdk android:minSdkVersion="21" />
6
- 6
7
- 7 <queries>
8
- 7-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:3:1-7:15
9
- 8 <package android:name="com.google.android.apps.nbu.paisa.user" />
10
- 8-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:4:9-73
11
- 8-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:4:18-71
12
- 9 <package android:name="com.phonepe.app" />
13
- 9-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:5:9-50
14
- 9-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:5:18-48
15
- 10 <package android:name="net.one97.paytm" />
16
- 10-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:6:9-50
17
- 10-->/Users/ishikabansal/checkout-react-native-sdk/node_modules/cross_platform_sdk_react_native_plugin/android/src/main/AndroidManifest.xml:6:18-48
18
- 11 </queries>
19
- 12
20
- 13</manifest>
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
- package="com.reactnativemodule" >
4
-
5
- <uses-sdk android:minSdkVersion="21" />
6
-
7
- <queries>
8
- <package android:name="com.google.android.apps.nbu.paisa.user" />
9
- <package android:name="com.phonepe.app" />
10
- <package android:name="net.one97.paytm" />
11
- </queries>
12
-
13
- </manifest>