@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["FormGenerator","ImageCapture","SignatureET","CancelET","DeliverET","verifyLocation","PickupET","DisplayModalET","VerifyOtpET","VerifyLocationET","CaptureText","InitPaymentET","ProcessPaymentET","DropCashET","CompletePaymentET","SLDeliverET","SLPickupET","SLDropCash","HttpRequestET","ScanET","ValidateOTPET"],"sources":["ExecutionTasksIndex.ts"],"sourcesContent":["import FormGenerator from './forms/FormGenerator';\nimport type { CaptureInput, CaptureOutput } from './imageCapture/CaptureSchema';\nimport ImageCapture from './imageCapture/ImageCapture';\n\nimport SignatureET from './doodle/SignatureET';\nimport CancelET from './cancellation/CancelET';\nimport type {\n CancellationInput,\n CancellationOutput,\n} from './cancellation/CancellationSchema';\nimport type { SignatureInput, SignatureOutput } from './doodle/SignatureSchema';\nimport DeliverET from './deliver/DeliverET';\nimport type {\n DeliverETInput,\n DeliverOutput,\n DeliverRemarks,\n LineItem,\n} from './deliver/DeliverETInput';\nimport type { BaseETResponse } from '../../models/execTasks/ETBaseModels';\nimport { verifyLocation } from './verifyLocation/GeofenceUtils';\nimport type {\n VerifyLocationInput,\n VerifyLocationOutput,\n} from './verifyLocation/VerifyLocSchema';\nimport PickupET from './pickup/PickupET';\nimport type { PickupETInput, PickupETOutput } from './pickup/PickpSchema';\nimport type { DisplayETInput, DisplayETOutput } from './display/DisplaySchema';\nimport DisplayModalET from './display/DisplayModalET';\nimport type { FormInputSchema, FormOutputSchema } from './forms/FormSchema';\nimport type {\n CompletePaymentInput,\n CompletePaymentOutput,\n} from './payments/completePayment/CompletePaymentSchema';\nimport type {\n InitPaymentInput,\n InitPaymentOutput,\n} from './payments/init/InitPaymentSchema';\nimport type {\n ProcessPaymentInput,\n ProcessPaymentOutput,\n} from './payments/processPayment/ProcessPaymentSchema';\nimport type {\n OtpInputSchema,\n OtpOutputSchema,\n} from './verifyOtp/VerifyOtpSchema';\n\nimport VerifyOtpET from './verifyOtp/VerifyOtpET';\nimport VerifyLocationET from './verifyLocation/VerifyLocationET';\nimport CaptureText from './captureInput/CaptureText';\nimport type {\n CaptureTextInput,\n CaptureTextOutput,\n} from './captureInput/CaptureInputSchema';\nimport type {\n VerifyInput,\n VerifyInputResponse,\n} from './verifyInput/VerifyInputSchema';\nimport InitPaymentET from './payments/init/InitPaymentET';\nimport ProcessPaymentET from './payments/processPayment/ProcessPaymentET';\nimport DropCashET from './dropCash/DropCashET';\nimport type { DropCashInput, DropCashOutput } from './dropCash/DropCashSchema';\nimport CompletePaymentET from './payments/completePayment/CompletePaymentET';\nimport SLDeliverET from './deliver/SLDeliverET';\nimport SLPickupET from './pickup/SLPickupET';\nimport SLDropCash from './dropCash/SLDropCash';\nimport HttpRequestET from './httpRequest/HttpRequestET';\nimport ScanET from './scan/ScanET';\nimport ValidateOTPET from './validateOTP/ValidateOTPET';\nimport type { ScannerInput, ScannerOutput } from './scan/ScanSchema';\nimport type {\n ValidateOTPInput,\n ValidateOTPOutput,\n} from './validateOTP/ValidateOTPSchema';\n\nexport type {\n CancellationInput,\n CancellationOutput,\n DeliverETInput,\n DeliverOutput,\n LineItem,\n DeliverRemarks,\n DisplayETInput,\n DisplayETOutput,\n SignatureInput,\n SignatureOutput,\n FormInputSchema,\n FormOutputSchema,\n CaptureOutput,\n CaptureInput,\n VerifyLocationOutput,\n VerifyLocationInput,\n CompletePaymentInput,\n CompletePaymentOutput,\n InitPaymentInput,\n InitPaymentOutput,\n ProcessPaymentInput,\n ProcessPaymentOutput,\n PickupETInput,\n PickupETOutput,\n BaseETResponse,\n OtpInputSchema,\n OtpOutputSchema,\n CaptureTextInput,\n CaptureTextOutput,\n VerifyInput,\n VerifyInputResponse,\n DropCashInput,\n DropCashOutput,\n ScannerInput,\n ScannerOutput,\n ValidateOTPInput,\n ValidateOTPOutput,\n};\n\nexport {\n CancelET,\n DeliverET,\n DisplayModalET,\n SignatureET,\n FormGenerator,\n ImageCapture,\n VerifyLocationET,\n verifyLocation,\n PickupET,\n VerifyOtpET,\n CaptureText,\n InitPaymentET,\n ProcessPaymentET,\n DropCashET,\n CompletePaymentET,\n SLDeliverET,\n SLPickupET,\n SLDropCash,\n HttpRequestET,\n ScanET,\n ValidateOTPET,\n};\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,uBAAuB;AAEjD,OAAOC,YAAY,MAAM,6BAA6B;AAEtD,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,QAAQ,MAAM,yBAAyB;AAM9C,OAAOC,SAAS,MAAM,qBAAqB;AAQ3C,SAASC,cAAc,QAAQ,gCAAgC;AAK/D,OAAOC,QAAQ,MAAM,mBAAmB;AAGxC,OAAOC,cAAc,MAAM,0BAA0B;AAmBrD,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,gBAAgB,MAAM,mCAAmC;AAChE,OAAOC,WAAW,MAAM,4BAA4B;AASpD,OAAOC,aAAa,MAAM,+BAA+B;AACzD,OAAOC,gBAAgB,MAAM,4CAA4C;AACzE,OAAOC,UAAU,MAAM,uBAAuB;AAE9C,OAAOC,iBAAiB,MAAM,8CAA8C;AAC5E,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,OAAOC,aAAa,MAAM,6BAA6B;AACvD,OAAOC,MAAM,MAAM,eAAe;AAClC,OAAOC,aAAa,MAAM,6BAA6B;
|
|
1
|
+
{"version":3,"names":["FormGenerator","ImageCapture","SignatureET","CancelET","DeliverET","verifyLocation","PickupET","DisplayModalET","VerifyOtpET","VerifyLocationET","CaptureText","InitPaymentET","ProcessPaymentET","DropCashET","CompletePaymentET","SLDeliverET","SLPickupET","SLDropCash","HttpRequestET","ScanET","ValidateOTPET","CollectPaymentET"],"sources":["ExecutionTasksIndex.ts"],"sourcesContent":["import FormGenerator from './forms/FormGenerator';\nimport type { CaptureInput, CaptureOutput } from './imageCapture/CaptureSchema';\nimport ImageCapture from './imageCapture/ImageCapture';\n\nimport SignatureET from './doodle/SignatureET';\nimport CancelET from './cancellation/CancelET';\nimport type {\n CancellationInput,\n CancellationOutput,\n} from './cancellation/CancellationSchema';\nimport type { SignatureInput, SignatureOutput } from './doodle/SignatureSchema';\nimport DeliverET from './deliver/DeliverET';\nimport type {\n DeliverETInput,\n DeliverOutput,\n DeliverRemarks,\n LineItem,\n} from './deliver/DeliverETInput';\nimport type { BaseETResponse } from '../../models/execTasks/ETBaseModels';\nimport { verifyLocation } from './verifyLocation/GeofenceUtils';\nimport type {\n VerifyLocationInput,\n VerifyLocationOutput,\n} from './verifyLocation/VerifyLocSchema';\nimport PickupET from './pickup/PickupET';\nimport type { PickupETInput, PickupETOutput } from './pickup/PickpSchema';\nimport type { DisplayETInput, DisplayETOutput } from './display/DisplaySchema';\nimport DisplayModalET from './display/DisplayModalET';\nimport type { FormInputSchema, FormOutputSchema } from './forms/FormSchema';\nimport type {\n CompletePaymentInput,\n CompletePaymentOutput,\n} from './payments/completePayment/CompletePaymentSchema';\nimport type {\n InitPaymentInput,\n InitPaymentOutput,\n} from './payments/init/InitPaymentSchema';\nimport type {\n ProcessPaymentInput,\n ProcessPaymentOutput,\n} from './payments/processPayment/ProcessPaymentSchema';\nimport type {\n OtpInputSchema,\n OtpOutputSchema,\n} from './verifyOtp/VerifyOtpSchema';\n\nimport VerifyOtpET from './verifyOtp/VerifyOtpET';\nimport VerifyLocationET from './verifyLocation/VerifyLocationET';\nimport CaptureText from './captureInput/CaptureText';\nimport type {\n CaptureTextInput,\n CaptureTextOutput,\n} from './captureInput/CaptureInputSchema';\nimport type {\n VerifyInput,\n VerifyInputResponse,\n} from './verifyInput/VerifyInputSchema';\nimport InitPaymentET from './payments/init/InitPaymentET';\nimport ProcessPaymentET from './payments/processPayment/ProcessPaymentET';\nimport DropCashET from './dropCash/DropCashET';\nimport type { DropCashInput, DropCashOutput } from './dropCash/DropCashSchema';\nimport CompletePaymentET from './payments/completePayment/CompletePaymentET';\nimport SLDeliverET from './deliver/SLDeliverET';\nimport SLPickupET from './pickup/SLPickupET';\nimport SLDropCash from './dropCash/SLDropCash';\nimport HttpRequestET from './httpRequest/HttpRequestET';\nimport ScanET from './scan/ScanET';\nimport ValidateOTPET from './validateOTP/ValidateOTPET';\nimport CollectPaymentET from './collectPayment/CollectPayment';\nimport type { ScannerInput, ScannerOutput } from './scan/ScanSchema';\nimport type {\n ValidateOTPInput,\n ValidateOTPOutput,\n} from './validateOTP/ValidateOTPSchema';\nimport type {\n CollectPaymentInput,\n CollectPaymentOutput,\n} from './collectPayment/CollectPaymentSchema';\n\nexport type {\n CancellationInput,\n CancellationOutput,\n DeliverETInput,\n DeliverOutput,\n LineItem,\n DeliverRemarks,\n DisplayETInput,\n DisplayETOutput,\n SignatureInput,\n SignatureOutput,\n FormInputSchema,\n FormOutputSchema,\n CaptureOutput,\n CaptureInput,\n VerifyLocationOutput,\n VerifyLocationInput,\n CompletePaymentInput,\n CompletePaymentOutput,\n InitPaymentInput,\n InitPaymentOutput,\n ProcessPaymentInput,\n ProcessPaymentOutput,\n PickupETInput,\n PickupETOutput,\n BaseETResponse,\n OtpInputSchema,\n OtpOutputSchema,\n CaptureTextInput,\n CaptureTextOutput,\n VerifyInput,\n VerifyInputResponse,\n DropCashInput,\n DropCashOutput,\n ScannerInput,\n ScannerOutput,\n ValidateOTPInput,\n ValidateOTPOutput,\n CollectPaymentInput,\n CollectPaymentOutput,\n};\n\nexport {\n CancelET,\n DeliverET,\n DisplayModalET,\n SignatureET,\n FormGenerator,\n ImageCapture,\n VerifyLocationET,\n verifyLocation,\n PickupET,\n VerifyOtpET,\n CaptureText,\n InitPaymentET,\n ProcessPaymentET,\n DropCashET,\n CompletePaymentET,\n SLDeliverET,\n SLPickupET,\n SLDropCash,\n HttpRequestET,\n ScanET,\n ValidateOTPET,\n CollectPaymentET,\n};\n"],"mappings":"AAAA,OAAOA,aAAa,MAAM,uBAAuB;AAEjD,OAAOC,YAAY,MAAM,6BAA6B;AAEtD,OAAOC,WAAW,MAAM,sBAAsB;AAC9C,OAAOC,QAAQ,MAAM,yBAAyB;AAM9C,OAAOC,SAAS,MAAM,qBAAqB;AAQ3C,SAASC,cAAc,QAAQ,gCAAgC;AAK/D,OAAOC,QAAQ,MAAM,mBAAmB;AAGxC,OAAOC,cAAc,MAAM,0BAA0B;AAmBrD,OAAOC,WAAW,MAAM,yBAAyB;AACjD,OAAOC,gBAAgB,MAAM,mCAAmC;AAChE,OAAOC,WAAW,MAAM,4BAA4B;AASpD,OAAOC,aAAa,MAAM,+BAA+B;AACzD,OAAOC,gBAAgB,MAAM,4CAA4C;AACzE,OAAOC,UAAU,MAAM,uBAAuB;AAE9C,OAAOC,iBAAiB,MAAM,8CAA8C;AAC5E,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,UAAU,MAAM,qBAAqB;AAC5C,OAAOC,UAAU,MAAM,uBAAuB;AAC9C,OAAOC,aAAa,MAAM,6BAA6B;AACvD,OAAOC,MAAM,MAAM,eAAe;AAClC,OAAOC,aAAa,MAAM,6BAA6B;AACvD,OAAOC,gBAAgB,MAAM,iCAAiC;AAqD9D,SACElB,QAAQ,EACRC,SAAS,EACTG,cAAc,EACdL,WAAW,EACXF,aAAa,EACbC,YAAY,EACZQ,gBAAgB,EAChBJ,cAAc,EACdC,QAAQ,EACRE,WAAW,EACXE,WAAW,EACXC,aAAa,EACbC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,EACjBC,WAAW,EACXC,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,MAAM,EACNC,aAAa,EACbC,gBAAgB","ignoreList":[]}
|
|
@@ -22,10 +22,9 @@ const CancelET = props => {
|
|
|
22
22
|
const [showReasonCode, setShowReasonCode] = useState((reasonList === null || reasonList === void 0 ? void 0 : reasonList.length) > 0 ? true : false);
|
|
23
23
|
const eventCodeIconName = showEventCode ? 'up' : 'down';
|
|
24
24
|
const reasonCodeIconName = showReasonCode ? 'up' : 'down';
|
|
25
|
-
const renderItem =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
} = _ref;
|
|
25
|
+
const renderItem = ({
|
|
26
|
+
item
|
|
27
|
+
}) => {
|
|
29
28
|
return /*#__PURE__*/React.createElement(View, {
|
|
30
29
|
style: {
|
|
31
30
|
backgroundColor: '#FFFFFF'
|
|
@@ -62,10 +61,9 @@ const CancelET = props => {
|
|
|
62
61
|
}
|
|
63
62
|
}, item)));
|
|
64
63
|
};
|
|
65
|
-
const renderEventsItem =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
} = _ref2;
|
|
64
|
+
const renderEventsItem = ({
|
|
65
|
+
item
|
|
66
|
+
}) => {
|
|
69
67
|
return /*#__PURE__*/React.createElement(View, {
|
|
70
68
|
style: {
|
|
71
69
|
backgroundColor: '#FFFFFF'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Alert","FlatList","Platform","StyleSheet","Text","ToastAndroid","TouchableOpacity","View","React","useEffect","useState","Button","RadioButton","isEmptyOrBlank","CommonStyles","Fonts","ReasonCodeContainer","EventCodeContainer","AntDesign","ScreenNameSdkConstants","SentryEventNameSdkConstants","SeverityLevelValue","fireEventWithScreenName","ICON_SIZE","CancelET","props","_props$cancellationEv","_props$cancellationEv2","reasonsContainer","getInstance","reasonList","setReasonList","cancellationReasons","reasonsRow","setReasonsRow","cancelEvent","setCancelEvent","cancelEventCode","setCancelEventCode","cancelReason","setCancelReason","btnDisabled","setBtnDisabled","showEventCode","setShowEventCode","cancellationEvents","length","showReasonCode","setShowReasonCode","eventCodeIconName","reasonCodeIconName","renderItem","_ref","item","createElement","style","backgroundColor","styles","reasonItemStyle","paddingBottom","color","value","status","onPress","cta","severityLevel","LOG","eventName","BUTTON_CLICKED","screenName","CANCEL_ET_SCREEN","reasonTextStyle","renderEventsItem","_ref2","eventRows","eventCode","getEventCodeFromText","reasonCodes","getReasonCodes","applicableCodes","values","reasonCode","push","description","mainContainer","flex","codeHeaderStyle","toUpperCase","codesHeaderTextStyle","marginEnd","name","size","flexGrow","data","keyExtractor","justifyContent","disabled","nextButton","marginStart","marginBottom","marginTop","labelStyle","nextButtonLabel","mode","onSubmitET","OS","show","SHORT","alert","create","flexDirection","alignItems","padding","paddingVertical","fontFamily","IBMPlexSans_400Regular","fontSize","flexWrap","fontStyle","lineHeight","letterSpacing","textAlign","paddingTop","heading"],"sources":["CancelET.tsx"],"sourcesContent":["import {\n Alert,\n FlatList,\n Platform,\n StyleSheet,\n Text,\n ToastAndroid,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { Button, Paragraph, RadioButton } from 'react-native-paper';\nimport type { CancellationInput } from './CancellationSchema';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport {\n CommonStyles,\n DeliverPickupStyles,\n Fonts,\n} from '../../../styles/executionTasks/CommonStyles';\nimport ReasonCodeContainer from '../../../manager/dispatchCodes/ReasonCodeContainer';\nimport type { ReasonsRow } from '../../../manager/syncmanager/DBConfig';\nimport EventCodeContainer from '../../../manager/dispatchCodes/EventCodeContainer';\nimport IconButton from '../../widgets/IconButton';\nimport { AntDesign } from '@expo/vector-icons';\nimport { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';\nimport { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';\n\nconst ICON_SIZE = 12;\n\nconst CancelET = (props: CancellationInput) => {\n const reasonsContainer = ReasonCodeContainer.getInstance();\n const [reasonList, setReasonList] = useState(\n props?.cancellationReasons || []\n );\n const [reasonsRow, setReasonsRow] = useState<ReasonsRow[]>([]);\n const [cancelEvent, setCancelEvent] = useState(props.cancelEvent);\n const [cancelEventCode, setCancelEventCode] = useState(props.cancelEvent);\n const [cancelReason, setCancelReason] = useState('');\n const [btnDisabled, setBtnDisabled] = useState(false);\n\n const [showEventCode, setShowEventCode] = useState(\n props?.cancellationEvents?.length ? true : false\n );\n const [showReasonCode, setShowReasonCode] = useState(\n reasonList?.length > 0 ? true : false\n );\n\n const eventCodeIconName = showEventCode ? 'up' : 'down';\n const reasonCodeIconName = showReasonCode ? 'up' : 'down';\n\n const renderItem = ({ item }: { item: string }) => {\n return (\n <View style={{ backgroundColor: '#FFFFFF' }}>\n <View style={[styles.reasonItemStyle, { paddingBottom: 0 }]}>\n <RadioButton\n color={'#5B80F7'}\n value={item}\n status={cancelReason === item ? 'checked' : 'unchecked'}\n onPress={() => {\n setCancelReason(item); \n const cta = cancelReason === item ? 'Cancel reason checked' : 'Cancel reason unchecked';\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n }}\n />\n <Text\n style={styles.reasonTextStyle}\n onPress={() => {\n setCancelReason(item);\n const cta = item;\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n {item}\n </Text>\n </View>\n </View>\n );\n };\n\n const renderEventsItem = ({ item }: { item: string }) => {\n return (\n <View style={{ backgroundColor: '#FFFFFF' }}>\n <View style={styles.reasonItemStyle}>\n <RadioButton\n color={'#5B80F7'}\n value={item}\n status={cancelEvent === item ? 'checked' : 'unchecked'}\n onPress={() => {\n setCancelEvent(item);\n const cta = cancelReason === item ? 'Cancel reason checked' : 'Cancel reason unchecked';\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n />\n <Text\n style={styles.reasonTextStyle}\n onPress={() => {\n setCancelEvent(item);\n const cta = item;\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n {item}\n </Text>\n </View>\n </View>\n );\n };\n\n useEffect(() => {\n (async () => {\n if (props.eventRows) {\n const eventCode = EventCodeContainer.getEventCodeFromText(\n cancelEvent,\n props.eventRows\n );\n setCancelEventCode(eventCode);\n const reasonCodes = await reasonsContainer.getReasonCodes(\n props.applicableCodes || {},\n eventCode\n );\n setReasonsRow(reasonCodes);\n\n if (reasonCodes) {\n const values: string[] = [];\n for (let reasonCode of reasonCodes) {\n values.push(reasonCode.description);\n }\n setReasonList(values);\n }\n }\n })();\n }, [cancelEvent]);\n\n useEffect(() => {\n if (reasonList.length) {\n setShowEventCode(false);\n if (!showReasonCode) setShowReasonCode(true);\n }\n }, [reasonList]);\n\n return (\n <View style={CommonStyles.mainContainer}>\n <View style={{ flex: 1 }}>\n {props?.cancellationEvents?.length ? (\n <View style={showEventCode ? { flex: 1 } : {}}>\n <TouchableOpacity\n style={styles.codeHeaderStyle}\n onPress={() => {\n setShowEventCode(!showEventCode);\n const cta = 'Select Event'.toUpperCase();\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n <Text style={styles.codesHeaderTextStyle}>\n {`${'Select Event'.toUpperCase()}`}\n </Text>\n <AntDesign\n style={{ marginEnd: 10 }}\n name={`${eventCodeIconName}`}\n size={ICON_SIZE}\n color=\"#3D445C\"\n />\n </TouchableOpacity>\n {showEventCode ? (\n <FlatList\n style={{\n flexGrow: 0,\n }}\n data={props.cancellationEvents}\n renderItem={renderEventsItem}\n keyExtractor={(item) => item}\n />\n ) : null}\n </View>\n ) : null}\n {reasonList?.length > 0 ? (\n <View style={showReasonCode ? { flex: 1 } : {}}>\n <TouchableOpacity\n style={styles.codeHeaderStyle}\n onPress={() => {\n setShowReasonCode(!showReasonCode);\n const cta = 'Select Reason'.toUpperCase();\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n <Text style={styles.codesHeaderTextStyle}>\n {`${'Select Reason'.toUpperCase()}`}\n </Text>\n <AntDesign\n name={`${reasonCodeIconName}`}\n size={ICON_SIZE}\n color=\"#3D445C\"\n style={{ marginEnd: 10 }}\n />\n </TouchableOpacity>\n {showReasonCode ? (\n <FlatList\n style={{\n flexGrow: 0,\n }}\n data={reasonList}\n renderItem={renderItem}\n keyExtractor={(item) => item}\n />\n ) : null}\n </View>\n ) : null}\n </View>\n <View style={{ justifyContent: 'flex-end', paddingBottom: 16 }}>\n <Button\n disabled={btnDisabled}\n style={[\n CommonStyles.nextButton,\n { marginStart: 10, marginEnd: 10, marginBottom: 10, marginTop: 10 },\n ]}\n labelStyle={CommonStyles.nextButtonLabel}\n mode={'contained'}\n onPress={() => {\n if (\n (!props.cancellationEvents ||\n props.cancellationEvents.length === 1 ||\n !isEmptyOrBlank(cancelEvent)) &&\n (!reasonList.length || !isEmptyOrBlank(cancelReason))\n ) {\n setBtnDisabled(true);\n props.onSubmitET(cancelReason, cancelEventCode, reasonsRow);\n } else {\n if (Platform.OS === 'android') {\n ToastAndroid.show('No reason selected', ToastAndroid.SHORT);\n } else {\n Alert.alert('No reason selected');\n }\n }\n const cta = 'Proceed';\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n\n }\n }\n >\n Proceed\n </Button>\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n codeHeaderStyle: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 8,\n paddingVertical: 12,\n },\n codesHeaderTextStyle: {\n fontFamily:\n Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n fontSize: 14,\n color: '#9D9D9D',\n marginStart: 10,\n },\n reasonTextStyle: {\n flex: 1,\n flexWrap: 'wrap',\n fontFamily:\n Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n fontStyle: 'normal',\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n textAlign: 'justify',\n color: '#111111',\n },\n reasonItemStyle: {\n flexDirection: 'row',\n marginStart: 12,\n marginEnd: 12,\n paddingTop: 8,\n paddingBottom: 8,\n alignItems: 'center',\n },\n heading: {\n marginTop: 30,\n marginStart: 25,\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n fontFamily:\n Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n color: '#9D9D9D',\n },\n});\nexport default CancelET;\n"],"mappings":"AAAA,SACEA,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,YAAY,EACZC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AACrB,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,MAAM,EAAaC,WAAW,QAAQ,oBAAoB;AAEnE,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SACEC,YAAY,EAEZC,KAAK,QACA,6CAA6C;AACpD,OAAOC,mBAAmB,MAAM,oDAAoD;AAEpF,OAAOC,kBAAkB,MAAM,mDAAmD;AAElF,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,sBAAsB,EAAEC,2BAA2B,EAAEC,kBAAkB,QAAQ,8CAA8C;AACtI,SAASC,uBAAuB,QAAQ,gDAAgD;AAExF,MAAMC,SAAS,GAAG,EAAE;AAEpB,MAAMC,QAAQ,GAAIC,KAAwB,IAAK;EAAA,IAAAC,qBAAA,EAAAC,sBAAA;EAC7C,MAAMC,gBAAgB,GAAGZ,mBAAmB,CAACa,WAAW,CAAC,CAAC;EAC1D,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGrB,QAAQ,CAC1C,CAAAe,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEO,mBAAmB,KAAI,EAChC,CAAC;EACD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGxB,QAAQ,CAAe,EAAE,CAAC;EAC9D,M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,EAAE,MAAM;IAChBH,UAAU,EACVhH,QAAQ,CAACuG,EAAE,KAAK,SAAS,GACnB1F,KAAK,CAACoG,sBAAsB,GAC5B,qBAAqB;IAC3BG,SAAS,EAAE,QAAQ;IACnBF,QAAQ,EAAE,EAAE;IACZG,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBC,SAAS,EAAE,SAAS;IACpB7D,KAAK,EAAE;EACT,CAAC;EACDF,eAAe,EAAE;IACfoD,aAAa,EAAE,KAAK;IACpBZ,WAAW,EAAE,EAAE;IACfT,SAAS,EAAE,EAAE;IACbiC,UAAU,EAAE,CAAC;IACb/D,aAAa,EAAE,CAAC;IAChBoD,UAAU,EAAE;EACd,CAAC;EACDY,OAAO,EAAE;IACPvB,SAAS,EAAE,EAAE;IACbF,WAAW,EAAE,EAAE;IACfkB,QAAQ,EAAE,EAAE;IACZG,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBN,UAAU,EACVhH,QAAQ,CAACuG,EAAE,KAAK,SAAS,GACnB1F,KAAK,CAACoG,sBAAsB,GAC5B,qBAAqB;IAC3BvD,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AACF,eAAepC,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["Alert","FlatList","Platform","StyleSheet","Text","ToastAndroid","TouchableOpacity","View","React","useEffect","useState","Button","RadioButton","isEmptyOrBlank","CommonStyles","Fonts","ReasonCodeContainer","EventCodeContainer","AntDesign","ScreenNameSdkConstants","SentryEventNameSdkConstants","SeverityLevelValue","fireEventWithScreenName","ICON_SIZE","CancelET","props","_props$cancellationEv","_props$cancellationEv2","reasonsContainer","getInstance","reasonList","setReasonList","cancellationReasons","reasonsRow","setReasonsRow","cancelEvent","setCancelEvent","cancelEventCode","setCancelEventCode","cancelReason","setCancelReason","btnDisabled","setBtnDisabled","showEventCode","setShowEventCode","cancellationEvents","length","showReasonCode","setShowReasonCode","eventCodeIconName","reasonCodeIconName","renderItem","item","createElement","style","backgroundColor","styles","reasonItemStyle","paddingBottom","color","value","status","onPress","cta","severityLevel","LOG","eventName","BUTTON_CLICKED","screenName","CANCEL_ET_SCREEN","reasonTextStyle","renderEventsItem","eventRows","eventCode","getEventCodeFromText","reasonCodes","getReasonCodes","applicableCodes","values","reasonCode","push","description","mainContainer","flex","codeHeaderStyle","toUpperCase","codesHeaderTextStyle","marginEnd","name","size","flexGrow","data","keyExtractor","justifyContent","disabled","nextButton","marginStart","marginBottom","marginTop","labelStyle","nextButtonLabel","mode","onSubmitET","OS","show","SHORT","alert","create","flexDirection","alignItems","padding","paddingVertical","fontFamily","IBMPlexSans_400Regular","fontSize","flexWrap","fontStyle","lineHeight","letterSpacing","textAlign","paddingTop","heading"],"sources":["CancelET.tsx"],"sourcesContent":["import {\n Alert,\n FlatList,\n Platform,\n StyleSheet,\n Text,\n ToastAndroid,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport React, { useEffect, useState } from 'react';\nimport { Button, Paragraph, RadioButton } from 'react-native-paper';\nimport type { CancellationInput } from './CancellationSchema';\nimport { isEmptyOrBlank } from '../../../utils/utils';\nimport {\n CommonStyles,\n DeliverPickupStyles,\n Fonts,\n} from '../../../styles/executionTasks/CommonStyles';\nimport ReasonCodeContainer from '../../../manager/dispatchCodes/ReasonCodeContainer';\nimport type { ReasonsRow } from '../../../manager/syncmanager/DBConfig';\nimport EventCodeContainer from '../../../manager/dispatchCodes/EventCodeContainer';\nimport IconButton from '../../widgets/IconButton';\nimport { AntDesign } from '@expo/vector-icons';\nimport { ScreenNameSdkConstants, SentryEventNameSdkConstants, SeverityLevelValue } from '../../../analytics/sentry/SentrySdkConstants';\nimport { fireEventWithScreenName } from '../../../analytics/sentry/SentryAnalyticsUtils';\n\nconst ICON_SIZE = 12;\n\nconst CancelET = (props: CancellationInput) => {\n const reasonsContainer = ReasonCodeContainer.getInstance();\n const [reasonList, setReasonList] = useState(\n props?.cancellationReasons || []\n );\n const [reasonsRow, setReasonsRow] = useState<ReasonsRow[]>([]);\n const [cancelEvent, setCancelEvent] = useState(props.cancelEvent);\n const [cancelEventCode, setCancelEventCode] = useState(props.cancelEvent);\n const [cancelReason, setCancelReason] = useState('');\n const [btnDisabled, setBtnDisabled] = useState(false);\n\n const [showEventCode, setShowEventCode] = useState(\n props?.cancellationEvents?.length ? true : false\n );\n const [showReasonCode, setShowReasonCode] = useState(\n reasonList?.length > 0 ? true : false\n );\n\n const eventCodeIconName = showEventCode ? 'up' : 'down';\n const reasonCodeIconName = showReasonCode ? 'up' : 'down';\n\n const renderItem = ({ item }: { item: string }) => {\n return (\n <View style={{ backgroundColor: '#FFFFFF' }}>\n <View style={[styles.reasonItemStyle, { paddingBottom: 0 }]}>\n <RadioButton\n color={'#5B80F7'}\n value={item}\n status={cancelReason === item ? 'checked' : 'unchecked'}\n onPress={() => {\n setCancelReason(item); \n const cta = cancelReason === item ? 'Cancel reason checked' : 'Cancel reason unchecked';\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n }}\n />\n <Text\n style={styles.reasonTextStyle}\n onPress={() => {\n setCancelReason(item);\n const cta = item;\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n {item}\n </Text>\n </View>\n </View>\n );\n };\n\n const renderEventsItem = ({ item }: { item: string }) => {\n return (\n <View style={{ backgroundColor: '#FFFFFF' }}>\n <View style={styles.reasonItemStyle}>\n <RadioButton\n color={'#5B80F7'}\n value={item}\n status={cancelEvent === item ? 'checked' : 'unchecked'}\n onPress={() => {\n setCancelEvent(item);\n const cta = cancelReason === item ? 'Cancel reason checked' : 'Cancel reason unchecked';\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n />\n <Text\n style={styles.reasonTextStyle}\n onPress={() => {\n setCancelEvent(item);\n const cta = item;\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n {item}\n </Text>\n </View>\n </View>\n );\n };\n\n useEffect(() => {\n (async () => {\n if (props.eventRows) {\n const eventCode = EventCodeContainer.getEventCodeFromText(\n cancelEvent,\n props.eventRows\n );\n setCancelEventCode(eventCode);\n const reasonCodes = await reasonsContainer.getReasonCodes(\n props.applicableCodes || {},\n eventCode\n );\n setReasonsRow(reasonCodes);\n\n if (reasonCodes) {\n const values: string[] = [];\n for (let reasonCode of reasonCodes) {\n values.push(reasonCode.description);\n }\n setReasonList(values);\n }\n }\n })();\n }, [cancelEvent]);\n\n useEffect(() => {\n if (reasonList.length) {\n setShowEventCode(false);\n if (!showReasonCode) setShowReasonCode(true);\n }\n }, [reasonList]);\n\n return (\n <View style={CommonStyles.mainContainer}>\n <View style={{ flex: 1 }}>\n {props?.cancellationEvents?.length ? (\n <View style={showEventCode ? { flex: 1 } : {}}>\n <TouchableOpacity\n style={styles.codeHeaderStyle}\n onPress={() => {\n setShowEventCode(!showEventCode);\n const cta = 'Select Event'.toUpperCase();\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n <Text style={styles.codesHeaderTextStyle}>\n {`${'Select Event'.toUpperCase()}`}\n </Text>\n <AntDesign\n style={{ marginEnd: 10 }}\n name={`${eventCodeIconName}`}\n size={ICON_SIZE}\n color=\"#3D445C\"\n />\n </TouchableOpacity>\n {showEventCode ? (\n <FlatList\n style={{\n flexGrow: 0,\n }}\n data={props.cancellationEvents}\n renderItem={renderEventsItem}\n keyExtractor={(item) => item}\n />\n ) : null}\n </View>\n ) : null}\n {reasonList?.length > 0 ? (\n <View style={showReasonCode ? { flex: 1 } : {}}>\n <TouchableOpacity\n style={styles.codeHeaderStyle}\n onPress={() => {\n setShowReasonCode(!showReasonCode);\n const cta = 'Select Reason'.toUpperCase();\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n \n }}\n >\n <Text style={styles.codesHeaderTextStyle}>\n {`${'Select Reason'.toUpperCase()}`}\n </Text>\n <AntDesign\n name={`${reasonCodeIconName}`}\n size={ICON_SIZE}\n color=\"#3D445C\"\n style={{ marginEnd: 10 }}\n />\n </TouchableOpacity>\n {showReasonCode ? (\n <FlatList\n style={{\n flexGrow: 0,\n }}\n data={reasonList}\n renderItem={renderItem}\n keyExtractor={(item) => item}\n />\n ) : null}\n </View>\n ) : null}\n </View>\n <View style={{ justifyContent: 'flex-end', paddingBottom: 16 }}>\n <Button\n disabled={btnDisabled}\n style={[\n CommonStyles.nextButton,\n { marginStart: 10, marginEnd: 10, marginBottom: 10, marginTop: 10 },\n ]}\n labelStyle={CommonStyles.nextButtonLabel}\n mode={'contained'}\n onPress={() => {\n if (\n (!props.cancellationEvents ||\n props.cancellationEvents.length === 1 ||\n !isEmptyOrBlank(cancelEvent)) &&\n (!reasonList.length || !isEmptyOrBlank(cancelReason))\n ) {\n setBtnDisabled(true);\n props.onSubmitET(cancelReason, cancelEventCode, reasonsRow);\n } else {\n if (Platform.OS === 'android') {\n ToastAndroid.show('No reason selected', ToastAndroid.SHORT);\n } else {\n Alert.alert('No reason selected');\n }\n }\n const cta = 'Proceed';\n fireEventWithScreenName({ severityLevel: SeverityLevelValue.LOG, eventName: SentryEventNameSdkConstants.BUTTON_CLICKED, screenName: ScreenNameSdkConstants.CANCEL_ET_SCREEN, cta: cta }); \n\n }\n }\n >\n Proceed\n </Button>\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n codeHeaderStyle: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: 8,\n paddingVertical: 12,\n },\n codesHeaderTextStyle: {\n fontFamily:\n Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n fontSize: 14,\n color: '#9D9D9D',\n marginStart: 10,\n },\n reasonTextStyle: {\n flex: 1,\n flexWrap: 'wrap',\n fontFamily:\n Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n fontStyle: 'normal',\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n textAlign: 'justify',\n color: '#111111',\n },\n reasonItemStyle: {\n flexDirection: 'row',\n marginStart: 12,\n marginEnd: 12,\n paddingTop: 8,\n paddingBottom: 8,\n alignItems: 'center',\n },\n heading: {\n marginTop: 30,\n marginStart: 25,\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n fontFamily:\n Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n color: '#9D9D9D',\n },\n});\nexport default CancelET;\n"],"mappings":"AAAA,SACEA,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,YAAY,EACZC,gBAAgB,EAChBC,IAAI,QACC,cAAc;AACrB,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,MAAM,EAAaC,WAAW,QAAQ,oBAAoB;AAEnE,SAASC,cAAc,QAAQ,sBAAsB;AACrD,SACEC,YAAY,EAEZC,KAAK,QACA,6CAA6C;AACpD,OAAOC,mBAAmB,MAAM,oDAAoD;AAEpF,OAAOC,kBAAkB,MAAM,mDAAmD;AAElF,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,sBAAsB,EAAEC,2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
|
+
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); }
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { PAYMENT_SCREEN } from './CollectPaymentSchema';
|
|
6
|
+
import InitPayment from './components/InitPayment';
|
|
7
|
+
import { Provider } from 'react-native-paper';
|
|
8
|
+
import ProcessPayment from './components/ProcessPayment';
|
|
9
|
+
import CompletePayment from './components/CompletePayment';
|
|
10
|
+
import PaymentContactDetails from './components/PaymentContactDetails';
|
|
11
|
+
const CollectPaymentET = props => {
|
|
12
|
+
const [moveToNextData, setMoveToNextData] = useState();
|
|
13
|
+
return /*#__PURE__*/React.createElement(Provider, null, /*#__PURE__*/React.createElement(View, {
|
|
14
|
+
style: {
|
|
15
|
+
flex: 1
|
|
16
|
+
}
|
|
17
|
+
}, !moveToNextData || moveToNextData.screen === PAYMENT_SCREEN.INIT ? /*#__PURE__*/React.createElement(InitPayment, _extends({}, props, moveToNextData, {
|
|
18
|
+
onSubmitET: async etOutput => props.onSubmitET(etOutput),
|
|
19
|
+
next: etOutput => setMoveToNextData(etOutput)
|
|
20
|
+
})) : moveToNextData.screen === PAYMENT_SCREEN.CONTACTS ? /*#__PURE__*/React.createElement(PaymentContactDetails, _extends({}, props, moveToNextData, {
|
|
21
|
+
onSubmitET: async etOutput => props.onSubmitET(etOutput),
|
|
22
|
+
next: etOutput => setMoveToNextData(etOutput)
|
|
23
|
+
})) : moveToNextData.screen === PAYMENT_SCREEN.PROCESS ? /*#__PURE__*/React.createElement(ProcessPayment, _extends({}, props, moveToNextData, {
|
|
24
|
+
onSubmitET: async etOutput => props.onSubmitET(etOutput),
|
|
25
|
+
next: etOutput => setMoveToNextData(etOutput)
|
|
26
|
+
})) : moveToNextData.screen === PAYMENT_SCREEN.COMPLETE ? /*#__PURE__*/React.createElement(CompletePayment, _extends({}, props, moveToNextData, {
|
|
27
|
+
onSubmitET: async etOutput => props.onSubmitET(etOutput),
|
|
28
|
+
next: etOutput => setMoveToNextData(etOutput)
|
|
29
|
+
})) : null));
|
|
30
|
+
};
|
|
31
|
+
export default CollectPaymentET;
|
|
32
|
+
//# sourceMappingURL=CollectPayment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","View","PAYMENT_SCREEN","InitPayment","Provider","ProcessPayment","CompletePayment","PaymentContactDetails","CollectPaymentET","props","moveToNextData","setMoveToNextData","createElement","style","flex","screen","INIT","_extends","onSubmitET","etOutput","next","CONTACTS","PROCESS","COMPLETE"],"sources":["CollectPayment.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport React, { useState } from 'react';\nimport { View } from 'react-native';\nimport {\n CollectPaymentInput,\n CollectPaymentOutput,\n PAYMENT_SCREEN,\n} from './CollectPaymentSchema';\nimport InitPayment from './components/InitPayment';\nimport { Provider } from 'react-native-paper';\nimport ProcessPayment from './components/ProcessPayment';\nimport CompletePayment from './components/CompletePayment';\nimport PaymentContactDetails from './components/PaymentContactDetails';\n\nconst CollectPaymentET = (props: CollectPaymentInput) => {\n const [moveToNextData, setMoveToNextData] = useState<\n CollectPaymentOutput & {\n screen: PAYMENT_SCREEN;\n sourceScreen: PAYMENT_SCREEN;\n }\n >();\n\n return (\n <Provider>\n <View style={{ flex: 1 }}>\n {!moveToNextData || moveToNextData.screen === PAYMENT_SCREEN.INIT ? (\n <InitPayment\n {...props}\n {...moveToNextData}\n onSubmitET={async (etOutput) => props.onSubmitET(etOutput)}\n next={(etOutput) => setMoveToNextData(etOutput)}\n />\n ) : moveToNextData.screen === PAYMENT_SCREEN.CONTACTS ? (\n <PaymentContactDetails\n {...props}\n {...moveToNextData}\n onSubmitET={async (etOutput) => props.onSubmitET(etOutput)}\n next={(etOutput) => setMoveToNextData(etOutput)}\n />\n ) : moveToNextData.screen === PAYMENT_SCREEN.PROCESS ? (\n <ProcessPayment\n {...props}\n {...moveToNextData}\n onSubmitET={async (etOutput) => props.onSubmitET(etOutput)}\n next={(etOutput) => setMoveToNextData(etOutput)}\n />\n ) : moveToNextData.screen === PAYMENT_SCREEN.COMPLETE ? (\n <CompletePayment\n {...props}\n {...moveToNextData}\n onSubmitET={async (etOutput) => props.onSubmitET(etOutput)}\n next={(etOutput) => setMoveToNextData(etOutput)}\n />\n ) : null}\n </View>\n </Provider>\n );\n};\n\nexport default CollectPaymentET;\n"],"mappings":";AAAA;AACA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,IAAI,QAAQ,cAAc;AACnC,SAGEC,cAAc,QACT,wBAAwB;AAC/B,OAAOC,WAAW,MAAM,0BAA0B;AAClD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,cAAc,MAAM,6BAA6B;AACxD,OAAOC,eAAe,MAAM,8BAA8B;AAC1D,OAAOC,qBAAqB,MAAM,oCAAoC;AAEtE,MAAMC,gBAAgB,GAAIC,KAA0B,IAAK;EACvD,MAAM,CAACC,cAAc,EAAEC,iBAAiB,CAAC,GAAGX,QAAQ,CAKlD,CAAC;EAEH,oBACED,KAAA,CAAAa,aAAA,CAACR,QAAQ,qBACPL,KAAA,CAAAa,aAAA,CAACX,IAAI;IAACY,KAAK,EAAE;MAAEC,IAAI,EAAE;IAAE;EAAE,GACtB,CAACJ,cAAc,IAAIA,cAAc,CAACK,MAAM,KAAKb,cAAc,CAACc,IAAI,gBAC/DjB,KAAA,CAAAa,aAAA,CAACT,WAAW,EAAAc,QAAA,KACNR,KAAK,EACLC,cAAc;IAClBQ,UAAU,EAAE,MAAOC,QAAQ,IAAKV,KAAK,CAACS,UAAU,CAACC,QAAQ,CAAE;IAC3DC,IAAI,EAAGD,QAAQ,IAAKR,iBAAiB,CAACQ,QAAQ;EAAE,EACjD,CAAC,GACAT,cAAc,CAACK,MAAM,KAAKb,cAAc,CAACmB,QAAQ,gBACnDtB,KAAA,CAAAa,aAAA,CAACL,qBAAqB,EAAAU,QAAA,KAChBR,KAAK,EACLC,cAAc;IAClBQ,UAAU,EAAE,MAAOC,QAAQ,IAAKV,KAAK,CAACS,UAAU,CAACC,QAAQ,CAAE;IAC3DC,IAAI,EAAGD,QAAQ,IAAKR,iBAAiB,CAACQ,QAAQ;EAAE,EACjD,CAAC,GACAT,cAAc,CAACK,MAAM,KAAKb,cAAc,CAACoB,OAAO,gBAClDvB,KAAA,CAAAa,aAAA,CAACP,cAAc,EAAAY,QAAA,KACTR,KAAK,EACLC,cAAc;IAClBQ,UAAU,EAAE,MAAOC,QAAQ,IAAKV,KAAK,CAACS,UAAU,CAACC,QAAQ,CAAE;IAC3DC,IAAI,EAAGD,QAAQ,IAAKR,iBAAiB,CAACQ,QAAQ;EAAE,EACjD,CAAC,GACAT,cAAc,CAACK,MAAM,KAAKb,cAAc,CAACqB,QAAQ,gBACnDxB,KAAA,CAAAa,aAAA,CAACN,eAAe,EAAAW,QAAA,KACVR,KAAK,EACLC,cAAc;IAClBQ,UAAU,EAAE,MAAOC,QAAQ,IAAKV,KAAK,CAACS,UAAU,CAACC,QAAQ,CAAE;IAC3DC,IAAI,EAAGD,QAAQ,IAAKR,iBAAiB,CAACQ,QAAQ;EAAE,EACjD,CAAC,GACA,IACA,CACE,CAAC;AAEf,CAAC;AAED,eAAeX,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export let STATUS = /*#__PURE__*/function (STATUS) {
|
|
2
|
+
STATUS["INITIATED"] = "INITIATED";
|
|
3
|
+
STATUS["FAILED"] = "FAILED";
|
|
4
|
+
STATUS["SUCCESS"] = "SUCCESS";
|
|
5
|
+
return STATUS;
|
|
6
|
+
}({});
|
|
7
|
+
export let SUB_STATUS = /*#__PURE__*/function (SUB_STATUS) {
|
|
8
|
+
SUB_STATUS["completed"] = "completed";
|
|
9
|
+
SUB_STATUS["expired"] = "expired";
|
|
10
|
+
SUB_STATUS["created"] = "created";
|
|
11
|
+
SUB_STATUS["plFailed"] = "plFailed";
|
|
12
|
+
SUB_STATUS["qrFailed"] = "qrFailed";
|
|
13
|
+
SUB_STATUS["paymentFailed"] = "paymentFailed";
|
|
14
|
+
SUB_STATUS["closed"] = "closed";
|
|
15
|
+
return SUB_STATUS;
|
|
16
|
+
}({});
|
|
17
|
+
export let PAYMENT_SCREEN = /*#__PURE__*/function (PAYMENT_SCREEN) {
|
|
18
|
+
PAYMENT_SCREEN["INIT"] = "INIT";
|
|
19
|
+
PAYMENT_SCREEN["CONTACTS"] = "CONTACTS";
|
|
20
|
+
PAYMENT_SCREEN["PROCESS"] = "PROCESS";
|
|
21
|
+
PAYMENT_SCREEN["COMPLETE"] = "COMPLETE";
|
|
22
|
+
return PAYMENT_SCREEN;
|
|
23
|
+
}({});
|
|
24
|
+
export let TRANSACTION_TYPE = /*#__PURE__*/function (TRANSACTION_TYPE) {
|
|
25
|
+
TRANSACTION_TYPE["LINK"] = "link";
|
|
26
|
+
TRANSACTION_TYPE["QRCODE"] = "qrCode";
|
|
27
|
+
return TRANSACTION_TYPE;
|
|
28
|
+
}({});
|
|
29
|
+
//# sourceMappingURL=CollectPaymentSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["STATUS","SUB_STATUS","PAYMENT_SCREEN","TRANSACTION_TYPE"],"sources":["CollectPaymentSchema.ts"],"sourcesContent":["import {\n BaseETRequest,\n BaseETResponse,\n} from '../../../models/execTasks/ETBaseModels';\nimport {\n HTTPMethod,\n HTTPRequestBody,\n} from '../httpRequest/HttpRequestETSchema';\nimport { Headers, PathParams, QueryParams } from '../../../utils/ApiUtils';\n\nexport type AllowedModes = 'CASH' | 'QR_CODE' | 'PAYMENT_LINK' | 'ONLINE';\nexport type OnsiteLink = 'Phone Number' | 'Email';\n\nexport interface ETAmount {\n value: number;\n currencyCode: string;\n // minorUnit?: number;\n}\n\nexport interface API {\n uri: string;\n timeout?: number;\n httpMethod: HTTPMethod;\n headers?: Headers[];\n requestBody?: HTTPRequestBody;\n queryParams?: QueryParams[];\n pathParams?: PathParams[];\n responseJsonLogic: object;\n errorJsonLogic: object;\n}\n\nexport type CollectPaymentInput = BaseETRequest & {\n // amount: ETAmount;\n allowedModes: AllowedModes[];\n plModes?: string[];\n expectedAmount: number;\n onsiteLinkSharing?: OnsiteLink[];\n onSubmitET: (output: CollectPaymentOutput) => void;\n next: (\n output: CollectPaymentOutput & {\n screen: PAYMENT_SCREEN;\n contactDetails?: string;\n sourceScreen: PAYMENT_SCREEN;\n }\n ) => void;\n screen: PAYMENT_SCREEN;\n sourceScreen: PAYMENT_SCREEN;\n};\n\nexport interface ProcessPaymentInput {\n paymentMode: AllowedModes;\n contactDetails?: string;\n}\n\nexport interface CompletePaymentInput {\n paymentMode: AllowedModes;\n}\n\nexport type CollectPaymentOutput = BaseETResponse & {\n refId: string;\n collectedAmount: ETAmount;\n paymentMeta?: {};\n paymentMode: AllowedModes;\n};\n\nexport interface QrResponse {\n data: {\n qrCode?: string;\n txnId?: string;\n paymentCompleted?: boolean;\n status?: STATUS;\n };\n}\n\nexport interface QR_REQUEST_BODY {\n refId: string;\n appAbbr: string;\n money: {\n amount: number;\n currency: string;\n };\n userInfo?: {\n phone?: {\n countryCode: string;\n mobileNumber: string;\n };\n };\n pgConfigId?: string;\n description?: string;\n meta?: { [key: string]: any };\n}\n\nexport interface PaymentStatusResponse {\n data: {\n meta?: { totalCount?: number };\n transactions?: {\n refId: string;\n status: STATUS;\n subStatus: SUB_STATUS;\n money: {\n amount: number;\n currency: string;\n };\n txnId: string;\n txnType: TRANSACTION_TYPE;\n appAbbr: string;\n }[];\n };\n}\n\nexport interface PaymentLinkResponse {\n txnId: string;\n refId: string;\n status?: STATUS;\n}\n\nexport interface notificationPaymentStatus {\n refId: string;\n status: STATUS;\n}\n\nexport enum STATUS {\n INITIATED = 'INITIATED',\n FAILED = 'FAILED',\n SUCCESS = 'SUCCESS',\n}\n\nexport enum SUB_STATUS {\n completed = 'completed',\n expired = 'expired',\n created = 'created',\n plFailed = 'plFailed',\n qrFailed = 'qrFailed',\n paymentFailed = 'paymentFailed',\n closed = 'closed',\n}\n\nexport enum PAYMENT_SCREEN {\n INIT = 'INIT',\n CONTACTS = 'CONTACTS',\n PROCESS = 'PROCESS',\n COMPLETE = 'COMPLETE',\n}\n\nexport interface sharedPrefPaymentDataInterface {\n paymentMode: AllowedModes;\n amount: ETAmount;\n // refId: string;\n moIds: string[];\n previousSelection?: AllowedModes[];\n}\n\nexport interface PaymentEventDataInterface {\n refId: string;\n money: {\n amount: number;\n currency: string;\n };\n contactDetails?: string;\n paymentLink?: string;\n}\n\nexport interface PaymentConfigResponse {\n data: {\n configDetails: {\n tenantId: string;\n paymentMethods: PaymentMethods;\n modesMapping: object;\n }[];\n };\n}\n\nexport interface PaymentMethods {\n QR: boolean;\n paymentLink: boolean;\n modes?: object;\n}\n\nexport enum TRANSACTION_TYPE {\n LINK = 'link',\n QRCODE = 'qrCode',\n}\n"],"mappings":"AAyHA,WAAYA,MAAM,0BAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAANA,MAAM;EAAA,OAANA,MAAM;AAAA;AAMlB,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAUtB,WAAYC,cAAc,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA;AAyC1B,WAAYC,gBAAgB,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { StyleSheet, Platform } from 'react-native';
|
|
2
|
+
import { Fonts } from '../../../styles/executionTasks/CommonStyles';
|
|
3
|
+
export const PaymentStyles = StyleSheet.create({
|
|
4
|
+
amountStyle: {
|
|
5
|
+
fontSize: 18,
|
|
6
|
+
fontWeight: '600',
|
|
7
|
+
fontStyle: 'normal',
|
|
8
|
+
// backgroundColor: 'white',
|
|
9
|
+
textAlign: 'center',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
paddingTop: 25,
|
|
12
|
+
paddingBottom: 25,
|
|
13
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_600SemiBold : 'IBMPlexSans-SemiBold'
|
|
14
|
+
},
|
|
15
|
+
messageStyle: {
|
|
16
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
17
|
+
backgroundColor: '#FFFFFF',
|
|
18
|
+
color: '#111111',
|
|
19
|
+
padding: 20,
|
|
20
|
+
fontStyle: 'normal',
|
|
21
|
+
fontWeight: 'normal',
|
|
22
|
+
fontSize: 14
|
|
23
|
+
},
|
|
24
|
+
textStyle1: {
|
|
25
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
26
|
+
marginTop: 20,
|
|
27
|
+
marginStart: 20,
|
|
28
|
+
marginEnd: 20,
|
|
29
|
+
color: '#9D9D9D',
|
|
30
|
+
fontStyle: 'normal',
|
|
31
|
+
fontWeight: 'normal',
|
|
32
|
+
fontSize: 14
|
|
33
|
+
},
|
|
34
|
+
reasonTextStyle: {
|
|
35
|
+
flex: 1,
|
|
36
|
+
flexWrap: 'wrap',
|
|
37
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
38
|
+
fontStyle: 'normal',
|
|
39
|
+
fontSize: 14,
|
|
40
|
+
lineHeight: 21,
|
|
41
|
+
letterSpacing: 0.25,
|
|
42
|
+
textAlign: 'justify',
|
|
43
|
+
color: '#111111',
|
|
44
|
+
paddingTop: 5
|
|
45
|
+
},
|
|
46
|
+
reasonItemStyle: {
|
|
47
|
+
flexDirection: 'row',
|
|
48
|
+
paddingTop: 10,
|
|
49
|
+
paddingStart: 20,
|
|
50
|
+
paddingEnd: 20,
|
|
51
|
+
backgroundColor: 'white'
|
|
52
|
+
},
|
|
53
|
+
heading: {
|
|
54
|
+
marginTop: 30,
|
|
55
|
+
marginStart: 25,
|
|
56
|
+
fontSize: 14,
|
|
57
|
+
lineHeight: 21,
|
|
58
|
+
letterSpacing: 0.25,
|
|
59
|
+
fontFamily: 'IBMPlexSans_400Regular',
|
|
60
|
+
color: '#9D9D9D'
|
|
61
|
+
},
|
|
62
|
+
item: {
|
|
63
|
+
margin: 10,
|
|
64
|
+
padding: 15,
|
|
65
|
+
borderWidth: 0.2
|
|
66
|
+
},
|
|
67
|
+
btn: {
|
|
68
|
+
width: 240,
|
|
69
|
+
borderRadius: 4,
|
|
70
|
+
backgroundColor: '#62d1bc',
|
|
71
|
+
paddingHorizontal: 24,
|
|
72
|
+
paddingVertical: 12,
|
|
73
|
+
marginVertical: 8
|
|
74
|
+
},
|
|
75
|
+
loader: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
justifyContent: 'center',
|
|
78
|
+
alignItems: 'center'
|
|
79
|
+
},
|
|
80
|
+
flexCenter: {
|
|
81
|
+
width: 300,
|
|
82
|
+
height: 200,
|
|
83
|
+
flex: 1,
|
|
84
|
+
justifyContent: 'center',
|
|
85
|
+
alignItems: 'center'
|
|
86
|
+
},
|
|
87
|
+
paymentWaitIcon: {
|
|
88
|
+
backgroundColor: '#ECF0FF',
|
|
89
|
+
width: 113,
|
|
90
|
+
height: 113,
|
|
91
|
+
borderRadius: 60,
|
|
92
|
+
justifyContent: 'center',
|
|
93
|
+
alignItems: 'center'
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=PaymentStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["StyleSheet","Platform","Fonts","PaymentStyles","create","amountStyle","fontSize","fontWeight","fontStyle","textAlign","alignItems","paddingTop","paddingBottom","fontFamily","OS","IBMPlexSans_600SemiBold","messageStyle","IBMPlexSans_400Regular","backgroundColor","color","padding","textStyle1","marginTop","marginStart","marginEnd","reasonTextStyle","flex","flexWrap","lineHeight","letterSpacing","reasonItemStyle","flexDirection","paddingStart","paddingEnd","heading","item","margin","borderWidth","btn","width","borderRadius","paddingHorizontal","paddingVertical","marginVertical","loader","justifyContent","flexCenter","height","paymentWaitIcon"],"sources":["PaymentStyles.ts"],"sourcesContent":["import { StyleSheet, Platform } from 'react-native';\nimport { Fonts } from '../../../styles/executionTasks/CommonStyles';\n\nexport const PaymentStyles = StyleSheet.create({\n amountStyle: {\n fontSize: 18,\n fontWeight: '600',\n fontStyle: 'normal',\n // backgroundColor: 'white',\n textAlign: 'center',\n alignItems: 'center',\n paddingTop: 25,\n paddingBottom: 25,\n fontFamily: Platform.OS === 'android'\n ? Fonts.IBMPlexSans_600SemiBold\n : 'IBMPlexSans-SemiBold',\n },\n messageStyle: {\n fontFamily: Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n backgroundColor: '#FFFFFF',\n color: '#111111',\n padding: 20,\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n },\n textStyle1: {\n fontFamily: Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n marginTop: 20,\n marginStart: 20,\n marginEnd: 20,\n color: '#9D9D9D',\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 14,\n },\n reasonTextStyle: {\n flex: 1,\n flexWrap: 'wrap',\n fontFamily: Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n fontStyle: 'normal',\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n textAlign: 'justify',\n color: '#111111',\n paddingTop: 5,\n },\n\n reasonItemStyle: {\n flexDirection: 'row',\n paddingTop: 10,\n paddingStart: 20,\n paddingEnd: 20,\n backgroundColor: 'white',\n },\n heading: {\n marginTop: 30,\n marginStart: 25,\n fontSize: 14,\n lineHeight: 21,\n letterSpacing: 0.25,\n fontFamily: 'IBMPlexSans_400Regular',\n color: '#9D9D9D',\n },\n item: {\n margin: 10,\n padding: 15,\n borderWidth: 0.2,\n },\n btn: {\n width: 240,\n borderRadius: 4,\n backgroundColor: '#62d1bc',\n paddingHorizontal: 24,\n paddingVertical: 12,\n marginVertical: 8,\n },\n\n loader: { flex: 1, justifyContent: 'center', alignItems: 'center' },\n flexCenter: {\n width: 300,\n height: 200,\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n paymentWaitIcon: {\n backgroundColor: '#ECF0FF',\n width: 113,\n height: 113,\n borderRadius: 60,\n justifyContent: 'center',\n alignItems: 'center',\n },\n});\n"],"mappings":"AAAA,SAASA,UAAU,EAAEC,QAAQ,QAAQ,cAAc;AACnD,SAASC,KAAK,QAAQ,6CAA6C;AAEnE,OAAO,MAAMC,aAAa,GAAGH,UAAU,CAACI,MAAM,CAAC;EAC7CC,WAAW,EAAE;IACXC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,KAAK;IACjBC,SAAS,EAAE,QAAQ;IACnB;IACAC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,EAAE;IACjBC,UAAU,EAAEZ,QAAQ,CAACa,EAAE,KAAK,SAAS,GACnCZ,KAAK,CAACa,uBAAuB,GAC7B;EACJ,CAAC;EACDC,YAAY,EAAE;IACZH,UAAU,EAAEZ,QAAQ,CAACa,EAAE,KAAK,SAAS,GACnCZ,KAAK,CAACe,sBAAsB,GAC5B,qBAAqB;IACvBC,eAAe,EAAE,SAAS;IAC1BC,KAAK,EAAE,SAAS;IAChBC,OAAO,EAAE,EA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IACVC,YAAY,EAAE,CAAC;IACftB,eAAe,EAAE,SAAS;IAC1BuB,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE,EAAE;IACnBC,cAAc,EAAE;EAClB,CAAC;EAEDC,MAAM,EAAE;IAAElB,IAAI,EAAE,CAAC;IAAEmB,cAAc,EAAE,QAAQ;IAAEnC,UAAU,EAAE;EAAS,CAAC;EACnEoC,UAAU,EAAE;IACVP,KAAK,EAAE,GAAG;IACVQ,MAAM,EAAE,GAAG;IACXrB,IAAI,EAAE,CAAC;IACPmB,cAAc,EAAE,QAAQ;IACxBnC,UAAU,EAAE;EACd,CAAC;EACDsC,eAAe,EAAE;IACf9B,eAAe,EAAE,SAAS;IAC1BqB,KAAK,EAAE,GAAG;IACVQ,MAAM,EAAE,GAAG;IACXP,YAAY,EAAE,EAAE;IAChBK,cAAc,EAAE,QAAQ;IACxBnC,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import Logger, { LOG_TYPE } from '../../../utils/Logger';
|
|
2
|
+
import { getApiResponse } from '../../../utils/ApiUtils';
|
|
3
|
+
import * as jsonLogic from 'json-logic-js';
|
|
4
|
+
import { TRANSACTION_TYPE } from './CollectPaymentSchema';
|
|
5
|
+
export const PAYMENT_SHARED_PREF_KEY = '@Payment_';
|
|
6
|
+
export const PAYMENT_SELECTION_SHARED_PREF_KEY = '@Payment_Selection_';
|
|
7
|
+
export function getUniqueTransactionID(amt) {
|
|
8
|
+
return `TID${Date.now().toString() + amt.toString()}`;
|
|
9
|
+
}
|
|
10
|
+
export function getPaymentValue(amt, minorUnit) {
|
|
11
|
+
if (!minorUnit) return amt;
|
|
12
|
+
return amt / Math.pow(10, minorUnit);
|
|
13
|
+
}
|
|
14
|
+
export function getPaymentType(txnType) {
|
|
15
|
+
if (txnType === TRANSACTION_TYPE.LINK) {
|
|
16
|
+
return 'PAYMENT_LINK';
|
|
17
|
+
} else if (txnType === TRANSACTION_TYPE.QRCODE) {
|
|
18
|
+
return 'QR_CODE';
|
|
19
|
+
} else return null;
|
|
20
|
+
}
|
|
21
|
+
export function getPaymentLink(env, tenant, appAbbr, refId) {
|
|
22
|
+
let baseDomain = 'dev.os1.delhivery.com';
|
|
23
|
+
switch (env) {
|
|
24
|
+
case 'SHARED_P1':
|
|
25
|
+
case 'DLV_INDIA_P2':
|
|
26
|
+
baseDomain = 'os1.app';
|
|
27
|
+
break;
|
|
28
|
+
case 'SANDBOX':
|
|
29
|
+
baseDomain = 'sandbox.os1.app';
|
|
30
|
+
break;
|
|
31
|
+
case 'DEV':
|
|
32
|
+
default:
|
|
33
|
+
baseDomain = 'dev.os1.delhivery.com';
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
return `https://${tenant}.${baseDomain}/pay/${appAbbr}/${refId}`;
|
|
37
|
+
}
|
|
38
|
+
export const apiExecution = async api => {
|
|
39
|
+
try {
|
|
40
|
+
const apiData = {
|
|
41
|
+
errorJsonPath: '',
|
|
42
|
+
responseJsonPath: '',
|
|
43
|
+
uri: api.uri,
|
|
44
|
+
httpMethod: api.httpMethod,
|
|
45
|
+
timeout: api.timeout
|
|
46
|
+
};
|
|
47
|
+
if (api.headers) {
|
|
48
|
+
apiData.headers = api.headers;
|
|
49
|
+
}
|
|
50
|
+
if (api.requestBody) {
|
|
51
|
+
apiData.requestBody = api.requestBody;
|
|
52
|
+
}
|
|
53
|
+
if (api.pathParams) {
|
|
54
|
+
apiData.pathParams = api.pathParams;
|
|
55
|
+
}
|
|
56
|
+
if (api.queryParams) {
|
|
57
|
+
apiData.queryParams = api.queryParams;
|
|
58
|
+
}
|
|
59
|
+
const apiResponse = await getApiResponse(apiData);
|
|
60
|
+
console.log('apiResponse: ', JSON.stringify(apiResponse.data));
|
|
61
|
+
return jsonLogic.apply(api.responseJsonLogic, apiResponse.data);
|
|
62
|
+
} catch (error) {
|
|
63
|
+
console.log('error: ', error);
|
|
64
|
+
console.log('error: ', JSON.stringify(error));
|
|
65
|
+
Logger.getInstance().logEvent('~ api triggered ', error.message, LOG_TYPE.SDK_ERROR);
|
|
66
|
+
// return false;
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export async function getPaymentDataMO(mergedObjectiveIds, refId, storage) {
|
|
70
|
+
/**
|
|
71
|
+
* Can use bulk get here, but probability of getting the item on first render is more compared to
|
|
72
|
+
* fetching all the data and finding a single moId
|
|
73
|
+
*/
|
|
74
|
+
/* for await (const moId of mergedObjectiveId) {
|
|
75
|
+
const moIdPaymentData = await storage.getSharedItem(
|
|
76
|
+
PAYMENT_SHARED_PREF_KEY + moId
|
|
77
|
+
);
|
|
78
|
+
if (moIdPaymentData) {
|
|
79
|
+
const parsedPaymentData: sharedPrefPaymentDataInterface =
|
|
80
|
+
JSON.parse(moIdPaymentData);
|
|
81
|
+
if (parsedPaymentData.refId === refId) {
|
|
82
|
+
return parsedPaymentData;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} */
|
|
86
|
+
|
|
87
|
+
const moIdPaymentData = await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + refId);
|
|
88
|
+
if (moIdPaymentData) {
|
|
89
|
+
const parsedPaymentData = JSON.parse(moIdPaymentData);
|
|
90
|
+
if (parsedPaymentData.moIds.some(value => mergedObjectiveIds.includes(value))) {
|
|
91
|
+
return parsedPaymentData;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
export async function setSharedPrefPaymentData(refId,
|
|
97
|
+
// moIds: string[],
|
|
98
|
+
payload, storage) {
|
|
99
|
+
await storage.setSharedItem(PAYMENT_SHARED_PREF_KEY + refId, JSON.stringify(payload));
|
|
100
|
+
/* let finalPayload: { key: string; value: string }[] = [];
|
|
101
|
+
for (const moId of moIds) {
|
|
102
|
+
finalPayload.push({
|
|
103
|
+
key: PAYMENT_SHARED_PREF_KEY + moId,
|
|
104
|
+
value: JSON.stringify(payload),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
await storage.setSharedItems(finalPayload); */
|
|
108
|
+
}
|
|
109
|
+
export async function getSharedPrefPaymentSelection(refId, storage) {
|
|
110
|
+
let prevSelection = await storage.getSharedItem(PAYMENT_SELECTION_SHARED_PREF_KEY + refId);
|
|
111
|
+
if (prevSelection) {
|
|
112
|
+
return JSON.parse(prevSelection);
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
export async function setSharedPrefPaymentSelection(refId, mode, storage) {
|
|
117
|
+
let updatedPayload = [mode];
|
|
118
|
+
let prevSelection = await getSharedPrefPaymentSelection(refId, storage);
|
|
119
|
+
if (prevSelection) {
|
|
120
|
+
updatedPayload = [...new Set([...prevSelection, mode])];
|
|
121
|
+
}
|
|
122
|
+
await storage.setSharedItem(PAYMENT_SELECTION_SHARED_PREF_KEY + refId, JSON.stringify(updatedPayload));
|
|
123
|
+
}
|
|
124
|
+
export async function removeSharedPrefPaymentData(refId, storage) {
|
|
125
|
+
await storage.removeSharedItem(PAYMENT_SHARED_PREF_KEY + refId);
|
|
126
|
+
}
|
|
127
|
+
export const formatTime = time => {
|
|
128
|
+
const minutes = Math.floor(time / 60);
|
|
129
|
+
const remainingSeconds = time % 60;
|
|
130
|
+
return `${minutes > 0 ? String(minutes).padStart(2, '') + ' min' : ''} ${String(remainingSeconds).padStart(2, '')} sec`;
|
|
131
|
+
};
|
|
132
|
+
//# sourceMappingURL=PaymentUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Logger","LOG_TYPE","getApiResponse","jsonLogic","TRANSACTION_TYPE","PAYMENT_SHARED_PREF_KEY","PAYMENT_SELECTION_SHARED_PREF_KEY","getUniqueTransactionID","amt","Date","now","toString","getPaymentValue","minorUnit","Math","pow","getPaymentType","txnType","LINK","QRCODE","getPaymentLink","env","tenant","appAbbr","refId","baseDomain","apiExecution","api","apiData","errorJsonPath","responseJsonPath","uri","httpMethod","timeout","headers","requestBody","pathParams","queryParams","apiResponse","console","log","JSON","stringify","data","apply","responseJsonLogic","error","getInstance","logEvent","message","SDK_ERROR","getPaymentDataMO","mergedObjectiveIds","storage","moIdPaymentData","getSharedItem","parsedPaymentData","parse","moIds","some","value","includes","setSharedPrefPaymentData","payload","setSharedItem","getSharedPrefPaymentSelection","prevSelection","setSharedPrefPaymentSelection","mode","updatedPayload","Set","removeSharedPrefPaymentData","removeSharedItem","formatTime","time","minutes","floor","remainingSeconds","String","padStart"],"sources":["PaymentUtils.ts"],"sourcesContent":["import Logger, { LOG_TYPE } from '../../../utils/Logger';\nimport { APIData, getApiResponse } from '../../../utils/ApiUtils';\nimport * as jsonLogic from 'json-logic-js';\nimport {\n API,\n AllowedModes,\n TRANSACTION_TYPE,\n sharedPrefPaymentDataInterface,\n} from './CollectPaymentSchema';\nimport Storage from '../../../utils/storage';\nimport { ENV } from '../../../models/sdk';\n\nexport const PAYMENT_SHARED_PREF_KEY = '@Payment_';\nexport const PAYMENT_SELECTION_SHARED_PREF_KEY = '@Payment_Selection_';\n\nexport function getUniqueTransactionID(amt: number): string {\n return `TID${Date.now().toString() + amt.toString()}`;\n}\nexport function getPaymentValue(amt: number, minorUnit?: number): number {\n if (!minorUnit) return amt;\n return amt / Math.pow(10, minorUnit);\n}\n\nexport function getPaymentType(txnType: TRANSACTION_TYPE): AllowedModes | null {\n if (txnType === TRANSACTION_TYPE.LINK) {\n return 'PAYMENT_LINK';\n } else if (txnType === TRANSACTION_TYPE.QRCODE) {\n return 'QR_CODE';\n } else return null;\n}\n\nexport function getPaymentLink(\n env: ENV,\n tenant: string,\n appAbbr: string,\n refId: string\n) {\n let baseDomain = 'dev.os1.delhivery.com';\n switch (env) {\n case 'SHARED_P1':\n case 'DLV_INDIA_P2':\n baseDomain = 'os1.app';\n break;\n case 'SANDBOX':\n baseDomain = 'sandbox.os1.app';\n break;\n case 'DEV':\n default:\n baseDomain = 'dev.os1.delhivery.com';\n break;\n }\n return `https://${tenant}.${baseDomain}/pay/${appAbbr}/${refId}`;\n}\n\nexport const apiExecution = async (api: API) => {\n try {\n const apiData: APIData = {\n errorJsonPath: '',\n responseJsonPath: '',\n uri: api.uri,\n httpMethod: api.httpMethod,\n timeout: api.timeout,\n };\n if (api.headers) {\n apiData.headers = api.headers;\n }\n if (api.requestBody) {\n apiData.requestBody = api.requestBody;\n }\n if (api.pathParams) {\n apiData.pathParams = api.pathParams;\n }\n if (api.queryParams) {\n apiData.queryParams = api.queryParams;\n }\n\n const apiResponse = await getApiResponse(apiData);\n console.log('apiResponse: ', JSON.stringify(apiResponse.data));\n\n return jsonLogic.apply(\n <jsonLogic.RulesLogic>api.responseJsonLogic,\n apiResponse.data\n );\n } catch (error: any) {\n console.log('error: ', error);\n console.log('error: ', JSON.stringify(error));\n\n Logger.getInstance().logEvent(\n '~ api triggered ',\n error.message,\n LOG_TYPE.SDK_ERROR\n );\n // return false;\n }\n};\n\nexport async function getPaymentDataMO(\n mergedObjectiveIds: string[],\n refId: string,\n storage: Storage\n) {\n /**\n * Can use bulk get here, but probability of getting the item on first render is more compared to\n * fetching all the data and finding a single moId\n */\n /* for await (const moId of mergedObjectiveId) {\n const moIdPaymentData = await storage.getSharedItem(\n PAYMENT_SHARED_PREF_KEY + moId\n );\n if (moIdPaymentData) {\n const parsedPaymentData: sharedPrefPaymentDataInterface =\n JSON.parse(moIdPaymentData);\n if (parsedPaymentData.refId === refId) {\n return parsedPaymentData;\n }\n }\n } */\n\n const moIdPaymentData = await storage.getSharedItem(\n PAYMENT_SHARED_PREF_KEY + refId\n );\n if (moIdPaymentData) {\n const parsedPaymentData: sharedPrefPaymentDataInterface =\n JSON.parse(moIdPaymentData);\n if (\n parsedPaymentData.moIds.some((value) =>\n mergedObjectiveIds.includes(value)\n )\n ) {\n return parsedPaymentData;\n }\n }\n return null;\n}\n\nexport async function setSharedPrefPaymentData(\n refId: string,\n // moIds: string[],\n payload: sharedPrefPaymentDataInterface,\n storage: Storage\n) {\n await storage.setSharedItem(\n PAYMENT_SHARED_PREF_KEY + refId,\n JSON.stringify(payload)\n );\n /* let finalPayload: { key: string; value: string }[] = [];\n for (const moId of moIds) {\n finalPayload.push({\n key: PAYMENT_SHARED_PREF_KEY + moId,\n value: JSON.stringify(payload),\n });\n }\n await storage.setSharedItems(finalPayload); */\n}\n\nexport async function getSharedPrefPaymentSelection(\n refId: string,\n storage: Storage\n): Promise<AllowedModes[] | null> {\n let prevSelection = await storage.getSharedItem(\n PAYMENT_SELECTION_SHARED_PREF_KEY + refId\n );\n if (prevSelection) {\n return JSON.parse(prevSelection);\n }\n\n return null;\n}\n\nexport async function setSharedPrefPaymentSelection(\n refId: string,\n mode: AllowedModes,\n storage: Storage\n) {\n let updatedPayload = [mode];\n let prevSelection = await getSharedPrefPaymentSelection(refId, storage);\n if (prevSelection) {\n updatedPayload = [...new Set([...prevSelection, mode])];\n }\n\n await storage.setSharedItem(\n PAYMENT_SELECTION_SHARED_PREF_KEY + refId,\n JSON.stringify(updatedPayload)\n );\n}\n\nexport async function removeSharedPrefPaymentData(\n refId: string,\n storage: Storage\n) {\n await storage.removeSharedItem(PAYMENT_SHARED_PREF_KEY + refId);\n}\n\nexport const formatTime = (time: number) => {\n const minutes = Math.floor(time / 60);\n const remainingSeconds = time % 60;\n return `${\n minutes > 0 ? String(minutes).padStart(2, '') + ' min' : ''\n } ${String(remainingSeconds).padStart(2, '')} sec`;\n};\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,QAAQ,QAAQ,uBAAuB;AACxD,SAAkBC,cAAc,QAAQ,yBAAyB;AACjE,OAAO,KAAKC,SAAS,MAAM,eAAe;AAC1C,SAGEC,gBAAgB,QAEX,wBAAwB;AAI/B,OAAO,MAAMC,uBAAuB,GAAG,WAAW;AAClD,OAAO,MAAMC,iCAAiC,GAAG,qBAAqB;AAEtE,OAAO,SAASC,sBAAsBA,CAACC,GAAW,EAAU;EAC1D,OAAO,MAAMC,IAAI,CAACC,GAAG,CAAC,CAAC,CAACC,QAAQ,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