react-native-unit-components 1.8.1 → 1.10.0
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/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +9 -12
- package/android/src/main/java/com/unitreactnativecomponents/appInfo/UNAppInfoModule.kt +59 -0
- package/android/src/main/java/com/unitreactnativecomponents/extensions/ContextExtensions.kt +35 -0
- package/ios/Extensions/Bundle+Extensions.swift +23 -0
- package/ios/UNAppInfo/IOSAppInfo.swift +47 -0
- package/ios/UNAppInfo/UNAppInfoExportModule.m +5 -2
- package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +34 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +6 -4
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +6 -4
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +21 -15
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/index.js +27 -0
- package/lib/commonjs/components/UNAccountComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +17 -11
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/index.js +21 -0
- package/lib/commonjs/components/UNActivityComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +4 -2
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/index.js +21 -0
- package/lib/commonjs/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js +14 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +34 -10
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/index.js +27 -0
- package/lib/commonjs/components/UNCardComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +4 -2
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/index.js +21 -0
- package/lib/commonjs/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +86 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +41 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/index.js +21 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/index.js.map +1 -0
- package/lib/commonjs/components/index.js +19 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/flows/card/UNCardFlows.js +8 -4
- package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/helpers.js +34 -0
- package/lib/commonjs/helpers/pushProvisioningService/helpers.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +49 -3
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +33 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.js +41 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.js.map +1 -0
- package/lib/commonjs/helpers/store/helpers.js +29 -0
- package/lib/commonjs/helpers/store/helpers.js.map +1 -0
- package/lib/commonjs/hooks/useListenerToEvent.js +26 -0
- package/lib/commonjs/hooks/useListenerToEvent.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js +12 -0
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/onLoadMessage.js +2 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +30 -6
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +13 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/slices/ConfigurationSlice.js +36 -0
- package/lib/commonjs/slices/ConfigurationSlice.js.map +1 -0
- package/lib/commonjs/slices/SharedEventsSlice.js +28 -0
- package/lib/commonjs/slices/SharedEventsSlice.js.map +1 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js +28 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/commonjs/store/index.js +17 -0
- package/lib/commonjs/store/index.js.map +1 -0
- package/lib/commonjs/store/store.js +20 -0
- package/lib/commonjs/store/store.js.map +1 -0
- package/lib/commonjs/types/internal/errorHelpers.js +20 -0
- package/lib/commonjs/types/internal/errorHelpers.js.map +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
- package/lib/commonjs/types/shared/activity.types.js +7 -0
- package/lib/commonjs/types/shared/activity.types.js.map +1 -1
- package/lib/commonjs/types/shared/error.types.js +29 -0
- package/lib/commonjs/types/shared/error.types.js.map +1 -0
- package/lib/commonjs/types/shared/index.js +33 -0
- package/lib/commonjs/types/shared/index.js.map +1 -1
- package/lib/commonjs/types/shared/multipleCards.types.js +13 -0
- package/lib/commonjs/types/shared/multipleCards.types.js.map +1 -0
- package/lib/commonjs/types/shared/onLoadResponse.types.js +4 -0
- package/lib/commonjs/types/shared/onLoadResponse.types.js.map +1 -1
- package/lib/commonjs/types/shared/versioning.types.js +14 -0
- package/lib/commonjs/types/shared/versioning.types.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +9 -14
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +17 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +21 -22
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +19 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/commonjs/utils/AppInfo.js +49 -0
- package/lib/commonjs/utils/AppInfo.js.map +1 -0
- package/lib/commonjs/utils/SDKInfo.js +13 -0
- package/lib/commonjs/utils/SDKInfo.js.map +1 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js +58 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +30 -32
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js +19 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +4 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +5 -3
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/index.js +2 -0
- package/lib/module/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +5 -3
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/index.js +2 -0
- package/lib/module/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +19 -12
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -2
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/index.js +2 -0
- package/lib/module/components/UNAccountComponent/index.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +16 -9
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/index.js +2 -0
- package/lib/module/components/UNActivityComponent/index.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +3 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/index.js +2 -0
- package/lib/module/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js +34 -9
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCardComponent/index.js +2 -0
- package/lib/module/components/UNCardComponent/index.js.map +1 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +3 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/index.js +2 -0
- package/lib/module/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +77 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +33 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/index.js +2 -0
- package/lib/module/components/UNMultipleCardsComponent/index.js.map +1 -0
- package/lib/module/components/index.js +9 -8
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/flows/card/UNCardFlows.js +8 -3
- package/lib/module/flows/card/UNCardFlows.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/helpers.js +24 -0
- package/lib/module/helpers/pushProvisioningService/helpers.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +50 -4
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +26 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/types.js +34 -0
- package/lib/module/helpers/pushProvisioningService/types.js.map +1 -0
- package/lib/module/helpers/store/helpers.js +20 -0
- package/lib/module/helpers/store/helpers.js.map +1 -0
- package/lib/module/hooks/useListenerToEvent.js +19 -0
- package/lib/module/hooks/useListenerToEvent.js.map +1 -0
- package/lib/module/messages/webMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/multipleCardsMessage.js +5 -0
- package/lib/module/messages/webMessages/multipleCardsMessage.js.map +1 -0
- package/lib/module/messages/webMessages/onLoadMessage.js +2 -1
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/module/networking/requests/UNWalletPayloadRequest.js +29 -6
- package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +10 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/slices/ConfigurationSlice.js +25 -0
- package/lib/module/slices/ConfigurationSlice.js.map +1 -0
- package/lib/module/slices/SharedEventsSlice.js +19 -0
- package/lib/module/slices/SharedEventsSlice.js.map +1 -0
- package/lib/module/slices/pushProvisioningSlice.js +19 -0
- package/lib/module/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/module/store/index.js +2 -0
- package/lib/module/store/index.js.map +1 -0
- package/lib/module/store/store.js +12 -0
- package/lib/module/store/store.js.map +1 -0
- package/lib/module/types/internal/errorHelpers.js +12 -0
- package/lib/module/types/internal/errorHelpers.js.map +1 -0
- package/lib/module/types/internal/webComponent.types.js +1 -0
- package/lib/module/types/internal/webComponent.types.js.map +1 -1
- package/lib/module/types/shared/activity.types.js +5 -1
- package/lib/module/types/shared/activity.types.js.map +1 -1
- package/lib/module/types/shared/error.types.js +22 -0
- package/lib/module/types/shared/error.types.js.map +1 -0
- package/lib/module/types/shared/index.js +3 -0
- package/lib/module/types/shared/index.js.map +1 -1
- package/lib/module/types/shared/multipleCards.types.js +6 -0
- package/lib/module/types/shared/multipleCards.types.js.map +1 -0
- package/lib/module/types/shared/onLoadResponse.types.js +1 -1
- package/lib/module/types/shared/onLoadResponse.types.js.map +1 -1
- package/lib/module/types/shared/versioning.types.js +7 -0
- package/lib/module/types/shared/versioning.types.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js +9 -12
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdk.constants.js +10 -0
- package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +20 -19
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +12 -0
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/module/utils/AppInfo.js +39 -0
- package/lib/module/utils/AppInfo.js.map +1 -0
- package/lib/module/utils/SDKInfo.js +5 -0
- package/lib/module/utils/SDKInfo.js.map +1 -0
- package/lib/module/utils/webVersioningStrategy.utils.js +48 -0
- package/lib/module/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +33 -34
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/WebComponent.utils.js +15 -0
- package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/module/webComponent/html.js +5 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.d.ts +3 -1
- package/lib/typescript/src/components/UNACHCreditComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -1
- package/lib/typescript/src/components/UNACHDebitComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.d.ts +3 -2
- package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -2
- package/lib/typescript/src/components/UNAccountComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.d.ts +5 -1
- package/lib/typescript/src/components/UNActivityComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNBookPaymentComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +2 -1
- package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.d.ts +2 -2
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/components/index.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.d.ts +4 -1
- package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.utils.d.ts +2 -0
- package/lib/typescript/src/components/UNCardComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNCheckDepositComponent/index.d.ts +1 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts +15 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts +3 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts +9 -0
- package/lib/typescript/src/helpers/pushProvisioningService/helpers.d.ts +4 -0
- package/lib/typescript/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.d.ts +3 -0
- package/lib/typescript/src/helpers/pushProvisioningService/types.d.ts +49 -0
- package/lib/typescript/src/helpers/store/helpers.d.ts +3 -0
- package/lib/typescript/src/hooks/useListenerToEvent.d.ts +9 -0
- package/lib/typescript/{messages → src/messages}/webMessages/index.d.ts +3 -2
- package/lib/typescript/src/messages/webMessages/multipleCardsMessage.d.ts +6 -0
- package/lib/typescript/{messages → src/messages}/webMessages/onLoadMessage.d.ts +7 -3
- package/lib/typescript/src/networking/requests/UNWalletPayloadRequest.d.ts +2 -0
- package/lib/typescript/{scripts → src/scripts}/html/bodyScript.d.ts +2 -0
- package/lib/typescript/src/slices/ConfigurationSlice.d.ts +10 -0
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts +56 -0
- package/lib/typescript/src/slices/pushProvisioningSlice.d.ts +8 -0
- package/lib/typescript/src/store/index.d.ts +1 -0
- package/lib/typescript/src/store/store.d.ts +76 -0
- package/lib/typescript/src/types/internal/errorHelpers.d.ts +4 -0
- package/lib/typescript/{types → src/types}/internal/webComponent.types.d.ts +1 -0
- package/lib/typescript/{types → src/types}/shared/activity.types.d.ts +5 -1
- package/lib/typescript/src/types/shared/error.types.d.ts +36 -0
- package/lib/typescript/{types → src/types}/shared/index.d.ts +3 -0
- package/lib/typescript/src/types/shared/multipleCards.types.d.ts +6 -0
- package/lib/typescript/src/types/shared/onLoadResponse.types.d.ts +5 -0
- package/lib/typescript/src/types/shared/versioning.types.d.ts +22 -0
- package/lib/typescript/src/unitSdkManager/UnitSdk.api.d.ts +1 -0
- package/lib/typescript/src/unitSdkManager/UnitSdk.constants.d.ts +8 -0
- package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdkManager.d.ts +11 -10
- package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts +3 -0
- package/lib/typescript/src/utils/AppInfo.d.ts +4 -0
- package/lib/typescript/src/utils/SDKInfo.d.ts +1 -0
- package/lib/typescript/src/utils/webVersioningStrategy.utils.d.ts +5 -0
- package/lib/typescript/{webComponent → src/webComponent}/WebComponent.utils.d.ts +3 -0
- package/package.json +8 -6
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +7 -3
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
- package/src/components/UNACHCreditComponent/index.ts +1 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +7 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
- package/src/components/UNACHDebitComponent/index.ts +1 -0
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +30 -14
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
- package/src/components/UNAccountComponent/index.ts +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +37 -17
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -1
- package/src/components/UNActivityComponent/index.ts +1 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +4 -1
- package/src/components/UNBookPaymentComponent/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +59 -32
- package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.tsx → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx} +18 -13
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/components/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/index.ts +1 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +51 -14
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +7 -0
- package/src/components/UNCardComponent/index.ts +1 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -1
- package/src/components/UNCheckDepositComponent/index.ts +1 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +119 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +36 -0
- package/src/components/UNMultipleCardsComponent/index.ts +3 -0
- package/src/components/index.ts +9 -8
- package/src/flows/card/UNCardFlows.ts +10 -4
- package/src/helpers/pushProvisioningService/helpers.ts +31 -0
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +46 -7
- package/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.ts +29 -0
- package/src/helpers/pushProvisioningService/types.ts +52 -0
- package/src/helpers/store/helpers.tsx +22 -0
- package/src/hooks/useListenerToEvent.ts +32 -0
- package/src/messages/webMessages/index.ts +3 -0
- package/src/messages/webMessages/multipleCardsMessage.ts +9 -0
- package/src/messages/webMessages/onLoadMessage.ts +14 -3
- package/src/networking/requests/UNWalletPayloadRequest.ts +30 -7
- package/src/scripts/html/bodyScript.ts +13 -1
- package/src/slices/ConfigurationSlice.ts +31 -0
- package/src/slices/SharedEventsSlice.ts +93 -0
- package/src/slices/pushProvisioningSlice.ts +24 -0
- package/src/store/index.ts +1 -0
- package/src/store/store.ts +14 -0
- package/src/types/internal/errorHelpers.ts +22 -0
- package/src/types/internal/webComponent.types.ts +1 -1
- package/src/types/shared/activity.types.ts +6 -1
- package/src/types/shared/error.types.ts +38 -0
- package/src/types/shared/index.ts +3 -0
- package/src/types/shared/multipleCards.types.ts +8 -0
- package/src/types/shared/onLoadResponse.types.ts +2 -12
- package/src/types/shared/versioning.types.ts +28 -0
- package/src/unitSdkManager/UnitSdk.api.ts +10 -10
- package/src/unitSdkManager/UnitSdk.constants.ts +11 -0
- package/src/unitSdkManager/UnitSdkManager.ts +21 -24
- package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +13 -0
- package/src/utils/AppInfo.ts +40 -0
- package/src/utils/SDKInfo.ts +5 -0
- package/src/utils/webVersioningStrategy.utils.ts +52 -0
- package/src/webComponent/WebComponent.tsx +37 -34
- package/src/webComponent/WebComponent.utils.ts +17 -0
- package/src/webComponent/html.ts +16 -2
- package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +0 -35
- package/ios/UNAppInfo/UNAppInfo.swift +0 -23
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/commonjs/components/utils/nativeModulesInfo.js +0 -20
- package/lib/commonjs/components/utils/nativeModulesInfo.js.map +0 -1
- package/lib/commonjs/helpers/EventBus.js +0 -58
- package/lib/commonjs/helpers/EventBus.js.map +0 -1
- package/lib/commonjs/hooks/listenerToBus.js +0 -34
- package/lib/commonjs/hooks/listenerToBus.js.map +0 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/module/components/utils/nativeModulesInfo.js +0 -13
- package/lib/module/components/utils/nativeModulesInfo.js.map +0 -1
- package/lib/module/helpers/EventBus.js +0 -51
- package/lib/module/helpers/EventBus.js.map +0 -1
- package/lib/module/hooks/listenerToBus.js +0 -25
- package/lib/module/hooks/listenerToBus.js.map +0 -1
- package/lib/typescript/components/index.d.ts +0 -8
- package/lib/typescript/components/utils/nativeModulesInfo.d.ts +0 -1
- package/lib/typescript/helpers/EventBus.d.ts +0 -13
- package/lib/typescript/hooks/listenerToBus.d.ts +0 -7
- package/lib/typescript/networking/requests/UNWalletPayloadRequest.d.ts +0 -2
- package/lib/typescript/types/shared/onLoadResponse.types.d.ts +0 -14
- package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +0 -3
- package/src/components/utils/nativeModulesInfo.ts +0 -11
- package/src/helpers/EventBus.ts +0 -58
- package/src/hooks/listenerToBus.ts +0 -31
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/typescript/{assets → src/assets}/images/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +0 -0
- /package/lib/typescript/{flows → src/flows}/UNFlows.d.ts +0 -0
- /package/lib/typescript/{flows → src/flows}/card/UNCardFlows.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.styles.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/hooks/useCardWallet.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/startProvisioning.d.ts +0 -0
- /package/lib/typescript/{hooks → src/hooks}/useAppStateListener.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/bottomSheetMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/cardMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/index.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/sdkMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/accountMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/achCreditMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/activityMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/bookPaymentMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/cardMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/checkMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/pageMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/paymentsMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/unitMessages.d.ts +0 -0
- /package/lib/typescript/{nativeComponent → src/nativeComponent}/UnitAddToWalletButton.d.ts +0 -0
- /package/lib/typescript/{networking → src/networking}/common/UNNetworkConstants.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/bodyHtml.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/fontFaces.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/fonts.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/variables.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/internal/bottomSheet.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/account.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/achCredit.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/authorization.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/bookPayment.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/card.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/checkDeposit.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/fonts.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/payments.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/transactions.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/wallet.types.d.ts +0 -0
- /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/unitUiManager/unitUiManager.d.ts +0 -0
- /package/lib/typescript/{webComponent → src/webComponent}/WebComponent.d.ts +0 -0
- /package/lib/typescript/{webComponent → src/webComponent}/html.d.ts +0 -0
- /package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.ts} +0 -0
|
@@ -3,19 +3,35 @@ import { View } from 'react-native';
|
|
|
3
3
|
import type WebView from 'react-native-webview';
|
|
4
4
|
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
5
5
|
import { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
6
|
-
import EventBus from '../../helpers/EventBus';
|
|
7
6
|
import { WebComponent } from '../../webComponent/WebComponent';
|
|
8
|
-
import { useListenerToBus } from '../../hooks/listenerToBus';
|
|
9
7
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
10
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getCardParams,
|
|
10
|
+
getCardScript,
|
|
11
|
+
injectRefreshEventIfNeeded,
|
|
12
|
+
injectOpenActionsMenuScript,
|
|
13
|
+
injectRequestCardActionScript,
|
|
14
|
+
injectRequestShowSensitiveDataScript, injectRequestHideSensitiveDataScript,
|
|
15
|
+
} from './UNCardComponent.utils';
|
|
11
16
|
import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../types/shared';
|
|
12
17
|
import { CardMessage } from '../../messages/webMessages/cardMessage';
|
|
13
18
|
import type { NativeModules } from 'react-native';
|
|
14
19
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
15
|
-
import {
|
|
20
|
+
import {
|
|
21
|
+
BottomSheetRenderingType,
|
|
22
|
+
SlotRendering,
|
|
23
|
+
type BottomSheetSlotData,
|
|
24
|
+
} from '../../types/internal/bottomSheet.types';
|
|
16
25
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
17
26
|
import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
|
|
18
27
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
28
|
+
import { useLaunchInitialize } from '../../helpers/pushProvisioningService/hooks/useLaunchInitialize';
|
|
29
|
+
import { selectWallet } from '../../slices/pushProvisioningSlice';
|
|
30
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
31
|
+
import { withReduxStoreAndRefForwarding } from '../../helpers/store/helpers';
|
|
32
|
+
import { useListenerToEvent } from '../../hooks/useListenerToEvent';
|
|
33
|
+
import { setEvent } from '../../slices/SharedEventsSlice';
|
|
34
|
+
|
|
19
35
|
export interface UNCardComponentProps {
|
|
20
36
|
// inputs
|
|
21
37
|
cardId: string;
|
|
@@ -30,20 +46,27 @@ export interface UNCardComponentProps {
|
|
|
30
46
|
hideSensitiveDataButton?: boolean;
|
|
31
47
|
|
|
32
48
|
// events
|
|
33
|
-
onLoad?: (response: UNOnLoadResponse<UNCardData>) => void
|
|
49
|
+
onLoad?: (response: UNOnLoadResponse<UNCardData>) => void;
|
|
34
50
|
onStatusChanged?: (card: UNCardData) => void;
|
|
35
51
|
onCardActivated?: (card: UNCardData) => void;
|
|
36
52
|
pushProvisioningModule?: typeof NativeModules;
|
|
37
53
|
}
|
|
54
|
+
|
|
38
55
|
export interface CardRef {
|
|
39
56
|
openActionsMenu: () => void;
|
|
40
57
|
openAction: (action: UNCardMenuAction) => void;
|
|
58
|
+
showSensitiveData: () => void;
|
|
59
|
+
hideSensitiveData: () => void;
|
|
41
60
|
}
|
|
42
61
|
|
|
43
|
-
|
|
62
|
+
const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(function UNCardComponent(props, cardRef) {
|
|
63
|
+
const dispatch = useDispatch();
|
|
64
|
+
|
|
44
65
|
const [height, setHeight] = useState(0);
|
|
45
66
|
|
|
46
67
|
const webRef = useRef<WebView>(null);
|
|
68
|
+
const { initializePushProvisioning } = useLaunchInitialize();
|
|
69
|
+
const { signedNonce } = useSelector(selectWallet);
|
|
47
70
|
|
|
48
71
|
useImperativeHandle(cardRef, () => ({
|
|
49
72
|
openActionsMenu() {
|
|
@@ -51,7 +74,13 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
51
74
|
},
|
|
52
75
|
openAction(action: UNCardMenuAction) {
|
|
53
76
|
injectRequestCardActionScript(webRef.current, action);
|
|
54
|
-
}
|
|
77
|
+
},
|
|
78
|
+
showSensitiveData() {
|
|
79
|
+
injectRequestShowSensitiveDataScript(webRef.current);
|
|
80
|
+
},
|
|
81
|
+
hideSensitiveData() {
|
|
82
|
+
injectRequestHideSensitiveDataScript(webRef.current);
|
|
83
|
+
},
|
|
55
84
|
}));
|
|
56
85
|
|
|
57
86
|
const cardStatusChanged = (card: UNCardData) => {
|
|
@@ -90,9 +119,9 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
90
119
|
return;
|
|
91
120
|
};
|
|
92
121
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
122
|
+
useListenerToEvent({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
|
|
123
|
+
useListenerToEvent({ busEventKey: CardMessage.CARD_STATUS_CHANGED, action: cardStatusChanged });
|
|
124
|
+
useListenerToEvent({ busEventKey: CardMessage.CARD_ACTIVATED, action: cardActivated });
|
|
96
125
|
|
|
97
126
|
const handleMessage = (message: WebViewMessage) => {
|
|
98
127
|
if (!message || !message.details) return;
|
|
@@ -102,15 +131,15 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
102
131
|
const slotData: BottomSheetSlotData = {
|
|
103
132
|
componentName: WebComponentType.card,
|
|
104
133
|
componentResourceId: props.cardId,
|
|
105
|
-
requestRenderingEvent: message.details as RequestRenderingEvent
|
|
134
|
+
requestRenderingEvent: message.details as RequestRenderingEvent,
|
|
106
135
|
};
|
|
107
136
|
|
|
108
|
-
const
|
|
137
|
+
const data = {
|
|
109
138
|
type: BottomSheetRenderingType.Slot,
|
|
110
|
-
data: slotData
|
|
139
|
+
data: slotData,
|
|
111
140
|
} as SlotRendering;
|
|
112
141
|
|
|
113
|
-
|
|
142
|
+
dispatch(setEvent({ key: BottomSheetNativeMessage.START_FLOW, data }));
|
|
114
143
|
break;
|
|
115
144
|
}
|
|
116
145
|
case PageMessage.PAGE_HEIGHT:
|
|
@@ -132,6 +161,11 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
132
161
|
}
|
|
133
162
|
}, [props.pushProvisioningModule]);
|
|
134
163
|
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (signedNonce || !UnitSDK.getPushProvisionModule()) return;
|
|
166
|
+
initializePushProvisioning();
|
|
167
|
+
}, []);
|
|
168
|
+
|
|
135
169
|
return (
|
|
136
170
|
<View style={{ height, width: '100%', minWidth: 235 }}>
|
|
137
171
|
<WebComponent
|
|
@@ -147,4 +181,7 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
147
181
|
/>
|
|
148
182
|
</View>
|
|
149
183
|
);
|
|
184
|
+
|
|
150
185
|
});
|
|
186
|
+
|
|
187
|
+
export default withReduxStoreAndRefForwarding<UNCardComponentProps, CardRef>(UNCardComponent);
|
|
@@ -29,6 +29,13 @@ export const injectRequestCardActionScript = (currentWeb: WebView | null, action
|
|
|
29
29
|
currentWeb?.injectJavaScript(`dispatchRequestCardAction('${action}')`);
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
export const injectRequestHideSensitiveDataScript = (currentWeb: WebView | null) => {
|
|
33
|
+
currentWeb?.injectJavaScript(`dispatchRequestHideSensitiveData('${WebComponentType.card}')`);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const injectRequestShowSensitiveDataScript = (currentWeb: WebView | null) => {
|
|
37
|
+
currentWeb?.injectJavaScript(`dispatchRequestShowSensitiveData('${WebComponentType.card}')`);
|
|
38
|
+
};
|
|
32
39
|
export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {
|
|
33
40
|
if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {
|
|
34
41
|
currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCardComponent, UNCardComponentProps, CardRef } from './UNCardComponent';
|
|
@@ -10,6 +10,7 @@ import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
|
|
|
10
10
|
import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
|
|
11
11
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
12
12
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
13
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
13
14
|
|
|
14
15
|
const { Camera } = NativeModules;
|
|
15
16
|
|
|
@@ -24,7 +25,7 @@ export interface UNCheckDepositComponentProps {
|
|
|
24
25
|
onRestartRequest?: (checkData: UNCheckDepositData) => void
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
+
const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) => {
|
|
28
29
|
const [height, setHeight] = useState<number>(0);
|
|
29
30
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
30
31
|
|
|
@@ -112,3 +113,5 @@ export const UNCheckDepositComponent = (props: UNCheckDepositComponentProps) =>
|
|
|
112
113
|
</View>
|
|
113
114
|
);
|
|
114
115
|
};
|
|
116
|
+
|
|
117
|
+
export default withReduxStore<UNCheckDepositComponentProps>(UNCheckDepositComponent);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCheckDepositComponent, UNCheckDepositComponentProps } from './UNCheckDepositComponent';
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { Dimensions, View } from 'react-native';
|
|
3
|
+
import type { WebViewMessage } from '../../messages/webMessages';
|
|
4
|
+
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
5
|
+
import { WebComponent } from '../../webComponent/WebComponent';
|
|
6
|
+
|
|
7
|
+
import type WebView from 'react-native-webview';
|
|
8
|
+
|
|
9
|
+
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
10
|
+
import { withReduxStore } from '../../helpers/store/helpers';
|
|
11
|
+
import { getMultipleCardsParams, getMultipleCardsScript } from './UNMultipleCardsComponent.utils';
|
|
12
|
+
import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
13
|
+
import type { UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
14
|
+
import { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
|
|
15
|
+
import type {
|
|
16
|
+
UNCardData,
|
|
17
|
+
UNError,
|
|
18
|
+
UNMultipleCardsComponentPaginationType,
|
|
19
|
+
UNMultipleCardsOnLoadData,
|
|
20
|
+
UNOnLoadResponse,
|
|
21
|
+
UNOnLoadResponseData,
|
|
22
|
+
} from '../../types/shared';
|
|
23
|
+
import { MultipleCardsCardClickedEvent, MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
|
|
24
|
+
|
|
25
|
+
const DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;
|
|
26
|
+
|
|
27
|
+
export interface UNMultipleCardsComponentProps {
|
|
28
|
+
// inputs
|
|
29
|
+
customerToken: string;
|
|
30
|
+
|
|
31
|
+
// ui
|
|
32
|
+
paginationType?: UNMultipleCardsComponentPaginationType;
|
|
33
|
+
cardsPerPage?: number;
|
|
34
|
+
disableCardClick?: boolean;
|
|
35
|
+
theme?: string;
|
|
36
|
+
language?: string;
|
|
37
|
+
queryFilter?: string;
|
|
38
|
+
hideTitle?: boolean;
|
|
39
|
+
|
|
40
|
+
// events
|
|
41
|
+
onLoad?: (response: UNOnLoadResponse<UNMultipleCardsOnLoadData>) => void;
|
|
42
|
+
onCardClicked?: (card: UNCardData) => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
|
|
46
|
+
const webRef = useRef<WebView>(null);
|
|
47
|
+
const [defaultHeight, setDefaultHeight] = useState<number>();
|
|
48
|
+
|
|
49
|
+
const cardClicked = (card: UNCardData) => {
|
|
50
|
+
if (props.onCardClicked) {
|
|
51
|
+
props.onCardClicked(card);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
|
|
56
|
+
if (!props.onLoad) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (RESPONSE_KEYS.errors in response) {
|
|
61
|
+
props.onLoad(response as UNError);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (RESPONSE_KEYS.cards in response) {
|
|
66
|
+
// MultipleCardsOnLoadResponse;
|
|
67
|
+
props.onLoad(response[RESPONSE_KEYS.cards] as UNOnLoadResponseData<UNMultipleCardsOnLoadData>);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
console.error('On Load Error: unexpected response type');
|
|
72
|
+
return;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const handleWebViewMessage = (message: WebViewMessage) => {
|
|
76
|
+
if (!message || !message.details) return;
|
|
77
|
+
switch (message.type) {
|
|
78
|
+
case UnitMessage.UNIT_ON_LOAD:
|
|
79
|
+
handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);
|
|
80
|
+
break;
|
|
81
|
+
case PageMessage.PAGE_HEIGHT: {
|
|
82
|
+
const currentHeight = (message.details as HeightEvent).height;
|
|
83
|
+
currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
case MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED: {
|
|
87
|
+
cardClicked(message.details as MultipleCardsCardClickedEvent);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const renderMultipleCardsWebView = () => {
|
|
93
|
+
return (
|
|
94
|
+
<WebComponent
|
|
95
|
+
ref={webRef}
|
|
96
|
+
type={WebComponentType.multipleCards}
|
|
97
|
+
presentationMode={PresentationMode.Inherit}
|
|
98
|
+
params={getMultipleCardsParams(props)}
|
|
99
|
+
script={getMultipleCardsScript()}
|
|
100
|
+
onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
|
|
101
|
+
nestedScrollEnabled={true}
|
|
102
|
+
theme={props.theme}
|
|
103
|
+
language={props.language}
|
|
104
|
+
/>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
if (!defaultHeight) {
|
|
109
|
+
return renderMultipleCardsWebView();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return (
|
|
113
|
+
<View style={{ height: defaultHeight }}>
|
|
114
|
+
{renderMultipleCardsWebView()}
|
|
115
|
+
</View>
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
export default withReduxStore<UNMultipleCardsComponentProps>(UNMultipleCardsComponent);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { UNMultipleCardsComponentProps } from './UNMultipleCardsComponent';
|
|
2
|
+
import { MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
|
|
3
|
+
|
|
4
|
+
export const getMultipleCardsParams = (props: UNMultipleCardsComponentProps) => {
|
|
5
|
+
const paginationType = props.paginationType ? `pagination-type="${props.paginationType}"` : '';
|
|
6
|
+
const cardsPerPage = props.cardsPerPage ? `cards-per-page="${props.cardsPerPage}"` : '';
|
|
7
|
+
const queryFilter = props.queryFilter ? `query-filter="${props.queryFilter}"` : '';
|
|
8
|
+
return `
|
|
9
|
+
customer-token="${props.customerToken}"
|
|
10
|
+
${paginationType}
|
|
11
|
+
${cardsPerPage}
|
|
12
|
+
disable-card-click="${props.disableCardClick || false}"
|
|
13
|
+
${queryFilter}
|
|
14
|
+
hide-title="${props.hideTitle || false}"
|
|
15
|
+
style="height: 100%"
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const MULTIPLE_CARDS_LISTENERS = {
|
|
20
|
+
cardClicked: `
|
|
21
|
+
window.addEventListener("${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", (e) => {
|
|
22
|
+
const response = e.detail
|
|
23
|
+
response.then((data) => {
|
|
24
|
+
postMessageToSDK({ type: "${MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED}", details: data.data })
|
|
25
|
+
}).catch((e) => {
|
|
26
|
+
console.log(e)
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
`,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const getMultipleCardsScript = () => {
|
|
33
|
+
return `
|
|
34
|
+
${MULTIPLE_CARDS_LISTENERS.cardClicked}
|
|
35
|
+
`;
|
|
36
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * from './UNCardComponent
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
1
|
+
export * from './UNCardComponent';
|
|
2
|
+
export * from './UNMultipleCardsComponent';
|
|
3
|
+
export * from './UNBottomSheetComponent';
|
|
4
|
+
export * from './UNBookPaymentComponent';
|
|
5
|
+
export * from './UNActivityComponent';
|
|
6
|
+
export * from './UNAccountComponent';
|
|
7
|
+
export * from './UNCheckDepositComponent';
|
|
8
|
+
export * from './UNACHDebitComponent';
|
|
9
|
+
export * from './UNACHCreditComponent';
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import EventBus from '../../helpers/EventBus';
|
|
2
1
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
3
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
BottomSheetRenderingType,
|
|
4
|
+
type WebComponentData,
|
|
5
|
+
type WebComponentRendering,
|
|
6
|
+
} from '../../types/internal/bottomSheet.types';
|
|
4
7
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
8
|
+
import { useDispatch } from 'react-redux';
|
|
9
|
+
import { setEvent } from '../../slices/SharedEventsSlice';
|
|
5
10
|
|
|
6
11
|
export class UNCardFlows {
|
|
7
12
|
public static startPushProvisioning = async (cardId: string, customerToken: string) => {
|
|
13
|
+
const dispatch = useDispatch(); //todo: can we use hook here?
|
|
8
14
|
try {
|
|
9
15
|
const addToWalletComponentData: WebComponentData = {
|
|
10
16
|
type: WebComponentType.cardAction,
|
|
@@ -12,12 +18,12 @@ export class UNCardFlows {
|
|
|
12
18
|
params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`,
|
|
13
19
|
};
|
|
14
20
|
|
|
15
|
-
const
|
|
21
|
+
const data: WebComponentRendering = {
|
|
16
22
|
type: BottomSheetRenderingType.WebComponent,
|
|
17
23
|
data: addToWalletComponentData,
|
|
18
24
|
};
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
dispatch(setEvent({ key: BottomSheetNativeMessage.START_FLOW, data }));
|
|
21
27
|
} catch (error) {
|
|
22
28
|
console.error(error);
|
|
23
29
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { UNNativePromiseReject, UNVPError, UNVPErrorType } from './types';
|
|
3
|
+
|
|
4
|
+
export const isUNVPError = (error: any): error is UNVPError => {
|
|
5
|
+
return 'code' in error &&
|
|
6
|
+
'description' in error &&
|
|
7
|
+
'type' in error &&
|
|
8
|
+
isUNVPErrorType(error.type) &&
|
|
9
|
+
'correlationId' in error;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const isUNVPErrorType = (type: any): type is UNVPErrorType => {
|
|
13
|
+
return Object.values(UNVPErrorType).includes(type);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const isUNNativePromiseReject = (error: any): error is UNNativePromiseReject => {
|
|
17
|
+
return 'code' in error && 'message' in error;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const promiseRejectToUNVPErrorType = (error: any): UNVPErrorType | null => {
|
|
21
|
+
// validate the shape of a promise reject we get from iOS/Android native
|
|
22
|
+
if (!isUNNativePromiseReject(error)) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const parsedError = JSON.parse(error.message);
|
|
26
|
+
// validate the shape of an error we get from VDE SDK
|
|
27
|
+
if (!isUNVPError(parsedError)) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return parsedError.type;
|
|
31
|
+
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
1
|
+
import { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { UNWalletCode, type UNWallet, UNWalletName } from '../../../types/shared/wallet.types';
|
|
3
3
|
import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
|
|
4
4
|
import { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';
|
|
5
|
+
import { useSelector, useDispatch } from 'react-redux';
|
|
6
|
+
import { selectWallet, setSignedNonce } from '../../../slices/pushProvisioningSlice';
|
|
7
|
+
import { useLaunchInitialize } from './useLaunchInitialize';
|
|
8
|
+
import { UNVPErrorType } from '../types';
|
|
9
|
+
import { promiseRejectToUNVPErrorType } from '../helpers';
|
|
10
|
+
import { UNErrorCodes, UNErrorData } from '../../../types/shared/error.types';
|
|
11
|
+
import { isUNError } from '../../../types/internal/errorHelpers';
|
|
5
12
|
|
|
6
13
|
export type CardToEncryptedPayload = {
|
|
7
14
|
[cardId: string]: string;
|
|
@@ -9,14 +16,27 @@ export type CardToEncryptedPayload = {
|
|
|
9
16
|
|
|
10
17
|
export const useCardWallet = (cardId: string) => {
|
|
11
18
|
const [currentUNWallet, setCurrentUNWallet] = useState<UNWallet>();
|
|
19
|
+
const { signedNonce } = useSelector(selectWallet);
|
|
20
|
+
const { initializePushProvisioning } = useLaunchInitialize();
|
|
21
|
+
const dispatch = useDispatch();
|
|
22
|
+
const isRecoveringSignedNonceRef = useRef<boolean>(false);
|
|
23
|
+
|
|
24
|
+
const shouldRecoverVPSDKForError = (errorType: UNVPErrorType) => {
|
|
25
|
+
const recoveringTypes = [UNVPErrorType.PayloadDecryptionFailed, UNVPErrorType.SessionExpired, UNVPErrorType.InvalidNonce];
|
|
26
|
+
return recoveringTypes.includes(errorType);
|
|
27
|
+
};
|
|
12
28
|
|
|
13
29
|
useEffect(() => {
|
|
14
30
|
const getEncryptedPayload = async () => {
|
|
15
31
|
const env = UnitSDK.getEnv();
|
|
16
32
|
const customerToken = UnitSDK.getCustomerToken();
|
|
17
33
|
if (!env || !customerToken) return;
|
|
18
|
-
|
|
19
|
-
|
|
34
|
+
// In case we use flow
|
|
35
|
+
if (!signedNonce) {
|
|
36
|
+
await initializePushProvisioning();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env, signedNonce);
|
|
20
40
|
return encryptedPayload;
|
|
21
41
|
};
|
|
22
42
|
|
|
@@ -25,20 +45,39 @@ export const useCardWallet = (cardId: string) => {
|
|
|
25
45
|
if (!currentProvisioningModule) return;
|
|
26
46
|
try {
|
|
27
47
|
const encryptedPayload = await getEncryptedPayload();
|
|
48
|
+
if (!encryptedPayload) return;
|
|
28
49
|
const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
|
|
29
|
-
|
|
30
50
|
const unWallet: UNWallet | null = parseWalletsResponse(walletsResponse);
|
|
31
51
|
if (!unWallet) return;
|
|
32
52
|
setCurrentUNWallet(unWallet);
|
|
33
53
|
return;
|
|
34
54
|
} catch (error) {
|
|
35
|
-
|
|
55
|
+
console.error('Coudln\'t get card wallet data:', error);
|
|
56
|
+
if (isRecoveringSignedNonceRef.current) return;
|
|
57
|
+
isRecoveringSignedNonceRef.current = true;
|
|
58
|
+
|
|
59
|
+
// handle unit network api errors
|
|
60
|
+
if (isUNError(error)) {
|
|
61
|
+
const errors: UNErrorData[] = error.errors;
|
|
62
|
+
// errors will return in an array but hold only a single error element
|
|
63
|
+
if (errors[0]?.code === UNErrorCodes.INVALID_NONCE) {
|
|
64
|
+
dispatch(setSignedNonce(null));
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// handle VDE SDK errors
|
|
70
|
+
const errorType = promiseRejectToUNVPErrorType(error);
|
|
71
|
+
if (!errorType) return;
|
|
72
|
+
if (shouldRecoverVPSDKForError(errorType)) {
|
|
73
|
+
dispatch(setSignedNonce(null));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
36
76
|
}
|
|
37
77
|
};
|
|
38
78
|
|
|
39
79
|
getCardWalletData();
|
|
40
|
-
|
|
41
|
-
}, [cardId]);
|
|
80
|
+
}, [signedNonce, cardId]);
|
|
42
81
|
|
|
43
82
|
return {
|
|
44
83
|
currentUNWallet
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
|
|
2
|
+
import { useDispatch } from 'react-redux';
|
|
3
|
+
import { setSignedNonce } from '../../../slices/pushProvisioningSlice';
|
|
4
|
+
|
|
5
|
+
export const useLaunchInitialize = () => {
|
|
6
|
+
const dispatch = useDispatch();
|
|
7
|
+
|
|
8
|
+
const initializePushProvisioning = async () => {
|
|
9
|
+
const pushProvisioningModule = UnitSDK.getPushProvisionModule();
|
|
10
|
+
if (!pushProvisioningModule) {
|
|
11
|
+
console.error('Missing a PushProvisioningModule');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const response = await pushProvisioningModule.launchInitialize();
|
|
16
|
+
console.log(`PushProvisioningModule.launchInitialize: Success \n\n signedNonce : ${response}`);
|
|
17
|
+
const signedNonce = JSON.parse(response).signedNonce;
|
|
18
|
+
dispatch(setSignedNonce(signedNonce));
|
|
19
|
+
} catch (error) {
|
|
20
|
+
// TODO - handle errors
|
|
21
|
+
console.error(error);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
initializePushProvisioning
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export enum UNVPErrorType {
|
|
2
|
+
EmptyAppId = 'EmptyAppId',
|
|
3
|
+
DeviceAuthenticationFailed = 'DeviceAuthenticationFailed',
|
|
4
|
+
DeviceRootDetection = 'DeviceRootDetection',
|
|
5
|
+
HookDetection = 'HookDetection',
|
|
6
|
+
PlayIntegrityCheckFailed = 'PlayIntegrityCheckFailed',
|
|
7
|
+
EmptyEncryptedPayload = 'EmptyEncryptedPayload',
|
|
8
|
+
NoWallets = 'NoWallets',
|
|
9
|
+
InvalidCardId = 'InvalidCardId',
|
|
10
|
+
ProvisioningNotAllowed = 'ProvisioningNotAllowed',
|
|
11
|
+
CancelledByUser = 'CancelledByUser',
|
|
12
|
+
GoogleWalletCreationFailed = 'GoogleWalletCreationFailed',
|
|
13
|
+
UnknownErrorOccurred = 'UnknownErrorOccurred',
|
|
14
|
+
WalletProvisioningInconclusive = 'WalletProvisioningInconclusive',
|
|
15
|
+
WalletProvisioningError = 'WalletProvisioningError',
|
|
16
|
+
NetworkFailure = 'NetworkFailure',
|
|
17
|
+
SessionExpired = 'SessionExpired',
|
|
18
|
+
InvalidInfo = 'InvalidInfo',
|
|
19
|
+
PayloadDecryptionFailed = 'PayloadDecryptionFailed',
|
|
20
|
+
ApiError = 'ApiError',
|
|
21
|
+
InvalidNonce = 'InvalidNonce',
|
|
22
|
+
SDKLockout = 'SDKLockout',
|
|
23
|
+
NoBrowserFound = 'NoBrowserFound',
|
|
24
|
+
TLCMFeatureNotSupported = 'TLCMFeatureNotSupported',
|
|
25
|
+
TLCMUnsupportedWallet = 'TLCMUnsupportedWallet',
|
|
26
|
+
TLCMDetailsNotFoundInPaySdk = 'TLCMDetailsNotFoundInPaySdk',
|
|
27
|
+
TLCMTokenStatusExists = 'TLCMTokenStatusExists',
|
|
28
|
+
TLCMInvalidOperationInput = 'TLCMInvalidOperationInput',
|
|
29
|
+
TLCMInvalidRequest = 'TLCMInvalidRequest',
|
|
30
|
+
TLCMUpdateStatusNotAllowed = 'TLCMUpdateStatusNotAllowed',
|
|
31
|
+
TLCMTokenNotFound = 'TLCMTokenNotFound',
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface UNVPError {
|
|
35
|
+
code: string;
|
|
36
|
+
description: string;
|
|
37
|
+
type: UNVPErrorType;
|
|
38
|
+
correlationId: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type UNNativePromiseReject = {
|
|
42
|
+
code: string;
|
|
43
|
+
message: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface UNMobileWalletPayload {
|
|
47
|
+
data: {
|
|
48
|
+
attributes: {
|
|
49
|
+
payload: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Provider } from 'react-redux';
|
|
3
|
+
import { store } from '../../store';
|
|
4
|
+
|
|
5
|
+
export const withReduxStore = <Props, >(Component: React.ComponentType<any>) => {
|
|
6
|
+
const Wrapper = (props: Props) => {
|
|
7
|
+
return (
|
|
8
|
+
<Provider store={store} >
|
|
9
|
+
<Component {...props} />
|
|
10
|
+
</Provider>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
return Wrapper;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const withReduxStoreAndRefForwarding = <Props, Ref>(Component: React.ComponentType<any>) => React.forwardRef<Ref, Props>((props, ref) => {
|
|
17
|
+
return (
|
|
18
|
+
<Provider store={store}>
|
|
19
|
+
<Component ref={ref} {...props} />
|
|
20
|
+
</Provider>
|
|
21
|
+
);
|
|
22
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
import type { RootState } from '../store';
|
|
6
|
+
import type { NativeMessageType } from '../messages/nativeMessages';
|
|
7
|
+
import type { WebViewMessageType } from '../messages/webMessages';
|
|
8
|
+
|
|
9
|
+
export type BusEventKey = NativeMessageType | WebViewMessageType
|
|
10
|
+
|
|
11
|
+
type EventListener = {
|
|
12
|
+
busEventKey: BusEventKey,
|
|
13
|
+
action: (data: any) => void
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const useListenerToEvent = (listener: EventListener) => {
|
|
17
|
+
const isFirstRun = useRef(true);
|
|
18
|
+
const event = useSelector((state: RootState) => state.sharedEvents.event);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (isFirstRun.current) {
|
|
21
|
+
isFirstRun.current = false;
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (event == null || event == undefined || event?.key != listener.busEventKey) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
listener.action(event.data);
|
|
30
|
+
|
|
31
|
+
}, [event]);
|
|
32
|
+
};
|