@os1-platform/dispatch-mobile 2.1.21 → 2.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +122 -11
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js +1 -1
- package/lib/commonjs/analytics/firebase/FirebaseLogging.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
- package/lib/commonjs/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js +9 -10
- package/lib/commonjs/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js +16 -6
- package/lib/commonjs/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js +8 -1
- package/lib/commonjs/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js +8 -10
- package/lib/commonjs/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js +2 -2
- package/lib/commonjs/components/executiontasks/captureInput/CaptureText.js.map +1 -1
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js +40 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js +35 -0
- package/lib/commonjs/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js +102 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js +151 -0
- package/lib/commonjs/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js +188 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js +442 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js +538 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js +887 -0
- package/lib/commonjs/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js +14 -20
- package/lib/commonjs/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js +24 -27
- package/lib/commonjs/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js +1 -1
- package/lib/commonjs/components/executiontasks/display/DisplayModalET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js +2 -3
- package/lib/commonjs/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js +9 -3
- package/lib/commonjs/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js +2 -2
- package/lib/commonjs/components/executiontasks/forms/FormGenerator.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js +13 -14
- package/lib/commonjs/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js +2 -2
- package/lib/commonjs/components/executiontasks/forms/widgets/DropdownWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +11 -12
- package/lib/commonjs/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js +3 -3
- package/lib/commonjs/components/executiontasks/forms/widgets/TimeRangeSelector.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpEtUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js +2 -2
- package/lib/commonjs/components/executiontasks/httpRequest/HttpRequestET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js +11 -13
- package/lib/commonjs/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js +11 -2
- package/lib/commonjs/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js +2 -2
- package/lib/commonjs/components/executiontasks/payments/completePayment/CompletePaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js +5 -6
- package/lib/commonjs/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js +2 -2
- package/lib/commonjs/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js +14 -20
- package/lib/commonjs/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js +18 -24
- package/lib/commonjs/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/ScanET.js +4 -6
- package/lib/commonjs/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js +4 -5
- package/lib/commonjs/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js +1 -2
- package/lib/commonjs/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js +2 -4
- package/lib/commonjs/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js +3 -6
- package/lib/commonjs/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/commonjs/components/executiontasks/scan/utils.js +14 -8
- package/lib/commonjs/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js +2 -2
- package/lib/commonjs/components/executiontasks/validateOTP/sub-components/OTPInput.js.map +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js +1 -1
- package/lib/commonjs/components/executiontasks/validateOTP/utils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyLocation/GeofenceUtils.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyLocation/VerifyLocationET.js.map +1 -1
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js +2 -2
- package/lib/commonjs/components/executiontasks/verifyOtp/VerifyOtpET.js.map +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js +1 -1
- package/lib/commonjs/components/widgets/AlertDisplay.js.map +1 -1
- package/lib/commonjs/components/widgets/CancelOrderDialog.js +2 -2
- package/lib/commonjs/components/widgets/CancelOrderDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/Card.js +1 -2
- package/lib/commonjs/components/widgets/Card.js.map +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js +1 -1
- package/lib/commonjs/components/widgets/GoBackModal.js.map +1 -1
- package/lib/commonjs/components/widgets/IconButton.js +20 -23
- package/lib/commonjs/components/widgets/IconButton.js.map +1 -1
- package/lib/commonjs/components/widgets/ModalWidget.js +3 -1
- package/lib/commonjs/components/widgets/ModalWidget.js.map +1 -1
- package/lib/commonjs/components/widgets/ProgressDialog.js +3 -3
- package/lib/commonjs/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js +1 -1
- package/lib/commonjs/components/widgets/SearchBar.js.map +1 -1
- package/lib/commonjs/components/widgets/SnackBarCustom.js +22 -21
- package/lib/commonjs/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/commonjs/components/widgets/SplitTextInput.js +10 -11
- package/lib/commonjs/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js +1 -1
- package/lib/commonjs/components/widgets/TabsComponent.js.map +1 -1
- package/lib/commonjs/components/widgets/Timer.js +40 -0
- package/lib/commonjs/components/widgets/Timer.js.map +1 -0
- package/lib/commonjs/constants/apiConstants.js +4 -1
- package/lib/commonjs/constants/apiConstants.js.map +1 -1
- package/lib/commonjs/constants/constants.js +4 -1
- package/lib/commonjs/constants/constants.js.map +1 -1
- package/lib/commonjs/errors/BaseError.js +3 -3
- package/lib/commonjs/events/EventDispatcher.js +5 -1
- package/lib/commonjs/events/EventDispatcher.js.map +1 -1
- package/lib/commonjs/events/constants.js +2 -1
- package/lib/commonjs/events/constants.js.map +1 -1
- package/lib/commonjs/events/index.js +1 -1
- package/lib/commonjs/events/index.js.map +1 -1
- package/lib/commonjs/events/interface.js.map +1 -1
- package/lib/commonjs/icons/CircleMark.js +27 -0
- package/lib/commonjs/icons/CircleMark.js.map +1 -0
- package/lib/commonjs/icons/FailedIcon.js +69 -0
- package/lib/commonjs/icons/FailedIcon.js.map +1 -0
- package/lib/commonjs/icons/FailureCloseIcon.js +42 -0
- package/lib/commonjs/icons/FailureCloseIcon.js.map +1 -0
- package/lib/commonjs/icons/ScanIcon.js +1 -1
- package/lib/commonjs/icons/ScanIcon.js.map +1 -1
- package/lib/commonjs/icons/SuccessCompleteIcon.js +42 -0
- package/lib/commonjs/icons/SuccessCompleteIcon.js.map +1 -0
- package/lib/commonjs/icons/file.js +1 -1
- package/lib/commonjs/icons/file.js.map +1 -1
- package/lib/commonjs/index.js +2 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/i18n.js +1 -1
- package/lib/commonjs/locale/i18n.js.map +1 -1
- package/lib/commonjs/locale/util.js +1 -1
- package/lib/commonjs/locale/util.js.map +1 -1
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js +11 -9
- package/lib/commonjs/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js +7 -7
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js +6 -6
- package/lib/commonjs/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/commonjs/manager/location/LocationManager.js +6 -6
- package/lib/commonjs/manager/location/LocationManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js +8 -8
- package/lib/commonjs/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js +6 -6
- package/lib/commonjs/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/commonjs/manager/sdk/callbacksHandler.js +4 -4
- package/lib/commonjs/manager/sdk/callbacksHandler.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js +7 -7
- package/lib/commonjs/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/database.js +2 -2
- package/lib/commonjs/manager/syncmanager/database.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js +2 -2
- package/lib/commonjs/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js +6 -6
- package/lib/commonjs/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js +8 -16
- package/lib/commonjs/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js +6 -7
- package/lib/commonjs/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js +7 -8
- package/lib/commonjs/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js +5 -9
- package/lib/commonjs/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/commonjs/models/DispatchModels.js.map +1 -1
- package/lib/commonjs/models/execTasks/ETConfig.js +3 -0
- package/lib/commonjs/models/execTasks/ETConfig.js.map +1 -1
- package/lib/commonjs/models/sdk.js.map +1 -1
- package/lib/commonjs/native/signature/SignatureCapture.js +5 -5
- package/lib/commonjs/native/signature/SignatureCapture.js.map +1 -1
- package/lib/commonjs/network/GraphQLClient.js +15 -19
- package/lib/commonjs/network/GraphQLClient.js.map +1 -1
- package/lib/commonjs/network/NetworkClient.js +30 -3
- package/lib/commonjs/network/NetworkClient.js.map +1 -1
- package/lib/commonjs/network/NetworkUtils.js +2 -5
- package/lib/commonjs/network/NetworkUtils.js.map +1 -1
- package/lib/commonjs/network/Queries.js.map +1 -1
- package/lib/commonjs/network/client.js +5 -5
- package/lib/commonjs/network/client.js.map +1 -1
- package/lib/commonjs/resources/Login.js +4 -4
- package/lib/commonjs/resources/Login.js.map +1 -1
- package/lib/commonjs/resources/network.js +4 -4
- package/lib/commonjs/resources/network.js.map +1 -1
- package/lib/commonjs/styles/executionTasks/CommonStyles.js +13 -3
- package/lib/commonjs/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/commonjs/ui/screens/CancellationScreen.js +7 -8
- package/lib/commonjs/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CaptureInputScreen.js +8 -9
- package/lib/commonjs/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js +251 -0
- package/lib/commonjs/ui/screens/CollectPaymentScreen.js.map +1 -0
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js +7 -8
- package/lib/commonjs/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DeliverScreen.js +8 -9
- package/lib/commonjs/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DisplayScreen.js +8 -9
- package/lib/commonjs/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DoodleScreen.js +8 -9
- package/lib/commonjs/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/DropCashScreen.js +43 -11
- package/lib/commonjs/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js +8 -1
- package/lib/commonjs/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/commonjs/ui/screens/FormsScreen.js +8 -9
- package/lib/commonjs/ui/screens/FormsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/GeofenceScreen.js +8 -9
- package/lib/commonjs/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HttpRequestScreen.js +7 -8
- package/lib/commonjs/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js +8 -9
- package/lib/commonjs/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PaymentScreen.js +9 -9
- package/lib/commonjs/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PickupScreen.js +8 -9
- package/lib/commonjs/ui/screens/PickupScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ScanScreen.js +8 -10
- package/lib/commonjs/ui/screens/ScanScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js +13 -9
- package/lib/commonjs/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js +8 -9
- package/lib/commonjs/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js +3 -3
- package/lib/commonjs/ui/screens/WithBaseDispatchScreen.js.map +1 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js +2 -1
- package/lib/commonjs/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/commonjs/utils/ApiUtils.js +3 -1
- package/lib/commonjs/utils/ApiUtils.js.map +1 -1
- package/lib/commonjs/utils/ExecTaskUtils.js +35 -5
- package/lib/commonjs/utils/ExecTaskUtils.js.map +1 -1
- package/lib/commonjs/utils/Logger.js +6 -7
- package/lib/commonjs/utils/Logger.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +4 -4
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/SdkUtils.js +2 -2
- package/lib/commonjs/utils/SdkUtils.js.map +1 -1
- package/lib/commonjs/utils/SyncManagerUtils.js +3 -3
- package/lib/commonjs/utils/SyncManagerUtils.js.map +1 -1
- package/lib/commonjs/utils/context/paymentContext.js +9 -0
- package/lib/commonjs/utils/context/paymentContext.js.map +1 -0
- package/lib/commonjs/utils/fcm/FCM.js +22 -4
- package/lib/commonjs/utils/fcm/FCM.js.map +1 -1
- package/lib/commonjs/utils/fcm/FcmUtils.js +12 -2
- package/lib/commonjs/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/commonjs/utils/helper.js +6 -6
- package/lib/commonjs/utils/helper.js.map +1 -1
- package/lib/commonjs/utils/hooks/useModal.js +4 -3
- package/lib/commonjs/utils/hooks/useModal.js.map +1 -1
- package/lib/commonjs/utils/hooks/useTimer.js.map +1 -1
- package/lib/commonjs/utils/loginHelper.js +1 -1
- package/lib/commonjs/utils/loginHelper.js.map +1 -1
- package/lib/commonjs/utils/storage.js +11 -17
- package/lib/commonjs/utils/storage.js.map +1 -1
- package/lib/commonjs/utils/utils.js +2 -3
- package/lib/commonjs/utils/utils.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js +5 -5
- package/lib/module/analytics/sentry/SentryAnalyticsSingleton.js.map +1 -1
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js +7 -8
- package/lib/module/analytics/sentry/SentryAnalyticsUtils.js.map +1 -1
- package/lib/module/components/dispatch/DispatchExecNavigator.js +14 -4
- package/lib/module/components/dispatch/DispatchExecNavigator.js.map +1 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js +2 -1
- package/lib/module/components/executiontasks/ExecutionTasksIndex.js.map +1 -1
- package/lib/module/components/executiontasks/cancellation/CancelET.js +6 -8
- package/lib/module/components/executiontasks/cancellation/CancelET.js.map +1 -1
- package/lib/module/components/executiontasks/collectPayment/CollectPayment.js +32 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js +29 -0
- package/lib/module/components/executiontasks/collectPayment/CollectPaymentSchema.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js +96 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentStyles.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js +132 -0
- package/lib/module/components/executiontasks/collectPayment/PaymentUtils.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js +179 -0
- package/lib/module/components/executiontasks/collectPayment/components/CompletePayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js +2 -0
- package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js +433 -0
- package/lib/module/components/executiontasks/collectPayment/components/InitPayment.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js +531 -0
- package/lib/module/components/executiontasks/collectPayment/components/PaymentContactDetails.js.map +1 -0
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js +880 -0
- package/lib/module/components/executiontasks/collectPayment/components/ProcessPayment.js.map +1 -0
- package/lib/module/components/executiontasks/deliver/DeliverET.js +13 -19
- package/lib/module/components/executiontasks/deliver/DeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js +21 -24
- package/lib/module/components/executiontasks/deliver/SLDeliverET.js.map +1 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js +0 -1
- package/lib/module/components/executiontasks/doodle/SignatureET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/DropCashET.js.map +1 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js +6 -1
- package/lib/module/components/executiontasks/dropCash/SLDropCash.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js +11 -12
- package/lib/module/components/executiontasks/forms/widgets/DateTimeWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js +9 -10
- package/lib/module/components/executiontasks/forms/widgets/QRBarcodeScannerWidget.js.map +1 -1
- package/lib/module/components/executiontasks/forms/widgets/TimeRangeSelector.js +1 -1
- package/lib/module/components/executiontasks/imageCapture/CaptureUtils.js.map +1 -1
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js +9 -11
- package/lib/module/components/executiontasks/imageCapture/ImageCapture.js.map +1 -1
- package/lib/module/components/executiontasks/payments/PaymentUtils.js +11 -2
- package/lib/module/components/executiontasks/payments/PaymentUtils.js.map +1 -1
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js +3 -4
- package/lib/module/components/executiontasks/payments/init/InitPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/payments/processPayment/ProcessPaymentET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/PickupET.js +13 -19
- package/lib/module/components/executiontasks/pickup/PickupET.js.map +1 -1
- package/lib/module/components/executiontasks/pickup/SLPickupET.js +15 -21
- package/lib/module/components/executiontasks/pickup/SLPickupET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/ScanET.js +2 -4
- package/lib/module/components/executiontasks/scan/ScanET.js.map +1 -1
- package/lib/module/components/executiontasks/scan/constants.js.map +1 -1
- package/lib/module/components/executiontasks/scan/interfaces.js.map +1 -1
- package/lib/module/components/executiontasks/scan/modalConstant.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js +3 -4
- package/lib/module/components/executiontasks/scan/sub_components/CScanner.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js +0 -1
- package/lib/module/components/executiontasks/scan/sub_components/DropDownUtils.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js +0 -2
- package/lib/module/components/executiontasks/scan/sub_components/ERDropDown.js.map +1 -1
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js +1 -4
- package/lib/module/components/executiontasks/scan/sub_components/SummaryPage.js.map +1 -1
- package/lib/module/components/executiontasks/scan/utils.js +11 -6
- package/lib/module/components/executiontasks/scan/utils.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/ValidateOTPET.js.map +1 -1
- package/lib/module/components/executiontasks/validateOTP/constants.js.map +1 -1
- package/lib/module/components/widgets/Card.js +0 -1
- package/lib/module/components/widgets/Card.js.map +1 -1
- package/lib/module/components/widgets/IconButton.js +19 -22
- package/lib/module/components/widgets/IconButton.js.map +1 -1
- package/lib/module/components/widgets/ModalWidget.js +1 -0
- package/lib/module/components/widgets/ModalWidget.js.map +1 -1
- package/lib/module/components/widgets/ProgressDialog.js +2 -2
- package/lib/module/components/widgets/ProgressDialog.js.map +1 -1
- package/lib/module/components/widgets/SnackBarCustom.js +21 -20
- package/lib/module/components/widgets/SnackBarCustom.js.map +1 -1
- package/lib/module/components/widgets/SplitTextInput.js +9 -10
- package/lib/module/components/widgets/SplitTextInput.js.map +1 -1
- package/lib/module/components/widgets/Timer.js +32 -0
- package/lib/module/components/widgets/Timer.js.map +1 -0
- package/lib/module/constants/apiConstants.js +4 -1
- package/lib/module/constants/apiConstants.js.map +1 -1
- package/lib/module/constants/constants.js +3 -0
- package/lib/module/constants/constants.js.map +1 -1
- package/lib/module/errors/BaseError.js +3 -3
- package/lib/module/events/EventDispatcher.js +3 -0
- package/lib/module/events/EventDispatcher.js.map +1 -1
- package/lib/module/events/constants.js +2 -1
- package/lib/module/events/constants.js.map +1 -1
- package/lib/module/events/interface.js.map +1 -1
- package/lib/module/icons/CircleMark.js +20 -0
- package/lib/module/icons/CircleMark.js.map +1 -0
- package/lib/module/icons/FailedIcon.js +62 -0
- package/lib/module/icons/FailedIcon.js.map +1 -0
- package/lib/module/icons/FailureCloseIcon.js +35 -0
- package/lib/module/icons/FailureCloseIcon.js.map +1 -0
- package/lib/module/icons/SuccessCompleteIcon.js +35 -0
- package/lib/module/icons/SuccessCompleteIcon.js.map +1 -0
- package/lib/module/manager/dispatch/DispatchStateContainer.js +10 -8
- package/lib/module/manager/dispatch/DispatchStateContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js +5 -5
- package/lib/module/manager/dispatchCodes/EventCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js +5 -5
- package/lib/module/manager/dispatchCodes/EventCodeRepo.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js +5 -5
- package/lib/module/manager/dispatchCodes/ReasonCodeContainer.js.map +1 -1
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js +5 -5
- package/lib/module/manager/dispatchCodes/ReasonCodeRepo.js.map +1 -1
- package/lib/module/manager/location/LocationManager.js +5 -5
- package/lib/module/manager/location/LocationManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSDKManager.js +6 -6
- package/lib/module/manager/sdk/DispatchSDKManager.js.map +1 -1
- package/lib/module/manager/sdk/DispatchSdkCache.js +5 -5
- package/lib/module/manager/sdk/DispatchSdkCache.js.map +1 -1
- package/lib/module/manager/sdk/callbacksHandler.js +3 -3
- package/lib/module/manager/syncmanager/AppSyncManager.js +5 -5
- package/lib/module/manager/syncmanager/AppSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/DBConfig.js +1 -0
- package/lib/module/manager/syncmanager/DBConfig.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentHttpClient.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentManager.js +5 -5
- package/lib/module/manager/syncmanager/document/DocumentManager.js.map +1 -1
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js +6 -14
- package/lib/module/manager/syncmanager/document/DocumentSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/ETEventsManager.js +5 -6
- package/lib/module/manager/syncmanager/events/ETEventsManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js +5 -6
- package/lib/module/manager/syncmanager/events/EventsSyncManager.js.map +1 -1
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js +3 -7
- package/lib/module/manager/syncmanager/events/SyncHttpClient.js.map +1 -1
- package/lib/module/models/DispatchModels.js.map +1 -1
- package/lib/module/models/execTasks/ETConfig.js +3 -0
- package/lib/module/models/execTasks/ETConfig.js.map +1 -1
- package/lib/module/models/sdk.js.map +1 -1
- package/lib/module/native/signature/SignatureCapture.js +4 -4
- package/lib/module/network/GraphQLClient.js +14 -18
- package/lib/module/network/GraphQLClient.js.map +1 -1
- package/lib/module/network/NetworkClient.js +29 -2
- package/lib/module/network/NetworkClient.js.map +1 -1
- package/lib/module/network/NetworkUtils.js +1 -4
- package/lib/module/network/NetworkUtils.js.map +1 -1
- package/lib/module/network/Queries.js.map +1 -1
- package/lib/module/network/client.js +4 -4
- package/lib/module/network/client.js.map +1 -1
- package/lib/module/resources/Login.js +3 -3
- package/lib/module/resources/network.js +3 -3
- package/lib/module/styles/executionTasks/CommonStyles.js +12 -2
- package/lib/module/styles/executionTasks/CommonStyles.js.map +1 -1
- package/lib/module/ui/screens/CancellationScreen.js +5 -6
- package/lib/module/ui/screens/CancellationScreen.js.map +1 -1
- package/lib/module/ui/screens/CaptureInputScreen.js +6 -7
- package/lib/module/ui/screens/CaptureInputScreen.js.map +1 -1
- package/lib/module/ui/screens/CollectPaymentScreen.js +244 -0
- package/lib/module/ui/screens/CollectPaymentScreen.js.map +1 -0
- package/lib/module/ui/screens/CompleteObjectiveScreen.js +5 -6
- package/lib/module/ui/screens/CompleteObjectiveScreen.js.map +1 -1
- package/lib/module/ui/screens/DeliverScreen.js +6 -7
- package/lib/module/ui/screens/DeliverScreen.js.map +1 -1
- package/lib/module/ui/screens/DisplayScreen.js +6 -7
- package/lib/module/ui/screens/DisplayScreen.js.map +1 -1
- package/lib/module/ui/screens/DoodleScreen.js +6 -7
- package/lib/module/ui/screens/DoodleScreen.js.map +1 -1
- package/lib/module/ui/screens/DropCashScreen.js +41 -10
- package/lib/module/ui/screens/DropCashScreen.js.map +1 -1
- package/lib/module/ui/screens/ETScreensIndex.js +2 -1
- package/lib/module/ui/screens/ETScreensIndex.js.map +1 -1
- package/lib/module/ui/screens/FormsScreen.js +6 -7
- package/lib/module/ui/screens/FormsScreen.js.map +1 -1
- package/lib/module/ui/screens/GeofenceScreen.js +6 -7
- package/lib/module/ui/screens/GeofenceScreen.js.map +1 -1
- package/lib/module/ui/screens/HttpRequestScreen.js +6 -7
- package/lib/module/ui/screens/HttpRequestScreen.js.map +1 -1
- package/lib/module/ui/screens/ImageCaptureScreen.js +6 -7
- package/lib/module/ui/screens/ImageCaptureScreen.js.map +1 -1
- package/lib/module/ui/screens/PaymentScreen.js +7 -7
- package/lib/module/ui/screens/PaymentScreen.js.map +1 -1
- package/lib/module/ui/screens/PickupScreen.js +6 -7
- package/lib/module/ui/screens/PickupScreen.js.map +1 -1
- package/lib/module/ui/screens/ScanScreen.js +6 -8
- package/lib/module/ui/screens/ScanScreen.js.map +1 -1
- package/lib/module/ui/screens/StartWorkFlowScreen.js +11 -7
- package/lib/module/ui/screens/StartWorkFlowScreen.js.map +1 -1
- package/lib/module/ui/screens/ValidateOTPScreen.js +6 -7
- package/lib/module/ui/screens/ValidateOTPScreen.js.map +1 -1
- package/lib/module/ui/screens/WithBaseDispatchScreen.js +1 -1
- package/lib/module/ui/uiConfig/RouteParams.js +2 -1
- package/lib/module/ui/uiConfig/RouteParams.js.map +1 -1
- package/lib/module/utils/ApiUtils.js +2 -0
- package/lib/module/utils/ApiUtils.js.map +1 -1
- package/lib/module/utils/ExecTaskUtils.js +31 -4
- package/lib/module/utils/ExecTaskUtils.js.map +1 -1
- package/lib/module/utils/Logger.js +5 -6
- package/lib/module/utils/Logger.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -3
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/SdkUtils.js.map +1 -1
- package/lib/module/utils/SyncManagerUtils.js +1 -1
- package/lib/module/utils/SyncManagerUtils.js.map +1 -1
- package/lib/module/utils/context/paymentContext.js +3 -0
- package/lib/module/utils/context/paymentContext.js.map +1 -0
- package/lib/module/utils/fcm/FCM.js +20 -2
- package/lib/module/utils/fcm/FCM.js.map +1 -1
- package/lib/module/utils/fcm/FcmUtils.js +10 -0
- package/lib/module/utils/fcm/FcmUtils.js.map +1 -1
- package/lib/module/utils/helper.js +5 -5
- package/lib/module/utils/helper.js.map +1 -1
- package/lib/module/utils/hooks/useModal.js +2 -1
- package/lib/module/utils/hooks/useModal.js.map +1 -1
- package/lib/module/utils/hooks/useTimer.js.map +1 -1
- package/lib/module/utils/storage.js +9 -15
- package/lib/module/utils/storage.js.map +1 -1
- package/lib/module/utils/utils.js +1 -2
- package/lib/module/utils/utils.js.map +1 -1
- package/lib/typescript/components/executiontasks/ExecutionTasksIndex.d.ts +4 -2
- package/lib/typescript/components/executiontasks/collectPayment/CollectPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/CollectPaymentSchema.d.ts +155 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentStyles.d.ts +92 -0
- package/lib/typescript/components/executiontasks/collectPayment/PaymentUtils.d.ts +16 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/CompletePayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/InitPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/PaymentContactDetails.d.ts +4 -0
- package/lib/typescript/components/executiontasks/collectPayment/components/ProcessPayment.d.ts +4 -0
- package/lib/typescript/components/executiontasks/scan/interfaces.d.ts +1 -1
- package/lib/typescript/components/executiontasks/scan/utils.d.ts +1 -0
- package/lib/typescript/components/widgets/ProgressDialog.d.ts +3 -0
- package/lib/typescript/components/widgets/SnackBarCustom.d.ts +3 -2
- package/lib/typescript/components/widgets/Timer.d.ts +7 -0
- package/lib/typescript/constants/apiConstants.d.ts +3 -0
- package/lib/typescript/constants/constants.d.ts +3 -0
- package/lib/typescript/events/EventDispatcher.d.ts +1 -0
- package/lib/typescript/events/constants.d.ts +1 -0
- package/lib/typescript/events/interface.d.ts +1 -1
- package/lib/typescript/icons/CircleMark.d.ts +3 -0
- package/lib/typescript/icons/FailedIcon.d.ts +4 -0
- package/lib/typescript/icons/FailureCloseIcon.d.ts +4 -0
- package/lib/typescript/icons/SuccessCompleteIcon.d.ts +4 -0
- package/lib/typescript/models/DispatchModels.d.ts +11 -0
- package/lib/typescript/models/execTasks/ETConfig.d.ts +6 -3
- package/lib/typescript/models/sdk.d.ts +12 -0
- package/lib/typescript/network/NetworkClient.d.ts +3 -1
- package/lib/typescript/styles/executionTasks/CommonStyles.d.ts +10 -1
- package/lib/typescript/ui/screens/CollectPaymentScreen.d.ts +3 -0
- package/lib/typescript/ui/screens/ETScreensIndex.d.ts +2 -1
- package/lib/typescript/ui/uiConfig/RouteParams.d.ts +1 -0
- package/lib/typescript/utils/ExecTaskUtils.d.ts +2 -0
- package/lib/typescript/utils/context/paymentContext.d.ts +7 -0
- package/package.json +6 -5
- package/src/components/dispatch/DispatchExecNavigator.tsx +14 -0
- package/src/components/executiontasks/ExecutionTasksIndex.ts +8 -0
- package/src/components/executiontasks/collectPayment/CollectPayment.tsx +60 -0
- package/src/components/executiontasks/collectPayment/CollectPaymentSchema.ts +182 -0
- package/src/components/executiontasks/collectPayment/PaymentStyles.ts +102 -0
- package/src/components/executiontasks/collectPayment/PaymentUtils.ts +200 -0
- package/src/components/executiontasks/collectPayment/components/CompletePayment.tsx +273 -0
- package/src/components/executiontasks/collectPayment/components/InitPayment.tsx +658 -0
- package/src/components/executiontasks/collectPayment/components/PaymentContactDetails.tsx +790 -0
- package/src/components/executiontasks/collectPayment/components/ProcessPayment.tsx +1352 -0
- package/src/components/executiontasks/deliver/SLDeliverET.tsx +132 -60
- package/src/components/executiontasks/dropCash/SLDropCash.tsx +35 -12
- package/src/components/executiontasks/payments/PaymentUtils.ts +10 -2
- package/src/components/executiontasks/pickup/SLPickupET.tsx +6 -3
- package/src/components/executiontasks/scan/ScanET.tsx +1 -1
- package/src/components/executiontasks/scan/interfaces.ts +1 -1
- package/src/components/executiontasks/scan/utils.ts +16 -8
- package/src/components/widgets/ModalWidget.tsx +26 -8
- package/src/components/widgets/ProgressDialog.tsx +23 -3
- package/src/components/widgets/SnackBarCustom.tsx +8 -1
- package/src/components/widgets/SplitTextInput.tsx +1 -1
- package/src/components/widgets/Timer.tsx +53 -0
- package/src/constants/apiConstants.ts +3 -0
- package/src/constants/constants.ts +3 -0
- package/src/events/EventDispatcher.ts +4 -0
- package/src/events/constants.ts +1 -0
- package/src/events/interface.ts +7 -1
- package/src/icons/CircleMark.tsx +18 -0
- package/src/icons/FailedIcon.tsx +80 -0
- package/src/icons/FailureCloseIcon.tsx +35 -0
- package/src/icons/SuccessCompleteIcon.tsx +35 -0
- package/src/manager/dispatch/DispatchStateContainer.tsx +6 -4
- package/src/manager/sdk/DispatchSDKManager.ts +1 -0
- package/src/models/DispatchModels.ts +12 -0
- package/src/models/execTasks/ETConfig.ts +3 -0
- package/src/models/sdk.ts +13 -0
- package/src/network/NetworkClient.ts +34 -1
- package/src/network/client.ts +1 -0
- package/src/styles/executionTasks/CommonStyles.ts +32 -8
- package/src/ui/screens/CollectPaymentScreen.tsx +315 -0
- package/src/ui/screens/DropCashScreen.tsx +49 -2
- package/src/ui/screens/ETScreensIndex.ts +2 -0
- package/src/ui/screens/PaymentScreen.tsx +1 -0
- package/src/ui/screens/StartWorkFlowScreen.tsx +15 -0
- package/src/ui/uiConfig/RouteParams.ts +8 -1
- package/src/utils/ApiUtils.ts +1 -0
- package/src/utils/ExecTaskUtils.ts +44 -3
- package/src/utils/SyncManagerUtils.ts +1 -0
- package/src/utils/context/paymentContext.ts +8 -0
- package/src/utils/fcm/FCM.ts +30 -0
- package/src/utils/fcm/FcmUtils.ts +53 -29
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.5/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/config.properties +0 -2
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -18
- package/android/.idea/kotlinc.xml +0 -6
- package/android/.idea/migrations.xml +0 -10
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/other.xml +0 -263
- package/android/.idea/vcs.xml +0 -6
- package/lib/commonjs/icons/circleMark.svg +0 -3
- package/lib/module/icons/circleMark.svg +0 -3
- package/src/icons/circleMark.svg +0 -3
- /package/{android/.gradle/6.8/gc.properties → lib/typescript/components/executiontasks/collectPayment/components/CustomContactsModal.d.ts} +0 -0
- /package/{android/.gradle/7.5/dependencies-accessors/gc.properties → src/components/executiontasks/collectPayment/components/CustomContactsModal.tsx} +0 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
3
|
+
import React, { useState, useLayoutEffect, useEffect, useContext } from 'react';
|
|
4
|
+
import { getBaseETResponse } from '../../../../utils/ExecTaskUtils';
|
|
5
|
+
import { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';
|
|
6
|
+
import { EntityCode, ExecutionTaskID } from '../../../../models/execTasks/ETConfig';
|
|
7
|
+
import { Button, Modal, Portal, Provider, Text } from 'react-native-paper';
|
|
8
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
9
|
+
import { CommonStyles, DeliverPickupStyles, Fonts } from '../../../../styles/executionTasks/CommonStyles';
|
|
10
|
+
import { PAYMENT_SUCCESS_DEFAULT_TIMEOUT } from '../../../../constants/constants';
|
|
11
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
12
|
+
import { BackHandler } from 'react-native';
|
|
13
|
+
import FailureCloseIcon from '../../../../icons/FailureCloseIcon';
|
|
14
|
+
import SuccessCompleteIcon from '../../../../icons/SuccessCompleteIcon';
|
|
15
|
+
import { PAYMENT_SCREEN } from '../CollectPaymentSchema';
|
|
16
|
+
import { PaymentContext } from '../../../../utils/context/paymentContext';
|
|
17
|
+
import { PAYMENT_SELECTION_SHARED_PREF_KEY, getSharedPrefPaymentSelection } from '../PaymentUtils';
|
|
18
|
+
import Storage from '../../../../utils/storage';
|
|
19
|
+
let storage = Storage.getInstance();
|
|
20
|
+
const CompletePayment = props => {
|
|
21
|
+
const paymentConfigContext = useContext(PaymentContext);
|
|
22
|
+
const [disableProceed, setDisableProceed] = useState(false);
|
|
23
|
+
const [showModal, setShowModal] = useState(true);
|
|
24
|
+
|
|
25
|
+
// TO hide header for modal screen
|
|
26
|
+
useLayoutEffect(() => {
|
|
27
|
+
props.navigation.setOptions({
|
|
28
|
+
headerShown: false
|
|
29
|
+
});
|
|
30
|
+
}, [props.navigation]);
|
|
31
|
+
|
|
32
|
+
// Handle back-button click
|
|
33
|
+
useFocusEffect(React.useCallback(() => {
|
|
34
|
+
const onBackPress = () => {
|
|
35
|
+
return false;
|
|
36
|
+
};
|
|
37
|
+
BackHandler.addEventListener('hardwareBackPress', onBackPress);
|
|
38
|
+
return () => BackHandler.removeEventListener('hardwareBackPress', onBackPress);
|
|
39
|
+
}, []));
|
|
40
|
+
|
|
41
|
+
// useLayoutEffect(() => {
|
|
42
|
+
// props.navigation.setOptions({
|
|
43
|
+
// title: 'Payment Complete',
|
|
44
|
+
// headerShown: false,
|
|
45
|
+
// });
|
|
46
|
+
// }, [props.navigation, props.title]);
|
|
47
|
+
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (props.success) {
|
|
50
|
+
// setTimeout(() => {
|
|
51
|
+
sendOutput();
|
|
52
|
+
// }, 3000);
|
|
53
|
+
}
|
|
54
|
+
}, [props.success]);
|
|
55
|
+
const sendOutput = () => {
|
|
56
|
+
var _paymentConfigContext;
|
|
57
|
+
setTimeout(async () => {
|
|
58
|
+
var _props$applicableReas;
|
|
59
|
+
const previousSelectedModes = await getSharedPrefPaymentSelection(props.refId, storage);
|
|
60
|
+
let etOutput = {
|
|
61
|
+
paymentMode: props.paymentMode,
|
|
62
|
+
collectedAmount: props.collectedAmount,
|
|
63
|
+
refId: props.refId,
|
|
64
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, props.success, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, props.success, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.success), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET))
|
|
65
|
+
};
|
|
66
|
+
if (previousSelectedModes) {
|
|
67
|
+
etOutput.paymentMeta = {
|
|
68
|
+
previousSelectedModes
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (props.success) {
|
|
72
|
+
setShowModal(false);
|
|
73
|
+
}
|
|
74
|
+
setDisableProceed(true);
|
|
75
|
+
props.onSubmitET(etOutput);
|
|
76
|
+
storage.removeSharedItem(PAYMENT_SELECTION_SHARED_PREF_KEY + props.refId);
|
|
77
|
+
}, (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext = paymentConfigContext.sdkConfig) === null || _paymentConfigContext === void 0 ? void 0 : _paymentConfigContext.paymentSuccessTimeout) || PAYMENT_SUCCESS_DEFAULT_TIMEOUT);
|
|
78
|
+
};
|
|
79
|
+
return /*#__PURE__*/React.createElement(Provider, null, /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement(View, {
|
|
80
|
+
style: DeliverPickupStyles.mainContainer
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Modal, {
|
|
82
|
+
dismissable: false,
|
|
83
|
+
visible: showModal,
|
|
84
|
+
contentContainerStyle: DeliverPickupStyles.modalContent
|
|
85
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
style: DeliverPickupStyles.modalView
|
|
87
|
+
}, props.success ? /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
style: {
|
|
89
|
+
justifyContent: 'center',
|
|
90
|
+
alignItems: 'center',
|
|
91
|
+
paddingVertical: 30
|
|
92
|
+
}
|
|
93
|
+
}, /*#__PURE__*/React.createElement(SuccessCompleteIcon, null), /*#__PURE__*/React.createElement(Text, {
|
|
94
|
+
style: [CommonStyles.titleText, {
|
|
95
|
+
marginTop: 20
|
|
96
|
+
}]
|
|
97
|
+
}, "Payment Received!")) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
98
|
+
style: {
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
paddingVertical: 30
|
|
102
|
+
}
|
|
103
|
+
}, /*#__PURE__*/React.createElement(FailureCloseIcon, null), /*#__PURE__*/React.createElement(Text, {
|
|
104
|
+
style: [CommonStyles.titleText, {
|
|
105
|
+
marginTop: 20
|
|
106
|
+
}]
|
|
107
|
+
}, "Payment Failed!")), /*#__PURE__*/React.createElement(Button, {
|
|
108
|
+
disabled: disableProceed,
|
|
109
|
+
mode: 'contained',
|
|
110
|
+
uppercase: false,
|
|
111
|
+
labelStyle: CommonStyles.nextButtonLabel,
|
|
112
|
+
style: [CommonStyles.nextButton, {
|
|
113
|
+
marginTop: 20
|
|
114
|
+
}],
|
|
115
|
+
onPress: async () => {
|
|
116
|
+
var _props$applicableReas2;
|
|
117
|
+
let etOutput = {
|
|
118
|
+
paymentMode: props.paymentMode,
|
|
119
|
+
collectedAmount: props.collectedAmount,
|
|
120
|
+
refId: props.refId,
|
|
121
|
+
screen: PAYMENT_SCREEN.INIT,
|
|
122
|
+
sourceScreen: PAYMENT_SCREEN.COMPLETE,
|
|
123
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, false, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, false, (_props$applicableReas2 = props.applicableReasons) === null || _props$applicableReas2 === void 0 ? void 0 : _props$applicableReas2.failure), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET))
|
|
124
|
+
};
|
|
125
|
+
storage.removeSharedItem(PAYMENT_SELECTION_SHARED_PREF_KEY + props.refId);
|
|
126
|
+
setDisableProceed(true);
|
|
127
|
+
props.next(etOutput);
|
|
128
|
+
}
|
|
129
|
+
}, "Try again"), /*#__PURE__*/React.createElement(Button, {
|
|
130
|
+
labelStyle: [CommonStyles.cancelButtonLabel, {
|
|
131
|
+
color: '#3D445C'
|
|
132
|
+
}],
|
|
133
|
+
style: [CommonStyles.cancelButton, {
|
|
134
|
+
marginTop: 10
|
|
135
|
+
}],
|
|
136
|
+
mode: 'outlined',
|
|
137
|
+
onPress: async () => {
|
|
138
|
+
var _props$applicableReas3;
|
|
139
|
+
const previousSelectedModes = await getSharedPrefPaymentSelection(props.refId, storage);
|
|
140
|
+
let etOutput = {
|
|
141
|
+
paymentMode: props.paymentMode,
|
|
142
|
+
collectedAmount: props.collectedAmount,
|
|
143
|
+
refId: props.refId,
|
|
144
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, false, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, false, (_props$applicableReas3 = props.applicableReasons) === null || _props$applicableReas3 === void 0 ? void 0 : _props$applicableReas3.failure), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET))
|
|
145
|
+
};
|
|
146
|
+
if (previousSelectedModes) {
|
|
147
|
+
etOutput.paymentMeta = {
|
|
148
|
+
previousSelectedModes
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
setDisableProceed(true);
|
|
152
|
+
props.onSubmitET(etOutput);
|
|
153
|
+
storage.removeSharedItem(PAYMENT_SELECTION_SHARED_PREF_KEY + props.refId);
|
|
154
|
+
}
|
|
155
|
+
}, "Cancel")))))));
|
|
156
|
+
};
|
|
157
|
+
export default CompletePayment;
|
|
158
|
+
const styles = StyleSheet.create({
|
|
159
|
+
title: {
|
|
160
|
+
fontSize: 18,
|
|
161
|
+
fontStyle: 'normal',
|
|
162
|
+
fontWeight: '600',
|
|
163
|
+
lineHeight: 28,
|
|
164
|
+
textAlign: 'center',
|
|
165
|
+
color: '#111111',
|
|
166
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_600SemiBold : 'IBMPlexSans-SemiBold'
|
|
167
|
+
},
|
|
168
|
+
message1: {
|
|
169
|
+
fontStyle: 'normal',
|
|
170
|
+
fontWeight: 'normal',
|
|
171
|
+
fontSize: 12,
|
|
172
|
+
lineHeight: 20,
|
|
173
|
+
textAlign: 'center',
|
|
174
|
+
color: '#111111',
|
|
175
|
+
marginTop: 12,
|
|
176
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular'
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
//# sourceMappingURL=CompletePayment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useLayoutEffect","useEffect","useContext","getBaseETResponse","getEventCodeByET","EntityCode","ExecutionTaskID","Button","Modal","Portal","Provider","Text","Platform","StyleSheet","View","CommonStyles","DeliverPickupStyles","Fonts","PAYMENT_SUCCESS_DEFAULT_TIMEOUT","useFocusEffect","BackHandler","FailureCloseIcon","SuccessCompleteIcon","PAYMENT_SCREEN","PaymentContext","PAYMENT_SELECTION_SHARED_PREF_KEY","getSharedPrefPaymentSelection","Storage","storage","getInstance","CompletePayment","props","paymentConfigContext","disableProceed","setDisableProceed","showModal","setShowModal","navigation","setOptions","headerShown","useCallback","onBackPress","addEventListener","removeEventListener","success","sendOutput","_paymentConfigContext","setTimeout","_props$applicableReas","previousSelectedModes","refId","etOutput","paymentMode","collectedAmount","COLLECT_PAYMENT_ET","applicableReasons","mergedObjectiveId","paymentMeta","onSubmitET","removeSharedItem","sdkConfig","paymentSuccessTimeout","createElement","style","mainContainer","dismissable","visible","contentContainerStyle","modalContent","modalView","justifyContent","alignItems","paddingVertical","titleText","marginTop","Fragment","disabled","mode","uppercase","labelStyle","nextButtonLabel","nextButton","onPress","_props$applicableReas2","screen","INIT","sourceScreen","COMPLETE","failure","next","cancelButtonLabel","color","cancelButton","_props$applicableReas3","styles","create","title","fontSize","fontStyle","fontWeight","lineHeight","textAlign","fontFamily","OS","IBMPlexSans_600SemiBold","message1","IBMPlexSans_400Regular"],"sources":["CompletePayment.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable react-native/no-inline-styles */\nimport React, { useState, useLayoutEffect, useEffect, useContext } from 'react';\nimport { getBaseETResponse } from '../../../../utils/ExecTaskUtils';\nimport { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';\nimport {\n EntityCode,\n ExecutionTaskID,\n} from '../../../../models/execTasks/ETConfig';\nimport { Button, Modal, Portal, Provider, Text } from 'react-native-paper';\nimport { Platform, StyleSheet, View } from 'react-native';\nimport {\n CommonStyles,\n DeliverPickupStyles,\n Fonts,\n} from '../../../../styles/executionTasks/CommonStyles';\nimport { PAYMENT_SUCCESS_DEFAULT_TIMEOUT } from '../../../../constants/constants';\nimport { useFocusEffect } from '@react-navigation/native';\nimport { BackHandler } from 'react-native';\nimport FailureCloseIcon from '../../../../icons/FailureCloseIcon';\nimport SuccessCompleteIcon from '../../../../icons/SuccessCompleteIcon';\nimport {\n CollectPaymentInput,\n CollectPaymentOutput,\n PAYMENT_SCREEN,\n} from '../CollectPaymentSchema';\nimport { PaymentContext } from '../../../../utils/context/paymentContext';\nimport {\n PAYMENT_SELECTION_SHARED_PREF_KEY,\n getSharedPrefPaymentSelection,\n} from '../PaymentUtils';\nimport Storage from '../../../../utils/storage';\n\nlet storage = Storage.getInstance();\n\nconst CompletePayment = (props: CollectPaymentInput & CollectPaymentOutput) => {\n const paymentConfigContext = useContext(PaymentContext);\n\n const [disableProceed, setDisableProceed] = useState(false);\n const [showModal, setShowModal] = useState<boolean>(true);\n\n // TO hide header for modal screen\n useLayoutEffect(() => {\n props.navigation.setOptions({\n headerShown: false,\n });\n }, [props.navigation]);\n\n // Handle back-button click\n useFocusEffect(\n React.useCallback(() => {\n const onBackPress = () => {\n return false;\n };\n BackHandler.addEventListener('hardwareBackPress', onBackPress);\n return () =>\n BackHandler.removeEventListener('hardwareBackPress', onBackPress);\n }, [])\n );\n\n // useLayoutEffect(() => {\n // props.navigation.setOptions({\n // title: 'Payment Complete',\n // headerShown: false,\n // });\n // }, [props.navigation, props.title]);\n\n useEffect(() => {\n if (props.success) {\n // setTimeout(() => {\n sendOutput();\n // }, 3000);\n }\n }, [props.success]);\n\n const sendOutput = () => {\n setTimeout(async () => {\n const previousSelectedModes = await getSharedPrefPaymentSelection(\n props.refId,\n storage\n );\n let etOutput: CollectPaymentOutput = {\n paymentMode: props.paymentMode,\n collectedAmount: props.collectedAmount,\n refId: props.refId,\n ...(await getBaseETResponse(\n EntityCode.COLLECT_PAYMENT_ET,\n props.success,\n getEventCodeByET(\n ExecutionTaskID.COLLECT_PAYMENT_ET,\n props.success,\n props.applicableReasons?.success\n ),\n '',\n props.mergedObjectiveId,\n ExecutionTaskID.COLLECT_PAYMENT_ET\n )),\n };\n if (previousSelectedModes) {\n etOutput.paymentMeta = {\n previousSelectedModes,\n };\n }\n if (props.success) {\n setShowModal(false);\n }\n setDisableProceed(true);\n props.onSubmitET(etOutput);\n storage.removeSharedItem(PAYMENT_SELECTION_SHARED_PREF_KEY + props.refId);\n }, paymentConfigContext?.sdkConfig?.paymentSuccessTimeout || PAYMENT_SUCCESS_DEFAULT_TIMEOUT);\n };\n\n return (\n <Provider>\n <Portal>\n <View style={DeliverPickupStyles.mainContainer}>\n <Modal\n dismissable={false}\n visible={showModal}\n contentContainerStyle={DeliverPickupStyles.modalContent}\n >\n <View style={DeliverPickupStyles.modalView}>\n {props.success ? (\n <View\n style={{\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 30,\n }}\n >\n <SuccessCompleteIcon />\n <Text style={[CommonStyles.titleText, { marginTop: 20 }]}>\n Payment Received!\n </Text>\n </View>\n ) : (\n <>\n <View\n style={{\n justifyContent: 'center',\n alignItems: 'center',\n paddingVertical: 30,\n }}\n >\n <FailureCloseIcon />\n <Text style={[CommonStyles.titleText, { marginTop: 20 }]}>\n Payment Failed!\n </Text>\n </View>\n <Button\n disabled={disableProceed}\n mode={'contained'}\n uppercase={false}\n labelStyle={CommonStyles.nextButtonLabel}\n style={[\n CommonStyles.nextButton,\n {\n marginTop: 20,\n },\n ]}\n onPress={async () => {\n let etOutput: CollectPaymentOutput & {\n screen: PAYMENT_SCREEN;\n contactDetails?: string;\n sourceScreen: PAYMENT_SCREEN;\n } = {\n paymentMode: props.paymentMode,\n collectedAmount: props.collectedAmount,\n refId: props.refId,\n screen: PAYMENT_SCREEN.INIT,\n sourceScreen: PAYMENT_SCREEN.COMPLETE,\n ...(await getBaseETResponse(\n EntityCode.COLLECT_PAYMENT_ET,\n false,\n getEventCodeByET(\n ExecutionTaskID.COLLECT_PAYMENT_ET,\n false,\n props.applicableReasons?.failure\n ),\n '',\n props.mergedObjectiveId,\n ExecutionTaskID.COLLECT_PAYMENT_ET\n )),\n };\n storage.removeSharedItem(\n PAYMENT_SELECTION_SHARED_PREF_KEY + props.refId\n );\n setDisableProceed(true);\n props.next(etOutput);\n }}\n >\n Try again\n </Button>\n <Button\n labelStyle={[\n CommonStyles.cancelButtonLabel,\n { color: '#3D445C' },\n ]}\n style={[CommonStyles.cancelButton, { marginTop: 10 }]}\n mode={'outlined'}\n onPress={async () => {\n const previousSelectedModes =\n await getSharedPrefPaymentSelection(\n props.refId,\n storage\n );\n let etOutput: CollectPaymentOutput = {\n paymentMode: props.paymentMode,\n collectedAmount: props.collectedAmount,\n refId: props.refId,\n ...(await getBaseETResponse(\n EntityCode.COLLECT_PAYMENT_ET,\n false,\n getEventCodeByET(\n ExecutionTaskID.COLLECT_PAYMENT_ET,\n false,\n props.applicableReasons?.failure\n ),\n '',\n props.mergedObjectiveId,\n ExecutionTaskID.COLLECT_PAYMENT_ET\n )),\n };\n if (previousSelectedModes) {\n etOutput.paymentMeta = {\n previousSelectedModes,\n };\n }\n setDisableProceed(true);\n props.onSubmitET(etOutput);\n storage.removeSharedItem(\n PAYMENT_SELECTION_SHARED_PREF_KEY + props.refId\n );\n }}\n >\n Cancel\n </Button>\n </>\n )}\n </View>\n </Modal>\n </View>\n </Portal>\n </Provider>\n );\n};\nexport default CompletePayment;\n\nconst styles = StyleSheet.create({\n title: {\n fontSize: 18,\n fontStyle: 'normal',\n fontWeight: '600',\n lineHeight: 28,\n textAlign: 'center',\n color: '#111111',\n fontFamily: Platform.OS === 'android'\n ? Fonts.IBMPlexSans_600SemiBold\n : 'IBMPlexSans-SemiBold',\n },\n message1: {\n fontStyle: 'normal',\n fontWeight: 'normal',\n fontSize: 12,\n lineHeight: 20,\n textAlign: 'center',\n color: '#111111',\n marginTop: 12,\n fontFamily: Platform.OS === 'android'\n ? Fonts.IBMPlexSans_400Regular\n : 'IBMPlexSans-Regular',\n },\n});\n"],"mappings":"AAAA;AACA;AACA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,eAAe,EAAEC,SAAS,EAAEC,UAAU,QAAQ,OAAO;AAC/E,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,gB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ACA,CAAC;AAEf,CAAC;AACD,eAAepB,eAAe;AAE9B,MAAMgE,MAAM,GAAGjF,UAAU,CAACkF,MAAM,CAAC;EAC/BC,KAAK,EAAE;IACLC,QAAQ,EAAE,EAAE;IACZC,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,KAAK;IACjBC,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE,QAAQ;IACnBV,KAAK,EAAE,SAAS;IAChBW,UAAU,EAAE1F,QAAQ,CAAC2F,EAAE,KAAK,SAAS,GACnCtF,KAAK,CAACuF,uBAAuB,GAC7B;EACJ,CAAC;EACDC,QAAQ,EAAE;IACRP,SAAS,EAAE,QAAQ;IACnBC,UAAU,EAAE,QAAQ;IACpBF,QAAQ,EAAE,EAAE;IACZG,UAAU,EAAE,EAAE;IACdC,SAAS,EAAE,QAAQ;IACnBV,KAAK,EAAE,SAAS;IAChBjB,SAAS,EAAE,EAAE;IACb4B,UAAU,EAAE1F,QAAQ,CAAC2F,EAAE,KAAK,SAAS,GACnCtF,KAAK,CAACyF,sBAAsB,GAC5B;EACJ;AACF,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/components/executiontasks/collectPayment/components/CustomContactsModal.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["CustomContactsModal.tsx"],"sourcesContent":[""],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
3
|
+
import React, { useEffect, useState, useLayoutEffect, useContext } from 'react';
|
|
4
|
+
import { FlatList, Platform, Text, TouchableOpacity, View } from 'react-native';
|
|
5
|
+
import { isEmptyOrBlank } from '../../../../utils/utils';
|
|
6
|
+
import { PAYMENT_SHARED_PREF_KEY, getPaymentDataMO, getPaymentType, removeSharedPrefPaymentData } from '../PaymentUtils';
|
|
7
|
+
import { getBaseETResponse } from '../../../../utils/ExecTaskUtils';
|
|
8
|
+
import { EntityCode, ExecutionTaskID } from '../../../../models/execTasks/ETConfig';
|
|
9
|
+
import { getEventCodeByET } from '../../../../manager/dispatchCodes/EventCodeContainer';
|
|
10
|
+
import { PaymentStyles } from '../PaymentStyles';
|
|
11
|
+
import { CommonStyles, Fonts } from '../../../../styles/executionTasks/CommonStyles';
|
|
12
|
+
import { showToast } from '../../../widgets/Toaster';
|
|
13
|
+
import { Button, Provider, RadioButton } from 'react-native-paper';
|
|
14
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
15
|
+
import { GO_BACK_EVENT_CODE, PAYMENT_NOTIFICATION } from '../../../../constants/constants';
|
|
16
|
+
import { hasGoBackConnector } from '../../../../components/utils';
|
|
17
|
+
import GoBackModal from '../../../../components/widgets/GoBackModal';
|
|
18
|
+
import { useFocusEffect } from '@react-navigation/native';
|
|
19
|
+
import { BackHandler } from 'react-native';
|
|
20
|
+
import ProgressDialog from '../../../../components/widgets/ProgressDialog';
|
|
21
|
+
import EventListener from '../../../../events';
|
|
22
|
+
import { PAYMENT_SCREEN, STATUS } from '../CollectPaymentSchema';
|
|
23
|
+
import Storage from '../../../../utils/storage';
|
|
24
|
+
import { PaymentContext } from '../../../../utils/context/paymentContext';
|
|
25
|
+
import { ENDPOINTS } from '../../../../constants/apiConstants';
|
|
26
|
+
import { RouteParams } from '../../../../ui/uiConfig/RouteParams';
|
|
27
|
+
import Logger, { LOG_TYPE } from '../../../../utils/Logger';
|
|
28
|
+
const styles = PaymentStyles;
|
|
29
|
+
let storage = Storage.getInstance();
|
|
30
|
+
const InitPayment = props => {
|
|
31
|
+
var _props$route$params$R, _paymentConfigContext8;
|
|
32
|
+
const paymentConfigContext = useContext(PaymentContext);
|
|
33
|
+
const [paymentStatus, setPaymentStatus] = useState(null);
|
|
34
|
+
const [paymentMode, setPaymentMode] = useState(props.allowedModes[0]);
|
|
35
|
+
const [disableNext, setDisableNext] = useState(false);
|
|
36
|
+
const [showBackModal, setShowBackModal] = useState(false);
|
|
37
|
+
const paymentRefId = (_props$route$params$R = props.route.params[RouteParams.ROOT_META_DATA].paymentConfig) === null || _props$route$params$R === void 0 ? void 0 : _props$route$params$R.paymentRefId;
|
|
38
|
+
const handleOnProceedClick = async () => {
|
|
39
|
+
if (!isEmptyOrBlank(paymentMode)) {
|
|
40
|
+
var _props$applicableReas, _paymentConfigContext;
|
|
41
|
+
setDisableNext(true);
|
|
42
|
+
props.next({
|
|
43
|
+
paymentMode: paymentMode,
|
|
44
|
+
refId: paymentRefId,
|
|
45
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, true, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas = props.applicableReasons) === null || _props$applicableReas === void 0 ? void 0 : _props$applicableReas.success), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET)),
|
|
46
|
+
screen: paymentMode === 'QR_CODE' ? PAYMENT_SCREEN.PROCESS : paymentMode === 'PAYMENT_LINK' ? PAYMENT_SCREEN.CONTACTS : PAYMENT_SCREEN.COMPLETE,
|
|
47
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
48
|
+
collectedAmount: {
|
|
49
|
+
value: props.expectedAmount,
|
|
50
|
+
currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext = paymentConfigContext.sdkConfig) === null || _paymentConfigContext === void 0 || (_paymentConfigContext = _paymentConfigContext.etConfig) === null || _paymentConfigContext === void 0 ? void 0 : _paymentConfigContext.currencyCode) || ''
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
} else showToast('No payment mode selected');
|
|
54
|
+
};
|
|
55
|
+
const handleOnCancelClick = async () => {
|
|
56
|
+
var _props$applicableReas2, _paymentConfigContext2;
|
|
57
|
+
props.onSubmitET({
|
|
58
|
+
paymentMode: paymentMode,
|
|
59
|
+
refId: paymentRefId,
|
|
60
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, false, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, false, (_props$applicableReas2 = props.applicableReasons) === null || _props$applicableReas2 === void 0 ? void 0 : _props$applicableReas2.failure), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET)),
|
|
61
|
+
collectedAmount: {
|
|
62
|
+
value: props.expectedAmount,
|
|
63
|
+
currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext2 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext2 === void 0 || (_paymentConfigContext2 = _paymentConfigContext2.etConfig) === null || _paymentConfigContext2 === void 0 ? void 0 : _paymentConfigContext2.currencyCode) || ''
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const getPaymentStatus = async isProceed => {
|
|
68
|
+
try {
|
|
69
|
+
var _ps$data$transactions, _ps$data$meta, _ps$data$meta2, _ps$data$transactions2;
|
|
70
|
+
let sharedPrefPaymentData = null;
|
|
71
|
+
const paymentResp = await (paymentConfigContext === null || paymentConfigContext === void 0 ? void 0 : paymentConfigContext.networkInstance.requestGet(ENDPOINTS.PAYMENT_STATUS + paymentRefId, {
|
|
72
|
+
requestId: 'payment:' + paymentRefId
|
|
73
|
+
}, {
|
|
74
|
+
appAbbr: paymentConfigContext.sdkConfig.etConfig.appAbbr,
|
|
75
|
+
latest: true
|
|
76
|
+
}));
|
|
77
|
+
// const paymentResp = {
|
|
78
|
+
// data: {
|
|
79
|
+
// data: {
|
|
80
|
+
// meta: { totalCount: 1 },
|
|
81
|
+
// transactions: [
|
|
82
|
+
// {
|
|
83
|
+
// refId: paymentRefId,
|
|
84
|
+
// status: STATUS.FAILED,
|
|
85
|
+
// subStatus: SUB_STATUS.completed,
|
|
86
|
+
// money: {
|
|
87
|
+
// amount: 1000,
|
|
88
|
+
// currency: 'INR',
|
|
89
|
+
// },
|
|
90
|
+
// txnId: '123',
|
|
91
|
+
// txnType: TRANSACTION_TYPE.LINK,
|
|
92
|
+
// appAbbr: 'testApp31',
|
|
93
|
+
// },
|
|
94
|
+
// ],
|
|
95
|
+
// },
|
|
96
|
+
// },
|
|
97
|
+
// };
|
|
98
|
+
const _ps = paymentResp === null || paymentResp === void 0 ? void 0 : paymentResp.data;
|
|
99
|
+
console.log('INIT getPaymentStatus _ps: ', JSON.stringify(_ps));
|
|
100
|
+
sharedPrefPaymentData = await getPaymentDataMO(props.mergedObjectiveId, paymentRefId, storage);
|
|
101
|
+
/**
|
|
102
|
+
* TBD: For first time INIT Screen rendering, no data in shared Pref, meaning the payment was not initiated from mobile.
|
|
103
|
+
* For next time init screen rendering, refId should be associated with a MergedObjectiveId, if not then the payment won't be considered.
|
|
104
|
+
*/
|
|
105
|
+
if (_ps !== null && _ps !== void 0 && (_ps$data$transactions = _ps.data.transactions) !== null && _ps$data$transactions !== void 0 && _ps$data$transactions.length && (sharedPrefPaymentData || getPaymentType(_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].txnType)) && (_ps$data$meta = _ps.data.meta) !== null && _ps$data$meta !== void 0 && _ps$data$meta.totalCount && (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].status) === STATUS.SUCCESS) {
|
|
106
|
+
var _sharedPrefPaymentDat, _sharedPrefPaymentDat2, _sharedPrefPaymentDat3, _paymentConfigContext3, _props$applicableReas3;
|
|
107
|
+
props.next({
|
|
108
|
+
paymentMode: ((_sharedPrefPaymentDat = sharedPrefPaymentData) === null || _sharedPrefPaymentDat === void 0 ? void 0 : _sharedPrefPaymentDat.paymentMode) || getPaymentType(_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].txnType) || paymentMode,
|
|
109
|
+
collectedAmount: {
|
|
110
|
+
value: ((_sharedPrefPaymentDat2 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat2 === void 0 ? void 0 : _sharedPrefPaymentDat2.amount.value) || (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.amount) || props.expectedAmount,
|
|
111
|
+
currencyCode: ((_sharedPrefPaymentDat3 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat3 === void 0 ? void 0 : _sharedPrefPaymentDat3.amount.currencyCode) || (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].money.currency) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext3 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext3 === void 0 || (_paymentConfigContext3 = _paymentConfigContext3.etConfig) === null || _paymentConfigContext3 === void 0 ? void 0 : _paymentConfigContext3.currencyCode) || ''
|
|
112
|
+
},
|
|
113
|
+
refId: _ps.data.transactions[0].refId,
|
|
114
|
+
screen: PAYMENT_SCREEN.COMPLETE,
|
|
115
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
116
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, true, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas3 = props.applicableReasons) === null || _props$applicableReas3 === void 0 ? void 0 : _props$applicableReas3.success), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET))
|
|
117
|
+
});
|
|
118
|
+
setPaymentStatus(_ps);
|
|
119
|
+
return;
|
|
120
|
+
} else if (sharedPrefPaymentData && (_ps$data$meta2 = _ps.data.meta) !== null && _ps$data$meta2 !== void 0 && _ps$data$meta2.totalCount && _ps !== null && _ps !== void 0 && (_ps$data$transactions2 = _ps.data.transactions) !== null && _ps$data$transactions2 !== void 0 && _ps$data$transactions2.length && (_ps === null || _ps === void 0 ? void 0 : _ps.data.transactions[0].status) === STATUS.FAILED) {
|
|
121
|
+
/* const _sharedPrefPaymentData = JSON.parse(
|
|
122
|
+
JSON.stringify(sharedPrefPaymentData)
|
|
123
|
+
); */
|
|
124
|
+
await removeSharedPrefPaymentData(paymentRefId, storage);
|
|
125
|
+
/* await storage.removeSharedItems(
|
|
126
|
+
props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
|
|
127
|
+
); */
|
|
128
|
+
}
|
|
129
|
+
if (isProceed) await handleOnProceedClick();else if (isProceed === false) await handleOnCancelClick();
|
|
130
|
+
setPaymentStatus(_ps);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
var _err$response, _err$response2;
|
|
133
|
+
Logger.getInstance().logEvent('~ getPaymentStatus triggered ', JSON.stringify((err === null || err === void 0 || (_err$response = err.response) === null || _err$response === void 0 ? void 0 : _err$response.data) || err), LOG_TYPE.SDK_ERROR);
|
|
134
|
+
console.error('STATUS: ', (err === null || err === void 0 || (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : _err$response2.data) || err.message);
|
|
135
|
+
if (isProceed) await handleOnProceedClick();else if (isProceed === false) await handleOnCancelClick();
|
|
136
|
+
setPaymentStatus(undefined);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
(async () => {
|
|
141
|
+
await getPaymentStatus(null);
|
|
142
|
+
// setPaymentStatus(false); // FOR TESTING payment status on click
|
|
143
|
+
})();
|
|
144
|
+
EventListener.on(PAYMENT_NOTIFICATION, async data => {
|
|
145
|
+
console.log('InitPayment:', JSON.stringify(data));
|
|
146
|
+
let sharedPrefPaymentData = null;
|
|
147
|
+
if (data && (data.status === STATUS.SUCCESS || data.status === STATUS.FAILED)) {
|
|
148
|
+
sharedPrefPaymentData = await getPaymentDataMO(props.mergedObjectiveId, data.refId, storage);
|
|
149
|
+
}
|
|
150
|
+
if (sharedPrefPaymentData && data && data.status === STATUS.SUCCESS) {
|
|
151
|
+
var _sharedPrefPaymentDat4, _sharedPrefPaymentDat5, _sharedPrefPaymentDat6, _paymentConfigContext4, _props$applicableReas4;
|
|
152
|
+
props.next({
|
|
153
|
+
paymentMode: ((_sharedPrefPaymentDat4 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat4 === void 0 ? void 0 : _sharedPrefPaymentDat4.paymentMode) || paymentMode,
|
|
154
|
+
collectedAmount: {
|
|
155
|
+
value: ((_sharedPrefPaymentDat5 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat5 === void 0 ? void 0 : _sharedPrefPaymentDat5.amount.value) || props.expectedAmount,
|
|
156
|
+
currencyCode: ((_sharedPrefPaymentDat6 = sharedPrefPaymentData) === null || _sharedPrefPaymentDat6 === void 0 ? void 0 : _sharedPrefPaymentDat6.amount.currencyCode) || (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext4 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext4 === void 0 || (_paymentConfigContext4 = _paymentConfigContext4.etConfig) === null || _paymentConfigContext4 === void 0 ? void 0 : _paymentConfigContext4.currencyCode) || ''
|
|
157
|
+
},
|
|
158
|
+
refId: data.refId,
|
|
159
|
+
screen: PAYMENT_SCREEN.COMPLETE,
|
|
160
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
161
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, true, getEventCodeByET(ExecutionTaskID.COLLECT_PAYMENT_ET, true, (_props$applicableReas4 = props.applicableReasons) === null || _props$applicableReas4 === void 0 ? void 0 : _props$applicableReas4.success), '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET))
|
|
162
|
+
});
|
|
163
|
+
} else if (sharedPrefPaymentData && data && data.status === STATUS.FAILED /* &&
|
|
164
|
+
props.sourceScreen !== 'COMPLETE' */) {
|
|
165
|
+
/* const _sharedPrefPaymentData = JSON.parse(
|
|
166
|
+
JSON.stringify(sharedPrefPaymentData)
|
|
167
|
+
); */
|
|
168
|
+
/* await storage.removeSharedItems(
|
|
169
|
+
props.mergedObjectiveId.map((_id) => PAYMENT_SHARED_PREF_KEY + _id)
|
|
170
|
+
); */
|
|
171
|
+
await removeSharedPrefPaymentData(data.refId, storage);
|
|
172
|
+
/* props.next({
|
|
173
|
+
paymentMode: _sharedPrefPaymentData?.paymentMode || paymentMode,
|
|
174
|
+
collectedAmount: {
|
|
175
|
+
value: data.amount,
|
|
176
|
+
currencyCode:
|
|
177
|
+
_sharedPrefPaymentData?.amount.currencyCode ||
|
|
178
|
+
props.amount.currencyCode,
|
|
179
|
+
minorUnit:
|
|
180
|
+
_sharedPrefPaymentData?.amount.minorUnit ||
|
|
181
|
+
props.amount.minorUnit,
|
|
182
|
+
},
|
|
183
|
+
txnId: data.txnId,
|
|
184
|
+
refId: data.refId,
|
|
185
|
+
transactionSuccess: false,
|
|
186
|
+
screen: PAYMENT_SCREEN.COMPLETE,
|
|
187
|
+
sourceScreen: PAYMENT_SCREEN.INIT,
|
|
188
|
+
...(await getBaseETResponse(
|
|
189
|
+
EntityCode.COLLECT_PAYMENT_ET,
|
|
190
|
+
false,
|
|
191
|
+
getEventCodeByET(
|
|
192
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET,
|
|
193
|
+
false,
|
|
194
|
+
props.applicableReasons?.failure
|
|
195
|
+
),
|
|
196
|
+
'',
|
|
197
|
+
props.mergedObjectiveId,
|
|
198
|
+
ExecutionTaskID.COLLECT_PAYMENT_ET
|
|
199
|
+
)),
|
|
200
|
+
}); */
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
return () => EventListener.remove(PAYMENT_NOTIFICATION);
|
|
204
|
+
}, []);
|
|
205
|
+
|
|
206
|
+
// Handle back-button click
|
|
207
|
+
useFocusEffect(React.useCallback(() => {
|
|
208
|
+
const onBackPress = async () => {
|
|
209
|
+
var _props$taskMeta;
|
|
210
|
+
let sharedPref = null;
|
|
211
|
+
// (async () => {
|
|
212
|
+
sharedPref = await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + paymentRefId);
|
|
213
|
+
// })();
|
|
214
|
+
|
|
215
|
+
const paymentInProgress =
|
|
216
|
+
/* props.mergedObjectiveId.some(
|
|
217
|
+
async (moId) =>
|
|
218
|
+
await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + moId)
|
|
219
|
+
) */
|
|
220
|
+
sharedPref || false;
|
|
221
|
+
if ((_props$taskMeta = props.taskMeta) !== null && _props$taskMeta !== void 0 && _props$taskMeta.enableGoBack && hasGoBackConnector(props.applicableReasons) && !paymentInProgress) {
|
|
222
|
+
setShowBackModal(true);
|
|
223
|
+
return true;
|
|
224
|
+
} else {
|
|
225
|
+
props.navigation.goBack();
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
BackHandler.addEventListener('hardwareBackPress', () => {
|
|
230
|
+
onBackPress();
|
|
231
|
+
return true;
|
|
232
|
+
});
|
|
233
|
+
return () => BackHandler.removeEventListener('hardwareBackPress', () => {
|
|
234
|
+
onBackPress();
|
|
235
|
+
return true;
|
|
236
|
+
});
|
|
237
|
+
}, []));
|
|
238
|
+
useLayoutEffect(() => {
|
|
239
|
+
props.navigation.setOptions({
|
|
240
|
+
headerShown: true,
|
|
241
|
+
title: 'Choose Payment Method',
|
|
242
|
+
headerLeft: () => {
|
|
243
|
+
return /*#__PURE__*/React.createElement(Icon, {
|
|
244
|
+
onPress: async () => {
|
|
245
|
+
var _props$taskMeta2;
|
|
246
|
+
const sharedPref = await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + paymentRefId);
|
|
247
|
+
const paymentInProgress =
|
|
248
|
+
/* props.mergedObjectiveId.some(
|
|
249
|
+
async (moId) =>
|
|
250
|
+
await storage.getSharedItem(PAYMENT_SHARED_PREF_KEY + moId)
|
|
251
|
+
) */
|
|
252
|
+
sharedPref || false;
|
|
253
|
+
if ((_props$taskMeta2 = props.taskMeta) !== null && _props$taskMeta2 !== void 0 && _props$taskMeta2.enableGoBack && hasGoBackConnector(props.applicableReasons) && !paymentInProgress) setShowBackModal(true);else props.navigation.goBack();
|
|
254
|
+
},
|
|
255
|
+
name: "arrow-back",
|
|
256
|
+
color: 'black',
|
|
257
|
+
size: 25,
|
|
258
|
+
style: {
|
|
259
|
+
paddingRight: 15,
|
|
260
|
+
paddingTop: 5
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}, [props.navigation]);
|
|
266
|
+
useEffect(() => {
|
|
267
|
+
if (props.allowedModes && props.allowedModes.length > 0) {
|
|
268
|
+
setPaymentMode(props.allowedModes[0]);
|
|
269
|
+
}
|
|
270
|
+
}, [props.allowedModes]);
|
|
271
|
+
const renderModal = () => {
|
|
272
|
+
return /*#__PURE__*/React.createElement(GoBackModal, {
|
|
273
|
+
showModal: showBackModal,
|
|
274
|
+
setShowModal: setShowBackModal,
|
|
275
|
+
onSuccess: async () => {
|
|
276
|
+
var _paymentConfigContext5;
|
|
277
|
+
props.onSubmitET({
|
|
278
|
+
collectedAmount: {
|
|
279
|
+
value: props.expectedAmount,
|
|
280
|
+
currencyCode: (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext5 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext5 === void 0 || (_paymentConfigContext5 = _paymentConfigContext5.etConfig) === null || _paymentConfigContext5 === void 0 ? void 0 : _paymentConfigContext5.currencyCode) || ''
|
|
281
|
+
},
|
|
282
|
+
paymentMode: paymentMode,
|
|
283
|
+
refId: paymentRefId,
|
|
284
|
+
...(await getBaseETResponse(EntityCode.COLLECT_PAYMENT_ET, false, GO_BACK_EVENT_CODE, '', props.mergedObjectiveId, ExecutionTaskID.COLLECT_PAYMENT_ET))
|
|
285
|
+
});
|
|
286
|
+
setShowBackModal(false);
|
|
287
|
+
},
|
|
288
|
+
onFailure: () => setShowBackModal(false)
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
const renderItem = ({
|
|
292
|
+
item
|
|
293
|
+
}) => {
|
|
294
|
+
var _paymentConfigContext6, _paymentConfigContext7, _props$plModes;
|
|
295
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
296
|
+
activeOpacity: 1,
|
|
297
|
+
onPress: () => {
|
|
298
|
+
setPaymentMode(item);
|
|
299
|
+
},
|
|
300
|
+
style: [styles.reasonItemStyle, {
|
|
301
|
+
marginBottom: 4,
|
|
302
|
+
paddingVertical: 8
|
|
303
|
+
}]
|
|
304
|
+
}, /*#__PURE__*/React.createElement(RadioButton, {
|
|
305
|
+
color: '#5B80F7',
|
|
306
|
+
value: item,
|
|
307
|
+
status: paymentMode === item ? 'checked' : 'unchecked',
|
|
308
|
+
onPress: () => {
|
|
309
|
+
setPaymentMode(item);
|
|
310
|
+
}
|
|
311
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
312
|
+
style: {
|
|
313
|
+
display: 'flex',
|
|
314
|
+
flexDirection: 'column'
|
|
315
|
+
}
|
|
316
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
317
|
+
style: [styles.reasonTextStyle, {
|
|
318
|
+
fontWeight: 'bold',
|
|
319
|
+
paddingTop: 6,
|
|
320
|
+
fontSize: 14,
|
|
321
|
+
lineHeight: 20,
|
|
322
|
+
color: '#3D445C'
|
|
323
|
+
}],
|
|
324
|
+
onPress: () => {
|
|
325
|
+
setPaymentMode(item);
|
|
326
|
+
}
|
|
327
|
+
}, item === 'CASH' ? 'Cash' : item === 'QR_CODE' ? 'QR Code' : item === 'PAYMENT_LINK' ? 'Payment Link' : item), (item === 'QR_CODE' || item === 'PAYMENT_LINK') && /*#__PURE__*/React.createElement(Text, {
|
|
328
|
+
style: [styles.reasonTextStyle, {
|
|
329
|
+
fontWeight: '500',
|
|
330
|
+
fontFamily: Fonts.IBMPlexSans_500Medium,
|
|
331
|
+
paddingTop: 2,
|
|
332
|
+
fontSize: 12,
|
|
333
|
+
lineHeight: 16,
|
|
334
|
+
color: '#525B7A'
|
|
335
|
+
}],
|
|
336
|
+
onPress: () => {
|
|
337
|
+
setPaymentMode(item);
|
|
338
|
+
}
|
|
339
|
+
}, item === 'QR_CODE' ? (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext6 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext6 === void 0 || (_paymentConfigContext6 = _paymentConfigContext6.etConfig) === null || _paymentConfigContext6 === void 0 ? void 0 : _paymentConfigContext6.currencyCode) === 'INR' ? 'UPI' : 'Scan to get a payment link' : item === 'PAYMENT_LINK' ? (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext7 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext7 === void 0 || (_paymentConfigContext7 = _paymentConfigContext7.etConfig) === null || _paymentConfigContext7 === void 0 ? void 0 : _paymentConfigContext7.currencyCode) === 'INR' ? (_props$plModes = props.plModes) === null || _props$plModes === void 0 ? void 0 : _props$plModes.join(', ') : 'Credit / Debit Cards, Netbanking …' : '')));
|
|
340
|
+
};
|
|
341
|
+
return /*#__PURE__*/React.createElement(Provider, null, renderModal(), /*#__PURE__*/React.createElement(ProgressDialog, {
|
|
342
|
+
customModalContentStyle: {
|
|
343
|
+
paddingVertical: 40
|
|
344
|
+
},
|
|
345
|
+
visible: paymentStatus === null ? true : false,
|
|
346
|
+
label: "Loading",
|
|
347
|
+
labelStyle: {
|
|
348
|
+
fontWeight: '400',
|
|
349
|
+
fontFamily: Platform.OS === 'android' ? Fonts.IBMPlexSans_400Regular : 'IBMPlexSans-Regular',
|
|
350
|
+
marginTop: 16,
|
|
351
|
+
color: '#3D445C'
|
|
352
|
+
}
|
|
353
|
+
}), paymentStatus === null ? null : /*#__PURE__*/React.createElement(View, {
|
|
354
|
+
style: CommonStyles.mainContainer
|
|
355
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
356
|
+
style: {
|
|
357
|
+
backgroundColor: 'white',
|
|
358
|
+
marginTop: 30
|
|
359
|
+
}
|
|
360
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
361
|
+
style: [styles.amountStyle, styles.textStyle1, {
|
|
362
|
+
paddingTop: 0,
|
|
363
|
+
paddingBottom: 0,
|
|
364
|
+
color: '#3D445C',
|
|
365
|
+
margin: 0,
|
|
366
|
+
fontSize: 16
|
|
367
|
+
}]
|
|
368
|
+
}, "Collect at Delivery"), /*#__PURE__*/React.createElement(Text, {
|
|
369
|
+
style: [styles.amountStyle, {
|
|
370
|
+
paddingTop: 0,
|
|
371
|
+
fontSize: 24
|
|
372
|
+
}]
|
|
373
|
+
}, (paymentConfigContext === null || paymentConfigContext === void 0 || (_paymentConfigContext8 = paymentConfigContext.sdkConfig) === null || _paymentConfigContext8 === void 0 || (_paymentConfigContext8 = _paymentConfigContext8.etConfig) === null || _paymentConfigContext8 === void 0 ? void 0 : _paymentConfigContext8.currencyCode) + ' ' + props.expectedAmount)), /*#__PURE__*/React.createElement(Text, {
|
|
374
|
+
style: [styles.textStyle1, {
|
|
375
|
+
paddingBottom: 12
|
|
376
|
+
}]
|
|
377
|
+
}, 'Select a payment option'.toUpperCase()), /*#__PURE__*/React.createElement(View, {
|
|
378
|
+
style: {
|
|
379
|
+
flex: 1
|
|
380
|
+
}
|
|
381
|
+
}, /*#__PURE__*/React.createElement(FlatList, {
|
|
382
|
+
data: props.allowedModes,
|
|
383
|
+
renderItem: renderItem,
|
|
384
|
+
keyExtractor: item => item
|
|
385
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
386
|
+
style: {
|
|
387
|
+
justifyContent: 'flex-end',
|
|
388
|
+
// marginBottom: 10,
|
|
389
|
+
padding: 16,
|
|
390
|
+
// paddingTop: 10,
|
|
391
|
+
borderTopWidth: 1,
|
|
392
|
+
borderTopColor: '#E0E3EB',
|
|
393
|
+
elevation: 0.5
|
|
394
|
+
}
|
|
395
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
396
|
+
style: {
|
|
397
|
+
flexDirection: 'row'
|
|
398
|
+
// marginStart: 10,
|
|
399
|
+
// marginEnd: 10,
|
|
400
|
+
}
|
|
401
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
402
|
+
style: [CommonStyles.cancelButton, {
|
|
403
|
+
marginEnd: 5,
|
|
404
|
+
flex: 1
|
|
405
|
+
}],
|
|
406
|
+
labelStyle: {
|
|
407
|
+
...CommonStyles.cancelButtonLabel,
|
|
408
|
+
color: '#5B80F7',
|
|
409
|
+
textTransform: 'capitalize'
|
|
410
|
+
},
|
|
411
|
+
mode: 'outlined',
|
|
412
|
+
onPress: async () => {
|
|
413
|
+
await getPaymentStatus(false);
|
|
414
|
+
}
|
|
415
|
+
}, "Cancel"), /*#__PURE__*/React.createElement(Button, {
|
|
416
|
+
disabled: disableNext,
|
|
417
|
+
style: [CommonStyles.nextButton, {
|
|
418
|
+
flex: 1,
|
|
419
|
+
marginStart: 5
|
|
420
|
+
}],
|
|
421
|
+
labelStyle: {
|
|
422
|
+
...CommonStyles.nextButtonLabel,
|
|
423
|
+
textTransform: 'capitalize'
|
|
424
|
+
},
|
|
425
|
+
mode: 'contained',
|
|
426
|
+
onPress: async () => {
|
|
427
|
+
// Check payment status every time when moving away from init screen
|
|
428
|
+
await getPaymentStatus(true);
|
|
429
|
+
}
|
|
430
|
+
}, "Proceed")))));
|
|
431
|
+
};
|
|
432
|
+
export default InitPayment;
|
|
433
|
+
//# sourceMappingURL=InitPayment.js.map
|