@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.
- package/README.md +122 -11
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js +1 -1
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +9 -10
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +16 -6
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +8 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +8 -10
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +2 -2
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js +40 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +35 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +102 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +151 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +188 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +442 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +538 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +887 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +14 -20
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +24 -27
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +2 -3
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +9 -3
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +2 -2
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +13 -14
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +2 -2
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +11 -12
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +3 -3
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +2 -2
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +11 -13
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +11 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +2 -2
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +5 -6
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +2 -2
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +14 -20
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +18 -24
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -6
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -2
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +2 -4
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +3 -6
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +14 -8
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +2 -2
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +1 -2
- package/lib/commonjs/components/widgets/Card.js.map +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +20 -23
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
- package/lib/commonjs/components/widgets/ModalWidget.js +3 -1
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +3 -3
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +22 -21
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +10 -11
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
- package/lib/commonjs/components/widgets/Timer.js +40 -0
- package/lib/commonjs/components/widgets/Timer.js.map +1 -0
- package/lib/commonjs/constants/apiConstants.js +4 -1
- package/lib/commonjs/constants/apiConstants.js.map +1 -1
- package/lib/commonjs/constants/constants.js +4 -1
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -3
- package/lib/commonjs/events/EventDispatcher.js +5 -1
- package/lib/commonjs/events/EventDispatcher.js.map +1 -1
- package/lib/commonjs/events/constants.js +2 -1
- package/lib/commonjs/events/constants.js.map +1 -1
- package/lib/commonjs/events/index.js +1 -1
- package/lib/commonjs/events/index.js.map +1 -1
- package/lib/commonjs/events/interface.js.map +1 -1
- package/lib/commonjs/icons/CircleMark.js +27 -0
- package/lib/commonjs/icons/CircleMark.js.map +1 -0
- package/lib/commonjs/icons/FailedIcon.js +69 -0
- package/lib/commonjs/icons/FailedIcon.js.map +1 -0
- package/lib/commonjs/icons/FailureCloseIcon.js +42 -0
- package/lib/commonjs/icons/FailureCloseIcon.js.map +1 -0
- package/lib/commonjs/icons/ScanIcon.js +1 -1
- package/lib/commonjs/icons/ScanIcon.js.map +1 -1
- package/lib/commonjs/icons/SuccessCompleteIcon.js +42 -0
- package/lib/commonjs/icons/SuccessCompleteIcon.js.map +1 -0
- package/lib/commonjs/icons/file.js +1 -1
- package/lib/commonjs/icons/file.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/i18n.js +1 -1
- package/lib/commonjs/locale/i18n.js.map +1 -1
- package/lib/commonjs/locale/util.js +1 -1
- package/lib/commonjs/locale/util.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +11 -9
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +7 -7
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +6 -6
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -8
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -6
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +4 -4
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +7 -7
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +2 -2
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +2 -2
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +6 -6
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +8 -16
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +6 -7
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +7 -8
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +5 -9
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +3 -0
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +5 -5
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +15 -19
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +30 -3
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +2 -5
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +5 -5
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -4
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +4 -4
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +13 -3
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +7 -8
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +8 -9
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js +251 -0
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +7 -8
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +8 -9
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +8 -9
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +8 -9
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -11
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +8 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +8 -9
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +8 -9
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +7 -8
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +8 -9
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +9 -9
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +8 -9
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +8 -10
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +13 -9
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +8 -9
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +3 -3
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +2 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +3 -1
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/ExecTaskUtils.js +35 -5
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +6 -7
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +4 -4
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -2
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +3 -3
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/context/paymentContext.js +9 -0
- package/lib/commonjs/utils/context/paymentContext.js.map +1 -0
- package/lib/commonjs/utils/fcm/FCM.js +22 -4
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +12 -2
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +6 -6
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +4 -3
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
- package/lib/commonjs/utils/loginHelper.js +1 -1
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +11 -17
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +2 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +7 -8
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +14 -4
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +2 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +6 -8
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/CollectPayment.js +32 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +29 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +96 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +132 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +179 -0
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
- package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +433 -0
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +531 -0
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +880 -0
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +13 -19
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +21 -24
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +0 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +6 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +11 -12
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +9 -10
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js +11 -2
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +15 -21
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +2 -4
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js +11 -6
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/module/components/widgets/Card.js +0 -1
- package/lib/module/components/widgets/Card.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +19 -22
- package/lib/module/components/widgets/IconButton.js.map +1 -1
- package/lib/module/components/widgets/ModalWidget.js +1 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js +2 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +21 -20
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +9 -10
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/module/components/widgets/Timer.js +32 -0
- package/lib/module/components/widgets/Timer.js.map +1 -0
- package/lib/module/constants/apiConstants.js +4 -1
- package/lib/module/constants/apiConstants.js.map +1 -1
- package/lib/module/constants/constants.js +3 -0
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -3
- package/lib/module/events/EventDispatcher.js +3 -0
- package/lib/module/events/EventDispatcher.js.map +1 -1
- package/lib/module/events/constants.js +2 -1
- package/lib/module/events/constants.js.map +1 -1
- package/lib/module/events/interface.js.map +1 -1
- package/lib/module/icons/CircleMark.js +20 -0
- package/lib/module/icons/CircleMark.js.map +1 -0
- package/lib/module/icons/FailedIcon.js +62 -0
- package/lib/module/icons/FailedIcon.js.map +1 -0
- package/lib/module/icons/FailureCloseIcon.js +35 -0
- package/lib/module/icons/FailureCloseIcon.js.map +1 -0
- package/lib/module/icons/SuccessCompleteIcon.js +35 -0
- package/lib/module/icons/SuccessCompleteIcon.js.map +1 -0
- package/lib/module/manager/dispatch/DispatchStateContainer.js +10 -8
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +5 -5
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +5 -5
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +5 -5
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +5 -5
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +5 -5
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +6 -6
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +5 -5
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +3 -3
- package/lib/module/manager/syncmanager/AppSyncManager.js +5 -5
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +1 -0
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +5 -5
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +6 -14
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +5 -6
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +5 -6
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +3 -7
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +3 -0
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +4 -4
- package/lib/module/network/GraphQLClient.js +14 -18
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +29 -2
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +1 -4
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +4 -4
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/resources/Login.js +3 -3
- package/lib/module/resources/network.js +3 -3
- package/lib/module/styles/executionTasks/CommonStyles.js +12 -2
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +5 -6
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +6 -7
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CollectPaymentScreen.js +244 -0
- package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -0
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +6 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +6 -7
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +6 -7
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +41 -10
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +2 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +6 -7
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +6 -7
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +6 -7
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +6 -7
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +7 -7
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +6 -7
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +6 -8
- package/lib/module/ui/screens/ScanScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +11 -7
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +6 -7
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +2 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +2 -0
- package/lib/module/utils/ApiUtils.js.map +1 -1
- package/lib/module/utils/ExecTaskUtils.js +31 -4
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +5 -6
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -3
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +1 -1
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/context/paymentContext.js +3 -0
- package/lib/module/utils/context/paymentContext.js.map +1 -0
- package/lib/module/utils/fcm/FCM.js +20 -2
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +10 -0
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +5 -5
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +2 -1
- package/lib/module/utils/hooks/useModal.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js.map +1 -1
- package/lib/module/utils/storage.js +9 -15
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +1 -2
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +4 -2
- package/lib/typescript/components/executiontasks/collectPayment/CollectPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +155 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +92 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +16 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/CompletePayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/InitPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/ProcessPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +1 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +3 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +3 -2
- package/lib/typescript/components/widgets/Timer.d.ts +7 -0
- package/lib/typescript/constants/apiConstants.d.ts +3 -0
- package/lib/typescript/constants/constants.d.ts +3 -0
- package/lib/typescript/events/EventDispatcher.d.ts +1 -0
- package/lib/typescript/events/constants.d.ts +1 -0
- package/lib/typescript/events/interface.d.ts +1 -1
- package/lib/typescript/icons/CircleMark.d.ts +3 -0
- package/lib/typescript/icons/FailedIcon.d.ts +4 -0
- package/lib/typescript/icons/FailureCloseIcon.d.ts +4 -0
- package/lib/typescript/icons/SuccessCompleteIcon.d.ts +4 -0
- package/lib/typescript/models/DispatchModels.d.ts +11 -0
- package/lib/typescript/models/execTasks/ETConfig.d.ts +6 -3
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/network/NetworkClient.d.ts +3 -1
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +10 -1
- package/lib/typescript/ui/screens/CollectPaymentScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +2 -1
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +1 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +2 -0
- package/lib/typescript/utils/context/paymentContext.d.ts +7 -0
- package/package.json +6 -5
- package/src/components/dispatch/DispatchExecNavigator.tsx +14 -0
- package/src/components/executiontasks/ExecutionTasksIndex.ts +8 -0
- package/src/components/executiontasks/collectPayment/CollectPayment.tsx +60 -0
- package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +182 -0
- package/src/components/executiontasks/collectPayment/PaymentStyles.ts +102 -0
- package/src/components/executiontasks/collectPayment/PaymentUtils.ts +200 -0
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +273 -0
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +658 -0
- package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +790 -0
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +1352 -0
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +132 -60
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +35 -12
- package/src/components/executiontasks/payments/PaymentUtils.ts +10 -2
- package/src/components/executiontasks/pickup/SLPickupET.tsx +6 -3
- package/src/components/executiontasks/scan/ScanET.tsx +1 -1
- package/src/components/executiontasks/scan/interfaces.ts +1 -1
- package/src/components/executiontasks/scan/utils.ts +16 -8
- package/src/components/widgets/ModalWidget.tsx +26 -8
- package/src/components/widgets/ProgressDialog.tsx +23 -3
- package/src/components/widgets/SnackBarCustom.tsx +8 -1
- package/src/components/widgets/SplitTextInput.tsx +1 -1
- package/src/components/widgets/Timer.tsx +53 -0
- package/src/constants/apiConstants.ts +3 -0
- package/src/constants/constants.ts +3 -0
- package/src/events/EventDispatcher.ts +4 -0
- package/src/events/constants.ts +1 -0
- package/src/events/interface.ts +7 -1
- package/src/icons/CircleMark.tsx +18 -0
- package/src/icons/FailedIcon.tsx +80 -0
- package/src/icons/FailureCloseIcon.tsx +35 -0
- package/src/icons/SuccessCompleteIcon.tsx +35 -0
- package/src/manager/dispatch/DispatchStateContainer.tsx +6 -4
- package/src/manager/sdk/DispatchSDKManager.ts +1 -0
- package/src/models/DispatchModels.ts +12 -0
- package/src/models/execTasks/ETConfig.ts +3 -0
- package/src/models/sdk.ts +13 -0
- package/src/network/NetworkClient.ts +34 -1
- package/src/network/client.ts +1 -0
- package/src/styles/executionTasks/CommonStyles.ts +32 -8
- package/src/ui/screens/CollectPaymentScreen.tsx +315 -0
- package/src/ui/screens/DropCashScreen.tsx +49 -2
- package/src/ui/screens/ETScreensIndex.ts +2 -0
- package/src/ui/screens/PaymentScreen.tsx +1 -0
- package/src/ui/screens/StartWorkFlowScreen.tsx +15 -0
- package/src/ui/uiConfig/RouteParams.ts +8 -1
- package/src/utils/ApiUtils.ts +1 -0
- package/src/utils/ExecTaskUtils.ts +44 -3
- package/src/utils/SyncManagerUtils.ts +1 -0
- package/src/utils/context/paymentContext.ts +8 -0
- package/src/utils/fcm/FCM.ts +30 -0
- package/src/utils/fcm/FcmUtils.ts +53 -29
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/kotlinc.xml +0 -6
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/other.xml +0 -263
- package/android/.idea/vcs.xml +0 -6
- package/lib/commonjs/icons/circleMark.svg +0 -3
- package/lib/module/icons/circleMark.svg +0 -3
- package/src/icons/circleMark.svg +0 -3
- /package/{android/.gradle/6.8/gc.properties → lib/typescript/components/executiontasks/collectPayment/components/CustomContactsModal.d.ts} +0 -0
- /package/{android/.gradle/7.5/dependencies-accessors/gc.properties → src/components/executiontasks/collectPayment/components/CustomContactsModal.tsx} +0 -0
|
@@ -0,0 +1,658 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
3
|
+
import React, { useEffect, useState, useLayoutEffect, useContext } from 'react';
|
|
4
|
+
import { FlatList, Platform, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { isEmptyOrBlank } from '../../../../utils/utils';
|
|
6
|
+
import {
|
|
7
|
+
PAYMENT_SHARED_PREF_KEY,
|
|
8
|
+
getPaymentDataMO,
|
|
9
|
+
getPaymentType,
|
|
10
|
+
removeSharedPrefPaymentData,
|
|
11
|
+
} from '../PaymentUtils';
|
|
12
|
+
import { getBaseETResponse } from '../../../../utils/ExecTaskUtils';
|
|
13
|
+
import {
|
|
14
|
+
EntityCode,
|
|
15
|
+
ExecutionTaskID,
|
|
16
|
+
} from '../../../../models/execTasks/ETConfig';
|
|
17
|
+
import { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';
|
|
18
|
+
import { PaymentStyles } from '../PaymentStyles';
|
|
19
|
+
import {
|
|
20
|
+
CommonStyles,
|
|
21
|
+
Fonts,
|
|
22
|
+
} from '../../../../styles/executionTasks/CommonStyles';
|
|
23
|
+
import { showToast } from '../../../widgets/Toaster';
|
|
24
|
+
import { Button, Provider, RadioButton } from 'react-native-paper';
|
|
25
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
26
|
+
import {
|
|
27
|
+
GO_BACK_EVENT_CODE,
|
|
28
|
+
PAYMENT_NOTIFICATION,
|
|
29
|
+
} from '../../../../constants/constants';
|
|
30
|
+
import { hasGoBackConnector } from '../../../../components/utils';
|
|
31
|
+
import GoBackModal from '../../../../components/widgets/GoBackModal';
|
|
32
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
33
|
+
import { BackHandler } from 'react-native';
|
|
34
|
+
import ProgressDialog from '../../../../components/widgets/ProgressDialog';
|
|
35
|
+
import EventListener from '../../../../events';
|
|
36
|
+
import {
|
|
37
|
+
AllowedModes,
|
|
38
|
+
CollectPaymentInput,
|
|
39
|
+
PAYMENT_SCREEN,
|
|
40
|
+
PaymentStatusResponse,
|
|
41
|
+
STATUS,
|
|
42
|
+
SUB_STATUS,
|
|
43
|
+
TRANSACTION_TYPE,
|
|
44
|
+
notificationPaymentStatus,
|
|
45
|
+
sharedPrefPaymentDataInterface,
|
|
46
|
+
} from '../CollectPaymentSchema';
|
|
47
|
+
import Storage from '../../../../utils/storage';
|
|
48
|
+
import { PaymentContext } from '../../../../utils/context/paymentContext';
|
|
49
|
+
import { ENDPOINTS } from '../../../../constants/apiConstants';
|
|
50
|
+
import { RouteParams } from '../../../../ui/uiConfig/RouteParams';
|
|
51
|
+
import Logger, { LOG_TYPE } from '../../../../utils/Logger';
|
|
52
|
+
|
|
53
|
+
const styles = PaymentStyles;
|
|
54
|
+
let storage = Storage.getInstance();
|
|
55
|
+
|
|
56
|
+
const InitPayment = (props: CollectPaymentInput) => {
|
|
57
|
+
const paymentConfigContext = useContext(PaymentContext);
|
|
58
|
+
const [paymentStatus, setPaymentStatus] = useState<
|
|
59
|
+
PaymentStatusResponse | null | undefined
|
|
60
|
+
>(null);
|
|
61
|
+
const [paymentMode, setPaymentMode] = useState<AllowedModes>(
|
|
62
|
+
props.allowedModes[0]
|
|
63
|
+
);
|
|
64
|
+
const [disableNext, setDisableNext] = useState(false);
|
|
65
|
+
const [showBackModal, setShowBackModal] = useState(false);
|
|
66
|
+
const paymentRefId =
|
|
67
|
+
props.route.params[RouteParams.ROOT_META_DATA].paymentConfig?.paymentRefId;
|
|
68
|
+
|
|
69
|
+
const handleOnProceedClick = async () => {
|
|
70
|
+
if (!isEmptyOrBlank(paymentMode)) {
|
|
71
|
+
setDisableNext(true);
|
|
72
|
+
props.next({
|
|
73
|
+
paymentMode: paymentMode,
|
|
74
|
+
refId: paymentRefId,
|
|
75
|
+
...(await getBaseETResponse(
|
|
76
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
77
|
+
true,
|
|
78
|
+
getEventCodeByET(
|
|
79
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET,
|
|
80
|
+
true,
|
|
81
|
+
props.applicableReasons?.success
|
|
82
|
+
),
|
|
83
|
+
'',
|
|
84
|
+
props.mergedObjectiveId,
|
|
85
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
86
|
+
)),
|
|
87
|
+
screen:
|
|
88
|
+
paymentMode === 'QR_CODE'
|
|
89
|
+
? PAYMENT_SCREEN.PROCESS
|
|
90
|
+
: paymentMode === 'PAYMENT_LINK'
|
|
91
|
+
? PAYMENT_SCREEN.CONTACTS
|
|
92
|
+
: PAYMENT_SCREEN.COMPLETE,
|
|
93
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
94
|
+
collectedAmount: {
|
|
95
|
+
value: props.expectedAmount,
|
|
96
|
+
currencyCode:
|
|
97
|
+
paymentConfigContext?.sdkConfig?.etConfig?.currencyCode || '',
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
} else showToast('No payment mode selected');
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const handleOnCancelClick = async () => {
|
|
104
|
+
props.onSubmitET({
|
|
105
|
+
paymentMode: paymentMode,
|
|
106
|
+
refId: paymentRefId,
|
|
107
|
+
...(await getBaseETResponse(
|
|
108
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
109
|
+
false,
|
|
110
|
+
getEventCodeByET(
|
|
111
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET,
|
|
112
|
+
false,
|
|
113
|
+
props.applicableReasons?.failure
|
|
114
|
+
),
|
|
115
|
+
'',
|
|
116
|
+
props.mergedObjectiveId,
|
|
117
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
118
|
+
)),
|
|
119
|
+
collectedAmount: {
|
|
120
|
+
value: props.expectedAmount,
|
|
121
|
+
currencyCode:
|
|
122
|
+
paymentConfigContext?.sdkConfig?.etConfig?.currencyCode || '',
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const getPaymentStatus = async (isProceed: boolean | null) => {
|
|
128
|
+
try {
|
|
129
|
+
let sharedPrefPaymentData: sharedPrefPaymentDataInterface | null = null;
|
|
130
|
+
const paymentResp =
|
|
131
|
+
await paymentConfigContext?.networkInstance.requestGet(
|
|
132
|
+
ENDPOINTS.PAYMENT_STATUS + paymentRefId,
|
|
133
|
+
{
|
|
134
|
+
requestId: 'payment:' + paymentRefId,
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
appAbbr: paymentConfigContext.sdkConfig.etConfig.appAbbr,
|
|
138
|
+
latest: true,
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
// const paymentResp = {
|
|
142
|
+
// data: {
|
|
143
|
+
// data: {
|
|
144
|
+
// meta: { totalCount: 1 },
|
|
145
|
+
// transactions: [
|
|
146
|
+
// {
|
|
147
|
+
// refId: paymentRefId,
|
|
148
|
+
// status: STATUS.FAILED,
|
|
149
|
+
// subStatus: SUB_STATUS.completed,
|
|
150
|
+
// money: {
|
|
151
|
+
// amount: 1000,
|
|
152
|
+
// currency: 'INR',
|
|
153
|
+
// },
|
|
154
|
+
// txnId: '123',
|
|
155
|
+
// txnType: TRANSACTION_TYPE.LINK,
|
|
156
|
+
// appAbbr: 'testApp31',
|
|
157
|
+
// },
|
|
158
|
+
// ],
|
|
159
|
+
// },
|
|
160
|
+
// },
|
|
161
|
+
// };
|
|
162
|
+
const _ps: PaymentStatusResponse = paymentResp?.data;
|
|
163
|
+
console.log('INIT getPaymentStatus _ps: ', JSON.stringify(_ps));
|
|
164
|
+
|
|
165
|
+
sharedPrefPaymentData = await getPaymentDataMO(
|
|
166
|
+
props.mergedObjectiveId,
|
|
167
|
+
paymentRefId,
|
|
168
|
+
storage
|
|
169
|
+
);
|
|
170
|
+
/**
|
|
171
|
+
* TBD: For first time INIT Screen rendering, no data in shared Pref, meaning the payment was not initiated from mobile.
|
|
172
|
+
* For next time init screen rendering, refId should be associated with a MergedObjectiveId, if not then the payment won't be considered.
|
|
173
|
+
*/
|
|
174
|
+
if (
|
|
175
|
+
_ps?.data.transactions?.length &&
|
|
176
|
+
(sharedPrefPaymentData ||
|
|
177
|
+
getPaymentType(_ps?.data.transactions[0].txnType)) &&
|
|
178
|
+
_ps.data.meta?.totalCount &&
|
|
179
|
+
_ps?.data.transactions[0].status === STATUS.SUCCESS
|
|
180
|
+
) {
|
|
181
|
+
props.next({
|
|
182
|
+
paymentMode:
|
|
183
|
+
sharedPrefPaymentData?.paymentMode ||
|
|
184
|
+
getPaymentType(_ps?.data.transactions[0].txnType) ||
|
|
185
|
+
paymentMode,
|
|
186
|
+
collectedAmount: {
|
|
187
|
+
value:
|
|
188
|
+
sharedPrefPaymentData?.amount.value ||
|
|
189
|
+
_ps?.data.transactions[0].money.amount ||
|
|
190
|
+
props.expectedAmount,
|
|
191
|
+
currencyCode:
|
|
192
|
+
sharedPrefPaymentData?.amount.currencyCode ||
|
|
193
|
+
_ps?.data.transactions[0].money.currency ||
|
|
194
|
+
paymentConfigContext?.sdkConfig?.etConfig?.currencyCode ||
|
|
195
|
+
'',
|
|
196
|
+
},
|
|
197
|
+
refId: _ps.data.transactions[0].refId,
|
|
198
|
+
screen: PAYMENT_SCREEN.COMPLETE,
|
|
199
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
200
|
+
...(await getBaseETResponse(
|
|
201
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
202
|
+
true,
|
|
203
|
+
getEventCodeByET(
|
|
204
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET,
|
|
205
|
+
true,
|
|
206
|
+
props.applicableReasons?.success
|
|
207
|
+
),
|
|
208
|
+
'',
|
|
209
|
+
props.mergedObjectiveId,
|
|
210
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
211
|
+
)),
|
|
212
|
+
});
|
|
213
|
+
setPaymentStatus(_ps);
|
|
214
|
+
return;
|
|
215
|
+
} else if (
|
|
216
|
+
sharedPrefPaymentData &&
|
|
217
|
+
_ps.data.meta?.totalCount &&
|
|
218
|
+
_ps?.data.transactions?.length &&
|
|
219
|
+
_ps?.data.transactions[0].status === STATUS.FAILED
|
|
220
|
+
) {
|
|
221
|
+
/* const _sharedPrefPaymentData = JSON.parse(
|
|
222
|
+
JSON.stringify(sharedPrefPaymentData)
|
|
223
|
+
); */
|
|
224
|
+
await removeSharedPrefPaymentData(paymentRefId, storage);
|
|
225
|
+
/* await storage.removeSharedItems(
|
|
226
|
+
props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
|
|
227
|
+
); */
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (isProceed) await handleOnProceedClick();
|
|
231
|
+
else if (isProceed === false) await handleOnCancelClick();
|
|
232
|
+
setPaymentStatus(_ps);
|
|
233
|
+
} catch (err: any) {
|
|
234
|
+
Logger.getInstance().logEvent(
|
|
235
|
+
'~ getPaymentStatus triggered ',
|
|
236
|
+
JSON.stringify(err?.response?.data || err),
|
|
237
|
+
LOG_TYPE.SDK_ERROR
|
|
238
|
+
);
|
|
239
|
+
console.error('STATUS: ', err?.response?.data || err.message);
|
|
240
|
+
if (isProceed) await handleOnProceedClick();
|
|
241
|
+
else if (isProceed === false) await handleOnCancelClick();
|
|
242
|
+
setPaymentStatus(undefined);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
useEffect(() => {
|
|
247
|
+
(async () => {
|
|
248
|
+
await getPaymentStatus(null);
|
|
249
|
+
// setPaymentStatus(false); // FOR TESTING payment status on click
|
|
250
|
+
})();
|
|
251
|
+
|
|
252
|
+
EventListener.on(
|
|
253
|
+
PAYMENT_NOTIFICATION,
|
|
254
|
+
async (data: notificationPaymentStatus) => {
|
|
255
|
+
console.log('InitPayment:', JSON.stringify(data));
|
|
256
|
+
let sharedPrefPaymentData: sharedPrefPaymentDataInterface | null = null;
|
|
257
|
+
if (
|
|
258
|
+
data &&
|
|
259
|
+
(data.status === STATUS.SUCCESS || data.status === STATUS.FAILED)
|
|
260
|
+
) {
|
|
261
|
+
sharedPrefPaymentData = await getPaymentDataMO(
|
|
262
|
+
props.mergedObjectiveId,
|
|
263
|
+
data.refId,
|
|
264
|
+
storage
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
if (sharedPrefPaymentData && data && data.status === STATUS.SUCCESS) {
|
|
268
|
+
props.next({
|
|
269
|
+
paymentMode: sharedPrefPaymentData?.paymentMode || paymentMode,
|
|
270
|
+
collectedAmount: {
|
|
271
|
+
value:
|
|
272
|
+
sharedPrefPaymentData?.amount.value || props.expectedAmount,
|
|
273
|
+
currencyCode:
|
|
274
|
+
sharedPrefPaymentData?.amount.currencyCode ||
|
|
275
|
+
paymentConfigContext?.sdkConfig?.etConfig?.currencyCode ||
|
|
276
|
+
'',
|
|
277
|
+
},
|
|
278
|
+
refId: data.refId,
|
|
279
|
+
screen: PAYMENT_SCREEN.COMPLETE,
|
|
280
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
281
|
+
...(await getBaseETResponse(
|
|
282
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
283
|
+
true,
|
|
284
|
+
getEventCodeByET(
|
|
285
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET,
|
|
286
|
+
true,
|
|
287
|
+
props.applicableReasons?.success
|
|
288
|
+
),
|
|
289
|
+
'',
|
|
290
|
+
props.mergedObjectiveId,
|
|
291
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
292
|
+
)),
|
|
293
|
+
});
|
|
294
|
+
} else if (
|
|
295
|
+
sharedPrefPaymentData &&
|
|
296
|
+
data &&
|
|
297
|
+
data.status === STATUS.FAILED /* &&
|
|
298
|
+
props.sourceScreen !== 'COMPLETE' */
|
|
299
|
+
) {
|
|
300
|
+
/* const _sharedPrefPaymentData = JSON.parse(
|
|
301
|
+
JSON.stringify(sharedPrefPaymentData)
|
|
302
|
+
); */
|
|
303
|
+
/* await storage.removeSharedItems(
|
|
304
|
+
props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
|
|
305
|
+
); */
|
|
306
|
+
await removeSharedPrefPaymentData(data.refId, storage);
|
|
307
|
+
/* props.next({
|
|
308
|
+
paymentMode: _sharedPrefPaymentData?.paymentMode || paymentMode,
|
|
309
|
+
collectedAmount: {
|
|
310
|
+
value: data.amount,
|
|
311
|
+
currencyCode:
|
|
312
|
+
_sharedPrefPaymentData?.amount.currencyCode ||
|
|
313
|
+
props.amount.currencyCode,
|
|
314
|
+
minorUnit:
|
|
315
|
+
_sharedPrefPaymentData?.amount.minorUnit ||
|
|
316
|
+
props.amount.minorUnit,
|
|
317
|
+
},
|
|
318
|
+
txnId: data.txnId,
|
|
319
|
+
refId: data.refId,
|
|
320
|
+
transactionSuccess: false,
|
|
321
|
+
screen: PAYMENT_SCREEN.COMPLETE,
|
|
322
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
323
|
+
...(await getBaseETResponse(
|
|
324
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
325
|
+
false,
|
|
326
|
+
getEventCodeByET(
|
|
327
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET,
|
|
328
|
+
false,
|
|
329
|
+
props.applicableReasons?.failure
|
|
330
|
+
),
|
|
331
|
+
'',
|
|
332
|
+
props.mergedObjectiveId,
|
|
333
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
334
|
+
)),
|
|
335
|
+
}); */
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
);
|
|
339
|
+
return () => EventListener.remove(PAYMENT_NOTIFICATION);
|
|
340
|
+
}, []);
|
|
341
|
+
|
|
342
|
+
// Handle back-button click
|
|
343
|
+
useFocusEffect(
|
|
344
|
+
React.useCallback(() => {
|
|
345
|
+
const onBackPress = async () => {
|
|
346
|
+
let sharedPref = null;
|
|
347
|
+
// (async () => {
|
|
348
|
+
sharedPref = await storage.getSharedItem(
|
|
349
|
+
PAYMENT_SHARED_PREF_KEY + paymentRefId
|
|
350
|
+
);
|
|
351
|
+
// })();
|
|
352
|
+
|
|
353
|
+
const paymentInProgress =
|
|
354
|
+
/* props.mergedObjectiveId.some(
|
|
355
|
+
async (moId) =>
|
|
356
|
+
await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + moId)
|
|
357
|
+
) */ sharedPref || false;
|
|
358
|
+
if (
|
|
359
|
+
props.taskMeta?.enableGoBack &&
|
|
360
|
+
hasGoBackConnector(props.applicableReasons) &&
|
|
361
|
+
!paymentInProgress
|
|
362
|
+
) {
|
|
363
|
+
setShowBackModal(true);
|
|
364
|
+
return true;
|
|
365
|
+
} else {
|
|
366
|
+
props.navigation.goBack();
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
BackHandler.addEventListener('hardwareBackPress', () => {
|
|
371
|
+
onBackPress();
|
|
372
|
+
return true;
|
|
373
|
+
});
|
|
374
|
+
return () =>
|
|
375
|
+
BackHandler.removeEventListener('hardwareBackPress', () => {
|
|
376
|
+
onBackPress();
|
|
377
|
+
return true;
|
|
378
|
+
});
|
|
379
|
+
}, [])
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
useLayoutEffect(() => {
|
|
383
|
+
props.navigation.setOptions({
|
|
384
|
+
headerShown: true,
|
|
385
|
+
title: 'Choose Payment Method',
|
|
386
|
+
headerLeft: () => {
|
|
387
|
+
return (
|
|
388
|
+
<Icon
|
|
389
|
+
onPress={async () => {
|
|
390
|
+
const sharedPref = await storage.getSharedItem(
|
|
391
|
+
PAYMENT_SHARED_PREF_KEY + paymentRefId
|
|
392
|
+
);
|
|
393
|
+
const paymentInProgress =
|
|
394
|
+
/* props.mergedObjectiveId.some(
|
|
395
|
+
async (moId) =>
|
|
396
|
+
await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + moId)
|
|
397
|
+
) */ sharedPref || false;
|
|
398
|
+
|
|
399
|
+
if (
|
|
400
|
+
props.taskMeta?.enableGoBack &&
|
|
401
|
+
hasGoBackConnector(props.applicableReasons) &&
|
|
402
|
+
!paymentInProgress
|
|
403
|
+
)
|
|
404
|
+
setShowBackModal(true);
|
|
405
|
+
else props.navigation.goBack();
|
|
406
|
+
}}
|
|
407
|
+
name="arrow-back"
|
|
408
|
+
color={'black'}
|
|
409
|
+
size={25}
|
|
410
|
+
style={{
|
|
411
|
+
paddingRight: 15,
|
|
412
|
+
paddingTop: 5,
|
|
413
|
+
}}
|
|
414
|
+
/>
|
|
415
|
+
);
|
|
416
|
+
},
|
|
417
|
+
});
|
|
418
|
+
}, [props.navigation]);
|
|
419
|
+
|
|
420
|
+
useEffect(() => {
|
|
421
|
+
if (props.allowedModes && props.allowedModes.length > 0) {
|
|
422
|
+
setPaymentMode(props.allowedModes[0]);
|
|
423
|
+
}
|
|
424
|
+
}, [props.allowedModes]);
|
|
425
|
+
|
|
426
|
+
const renderModal = () => {
|
|
427
|
+
return (
|
|
428
|
+
<GoBackModal
|
|
429
|
+
showModal={showBackModal}
|
|
430
|
+
setShowModal={setShowBackModal}
|
|
431
|
+
onSuccess={async () => {
|
|
432
|
+
props.onSubmitET({
|
|
433
|
+
collectedAmount: {
|
|
434
|
+
value: props.expectedAmount,
|
|
435
|
+
currencyCode:
|
|
436
|
+
paymentConfigContext?.sdkConfig?.etConfig?.currencyCode || '',
|
|
437
|
+
},
|
|
438
|
+
paymentMode: paymentMode,
|
|
439
|
+
refId: paymentRefId,
|
|
440
|
+
...(await getBaseETResponse(
|
|
441
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
442
|
+
false,
|
|
443
|
+
GO_BACK_EVENT_CODE,
|
|
444
|
+
'',
|
|
445
|
+
props.mergedObjectiveId,
|
|
446
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
447
|
+
)),
|
|
448
|
+
});
|
|
449
|
+
setShowBackModal(false);
|
|
450
|
+
}}
|
|
451
|
+
onFailure={() => setShowBackModal(false)}
|
|
452
|
+
/>
|
|
453
|
+
);
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
const renderItem = ({ item }: { item: AllowedModes }) => {
|
|
457
|
+
return (
|
|
458
|
+
<TouchableOpacity activeOpacity={1}
|
|
459
|
+
onPress={() => {
|
|
460
|
+
setPaymentMode(item);
|
|
461
|
+
}}
|
|
462
|
+
style={[
|
|
463
|
+
styles.reasonItemStyle,
|
|
464
|
+
{ marginBottom: 4, paddingVertical: 8 },
|
|
465
|
+
]}
|
|
466
|
+
>
|
|
467
|
+
<RadioButton
|
|
468
|
+
color={'#5B80F7'}
|
|
469
|
+
value={item}
|
|
470
|
+
status={paymentMode === item ? 'checked' : 'unchecked'}
|
|
471
|
+
onPress={() => {
|
|
472
|
+
setPaymentMode(item);
|
|
473
|
+
}}
|
|
474
|
+
/>
|
|
475
|
+
<View style={{ display: 'flex', flexDirection: 'column' }}>
|
|
476
|
+
<Text
|
|
477
|
+
style={[
|
|
478
|
+
styles.reasonTextStyle,
|
|
479
|
+
{
|
|
480
|
+
fontWeight: 'bold',
|
|
481
|
+
paddingTop: 6,
|
|
482
|
+
fontSize: 14,
|
|
483
|
+
lineHeight: 20,
|
|
484
|
+
color: '#3D445C',
|
|
485
|
+
},
|
|
486
|
+
]}
|
|
487
|
+
onPress={() => {
|
|
488
|
+
setPaymentMode(item);
|
|
489
|
+
}}
|
|
490
|
+
>
|
|
491
|
+
{item === 'CASH'
|
|
492
|
+
? 'Cash'
|
|
493
|
+
: item === 'QR_CODE'
|
|
494
|
+
? 'QR Code'
|
|
495
|
+
: item === 'PAYMENT_LINK'
|
|
496
|
+
? 'Payment Link'
|
|
497
|
+
: item}
|
|
498
|
+
</Text>
|
|
499
|
+
{(item === 'QR_CODE' || item === 'PAYMENT_LINK') && (
|
|
500
|
+
<Text
|
|
501
|
+
style={[
|
|
502
|
+
styles.reasonTextStyle,
|
|
503
|
+
{
|
|
504
|
+
fontWeight: '500',
|
|
505
|
+
fontFamily: Fonts.IBMPlexSans_500Medium,
|
|
506
|
+
paddingTop: 2,
|
|
507
|
+
fontSize: 12,
|
|
508
|
+
lineHeight: 16,
|
|
509
|
+
color: '#525B7A',
|
|
510
|
+
},
|
|
511
|
+
]}
|
|
512
|
+
onPress={() => {
|
|
513
|
+
setPaymentMode(item);
|
|
514
|
+
}}
|
|
515
|
+
>
|
|
516
|
+
{item === 'QR_CODE'
|
|
517
|
+
? paymentConfigContext?.sdkConfig?.etConfig?.currencyCode ===
|
|
518
|
+
'INR'
|
|
519
|
+
? 'UPI'
|
|
520
|
+
: 'Scan to get a payment link'
|
|
521
|
+
: item === 'PAYMENT_LINK'
|
|
522
|
+
? paymentConfigContext?.sdkConfig?.etConfig?.currencyCode ===
|
|
523
|
+
'INR'
|
|
524
|
+
? props.plModes?.join(', ')
|
|
525
|
+
: 'Credit / Debit Cards, Netbanking …'
|
|
526
|
+
: ''}
|
|
527
|
+
</Text>
|
|
528
|
+
)}
|
|
529
|
+
</View>
|
|
530
|
+
</TouchableOpacity>
|
|
531
|
+
);
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
return (
|
|
535
|
+
<Provider>
|
|
536
|
+
{renderModal()}
|
|
537
|
+
{/* PAYMENT STATUS DIALOG */}
|
|
538
|
+
<ProgressDialog
|
|
539
|
+
customModalContentStyle={{ paddingVertical: 40 }}
|
|
540
|
+
visible={paymentStatus === null ? true : false}
|
|
541
|
+
label="Loading"
|
|
542
|
+
labelStyle={{
|
|
543
|
+
fontWeight: '400',
|
|
544
|
+
fontFamily:
|
|
545
|
+
Platform.OS === 'android'
|
|
546
|
+
? Fonts.IBMPlexSans_400Regular
|
|
547
|
+
: 'IBMPlexSans-Regular',
|
|
548
|
+
marginTop: 16,
|
|
549
|
+
color: '#3D445C',
|
|
550
|
+
}}
|
|
551
|
+
/>
|
|
552
|
+
{/* Payment method screen */}
|
|
553
|
+
{paymentStatus === null ? null : (
|
|
554
|
+
<View style={CommonStyles.mainContainer}>
|
|
555
|
+
<View
|
|
556
|
+
style={{
|
|
557
|
+
backgroundColor: 'white',
|
|
558
|
+
marginTop: 30,
|
|
559
|
+
}}
|
|
560
|
+
>
|
|
561
|
+
<Text
|
|
562
|
+
style={[
|
|
563
|
+
styles.amountStyle,
|
|
564
|
+
styles.textStyle1,
|
|
565
|
+
{
|
|
566
|
+
paddingTop: 0,
|
|
567
|
+
paddingBottom: 0,
|
|
568
|
+
color: '#3D445C',
|
|
569
|
+
margin: 0,
|
|
570
|
+
fontSize: 16,
|
|
571
|
+
},
|
|
572
|
+
]}
|
|
573
|
+
>
|
|
574
|
+
Collect at Delivery
|
|
575
|
+
</Text>
|
|
576
|
+
<Text style={[styles.amountStyle, { paddingTop: 0, fontSize: 24 }]}>
|
|
577
|
+
{paymentConfigContext?.sdkConfig?.etConfig?.currencyCode +
|
|
578
|
+
' ' +
|
|
579
|
+
props.expectedAmount}
|
|
580
|
+
</Text>
|
|
581
|
+
</View>
|
|
582
|
+
<Text style={[styles.textStyle1, { paddingBottom: 12 }]}>
|
|
583
|
+
{'Select a payment option'.toUpperCase()}
|
|
584
|
+
</Text>
|
|
585
|
+
<View style={{ flex: 1 }}>
|
|
586
|
+
<FlatList
|
|
587
|
+
data={props.allowedModes}
|
|
588
|
+
renderItem={renderItem}
|
|
589
|
+
keyExtractor={(item) => item}
|
|
590
|
+
/>
|
|
591
|
+
</View>
|
|
592
|
+
<View
|
|
593
|
+
style={{
|
|
594
|
+
justifyContent: 'flex-end',
|
|
595
|
+
// marginBottom: 10,
|
|
596
|
+
padding: 16,
|
|
597
|
+
// paddingTop: 10,
|
|
598
|
+
borderTopWidth: 1,
|
|
599
|
+
borderTopColor: '#E0E3EB',
|
|
600
|
+
elevation: 0.5,
|
|
601
|
+
}}
|
|
602
|
+
>
|
|
603
|
+
<View
|
|
604
|
+
style={{
|
|
605
|
+
flexDirection: 'row',
|
|
606
|
+
// marginStart: 10,
|
|
607
|
+
// marginEnd: 10,
|
|
608
|
+
}}
|
|
609
|
+
>
|
|
610
|
+
<Button
|
|
611
|
+
style={[
|
|
612
|
+
CommonStyles.cancelButton,
|
|
613
|
+
{
|
|
614
|
+
marginEnd: 5,
|
|
615
|
+
flex: 1,
|
|
616
|
+
},
|
|
617
|
+
]}
|
|
618
|
+
labelStyle={{
|
|
619
|
+
...CommonStyles.cancelButtonLabel,
|
|
620
|
+
color: '#5B80F7',
|
|
621
|
+
textTransform: 'capitalize',
|
|
622
|
+
}}
|
|
623
|
+
mode={'outlined'}
|
|
624
|
+
onPress={async () => {
|
|
625
|
+
await getPaymentStatus(false);
|
|
626
|
+
}}
|
|
627
|
+
>
|
|
628
|
+
Cancel
|
|
629
|
+
</Button>
|
|
630
|
+
<Button
|
|
631
|
+
disabled={disableNext}
|
|
632
|
+
style={[
|
|
633
|
+
CommonStyles.nextButton,
|
|
634
|
+
{
|
|
635
|
+
flex: 1,
|
|
636
|
+
marginStart: 5,
|
|
637
|
+
},
|
|
638
|
+
]}
|
|
639
|
+
labelStyle={{
|
|
640
|
+
...CommonStyles.nextButtonLabel,
|
|
641
|
+
textTransform: 'capitalize',
|
|
642
|
+
}}
|
|
643
|
+
mode={'contained'}
|
|
644
|
+
onPress={async () => {
|
|
645
|
+
// Check payment status every time when moving away from init screen
|
|
646
|
+
await getPaymentStatus(true);
|
|
647
|
+
}}
|
|
648
|
+
>
|
|
649
|
+
Proceed
|
|
650
|
+
</Button>
|
|
651
|
+
</View>
|
|
652
|
+
</View>
|
|
653
|
+
</View>
|
|
654
|
+
)}
|
|
655
|
+
</Provider>
|
|
656
|
+
);
|
|
657
|
+
};
|
|
658
|
+
export default InitPayment;
|