@os1-platform/dispatch-mobile 2.1.21 → 2.1.23

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 (614) hide show
  1. package/README.md +122 -11
  2. package/lib/commonjs/analytics/firebase/FirebaseLogging.js +1 -1
  3. package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
  4. package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
  5. package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
  6. package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +9 -10
  7. package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
  8. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +16 -6
  9. package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
  10. package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +8 -1
  11. package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
  12. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +8 -10
  13. package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
  14. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +2 -2
  15. package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
  16. package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js +40 -0
  17. package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
  18. package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +35 -0
  19. package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
  20. package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +102 -0
  21. package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
  22. package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +151 -0
  23. package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
  24. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +188 -0
  25. package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
  26. package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
  27. package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
  28. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +442 -0
  29. package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
  30. package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +538 -0
  31. package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
  32. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +887 -0
  33. package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
  34. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +14 -20
  35. package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
  36. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +24 -27
  37. package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  38. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -1
  39. package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
  40. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +2 -3
  41. package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
  42. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -1
  43. package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  44. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +9 -3
  45. package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  46. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +2 -2
  47. package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
  48. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +13 -14
  49. package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  50. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +2 -2
  51. package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
  52. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +11 -12
  53. package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  54. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +3 -3
  55. package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
  56. package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +1 -1
  57. package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
  58. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +2 -2
  59. package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
  60. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -2
  61. package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  62. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +11 -13
  63. package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  64. package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +11 -2
  65. package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  66. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +2 -2
  67. package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
  68. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +5 -6
  69. package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  70. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +2 -2
  71. package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  72. package/lib/commonjs/components/executiontasks/pickup/PickupET.js +14 -20
  73. package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
  74. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +18 -24
  75. package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  76. package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -6
  77. package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
  78. package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
  79. package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
  80. package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -1
  81. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
  82. package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  83. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -2
  84. package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  85. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +2 -4
  86. package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  87. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +3 -6
  88. package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  89. package/lib/commonjs/components/executiontasks/scan/utils.js +14 -8
  90. package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
  91. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +2 -2
  92. package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  93. package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
  94. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +2 -2
  95. package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
  96. package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -1
  97. package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
  98. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +2 -2
  99. package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
  100. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +2 -2
  101. package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
  102. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +2 -2
  103. package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
  104. package/lib/commonjs/components/widgets/AlertDisplay.js +1 -1
  105. package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
  106. package/lib/commonjs/components/widgets/CancelOrderDialog.js +2 -2
  107. package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
  108. package/lib/commonjs/components/widgets/Card.js +1 -2
  109. package/lib/commonjs/components/widgets/Card.js.map +1 -1
  110. package/lib/commonjs/components/widgets/GoBackModal.js +1 -1
  111. package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
  112. package/lib/commonjs/components/widgets/IconButton.js +20 -23
  113. package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
  114. package/lib/commonjs/components/widgets/ModalWidget.js +3 -1
  115. package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
  116. package/lib/commonjs/components/widgets/ProgressDialog.js +3 -3
  117. package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
  118. package/lib/commonjs/components/widgets/SearchBar.js +1 -1
  119. package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
  120. package/lib/commonjs/components/widgets/SnackBarCustom.js +22 -21
  121. package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
  122. package/lib/commonjs/components/widgets/SplitTextInput.js +10 -11
  123. package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
  124. package/lib/commonjs/components/widgets/TabsComponent.js +1 -1
  125. package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
  126. package/lib/commonjs/components/widgets/Timer.js +40 -0
  127. package/lib/commonjs/components/widgets/Timer.js.map +1 -0
  128. package/lib/commonjs/constants/apiConstants.js +4 -1
  129. package/lib/commonjs/constants/apiConstants.js.map +1 -1
  130. package/lib/commonjs/constants/constants.js +4 -1
  131. package/lib/commonjs/constants/constants.js.map +1 -1
  132. package/lib/commonjs/errors/BaseError.js +3 -3
  133. package/lib/commonjs/events/EventDispatcher.js +5 -1
  134. package/lib/commonjs/events/EventDispatcher.js.map +1 -1
  135. package/lib/commonjs/events/constants.js +2 -1
  136. package/lib/commonjs/events/constants.js.map +1 -1
  137. package/lib/commonjs/events/index.js +1 -1
  138. package/lib/commonjs/events/index.js.map +1 -1
  139. package/lib/commonjs/events/interface.js.map +1 -1
  140. package/lib/commonjs/icons/CircleMark.js +27 -0
  141. package/lib/commonjs/icons/CircleMark.js.map +1 -0
  142. package/lib/commonjs/icons/FailedIcon.js +69 -0
  143. package/lib/commonjs/icons/FailedIcon.js.map +1 -0
  144. package/lib/commonjs/icons/FailureCloseIcon.js +42 -0
  145. package/lib/commonjs/icons/FailureCloseIcon.js.map +1 -0
  146. package/lib/commonjs/icons/ScanIcon.js +1 -1
  147. package/lib/commonjs/icons/ScanIcon.js.map +1 -1
  148. package/lib/commonjs/icons/SuccessCompleteIcon.js +42 -0
  149. package/lib/commonjs/icons/SuccessCompleteIcon.js.map +1 -0
  150. package/lib/commonjs/icons/file.js +1 -1
  151. package/lib/commonjs/icons/file.js.map +1 -1
  152. package/lib/commonjs/index.js +2 -2
  153. package/lib/commonjs/index.js.map +1 -1
  154. package/lib/commonjs/locale/i18n.js +1 -1
  155. package/lib/commonjs/locale/i18n.js.map +1 -1
  156. package/lib/commonjs/locale/util.js +1 -1
  157. package/lib/commonjs/locale/util.js.map +1 -1
  158. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +11 -9
  159. package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
  160. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +6 -6
  161. package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  162. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +6 -6
  163. package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  164. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +7 -7
  165. package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  166. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -6
  167. package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  168. package/lib/commonjs/manager/location/LocationManager.js +6 -6
  169. package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
  170. package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -8
  171. package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
  172. package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -6
  173. package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
  174. package/lib/commonjs/manager/sdk/callbacksHandler.js +4 -4
  175. package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
  176. package/lib/commonjs/manager/syncmanager/AppSyncManager.js +7 -7
  177. package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
  178. package/lib/commonjs/manager/syncmanager/database.js +2 -2
  179. package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
  180. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +2 -2
  181. package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  182. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +6 -6
  183. package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
  184. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +8 -16
  185. package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  186. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +6 -7
  187. package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  188. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +7 -8
  189. package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  190. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +5 -9
  191. package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  192. package/lib/commonjs/models/DispatchModels.js.map +1 -1
  193. package/lib/commonjs/models/execTasks/ETConfig.js +3 -0
  194. package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
  195. package/lib/commonjs/models/sdk.js.map +1 -1
  196. package/lib/commonjs/native/signature/SignatureCapture.js +5 -5
  197. package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
  198. package/lib/commonjs/network/GraphQLClient.js +15 -19
  199. package/lib/commonjs/network/GraphQLClient.js.map +1 -1
  200. package/lib/commonjs/network/NetworkClient.js +30 -3
  201. package/lib/commonjs/network/NetworkClient.js.map +1 -1
  202. package/lib/commonjs/network/NetworkUtils.js +2 -5
  203. package/lib/commonjs/network/NetworkUtils.js.map +1 -1
  204. package/lib/commonjs/network/Queries.js.map +1 -1
  205. package/lib/commonjs/network/client.js +5 -5
  206. package/lib/commonjs/network/client.js.map +1 -1
  207. package/lib/commonjs/resources/Login.js +4 -4
  208. package/lib/commonjs/resources/Login.js.map +1 -1
  209. package/lib/commonjs/resources/network.js +4 -4
  210. package/lib/commonjs/resources/network.js.map +1 -1
  211. package/lib/commonjs/styles/executionTasks/CommonStyles.js +13 -3
  212. package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
  213. package/lib/commonjs/ui/screens/CancellationScreen.js +7 -8
  214. package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
  215. package/lib/commonjs/ui/screens/CaptureInputScreen.js +8 -9
  216. package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
  217. package/lib/commonjs/ui/screens/CollectPaymentScreen.js +251 -0
  218. package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -0
  219. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +7 -8
  220. package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  221. package/lib/commonjs/ui/screens/DeliverScreen.js +8 -9
  222. package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
  223. package/lib/commonjs/ui/screens/DisplayScreen.js +8 -9
  224. package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
  225. package/lib/commonjs/ui/screens/DoodleScreen.js +8 -9
  226. package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
  227. package/lib/commonjs/ui/screens/DropCashScreen.js +43 -11
  228. package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
  229. package/lib/commonjs/ui/screens/ETScreensIndex.js +8 -1
  230. package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
  231. package/lib/commonjs/ui/screens/FormsScreen.js +8 -9
  232. package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
  233. package/lib/commonjs/ui/screens/GeofenceScreen.js +8 -9
  234. package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
  235. package/lib/commonjs/ui/screens/HttpRequestScreen.js +7 -8
  236. package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
  237. package/lib/commonjs/ui/screens/ImageCaptureScreen.js +8 -9
  238. package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
  239. package/lib/commonjs/ui/screens/PaymentScreen.js +9 -9
  240. package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
  241. package/lib/commonjs/ui/screens/PickupScreen.js +8 -9
  242. package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
  243. package/lib/commonjs/ui/screens/ScanScreen.js +8 -10
  244. package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
  245. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +13 -9
  246. package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
  247. package/lib/commonjs/ui/screens/ValidateOTPScreen.js +8 -9
  248. package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
  249. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +3 -3
  250. package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
  251. package/lib/commonjs/ui/uiConfig/RouteParams.js +2 -1
  252. package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
  253. package/lib/commonjs/utils/ApiUtils.js +3 -1
  254. package/lib/commonjs/utils/ApiUtils.js.map +1 -1
  255. package/lib/commonjs/utils/ExecTaskUtils.js +35 -5
  256. package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
  257. package/lib/commonjs/utils/Logger.js +6 -7
  258. package/lib/commonjs/utils/Logger.js.map +1 -1
  259. package/lib/commonjs/utils/NetworkUtil.js +4 -4
  260. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  261. package/lib/commonjs/utils/SdkUtils.js +2 -2
  262. package/lib/commonjs/utils/SdkUtils.js.map +1 -1
  263. package/lib/commonjs/utils/SyncManagerUtils.js +3 -3
  264. package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
  265. package/lib/commonjs/utils/context/paymentContext.js +9 -0
  266. package/lib/commonjs/utils/context/paymentContext.js.map +1 -0
  267. package/lib/commonjs/utils/fcm/FCM.js +22 -4
  268. package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
  269. package/lib/commonjs/utils/fcm/FcmUtils.js +12 -2
  270. package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
  271. package/lib/commonjs/utils/helper.js +6 -6
  272. package/lib/commonjs/utils/helper.js.map +1 -1
  273. package/lib/commonjs/utils/hooks/useModal.js +4 -3
  274. package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
  275. package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
  276. package/lib/commonjs/utils/loginHelper.js +1 -1
  277. package/lib/commonjs/utils/loginHelper.js.map +1 -1
  278. package/lib/commonjs/utils/storage.js +11 -17
  279. package/lib/commonjs/utils/storage.js.map +1 -1
  280. package/lib/commonjs/utils/utils.js +2 -3
  281. package/lib/commonjs/utils/utils.js.map +1 -1
  282. package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
  283. package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
  284. package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +7 -8
  285. package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
  286. package/lib/module/components/dispatch/DispatchExecNavigator.js +14 -4
  287. package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
  288. package/lib/module/components/executiontasks/ExecutionTasksIndex.js +2 -1
  289. package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
  290. package/lib/module/components/executiontasks/cancellation/CancelET.js +6 -8
  291. package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
  292. package/lib/module/components/executiontasks/collectPayment/CollectPayment.js +32 -0
  293. package/lib/module/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
  294. package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +29 -0
  295. package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
  296. package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +96 -0
  297. package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
  298. package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +132 -0
  299. package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
  300. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +179 -0
  301. package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
  302. package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
  303. package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
  304. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +433 -0
  305. package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
  306. package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +531 -0
  307. package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
  308. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +880 -0
  309. package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
  310. package/lib/module/components/executiontasks/deliver/DeliverET.js +13 -19
  311. package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
  312. package/lib/module/components/executiontasks/deliver/SLDeliverET.js +21 -24
  313. package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
  314. package/lib/module/components/executiontasks/doodle/SignatureET.js +0 -1
  315. package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
  316. package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
  317. package/lib/module/components/executiontasks/dropCash/SLDropCash.js +6 -1
  318. package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
  319. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +11 -12
  320. package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
  321. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +9 -10
  322. package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
  323. package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -1
  324. package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
  325. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
  326. package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
  327. package/lib/module/components/executiontasks/payments/PaymentUtils.js +11 -2
  328. package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
  329. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
  330. package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
  331. package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
  332. package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
  333. package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
  334. package/lib/module/components/executiontasks/pickup/SLPickupET.js +15 -21
  335. package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
  336. package/lib/module/components/executiontasks/scan/ScanET.js +2 -4
  337. package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
  338. package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
  339. package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
  340. package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
  341. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
  342. package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
  343. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
  344. package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
  345. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
  346. package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
  347. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
  348. package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
  349. package/lib/module/components/executiontasks/scan/utils.js +11 -6
  350. package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
  351. package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
  352. package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
  353. package/lib/module/components/widgets/Card.js +0 -1
  354. package/lib/module/components/widgets/Card.js.map +1 -1
  355. package/lib/module/components/widgets/IconButton.js +19 -22
  356. package/lib/module/components/widgets/IconButton.js.map +1 -1
  357. package/lib/module/components/widgets/ModalWidget.js +1 -0
  358. package/lib/module/components/widgets/ModalWidget.js.map +1 -1
  359. package/lib/module/components/widgets/ProgressDialog.js +2 -2
  360. package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
  361. package/lib/module/components/widgets/SnackBarCustom.js +21 -20
  362. package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
  363. package/lib/module/components/widgets/SplitTextInput.js +9 -10
  364. package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
  365. package/lib/module/components/widgets/Timer.js +32 -0
  366. package/lib/module/components/widgets/Timer.js.map +1 -0
  367. package/lib/module/constants/apiConstants.js +4 -1
  368. package/lib/module/constants/apiConstants.js.map +1 -1
  369. package/lib/module/constants/constants.js +3 -0
  370. package/lib/module/constants/constants.js.map +1 -1
  371. package/lib/module/errors/BaseError.js +3 -3
  372. package/lib/module/events/EventDispatcher.js +3 -0
  373. package/lib/module/events/EventDispatcher.js.map +1 -1
  374. package/lib/module/events/constants.js +2 -1
  375. package/lib/module/events/constants.js.map +1 -1
  376. package/lib/module/events/interface.js.map +1 -1
  377. package/lib/module/icons/CircleMark.js +20 -0
  378. package/lib/module/icons/CircleMark.js.map +1 -0
  379. package/lib/module/icons/FailedIcon.js +62 -0
  380. package/lib/module/icons/FailedIcon.js.map +1 -0
  381. package/lib/module/icons/FailureCloseIcon.js +35 -0
  382. package/lib/module/icons/FailureCloseIcon.js.map +1 -0
  383. package/lib/module/icons/SuccessCompleteIcon.js +35 -0
  384. package/lib/module/icons/SuccessCompleteIcon.js.map +1 -0
  385. package/lib/module/manager/dispatch/DispatchStateContainer.js +10 -8
  386. package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
  387. package/lib/module/manager/dispatchCodes/EventCodeContainer.js +5 -5
  388. package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
  389. package/lib/module/manager/dispatchCodes/EventCodeRepo.js +5 -5
  390. package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
  391. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +5 -5
  392. package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
  393. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +5 -5
  394. package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
  395. package/lib/module/manager/location/LocationManager.js +5 -5
  396. package/lib/module/manager/location/LocationManager.js.map +1 -1
  397. package/lib/module/manager/sdk/DispatchSDKManager.js +6 -6
  398. package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
  399. package/lib/module/manager/sdk/DispatchSdkCache.js +5 -5
  400. package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
  401. package/lib/module/manager/sdk/callbacksHandler.js +3 -3
  402. package/lib/module/manager/syncmanager/AppSyncManager.js +5 -5
  403. package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
  404. package/lib/module/manager/syncmanager/DBConfig.js +1 -0
  405. package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
  406. package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
  407. package/lib/module/manager/syncmanager/document/DocumentManager.js +5 -5
  408. package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
  409. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +6 -14
  410. package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
  411. package/lib/module/manager/syncmanager/events/ETEventsManager.js +5 -6
  412. package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
  413. package/lib/module/manager/syncmanager/events/EventsSyncManager.js +5 -6
  414. package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
  415. package/lib/module/manager/syncmanager/events/SyncHttpClient.js +3 -7
  416. package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
  417. package/lib/module/models/DispatchModels.js.map +1 -1
  418. package/lib/module/models/execTasks/ETConfig.js +3 -0
  419. package/lib/module/models/execTasks/ETConfig.js.map +1 -1
  420. package/lib/module/models/sdk.js.map +1 -1
  421. package/lib/module/native/signature/SignatureCapture.js +4 -4
  422. package/lib/module/network/GraphQLClient.js +14 -18
  423. package/lib/module/network/GraphQLClient.js.map +1 -1
  424. package/lib/module/network/NetworkClient.js +29 -2
  425. package/lib/module/network/NetworkClient.js.map +1 -1
  426. package/lib/module/network/NetworkUtils.js +1 -4
  427. package/lib/module/network/NetworkUtils.js.map +1 -1
  428. package/lib/module/network/Queries.js.map +1 -1
  429. package/lib/module/network/client.js +4 -4
  430. package/lib/module/network/client.js.map +1 -1
  431. package/lib/module/resources/Login.js +3 -3
  432. package/lib/module/resources/network.js +3 -3
  433. package/lib/module/styles/executionTasks/CommonStyles.js +12 -2
  434. package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
  435. package/lib/module/ui/screens/CancellationScreen.js +5 -6
  436. package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
  437. package/lib/module/ui/screens/CaptureInputScreen.js +6 -7
  438. package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
  439. package/lib/module/ui/screens/CollectPaymentScreen.js +244 -0
  440. package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -0
  441. package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
  442. package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
  443. package/lib/module/ui/screens/DeliverScreen.js +6 -7
  444. package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
  445. package/lib/module/ui/screens/DisplayScreen.js +6 -7
  446. package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
  447. package/lib/module/ui/screens/DoodleScreen.js +6 -7
  448. package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
  449. package/lib/module/ui/screens/DropCashScreen.js +41 -10
  450. package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
  451. package/lib/module/ui/screens/ETScreensIndex.js +2 -1
  452. package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
  453. package/lib/module/ui/screens/FormsScreen.js +6 -7
  454. package/lib/module/ui/screens/FormsScreen.js.map +1 -1
  455. package/lib/module/ui/screens/GeofenceScreen.js +6 -7
  456. package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
  457. package/lib/module/ui/screens/HttpRequestScreen.js +6 -7
  458. package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
  459. package/lib/module/ui/screens/ImageCaptureScreen.js +6 -7
  460. package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
  461. package/lib/module/ui/screens/PaymentScreen.js +7 -7
  462. package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
  463. package/lib/module/ui/screens/PickupScreen.js +6 -7
  464. package/lib/module/ui/screens/PickupScreen.js.map +1 -1
  465. package/lib/module/ui/screens/ScanScreen.js +6 -8
  466. package/lib/module/ui/screens/ScanScreen.js.map +1 -1
  467. package/lib/module/ui/screens/StartWorkFlowScreen.js +11 -7
  468. package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
  469. package/lib/module/ui/screens/ValidateOTPScreen.js +6 -7
  470. package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
  471. package/lib/module/ui/screens/WithBaseDispatchScreen.js +1 -1
  472. package/lib/module/ui/uiConfig/RouteParams.js +2 -1
  473. package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
  474. package/lib/module/utils/ApiUtils.js +2 -0
  475. package/lib/module/utils/ApiUtils.js.map +1 -1
  476. package/lib/module/utils/ExecTaskUtils.js +31 -4
  477. package/lib/module/utils/ExecTaskUtils.js.map +1 -1
  478. package/lib/module/utils/Logger.js +5 -6
  479. package/lib/module/utils/Logger.js.map +1 -1
  480. package/lib/module/utils/NetworkUtil.js +3 -3
  481. package/lib/module/utils/NetworkUtil.js.map +1 -1
  482. package/lib/module/utils/SdkUtils.js.map +1 -1
  483. package/lib/module/utils/SyncManagerUtils.js +1 -1
  484. package/lib/module/utils/SyncManagerUtils.js.map +1 -1
  485. package/lib/module/utils/context/paymentContext.js +3 -0
  486. package/lib/module/utils/context/paymentContext.js.map +1 -0
  487. package/lib/module/utils/fcm/FCM.js +20 -2
  488. package/lib/module/utils/fcm/FCM.js.map +1 -1
  489. package/lib/module/utils/fcm/FcmUtils.js +10 -0
  490. package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
  491. package/lib/module/utils/helper.js +5 -5
  492. package/lib/module/utils/helper.js.map +1 -1
  493. package/lib/module/utils/hooks/useModal.js +2 -1
  494. package/lib/module/utils/hooks/useModal.js.map +1 -1
  495. package/lib/module/utils/hooks/useTimer.js.map +1 -1
  496. package/lib/module/utils/storage.js +9 -15
  497. package/lib/module/utils/storage.js.map +1 -1
  498. package/lib/module/utils/utils.js +1 -2
  499. package/lib/module/utils/utils.js.map +1 -1
  500. package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +4 -2
  501. package/lib/typescript/components/executiontasks/collectPayment/CollectPayment.d.ts +4 -0
  502. package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +155 -0
  503. package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +92 -0
  504. package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +16 -0
  505. package/lib/typescript/components/executiontasks/collectPayment/components/CompletePayment.d.ts +4 -0
  506. package/lib/typescript/components/executiontasks/collectPayment/components/InitPayment.d.ts +4 -0
  507. package/lib/typescript/components/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +4 -0
  508. package/lib/typescript/components/executiontasks/collectPayment/components/ProcessPayment.d.ts +4 -0
  509. package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +1 -1
  510. package/lib/typescript/components/executiontasks/scan/utils.d.ts +1 -0
  511. package/lib/typescript/components/widgets/ProgressDialog.d.ts +3 -0
  512. package/lib/typescript/components/widgets/SnackBarCustom.d.ts +3 -2
  513. package/lib/typescript/components/widgets/Timer.d.ts +7 -0
  514. package/lib/typescript/constants/apiConstants.d.ts +3 -0
  515. package/lib/typescript/constants/constants.d.ts +3 -0
  516. package/lib/typescript/events/EventDispatcher.d.ts +1 -0
  517. package/lib/typescript/events/constants.d.ts +1 -0
  518. package/lib/typescript/events/interface.d.ts +1 -1
  519. package/lib/typescript/icons/CircleMark.d.ts +3 -0
  520. package/lib/typescript/icons/FailedIcon.d.ts +4 -0
  521. package/lib/typescript/icons/FailureCloseIcon.d.ts +4 -0
  522. package/lib/typescript/icons/SuccessCompleteIcon.d.ts +4 -0
  523. package/lib/typescript/models/DispatchModels.d.ts +11 -0
  524. package/lib/typescript/models/execTasks/ETConfig.d.ts +6 -3
  525. package/lib/typescript/models/sdk.d.ts +12 -0
  526. package/lib/typescript/network/NetworkClient.d.ts +3 -1
  527. package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +10 -1
  528. package/lib/typescript/ui/screens/CollectPaymentScreen.d.ts +3 -0
  529. package/lib/typescript/ui/screens/ETScreensIndex.d.ts +2 -1
  530. package/lib/typescript/ui/uiConfig/RouteParams.d.ts +1 -0
  531. package/lib/typescript/utils/ExecTaskUtils.d.ts +2 -0
  532. package/lib/typescript/utils/context/paymentContext.d.ts +7 -0
  533. package/package.json +6 -5
  534. package/src/components/dispatch/DispatchExecNavigator.tsx +14 -0
  535. package/src/components/executiontasks/ExecutionTasksIndex.ts +8 -0
  536. package/src/components/executiontasks/collectPayment/CollectPayment.tsx +60 -0
  537. package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +182 -0
  538. package/src/components/executiontasks/collectPayment/PaymentStyles.ts +102 -0
  539. package/src/components/executiontasks/collectPayment/PaymentUtils.ts +200 -0
  540. package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +273 -0
  541. package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +658 -0
  542. package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +790 -0
  543. package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +1352 -0
  544. package/src/components/executiontasks/deliver/SLDeliverET.tsx +132 -60
  545. package/src/components/executiontasks/dropCash/SLDropCash.tsx +35 -12
  546. package/src/components/executiontasks/payments/PaymentUtils.ts +10 -2
  547. package/src/components/executiontasks/pickup/SLPickupET.tsx +6 -3
  548. package/src/components/executiontasks/scan/ScanET.tsx +1 -1
  549. package/src/components/executiontasks/scan/interfaces.ts +1 -1
  550. package/src/components/executiontasks/scan/utils.ts +16 -8
  551. package/src/components/widgets/ModalWidget.tsx +26 -8
  552. package/src/components/widgets/ProgressDialog.tsx +23 -3
  553. package/src/components/widgets/SnackBarCustom.tsx +8 -1
  554. package/src/components/widgets/SplitTextInput.tsx +1 -1
  555. package/src/components/widgets/Timer.tsx +53 -0
  556. package/src/constants/apiConstants.ts +3 -0
  557. package/src/constants/constants.ts +3 -0
  558. package/src/events/EventDispatcher.ts +4 -0
  559. package/src/events/constants.ts +1 -0
  560. package/src/events/interface.ts +7 -1
  561. package/src/icons/CircleMark.tsx +18 -0
  562. package/src/icons/FailedIcon.tsx +80 -0
  563. package/src/icons/FailureCloseIcon.tsx +35 -0
  564. package/src/icons/SuccessCompleteIcon.tsx +35 -0
  565. package/src/manager/dispatch/DispatchStateContainer.tsx +6 -4
  566. package/src/manager/sdk/DispatchSDKManager.ts +1 -0
  567. package/src/models/DispatchModels.ts +12 -0
  568. package/src/models/execTasks/ETConfig.ts +3 -0
  569. package/src/models/sdk.ts +13 -0
  570. package/src/network/NetworkClient.ts +34 -1
  571. package/src/network/client.ts +1 -0
  572. package/src/styles/executionTasks/CommonStyles.ts +32 -8
  573. package/src/ui/screens/CollectPaymentScreen.tsx +315 -0
  574. package/src/ui/screens/DropCashScreen.tsx +49 -2
  575. package/src/ui/screens/ETScreensIndex.ts +2 -0
  576. package/src/ui/screens/PaymentScreen.tsx +1 -0
  577. package/src/ui/screens/StartWorkFlowScreen.tsx +15 -0
  578. package/src/ui/uiConfig/RouteParams.ts +8 -1
  579. package/src/utils/ApiUtils.ts +1 -0
  580. package/src/utils/ExecTaskUtils.ts +44 -3
  581. package/src/utils/SyncManagerUtils.ts +1 -0
  582. package/src/utils/context/paymentContext.ts +8 -0
  583. package/src/utils/fcm/FCM.ts +30 -0
  584. package/src/utils/fcm/FcmUtils.ts +53 -29
  585. package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
  586. package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
  587. package/android/.gradle/7.5/checksums/checksums.lock +0 -0
  588. package/android/.gradle/7.5/checksums/md5-checksums.bin +0 -0
  589. package/android/.gradle/7.5/checksums/sha1-checksums.bin +0 -0
  590. package/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock +0 -0
  591. package/android/.gradle/7.5/executionHistory/executionHistory.lock +0 -0
  592. package/android/.gradle/7.5/fileChanges/last-build.bin +0 -0
  593. package/android/.gradle/7.5/fileHashes/fileHashes.bin +0 -0
  594. package/android/.gradle/7.5/fileHashes/fileHashes.lock +0 -0
  595. package/android/.gradle/7.5/gc.properties +0 -0
  596. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  597. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  598. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  599. package/android/.gradle/checksums/checksums.lock +0 -0
  600. package/android/.gradle/config.properties +0 -2
  601. package/android/.gradle/configuration-cache/gc.properties +0 -0
  602. package/android/.gradle/vcs-1/gc.properties +0 -0
  603. package/android/.idea/compiler.xml +0 -6
  604. package/android/.idea/gradle.xml +0 -18
  605. package/android/.idea/kotlinc.xml +0 -6
  606. package/android/.idea/migrations.xml +0 -10
  607. package/android/.idea/misc.xml +0 -10
  608. package/android/.idea/other.xml +0 -263
  609. package/android/.idea/vcs.xml +0 -6
  610. package/lib/commonjs/icons/circleMark.svg +0 -3
  611. package/lib/module/icons/circleMark.svg +0 -3
  612. package/src/icons/circleMark.svg +0 -3
  613. /package/{android/.gradle/6.8/gc.properties → lib/typescript/components/executiontasks/collectPayment/components/CustomContactsModal.d.ts} +0 -0
  614. /package/{android/.gradle/7.5/dependencies-accessors/gc.properties → src/components/executiontasks/collectPayment/components/CustomContactsModal.tsx} +0 -0
@@ -0,0 +1,887 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _ExecTaskUtils = require("../../../../utils/ExecTaskUtils");
10
+ var _EventCodeContainer = require("../../../../manager/dispatchCodes/EventCodeContainer");
11
+ var _ETConfig = require("../../../../models/execTasks/ETConfig");
12
+ var _PaymentStyles = require("../PaymentStyles");
13
+ var _CommonStyles = require("../../../../styles/executionTasks/CommonStyles");
14
+ var _PaymentUtils = require("../PaymentUtils");
15
+ var _reactNativePaper = require("react-native-paper");
16
+ var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
17
+ var _constants = require("../../../../constants/constants");
18
+ var _native = require("@react-navigation/native");
19
+ var _ProgressDialog = _interopRequireDefault(require("../../../../components/widgets/ProgressDialog"));
20
+ var _MaterialCommunityIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialCommunityIcons"));
21
+ var _ModalWidget = _interopRequireDefault(require("../../../../components/widgets/ModalWidget"));
22
+ var _FailedIcon = _interopRequireDefault(require("../../../../icons/FailedIcon"));
23
+ var _events = _interopRequireDefault(require("../../../../events"));
24
+ var _RouteParams = require("../../../../ui/uiConfig/RouteParams");
25
+ var _CollectPaymentSchema = require("../CollectPaymentSchema");
26
+ var _SnackBarCustom = _interopRequireWildcard(require("../../../../components/widgets/SnackBarCustom"));
27
+ var _storage = _interopRequireDefault(require("../../../../utils/storage"));
28
+ var _paymentContext = require("../../../../utils/context/paymentContext");
29
+ var _apiConstants = require("../../../../constants/apiConstants");
30
+ var _Timer = require("../../../../components/widgets/Timer");
31
+ var _SentryAnalyticsUtils = require("../../../../analytics/sentry/SentryAnalyticsUtils");
32
+ var _SentrySdkConstants = require("../../../../analytics/sentry/SentrySdkConstants");
33
+ var _Logger = _interopRequireWildcard(require("../../../../utils/Logger"));
34
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
35
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
36
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
37
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable react-native/no-inline-styles */
38
+ const styles = _PaymentStyles.PaymentStyles;
39
+ let storage = _storage.default.getInstance();
40
+ const ProcessPayment = props => {
41
+ var _props$route$params$R, _paymentConfigContext;
42
+ const paymentConfigContext = (0, _react.useContext)(_paymentContext.PaymentContext);
43
+ const [showGoBackModal, setGoBackModal] = (0, _react.useState)(false);
44
+ const [showGoBackDisabledModal, setGoBackDisabledModal] = (0, _react.useState)(false);
45
+ const [isRetryEnabled, setIsRetryEnabled] = (0, _react.useState)(false);
46
+ const [backDisable, setBackDisable] = (0, _react.useState)(true);
47
+ const timerRef = (0, _react.useRef)();
48
+ const paymentRefId = (_props$route$params$R = props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].paymentConfig) === null || _props$route$params$R === void 0 ? void 0 : _props$route$params$R.paymentRefId;
49
+ const useTimer = (timerDuration, onTimerEnd) => {
50
+ const [counter, setCounter] = (0, _react.useState)(timerDuration);
51
+ const [hasTimerEnded, setHasTimerEnded] = (0, _react.useState)(false);
52
+ (0, _react.useEffect)(() => {
53
+ if (hasTimerEnded) return; // Stop if the timer has already ended
54
+
55
+ const interval = setInterval(() => {
56
+ if (counter > 0) {
57
+ setCounter(prev => prev - 1);
58
+ } else if (counter === 0 && !hasTimerEnded) {
59
+ setBackDisable(false);
60
+ setHasTimerEnded(true); // Mark the timer as ended
61
+ onTimerEnd && onTimerEnd(); // Call the callback if provided
62
+ clearInterval(interval);
63
+ }
64
+ }, 1000);
65
+ return () => clearInterval(interval);
66
+ }, [counter, hasTimerEnded]);
67
+
68
+ // Function to reset the timer
69
+ const resetTimer = () => {
70
+ setCounter(timerDuration);
71
+ setHasTimerEnded(false);
72
+ setBackDisable(true);
73
+ };
74
+ return {
75
+ counter,
76
+ resetTimer
77
+ };
78
+ };
79
+ const {
80
+ counter
81
+ } = useTimer(paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext = paymentConfigContext.sdkConfig) === null || _paymentConfigContext === void 0 || (_paymentConfigContext = _paymentConfigContext.etConfig) === null || _paymentConfigContext === void 0 ? void 0 : _paymentConfigContext.goBackDisableTimer, () => {
82
+ console.log('Timer ended!');
83
+ setBackDisable(false);
84
+ });
85
+ (0, _react.useEffect)(() => {
86
+ _events.default.on(_constants.PAYMENT_NOTIFICATION, async data => {
87
+ console.log('ProcessPayment:', JSON.stringify(data));
88
+ let sharedPrefPaymentData = null;
89
+ if (data && (data.status === _CollectPaymentSchema.STATUS.SUCCESS || data.status === _CollectPaymentSchema.STATUS.FAILED)) {
90
+ sharedPrefPaymentData = await (0, _PaymentUtils.getPaymentDataMO)(props.mergedObjectiveId, data.refId, storage);
91
+ }
92
+ if (sharedPrefPaymentData && data && data.status === _CollectPaymentSchema.STATUS.SUCCESS) {
93
+ var _sharedPrefPaymentDat, _sharedPrefPaymentDat2, _sharedPrefPaymentDat3, _paymentConfigContext2, _props$applicableReas;
94
+ props.next({
95
+ paymentMode: ((_sharedPrefPaymentDat = sharedPrefPaymentData) === null || _sharedPrefPaymentDat === void 0 ? void 0 : _sharedPrefPaymentDat.paymentMode) || props.paymentMode,
96
+ collectedAmount: {
97
+ value: ((_sharedPrefPaymentDat2 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat2 === void 0 ? void 0 : _sharedPrefPaymentDat2.amount.value) || props.expectedAmount,
98
+ currencyCode: ((_sharedPrefPaymentDat3 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat3 === void 0 ? void 0 : _sharedPrefPaymentDat3.amount.currencyCode) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext2 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext2 === void 0 || (_paymentConfigContext2 = _paymentConfigContext2.etConfig) === null || _paymentConfigContext2 === void 0 ? void 0 : _paymentConfigContext2.currencyCode) || ''
99
+ },
100
+ refId: data.refId,
101
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
102
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
103
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.success), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
104
+ });
105
+ } else if (sharedPrefPaymentData && data && data.status === _CollectPaymentSchema.STATUS.FAILED) {
106
+ var _paymentConfigContext3, _props$applicableReas2;
107
+ const _sharedPrefPaymentData = JSON.parse(JSON.stringify(sharedPrefPaymentData));
108
+ /* await storage.removeSharedItems(
109
+ props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
110
+ ); */
111
+ await (0, _PaymentUtils.removeSharedPrefPaymentData)(data.refId, storage);
112
+ props.next({
113
+ paymentMode: (_sharedPrefPaymentData === null || _sharedPrefPaymentData === void 0 ? void 0 : _sharedPrefPaymentData.paymentMode) || props.paymentMode,
114
+ collectedAmount: {
115
+ value: (_sharedPrefPaymentData === null || _sharedPrefPaymentData === void 0 ? void 0 : _sharedPrefPaymentData.amount.value) || props.expectedAmount,
116
+ currencyCode: (_sharedPrefPaymentData === null || _sharedPrefPaymentData === void 0 ? void 0 : _sharedPrefPaymentData.amount.currencyCode) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext3 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext3 === void 0 || (_paymentConfigContext3 = _paymentConfigContext3.etConfig) === null || _paymentConfigContext3 === void 0 ? void 0 : _paymentConfigContext3.currencyCode) || ''
117
+ },
118
+ refId: data.refId,
119
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
120
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
121
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, false, (_props$applicableReas2 = props.applicableReasons) === null || _props$applicableReas2 === void 0 ? void 0 : _props$applicableReas2.failure), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
122
+ });
123
+ }
124
+ });
125
+ return () => {
126
+ _events.default.remove(_constants.PAYMENT_NOTIFICATION);
127
+ };
128
+ }, []);
129
+ const onNext = async () => {
130
+ var _props$applicableReas3, _paymentConfigContext4;
131
+ props.next({
132
+ paymentMode: props.paymentMode,
133
+ refId: paymentRefId,
134
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas3 = props.applicableReasons) === null || _props$applicableReas3 === void 0 ? void 0 : _props$applicableReas3.success), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET)),
135
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.INIT,
136
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
137
+ collectedAmount: {
138
+ value: props.expectedAmount,
139
+ currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext4 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext4 === void 0 || (_paymentConfigContext4 = _paymentConfigContext4.etConfig) === null || _paymentConfigContext4 === void 0 ? void 0 : _paymentConfigContext4.currencyCode) || ''
140
+ }
141
+ });
142
+ };
143
+
144
+ // Handle back-button click
145
+ (0, _native.useFocusEffect)((0, _react.useCallback)(() => {
146
+ const onBackPress = () => {
147
+ // isRetryEnabled
148
+ // ? onNext()
149
+ // : backDisable
150
+ // ? setGoBackDisabledModal(true)
151
+ // : setGoBackModal(true);
152
+ isRetryEnabled ? onNext() : setGoBackModal(true);
153
+ return true;
154
+ };
155
+ _reactNative.BackHandler.addEventListener('hardwareBackPress', onBackPress);
156
+ return () => _reactNative.BackHandler.removeEventListener('hardwareBackPress', onBackPress);
157
+ }, [isRetryEnabled, backDisable]));
158
+ (0, _react.useLayoutEffect)(() => {
159
+ props.navigation.setOptions({
160
+ headerShown: true,
161
+ title: props.paymentMode === 'QR_CODE' ? 'QR Code' : props.paymentMode === 'PAYMENT_LINK' ? 'Payment Confirmation' : props.title,
162
+ headerLeft: () => {
163
+ return /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
164
+ onPress: () => {
165
+ // isRetryEnabled
166
+ // ? onNext()
167
+ // : backDisable
168
+ // ? setGoBackDisabledModal(true)
169
+ // : setGoBackModal(true);
170
+ isRetryEnabled ? onNext() : setGoBackModal(true);
171
+ },
172
+ name: "arrow-back",
173
+ color: 'black',
174
+ size: 25,
175
+ style: {
176
+ paddingRight: 15,
177
+ paddingTop: 5
178
+ }
179
+ });
180
+ }
181
+ });
182
+ }, [backDisable, props.navigation, props.title, isRetryEnabled]);
183
+ return /*#__PURE__*/_react.default.createElement(_reactNativePaper.Provider, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Portal, null, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Modal, {
184
+ visible: showGoBackModal,
185
+ dismissable: false,
186
+ contentContainerStyle: [modalStyles.modalContent]
187
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
188
+ style: [modalStyles.modalView, {
189
+ paddingVertical: 24,
190
+ paddingHorizontal: 16
191
+ }]
192
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
193
+ style: [modalStyles.subTitleText, {
194
+ textAlign: 'center'
195
+ }]
196
+ }, "Are you sure you want to go back and change the payment method?")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
197
+ style: {
198
+ alignSelf: 'center',
199
+ marginTop: 10
200
+ }
201
+ }, /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
202
+ style: [_CommonStyles.CommonStyles.nextButton, {
203
+ height: 35,
204
+ borderRadius: 5,
205
+ width: 240,
206
+ marginBottom: 16
207
+ }, counter !== 0 && {
208
+ backgroundColor: '#E0E3EB',
209
+ borderColor: '#F9F9FB'
210
+ }],
211
+ onPress: () => {
212
+ onNext();
213
+ (0, _SentryAnalyticsUtils.fireEventWithScreenName)({
214
+ severityLevel: _SentrySdkConstants.SeverityLevelValue.LOG,
215
+ eventName: _SentrySdkConstants.SentryEventNameSdkConstants.BUTTON_CLICKED,
216
+ screenName: _SentrySdkConstants.ScreenNameSdkConstants.MODEL_WIDGET_SCREEN,
217
+ cta: 'Yes'
218
+ });
219
+ },
220
+ disabled: backDisable
221
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
222
+ style: [_CommonStyles.CommonStyles.nextButtonLabel, {
223
+ textAlignVertical: 'center',
224
+ paddingVertical: 6,
225
+ paddingHorizontal: 20
226
+ }, counter !== 0 && {
227
+ color: '#A3AAC2'
228
+ }]
229
+ }, `Yes ${counter > 0 ? '(' + counter + ' sec)' : ''}`)), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
230
+ style: [_CommonStyles.CommonStyles.cancelButton, {
231
+ height: 35,
232
+ borderRadius: 5,
233
+ width: 240
234
+ }],
235
+ onPress: () => {
236
+ setGoBackModal(false);
237
+ (0, _SentryAnalyticsUtils.fireEventWithScreenName)({
238
+ severityLevel: _SentrySdkConstants.SeverityLevelValue.LOG,
239
+ eventName: _SentrySdkConstants.SentryEventNameSdkConstants.BUTTON_CLICKED,
240
+ screenName: _SentrySdkConstants.ScreenNameSdkConstants.MODEL_WIDGET_SCREEN,
241
+ cta: 'Cancel'
242
+ });
243
+ },
244
+ disabled: false
245
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
246
+ style: [_CommonStyles.CommonStyles.cancelButtonLabel, {
247
+ textAlignVertical: 'center',
248
+ paddingVertical: 6,
249
+ paddingHorizontal: 20,
250
+ color: '#3D445C'
251
+ }]
252
+ }, 'Cancel'))))))), /*#__PURE__*/_react.default.createElement(_ModalWidget.default, {
253
+ modalStyle: {
254
+ padding: 25
255
+ },
256
+ dismissable: false,
257
+ buttonStyle: {
258
+ alignSelf: 'center',
259
+ marginTop: 10
260
+ },
261
+ title: {
262
+ label: '',
263
+ styles: {
264
+ textAlign: 'center',
265
+ display: 'none'
266
+ }
267
+ },
268
+ subTitle: {
269
+ // label:
270
+ // 'Payment is in progress, please wait until the payment is completed or timed out.',
271
+ label: 'Please wait for the timer to complete before navigating back.',
272
+ styles: {
273
+ textAlign: 'center'
274
+ }
275
+ },
276
+ showModal: showGoBackDisabledModal,
277
+ primaryButton: {
278
+ label: 'OK',
279
+ onPress: () => {
280
+ setGoBackDisabledModal(false);
281
+ },
282
+ styles: {
283
+ height: 40,
284
+ borderRadius: 5,
285
+ width: 240,
286
+ marginBottom: 10,
287
+ marginTop: 24,
288
+ backgroundColor: 'white',
289
+ borderColor: '#5B80F7',
290
+ borderWidth: 1
291
+ },
292
+ labelStyles: {
293
+ textAlignVertical: 'center',
294
+ paddingVertical: 8,
295
+ paddingHorizontal: 20,
296
+ fontSize: 14,
297
+ lineHeight: 20,
298
+ fontFamily: 'IBM Plex Sans',
299
+ color: '#5B80F7',
300
+ fontWeight: '700'
301
+ }
302
+ },
303
+ secondaryButton: {
304
+ label: '',
305
+ onPress: () => {},
306
+ styles: {
307
+ height: 35,
308
+ borderRadius: 5,
309
+ width: 240,
310
+ display: 'none'
311
+ },
312
+ labelStyles: {
313
+ textAlignVertical: 'center'
314
+ }
315
+ }
316
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
317
+ style: _CommonStyles.CommonStyles.mainContainer
318
+ }, props.paymentMode === 'QR_CODE' ? /*#__PURE__*/_react.default.createElement(RenderQR, _extends({}, props, {
319
+ setBackDisable: setBackDisable,
320
+ showGoBackModal: showGoBackModal,
321
+ setIsRetryEnabled: isEnabled => {
322
+ setIsRetryEnabled(isEnabled);
323
+ }
324
+ })) : /*#__PURE__*/_react.default.createElement(PaymentLink, _extends({
325
+ setBackDisable: setBackDisable
326
+ }, props))));
327
+ };
328
+ var _default = exports.default = ProcessPayment;
329
+ const RenderQR = props => {
330
+ var _paymentConfigContext11;
331
+ const paymentConfigContext = (0, _react.useContext)(_paymentContext.PaymentContext);
332
+ const [qrData, setQrData] = (0, _react.useState)(null);
333
+ const [showStatusModal, setStatusModal] = (0, _react.useState)(false);
334
+ const [showRetryModal, setRetryModal] = (0, _react.useState)(false);
335
+ const [disableStatusBtn, setDisableStatusBtn] = (0, _react.useState)(true);
336
+ const [fetchQR, setFetchQR] = (0, _react.useState)(true);
337
+ const timerRef = (0, _react.useRef)();
338
+ const statusTimerRef = (0, _react.useRef)();
339
+ const paymentConfig = props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].paymentConfig;
340
+ const paymentRefId = paymentConfig === null || paymentConfig === void 0 ? void 0 : paymentConfig.paymentRefId;
341
+ (0, _react.useEffect)(() => {
342
+ props.setIsRetryEnabled(showRetryModal);
343
+ }, [showRetryModal]);
344
+ const sendClickEvent = event => {
345
+ var _paymentConfigContext5;
346
+ (0, _ExecTaskUtils.onClickEvent)(event, props.route.params[_RouteParams.RouteParams.NEXT_STATES], props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].customEventsData, {
347
+ refId: paymentRefId,
348
+ money: {
349
+ amount: props.expectedAmount,
350
+ currency: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext5 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext5 === void 0 || (_paymentConfigContext5 = _paymentConfigContext5.etConfig) === null || _paymentConfigContext5 === void 0 ? void 0 : _paymentConfigContext5.currencyCode) || ''
351
+ }
352
+ });
353
+ };
354
+ const fetchQrCode = async () => {
355
+ var _paymentConfigContext6;
356
+ sendClickEvent('QR_CODE');
357
+ setFetchQR(true);
358
+ let qrParams = {
359
+ refId: paymentRefId,
360
+ appAbbr: (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.sdkConfig.etConfig.appAbbr) || '',
361
+ money: {
362
+ amount: props.expectedAmount,
363
+ currency: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext6 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext6 === void 0 || (_paymentConfigContext6 = _paymentConfigContext6.etConfig) === null || _paymentConfigContext6 === void 0 ? void 0 : _paymentConfigContext6.currencyCode) || ''
364
+ }
365
+ };
366
+ if (paymentConfig !== null && paymentConfig !== void 0 && paymentConfig.userInfo) {
367
+ qrParams.userInfo = paymentConfig.userInfo;
368
+ }
369
+ try {
370
+ const paymentResp = await (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.networkInstance.requestPost(_apiConstants.ENDPOINTS.GENERATE_QR, qrParams, {
371
+ requestId: 'payment:' + paymentRefId
372
+ }));
373
+ // const paymentResp = {
374
+ // data: {
375
+ // data: {
376
+ // qrCode:
377
+ // 'data:image/png;base64,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',
378
+ // },
379
+ // },
380
+ // };
381
+ setFetchQR(false);
382
+ const _qrData = paymentResp === null || paymentResp === void 0 ? void 0 : paymentResp.data;
383
+ console.log('_qrData: ', _qrData);
384
+ if (_qrData.data.qrCode) {
385
+ var _paymentConfigContext7;
386
+ setQrData(_qrData);
387
+ setRetryModal(false);
388
+ await (0, _PaymentUtils.setSharedPrefPaymentData)(paymentRefId,
389
+ // props.mergedObjectiveId,
390
+ {
391
+ paymentMode: props.paymentMode,
392
+ amount: {
393
+ value: props.expectedAmount,
394
+ currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext7 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext7 === void 0 || (_paymentConfigContext7 = _paymentConfigContext7.etConfig) === null || _paymentConfigContext7 === void 0 ? void 0 : _paymentConfigContext7.currencyCode) || ''
395
+ },
396
+ // refId: paymentRefId,
397
+ moIds: props.mergedObjectiveId
398
+ }, storage);
399
+ await (0, _PaymentUtils.setSharedPrefPaymentSelection)(paymentRefId, 'QR_CODE', storage);
400
+ } else if (_qrData.data.status === _CollectPaymentSchema.STATUS.SUCCESS) {
401
+ var _paymentConfigContext8, _props$applicableReas4;
402
+ props.next({
403
+ paymentMode: props.paymentMode,
404
+ collectedAmount: {
405
+ value: props.expectedAmount,
406
+ currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext8 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext8 === void 0 || (_paymentConfigContext8 = _paymentConfigContext8.etConfig) === null || _paymentConfigContext8 === void 0 ? void 0 : _paymentConfigContext8.currencyCode) || ''
407
+ },
408
+ refId: paymentRefId,
409
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
410
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
411
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas4 = props.applicableReasons) === null || _props$applicableReas4 === void 0 ? void 0 : _props$applicableReas4.success), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
412
+ });
413
+ } else {
414
+ setRetryModal(true);
415
+ }
416
+ } catch (err) {
417
+ var _err$response, _err$response2;
418
+ _Logger.default.getInstance().logEvent('~ fetchQrCode triggered ', JSON.stringify((err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 ? void 0 : _err$response.data) || err), _Logger.LOG_TYPE.SDK_ERROR);
419
+ console.error('QR Gen: ', JSON.stringify((err === null || err === void 0 || (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : _err$response2.data) || err));
420
+ setFetchQR(false);
421
+ setRetryModal(true);
422
+ }
423
+ };
424
+ (0, _react.useEffect)(() => {
425
+ fetchQrCode();
426
+ }, []);
427
+ const checkStatus = async () => {
428
+ sendClickEvent('CHECK_STATUS');
429
+ setStatusModal(true);
430
+ try {
431
+ var _ps$data$meta, _ps$data$transactions, _ps$data$meta2, _ps$data$transactions2;
432
+ const paymentResp = await (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.networkInstance.requestGet(_apiConstants.ENDPOINTS.PAYMENT_STATUS + paymentRefId, {
433
+ requestId: 'payment:' + paymentRefId
434
+ }, {
435
+ appAbbr: paymentConfigContext.sdkConfig.etConfig.appAbbr,
436
+ latest: true
437
+ }));
438
+ const _ps = paymentResp === null || paymentResp === void 0 ? void 0 : paymentResp.data;
439
+ console.log('_ps qr: ', _ps);
440
+ if ((_ps$data$meta = _ps.data.meta) !== null && _ps$data$meta !== void 0 && _ps$data$meta.totalCount && _ps !== null && _ps !== void 0 && (_ps$data$transactions = _ps.data.transactions) !== null && _ps$data$transactions !== void 0 && _ps$data$transactions.length && (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].status) === _CollectPaymentSchema.STATUS.SUCCESS) {
441
+ var _paymentConfigContext9, _props$applicableReas5;
442
+ props.next({
443
+ paymentMode: (0, _PaymentUtils.getPaymentType)(_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].txnType) || props.paymentMode,
444
+ collectedAmount: {
445
+ value: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.amount) || props.expectedAmount,
446
+ currencyCode: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.currency) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext9 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext9 === void 0 || (_paymentConfigContext9 = _paymentConfigContext9.etConfig) === null || _paymentConfigContext9 === void 0 ? void 0 : _paymentConfigContext9.currencyCode) || ''
447
+ },
448
+ refId: paymentRefId,
449
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
450
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
451
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas5 = props.applicableReasons) === null || _props$applicableReas5 === void 0 ? void 0 : _props$applicableReas5.success), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
452
+ });
453
+ } else if ((_ps$data$meta2 = _ps.data.meta) !== null && _ps$data$meta2 !== void 0 && _ps$data$meta2.totalCount && _ps !== null && _ps !== void 0 && (_ps$data$transactions2 = _ps.data.transactions) !== null && _ps$data$transactions2 !== void 0 && _ps$data$transactions2.length && (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].status) === _CollectPaymentSchema.STATUS.FAILED) {
454
+ var _paymentConfigContext10, _props$applicableReas6;
455
+ /* await storage.removeSharedItems(
456
+ props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
457
+ ); */
458
+ await (0, _PaymentUtils.removeSharedPrefPaymentData)(paymentRefId, storage);
459
+ props.next({
460
+ paymentMode: (0, _PaymentUtils.getPaymentType)(_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].txnType) || props.paymentMode,
461
+ collectedAmount: {
462
+ value: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.amount) || props.expectedAmount,
463
+ currencyCode: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.currency) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext10 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext10 === void 0 || (_paymentConfigContext10 = _paymentConfigContext10.etConfig) === null || _paymentConfigContext10 === void 0 ? void 0 : _paymentConfigContext10.currencyCode) || ''
464
+ },
465
+ refId: paymentRefId,
466
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
467
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
468
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, false, (_props$applicableReas6 = props.applicableReasons) === null || _props$applicableReas6 === void 0 ? void 0 : _props$applicableReas6.failure), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
469
+ });
470
+ }
471
+ setStatusModal(false);
472
+ setDisableStatusBtn(true);
473
+ } catch (err) {
474
+ var _err$response3, _err$response4;
475
+ _Logger.default.getInstance().logEvent('~ checkStatus triggered ', JSON.stringify((err === null || err === void 0 || (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : _err$response3.data) || err), _Logger.LOG_TYPE.SDK_ERROR);
476
+ console.error('Get Status QR: ', (err === null || err === void 0 || (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : _err$response4.data) || err);
477
+ setStatusModal(false);
478
+ }
479
+ };
480
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProgressDialog.default, {
481
+ customModalContentStyle: {
482
+ paddingVertical: 40
483
+ },
484
+ visible: showStatusModal,
485
+ label: "Please wait while we are checking the status",
486
+ labelStyle: {
487
+ fontWeight: '400',
488
+ marginTop: 16,
489
+ fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
490
+ color: '#525B7A'
491
+ }
492
+ }), fetchQR ? /*#__PURE__*/_react.default.createElement(_ProgressDialog.default, {
493
+ visible: qrData ? false : true,
494
+ customModalContentStyle: {
495
+ paddingVertical: 40
496
+ },
497
+ label: "Generating QR Code",
498
+ labelStyle: {
499
+ fontWeight: '400',
500
+ marginTop: 16,
501
+ fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
502
+ color: '#3D445C'
503
+ }
504
+ }) : showRetryModal ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
505
+ style: [_CommonStyles.CommonStyles.mainContainer, {
506
+ justifyContent: 'center',
507
+ alignItems: 'center'
508
+ }]
509
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
510
+ style: styles.flexCenter
511
+ }, /*#__PURE__*/_react.default.createElement(_FailedIcon.default, null), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
512
+ style: [_CommonStyles.CommonStyles.titleText, {
513
+ marginTop: 20
514
+ }]
515
+ }, "QR Code Fetching Failed!"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
516
+ style: [_CommonStyles.CommonStyles.subText, {
517
+ marginHorizontal: 20,
518
+ color: '#525B7A'
519
+ }]
520
+ }, "Due to a technical issue, we are unable to fetch the QR Code"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
521
+ style: [_CommonStyles.CommonStyles.nextButton, {
522
+ marginEnd: 5,
523
+ marginTop: 5,
524
+ paddingBottom: 3
525
+ }],
526
+ labelStyle: {
527
+ ..._CommonStyles.CommonStyles.nextButtonLabel,
528
+ textTransform: 'capitalize',
529
+ fontSize: 14
530
+ },
531
+ mode: 'outlined',
532
+ onPress: fetchQrCode
533
+ }, "Retry"))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
534
+ style: _CommonStyles.CommonStyles.mainContainer
535
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
536
+ style: _CommonStyles.CommonStyles.mainContainer
537
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
538
+ style: {
539
+ alignItems: 'center',
540
+ paddingTop: 25
541
+ }
542
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
543
+ style: [_CommonStyles.CommonStyles.titleText, {
544
+ fontSize: 18
545
+ }]
546
+ }, "Scan to pay"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
547
+ style: [styles.textStyle1, {
548
+ color: '#3D445C',
549
+ marginTop: 12
550
+ }]
551
+ }, "Total payable amount"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
552
+ style: [_CommonStyles.CommonStyles.titleText, {
553
+ paddingBottom: 20,
554
+ fontWeight: 'bold'
555
+ }]
556
+ }, (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext11 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext11 === void 0 || (_paymentConfigContext11 = _paymentConfigContext11.etConfig) === null || _paymentConfigContext11 === void 0 ? void 0 : _paymentConfigContext11.currencyCode) + ' ' + props.expectedAmount), /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
557
+ style: {
558
+ width: 300,
559
+ height: 300,
560
+ backgroundColor: 'transparent'
561
+ },
562
+ source: {
563
+ uri: qrData === null || qrData === void 0 ? void 0 : qrData.data.qrCode
564
+ }
565
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
566
+ style: {
567
+ marginTop: 24
568
+ }
569
+ }, /*#__PURE__*/_react.default.createElement(_reactNativePaper.ActivityIndicator, {
570
+ size: "small",
571
+ color: "rgba(107, 142, 255, 1)",
572
+ style: {
573
+ marginBottom: 10
574
+ }
575
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
576
+ style: _CommonStyles.CommonStyles.subText
577
+ }, "Waiting for the payment confirmation"))))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
578
+ style: {
579
+ padding: 10,
580
+ borderWidth: 1,
581
+ borderColor: '#E0E3EB'
582
+ }
583
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
584
+ style: _CommonStyles.CommonStyles.subText
585
+ }, "Customer payment successful?"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
586
+ style: {
587
+ flexDirection: 'row',
588
+ marginStart: 10,
589
+ marginEnd: 10
590
+ }
591
+ }, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
592
+ style: [_CommonStyles.CommonStyles.nextButton, {
593
+ marginEnd: 5,
594
+ flex: 1
595
+ }, disableStatusBtn ? {
596
+ backgroundColor: '#E0E3EB'
597
+ } : {}],
598
+ labelStyle: [_CommonStyles.CommonStyles.nextButtonLabel, {
599
+ textTransform: 'capitalize'
600
+ }, disableStatusBtn ? {
601
+ color: '#A3AAC2'
602
+ } : {}],
603
+ mode: 'outlined',
604
+ onPress: checkStatus,
605
+ disabled: disableStatusBtn
606
+ }, disableStatusBtn ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, 'Check Status (', /*#__PURE__*/_react.default.createElement(_Timer.Timer, {
607
+ ref: statusTimerRef,
608
+ singleValue: true,
609
+ timer: 5,
610
+ onTimerEnd: () => setDisableStatusBtn(false)
611
+ }), ' sec)') : 'Check Status')))));
612
+ };
613
+ const PaymentLink = props => {
614
+ var _props$route$params$R2, _paymentConfigContext16;
615
+ const paymentConfigContext = (0, _react.useContext)(_paymentContext.PaymentContext);
616
+ const [showStatusModal, setStatusModal] = (0, _react.useState)(false);
617
+ const [disableStatusBtn, setDisableStatusBtn] = (0, _react.useState)(true);
618
+ const [snackBar, setSnackBar] = (0, _react.useState)({
619
+ show: false,
620
+ type: _SnackBarCustom.SnackBarType.SUCCESS,
621
+ message: ''
622
+ });
623
+ const [isTimerActive, setIsTimerActive] = (0, _react.useState)(true);
624
+ const timerRef = (0, _react.useRef)();
625
+ const statusTimerRef = (0, _react.useRef)();
626
+ const paymentRefId = (_props$route$params$R2 = props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].paymentConfig) === null || _props$route$params$R2 === void 0 ? void 0 : _props$route$params$R2.paymentRefId;
627
+ const sendClickEvent = event => {
628
+ var _paymentConfigContext12;
629
+ let param = {
630
+ refId: paymentRefId,
631
+ money: {
632
+ amount: props.expectedAmount,
633
+ currency: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext12 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext12 === void 0 || (_paymentConfigContext12 = _paymentConfigContext12.etConfig) === null || _paymentConfigContext12 === void 0 ? void 0 : _paymentConfigContext12.currencyCode) || ''
634
+ },
635
+ contactDetails: props.contactDetails,
636
+ paymentLink: (0, _PaymentUtils.getPaymentLink)((paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.sdkConfig.env) || 'DEV', (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.sdkConfig.tenantID) || '', (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.sdkConfig.etConfig.appAbbr) || '', paymentRefId)
637
+ };
638
+ if (event === 'CHECK_STATUS') {
639
+ delete param.contactDetails;
640
+ delete param.paymentLink;
641
+ }
642
+ (0, _ExecTaskUtils.onClickEvent)(event, props.route.params[_RouteParams.RouteParams.NEXT_STATES], props.route.params[_RouteParams.RouteParams.ROOT_META_DATA].customEventsData, param);
643
+ };
644
+ const sendPaymentLink = event => {
645
+ sendClickEvent(event);
646
+ setSnackBar({
647
+ show: true,
648
+ message: 'Payment link sent successfully!',
649
+ type: _SnackBarCustom.SnackBarType.SUCCESS
650
+ });
651
+ if (event === 'RESEND_LINK') {
652
+ var _statusTimerRef$curre, _timerRef$current;
653
+ setDisableStatusBtn(true);
654
+ statusTimerRef === null || statusTimerRef === void 0 || (_statusTimerRef$curre = statusTimerRef.current) === null || _statusTimerRef$curre === void 0 || _statusTimerRef$curre.resetTimer();
655
+ timerRef === null || timerRef === void 0 || (_timerRef$current = timerRef.current) === null || _timerRef$current === void 0 || _timerRef$current.resetTimer();
656
+ setIsTimerActive(true);
657
+ props.setBackDisable(true);
658
+ }
659
+ };
660
+ (0, _react.useEffect)(() => {
661
+ (async _paymentConfigContext13 => {
662
+ await (0, _PaymentUtils.setSharedPrefPaymentData)(paymentRefId,
663
+ // props.mergedObjectiveId,
664
+ {
665
+ paymentMode: props.paymentMode,
666
+ amount: {
667
+ value: props.expectedAmount,
668
+ currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext13 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext13 === void 0 || (_paymentConfigContext13 = _paymentConfigContext13.etConfig) === null || _paymentConfigContext13 === void 0 ? void 0 : _paymentConfigContext13.currencyCode) || ''
669
+ },
670
+ // refId: paymentRefId,
671
+ moIds: props.mergedObjectiveId
672
+ }, storage);
673
+ await (0, _PaymentUtils.setSharedPrefPaymentSelection)(paymentRefId, 'PAYMENT_LINK', storage);
674
+ sendPaymentLink('SEND_LINK');
675
+ })();
676
+ }, []);
677
+ const checkStatus = async () => {
678
+ sendClickEvent('CHECK_STATUS');
679
+ try {
680
+ var _ps$data$meta3, _ps$data$transactions3, _ps$data$meta4, _ps$data$transactions4;
681
+ setStatusModal(true);
682
+ const paymentResp = await (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.networkInstance.requestGet(_apiConstants.ENDPOINTS.PAYMENT_STATUS + paymentRefId, {
683
+ requestId: 'payment:' + paymentRefId
684
+ }, {
685
+ appAbbr: paymentConfigContext.sdkConfig.etConfig.appAbbr,
686
+ latest: true
687
+ }));
688
+ // const paymentResp = {
689
+ // data: {
690
+ // data: {
691
+ // meta: { totalCount: 1 },
692
+ // transactions: [
693
+ // {
694
+ // refId: paymentRefId,
695
+ // status: STATUS.FAILED,
696
+ // subStatus: SUB_STATUS.completed,
697
+ // money: {
698
+ // amount: 1000,
699
+ // currency: 'INR',
700
+ // },
701
+ // txnId: '123',
702
+ // txnType: TRANSACTION_TYPE.QRCODE,
703
+ // appAbbr: 'testApp31',
704
+ // },
705
+ // ],
706
+ // },
707
+ // },
708
+ // };
709
+ const _ps = paymentResp === null || paymentResp === void 0 ? void 0 : paymentResp.data;
710
+ console.log('_ps pl: ', JSON.stringify(_ps));
711
+ if ((_ps$data$meta3 = _ps.data.meta) !== null && _ps$data$meta3 !== void 0 && _ps$data$meta3.totalCount && _ps !== null && _ps !== void 0 && (_ps$data$transactions3 = _ps.data.transactions) !== null && _ps$data$transactions3 !== void 0 && _ps$data$transactions3.length && (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].status) === _CollectPaymentSchema.STATUS.SUCCESS) {
712
+ var _paymentConfigContext14, _props$applicableReas7;
713
+ props.next({
714
+ paymentMode: (0, _PaymentUtils.getPaymentType)(_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].txnType) || props.paymentMode,
715
+ collectedAmount: {
716
+ value: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.amount) || props.expectedAmount,
717
+ currencyCode: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.currency) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext14 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext14 === void 0 || (_paymentConfigContext14 = _paymentConfigContext14.etConfig) === null || _paymentConfigContext14 === void 0 ? void 0 : _paymentConfigContext14.currencyCode) || ''
718
+ },
719
+ refId: paymentRefId,
720
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
721
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
722
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, true, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas7 = props.applicableReasons) === null || _props$applicableReas7 === void 0 ? void 0 : _props$applicableReas7.success), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
723
+ });
724
+ } else if ((_ps$data$meta4 = _ps.data.meta) !== null && _ps$data$meta4 !== void 0 && _ps$data$meta4.totalCount && _ps !== null && _ps !== void 0 && (_ps$data$transactions4 = _ps.data.transactions) !== null && _ps$data$transactions4 !== void 0 && _ps$data$transactions4.length && (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].status) === _CollectPaymentSchema.STATUS.FAILED) {
725
+ var _paymentConfigContext15, _props$applicableReas8;
726
+ /* await storage.removeSharedItems(
727
+ props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
728
+ ); */
729
+ await (0, _PaymentUtils.removeSharedPrefPaymentData)(paymentRefId, storage);
730
+ props.next({
731
+ paymentMode: (0, _PaymentUtils.getPaymentType)(_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].txnType) || props.paymentMode,
732
+ collectedAmount: {
733
+ value: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.amount) || props.expectedAmount,
734
+ currencyCode: (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.currency) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext15 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext15 === void 0 || (_paymentConfigContext15 = _paymentConfigContext15.etConfig) === null || _paymentConfigContext15 === void 0 ? void 0 : _paymentConfigContext15.currencyCode) || ''
735
+ },
736
+ refId: paymentRefId,
737
+ screen: _CollectPaymentSchema.PAYMENT_SCREEN.COMPLETE,
738
+ sourceScreen: _CollectPaymentSchema.PAYMENT_SCREEN.PROCESS,
739
+ ...(await (0, _ExecTaskUtils.getBaseETResponse)(_ETConfig.EntityCode.COLLECT_PAYMENT_ET, false, (0, _EventCodeContainer.getEventCodeByET)(_ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET, false, (_props$applicableReas8 = props.applicableReasons) === null || _props$applicableReas8 === void 0 ? void 0 : _props$applicableReas8.failure), '', props.mergedObjectiveId, _ETConfig.ExecutionTaskID.COLLECT_PAYMENT_ET))
740
+ });
741
+ }
742
+ setStatusModal(false);
743
+ setDisableStatusBtn(true);
744
+ } catch (err) {
745
+ var _err$response5, _err$response6;
746
+ _Logger.default.getInstance().logEvent('~ checkStatus1 triggered ', JSON.stringify((err === null || err === void 0 || (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : _err$response5.data) || err), _Logger.LOG_TYPE.SDK_ERROR);
747
+ console.log('Check status pl: ', (err === null || err === void 0 || (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : _err$response6.data) || err);
748
+ setStatusModal(false);
749
+ }
750
+ };
751
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProgressDialog.default, {
752
+ customModalContentStyle: {
753
+ paddingVertical: 40
754
+ },
755
+ visible: showStatusModal,
756
+ label: "Please wait while we are checking the payment status",
757
+ labelStyle: {
758
+ fontWeight: '400',
759
+ fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
760
+ color: '#3D445C'
761
+ }
762
+ }), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_SnackBarCustom.default, {
763
+ type: snackBar.type,
764
+ message: `${snackBar.message}`,
765
+ visible: snackBar.show,
766
+ onDismiss: () => {
767
+ setSnackBar({
768
+ show: false,
769
+ message: '',
770
+ type: _SnackBarCustom.SnackBarType.SUCCESS
771
+ });
772
+ },
773
+ customTop: 0
774
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
775
+ style: [_CommonStyles.CommonStyles.mainContainer, {
776
+ justifyContent: 'center',
777
+ alignItems: 'center'
778
+ }]
779
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
780
+ style: styles.flexCenter
781
+ }, !isTimerActive ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
782
+ style: [styles.paymentWaitIcon, {
783
+ marginBottom: 20
784
+ }]
785
+ }, /*#__PURE__*/_react.default.createElement(_MaterialCommunityIcons.default, {
786
+ size: 64,
787
+ name: "clock-time-nine-outline",
788
+ color: "#3D445C"
789
+ })) : /*#__PURE__*/_react.default.createElement(_reactNativePaper.ActivityIndicator, {
790
+ size: "large",
791
+ color: "#3D445C",
792
+ style: {
793
+ marginBottom: 20
794
+ }
795
+ }), /*#__PURE__*/_react.default.createElement(_Timer.Timer, {
796
+ onTimerEnd: () => {
797
+ setIsTimerActive(false);
798
+ props.setBackDisable(false);
799
+ },
800
+ ref: timerRef,
801
+ timer: paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext16 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext16 === void 0 || (_paymentConfigContext16 = _paymentConfigContext16.etConfig) === null || _paymentConfigContext16 === void 0 ? void 0 : _paymentConfigContext16.goBackDisableTimer
802
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
803
+ style: [_CommonStyles.CommonStyles.titleText]
804
+ }, "Waiting for payment!"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
805
+ style: [_CommonStyles.CommonStyles.subText, {
806
+ marginHorizontal: 30
807
+ }]
808
+ }, "Please wait for the customer to make the payment"))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
809
+ style: {
810
+ padding: 10,
811
+ borderWidth: 1,
812
+ borderColor: '#E0E3EB'
813
+ }
814
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
815
+ style: {
816
+ flexDirection: 'row',
817
+ marginStart: 10,
818
+ marginEnd: 10
819
+ }
820
+ }, /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
821
+ style: [_CommonStyles.CommonStyles.cancelButton, {
822
+ marginEnd: 5,
823
+ flex: 1
824
+ }],
825
+ labelStyle: {
826
+ ..._CommonStyles.CommonStyles.cancelButtonLabel,
827
+ color: '#5B80F7',
828
+ textTransform: 'capitalize',
829
+ fontSize: 11
830
+ },
831
+ mode: 'outlined',
832
+ onPress: () => sendPaymentLink('RESEND_LINK')
833
+ }, "Resend Payment Link"), /*#__PURE__*/_react.default.createElement(_reactNativePaper.Button, {
834
+ style: [_CommonStyles.CommonStyles.nextButton, {
835
+ marginEnd: 5,
836
+ flex: 1
837
+ }, disableStatusBtn ? {
838
+ backgroundColor: '#E0E3EB'
839
+ } : {}],
840
+ labelStyle: [_CommonStyles.CommonStyles.nextButtonLabel, {
841
+ textTransform: 'capitalize'
842
+ }, disableStatusBtn ? {
843
+ color: '#A3AAC2'
844
+ } : {}],
845
+ mode: 'outlined',
846
+ onPress: checkStatus,
847
+ disabled: disableStatusBtn
848
+ }, disableStatusBtn ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, 'Check Status (', /*#__PURE__*/_react.default.createElement(_Timer.Timer, {
849
+ ref: statusTimerRef,
850
+ singleValue: true,
851
+ timer: 5,
852
+ onTimerEnd: () => setDisableStatusBtn(false)
853
+ }), ' sec)') : 'Check Status')))));
854
+ };
855
+ const modalStyles = _reactNative.StyleSheet.create({
856
+ modalContent: {
857
+ marginStart: 55,
858
+ marginEnd: 55,
859
+ marginBottom: 60,
860
+ flex: 1
861
+ },
862
+ modalView: {
863
+ backgroundColor: 'white',
864
+ padding: 15,
865
+ borderRadius: 9
866
+ },
867
+ titleText: {
868
+ justifyContent: 'center',
869
+ fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_600SemiBold : 'IBMPlexSans-SemiBold',
870
+ fontStyle: 'normal',
871
+ fontSize: 14,
872
+ lineHeight: 20,
873
+ textAlign: 'center',
874
+ color: '#111111',
875
+ marginBottom: 10
876
+ },
877
+ subTitleText: {
878
+ justifyContent: 'center',
879
+ fontFamily: _reactNative.Platform.OS === 'android' ? _CommonStyles.Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
880
+ fontStyle: 'normal',
881
+ fontSize: 14,
882
+ lineHeight: 20,
883
+ color: '#000000',
884
+ marginBottom: 10
885
+ }
886
+ });
887
+ //# sourceMappingURL=ProcessPayment.js.map