react-native-unit-components 1.6.1 → 1.7.1
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/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +6 -6
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +6 -6
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +14 -9
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +3 -3
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +12 -6
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +2 -2
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +6 -6
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +28 -8
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +49 -37
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +22 -53
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +4 -53
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +6 -6
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/flows/UNFlows.js +19 -0
- package/lib/commonjs/flows/UNFlows.js.map +1 -0
- package/lib/commonjs/flows/card/UNCardFlows.js +33 -0
- package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +70 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js +22 -0
- package/lib/commonjs/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
- package/lib/commonjs/index.js +4 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js +17 -0
- package/lib/commonjs/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
- package/lib/commonjs/messages/nativeMessages/cardMessage.js +2 -8
- package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/achCreditMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/checkMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/unitMessages.js +1 -0
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/commonjs/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
- package/lib/commonjs/networking/common/UNNetworkConstants.js.map +1 -0
- package/lib/commonjs/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +3 -1
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -0
- package/lib/commonjs/scripts/html/bodyHtml.js +4 -10
- package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
- package/lib/commonjs/types/internal/bottomSheet.types.js +14 -0
- package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js +27 -0
- package/lib/commonjs/types/internal/webComponent.types.js.map +1 -0
- package/lib/commonjs/types/shared/achCredit.types.js.map +1 -0
- package/lib/commonjs/types/shared/activity.types.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +20 -2
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js +21 -0
- package/lib/commonjs/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +6 -18
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +3 -1
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +2 -2
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -2
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +13 -8
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +10 -4
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -2
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +159 -74
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +23 -6
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +51 -39
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +23 -55
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +1 -48
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +2 -2
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/flows/UNFlows.js +12 -0
- package/lib/module/flows/UNFlows.js.map +1 -0
- package/lib/module/flows/card/UNCardFlows.js +25 -0
- package/lib/module/flows/card/UNCardFlows.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +63 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/startProvisioning.js +15 -0
- package/lib/module/helpers/pushProvisioningService/startProvisioning.js.map +1 -0
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/messages/nativeMessages/bottomSheetMessage.js +9 -0
- package/lib/module/messages/nativeMessages/bottomSheetMessage.js.map +1 -0
- package/lib/module/messages/nativeMessages/cardMessage.js +1 -6
- package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/nativeMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/accountMessage.js.map +1 -1
- package/lib/module/messages/webMessages/achCreditMessage.js.map +1 -1
- package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -1
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/webMessages/checkMessage.js.map +1 -1
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/module/messages/webMessages/unitMessages.js +1 -0
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/module/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.js +1 -1
- package/lib/module/networking/common/UNNetworkConstants.js.map +1 -0
- package/lib/module/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.js +4 -1
- package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -0
- package/lib/module/scripts/html/bodyHtml.js +1 -6
- package/lib/module/scripts/html/bodyHtml.js.map +1 -1
- package/lib/module/types/internal/bottomSheet.types.js +7 -0
- package/lib/module/types/internal/bottomSheet.types.js.map +1 -0
- package/lib/module/types/internal/webComponent.types.js +19 -0
- package/lib/module/types/internal/webComponent.types.js.map +1 -0
- package/lib/module/types/shared/achCredit.types.js.map +1 -0
- package/lib/module/types/shared/activity.types.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +20 -2
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js +14 -0
- package/lib/module/unitSdkManager/unitUiManager/unitUiManager.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +5 -16
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +3 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +1 -1
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +1 -1
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +3 -3
- package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +1 -1
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -2
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +1 -1
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +0 -7
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -1
- package/lib/typescript/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.d.ts +6 -2
- package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +1 -1
- package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +1 -9
- package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -2
- package/lib/typescript/flows/UNFlows.d.ts +4 -0
- package/lib/typescript/flows/card/UNCardFlows.d.ts +3 -0
- package/lib/typescript/helpers/pushProvisioningService/hooks/useCardWallet.d.ts +7 -0
- package/lib/typescript/helpers/pushProvisioningService/startProvisioning.d.ts +2 -0
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/messages/nativeMessages/bottomSheetMessage.d.ts +9 -0
- package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +0 -16
- package/lib/typescript/messages/nativeMessages/index.d.ts +3 -3
- package/lib/typescript/messages/webMessages/accountMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/achCreditMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/cardMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/checkMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/onLoadMessage.d.ts +3 -3
- package/lib/typescript/messages/webMessages/unitMessages.d.ts +2 -1
- package/lib/typescript/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.d.ts +1 -1
- package/lib/typescript/scripts/html/bodyHtml.d.ts +1 -5
- package/lib/typescript/types/internal/bottomSheet.types.d.ts +35 -0
- package/lib/typescript/types/internal/webComponent.types.d.ts +16 -0
- package/lib/typescript/{sharedTypes → types/shared}/achCredit.types.d.ts +1 -1
- package/lib/typescript/{sharedTypes → types/shared}/activity.types.d.ts +1 -1
- package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +9 -0
- package/lib/typescript/unitSdkManager/unitUiManager/unitUiManager.d.ts +6 -0
- package/lib/typescript/webComponent/WebComponent.d.ts +2 -12
- package/lib/typescript/webComponent/html.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +3 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +3 -3
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +17 -12
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +14 -7
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +1 -1
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +3 -3
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +151 -76
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +24 -6
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +72 -41
- package/src/components/UNCardComponent/UNCardComponent.tsx +25 -57
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +2 -49
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -4
- package/src/flows/UNFlows.ts +13 -0
- package/src/flows/card/UNCardFlows.ts +25 -0
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +67 -0
- package/src/helpers/pushProvisioningService/startProvisioning.ts +20 -0
- package/src/index.tsx +1 -1
- package/src/messages/nativeMessages/bottomSheetMessage.ts +15 -0
- package/src/messages/nativeMessages/cardMessage.ts +1 -24
- package/src/messages/nativeMessages/index.ts +3 -3
- package/src/messages/webMessages/accountMessage.ts +1 -1
- package/src/messages/webMessages/achCreditMessage.ts +1 -1
- package/src/messages/webMessages/bookPaymentMessage.ts +1 -1
- package/src/messages/webMessages/cardMessage.ts +1 -1
- package/src/messages/webMessages/checkMessage.ts +1 -1
- package/src/messages/webMessages/onLoadMessage.ts +3 -3
- package/src/messages/webMessages/unitMessages.ts +3 -2
- package/src/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.ts +1 -1
- package/src/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.ts +3 -1
- package/src/scripts/html/bodyHtml.ts +2 -14
- package/src/types/internal/bottomSheet.types.ts +43 -0
- package/src/types/internal/webComponent.types.ts +26 -0
- package/src/{sharedTypes → types/shared}/achCredit.types.ts +1 -1
- package/src/{sharedTypes → types/shared}/activity.types.ts +1 -1
- package/src/unitSdkManager/UnitSdkManager.ts +28 -2
- package/src/unitSdkManager/unitUiManager/unitUiManager.ts +13 -0
- package/src/webComponent/WebComponent.tsx +7 -17
- package/src/webComponent/html.ts +3 -1
- package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
- package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
- package/lib/commonjs/sharedTypes/achCredit.types.js.map +0 -1
- package/lib/commonjs/sharedTypes/activity.types.js.map +0 -1
- package/lib/module/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +0 -1
- package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +0 -1
- package/lib/module/sharedTypes/achCredit.types.js.map +0 -1
- package/lib/module/sharedTypes/activity.types.js.map +0 -1
- /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/account.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/achCredit.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/activity.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/card.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/index.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/index.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/payments.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/types.js.map +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js +0 -0
- /package/lib/commonjs/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/account.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/account.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/achCredit.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/activity.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/authorization.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/authorization.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/bookPayment.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/card.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/card.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/checkDeposit.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/index.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/index.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/onLoadResponse.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/payments.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/payments.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/transactions.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/transactions.types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/types.js.map +0 -0
- /package/lib/module/{sharedTypes → types/shared}/wallet.types.js +0 -0
- /package/lib/module/{sharedTypes → types/shared}/wallet.types.js.map +0 -0
- /package/lib/typescript/{components/UNCardComponent/networking → networking}/common/UNNetworkConstants.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/account.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/authorization.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/bookPayment.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/card.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/checkDeposit.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/index.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/onLoadResponse.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/payments.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/transactions.types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/types.d.ts +0 -0
- /package/lib/typescript/{sharedTypes → types/shared}/wallet.types.d.ts +0 -0
- /package/src/{sharedTypes → types/shared}/account.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/authorization.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/bookPayment.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/card.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/checkDeposit.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/index.ts +0 -0
- /package/src/{sharedTypes → types/shared}/onLoadResponse.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/payments.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/transactions.types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/types.ts +0 -0
- /package/src/{sharedTypes → types/shared}/wallet.types.ts +0 -0
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import React, { useImperativeHandle, useRef, useState } from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import React, { useImperativeHandle, useRef, useState, useEffect } from 'react';
|
|
2
|
+
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
6
|
import EventBus from '../../helpers/EventBus';
|
|
7
|
-
import { WebComponent
|
|
7
|
+
import { WebComponent } from '../../webComponent/WebComponent';
|
|
8
8
|
import { useListenerToBus } from '../../hooks/listenerToBus';
|
|
9
9
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
10
|
-
import { getCardParams, getCardScript, injectRefreshEventIfNeeded,
|
|
11
|
-
import {
|
|
12
|
-
import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../sharedTypes';
|
|
10
|
+
import { getCardParams, getCardScript, injectRefreshEventIfNeeded, injectOpenActionsMenuScript, injectRequestCardActionScript } from './UNCardComponent.utils';
|
|
11
|
+
import type { UNOnLoadResponse, UNCardData, UNError, UNCardMenuAction } from '../../types/shared';
|
|
13
12
|
import { CardMessage } from '../../messages/webMessages/cardMessage';
|
|
14
|
-
import { launchGetWallets } from './UNCardComponent.utils';
|
|
15
13
|
import type { NativeModules } from 'react-native';
|
|
16
|
-
import type { UNWallet } from 'src/sharedTypes/wallet.types';
|
|
17
|
-
import { CardAddToWalletErrors, UNCardAddToWalletStatusEvent, CardGetAddToWalletStatusEvent, CardNativeMessage, CardStartPushProvisioningEvent } from '../../messages/nativeMessages/cardMessage';
|
|
18
|
-
import type { BottomSheetSlotData } from '../UNBottomSheetComponent/UNBottomSheetComponent';
|
|
19
14
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
15
|
+
import { BottomSheetRenderingType, SlotRendering, type BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
|
|
16
|
+
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
17
|
+
import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
|
|
18
|
+
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
20
19
|
export interface UNCardComponentProps {
|
|
21
20
|
// inputs
|
|
22
21
|
cardId: string;
|
|
@@ -43,11 +42,6 @@ export interface CardRef {
|
|
|
43
42
|
|
|
44
43
|
export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(function UNCardComponent(props, cardRef) {
|
|
45
44
|
const [height, setHeight] = useState(0);
|
|
46
|
-
const windowWidth = Dimensions.get('window').width;
|
|
47
|
-
|
|
48
|
-
const walletRef = useRef<UNWallet | null>(null);
|
|
49
|
-
// walletRef can be changed to a state. (After the change of the listener hook)
|
|
50
|
-
// TODO: walletState and checks it works. =)
|
|
51
45
|
|
|
52
46
|
const webRef = useRef<WebView>(null);
|
|
53
47
|
|
|
@@ -76,16 +70,6 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
76
70
|
injectRefreshEventIfNeeded(webRef.current, data, props.cardId);
|
|
77
71
|
};
|
|
78
72
|
|
|
79
|
-
const startPushProvisioning = async (data: CardStartPushProvisioningEvent) => {
|
|
80
|
-
if (data.cardId !== props.cardId) return;
|
|
81
|
-
onAddToWalletClicked();
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const getAddToWalletStatus = (data: CardGetAddToWalletStatusEvent) => {
|
|
85
|
-
if (data.cardId !== props.cardId) return;
|
|
86
|
-
getWallets();
|
|
87
|
-
};
|
|
88
|
-
|
|
89
73
|
const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
|
|
90
74
|
if (!props.onLoad) {
|
|
91
75
|
return;
|
|
@@ -109,20 +93,24 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
109
93
|
useListenerToBus({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
|
|
110
94
|
useListenerToBus({ busEventKey: CardMessage.CARD_STATUS_CHANGED, action: cardStatusChanged });
|
|
111
95
|
useListenerToBus({ busEventKey: CardMessage.CARD_ACTIVATED, action: cardActivated });
|
|
112
|
-
useListenerToBus({ busEventKey: CardNativeMessage.CARD_START_PUSH_PROVISIONING, action: startPushProvisioning });
|
|
113
|
-
useListenerToBus({ busEventKey: CardNativeMessage.CARD_GET_ADD_TO_WALLET_STATUS, action: getAddToWalletStatus });
|
|
114
96
|
|
|
115
97
|
const handleMessage = (message: WebViewMessage) => {
|
|
116
98
|
if (!message || !message.details) return;
|
|
117
99
|
|
|
118
100
|
switch (message.type) {
|
|
119
101
|
case UnitMessage.UNIT_REQUEST_RENDERING: {
|
|
120
|
-
const
|
|
102
|
+
const slotData: BottomSheetSlotData = {
|
|
121
103
|
componentName: WebComponentType.card,
|
|
122
104
|
componentResourceId: props.cardId,
|
|
123
105
|
requestRenderingEvent: message.details as RequestRenderingEvent
|
|
124
106
|
};
|
|
125
|
-
|
|
107
|
+
|
|
108
|
+
const event = {
|
|
109
|
+
type: BottomSheetRenderingType.Slot,
|
|
110
|
+
data: slotData
|
|
111
|
+
} as SlotRendering;
|
|
112
|
+
|
|
113
|
+
EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);
|
|
126
114
|
break;
|
|
127
115
|
}
|
|
128
116
|
case PageMessage.PAGE_HEIGHT:
|
|
@@ -134,37 +122,18 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
134
122
|
}
|
|
135
123
|
};
|
|
136
124
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
125
|
+
useEffect(() => {
|
|
126
|
+
UnitSDK.setCustomerToken(props.customerToken);
|
|
127
|
+
}, [props.customerToken]);
|
|
140
128
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
walletRef.current = walletResponse;
|
|
146
|
-
|
|
147
|
-
const walletStatus: UNCardAddToWalletStatusEvent = { status: walletResponse.status };
|
|
148
|
-
EventBus.Instance.event(CardNativeMessage.CARD_UPDATE_ADD_TO_WALLET_STATUS, walletStatus);
|
|
149
|
-
} catch (error) {
|
|
150
|
-
console.error(error);
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
const onAddToWalletClicked = async () => {
|
|
155
|
-
try {
|
|
156
|
-
await launchStartCardProvisioning(props.pushProvisioningModule as NativeModule, walletRef.current);
|
|
157
|
-
} catch (error) {
|
|
158
|
-
if (error instanceof Error) {
|
|
159
|
-
const parsedError = JSON.parse(error.message);
|
|
160
|
-
if (parsedError.code === CardAddToWalletErrors.closedNativeWalletScreen) return;
|
|
161
|
-
}
|
|
162
|
-
console.log(error);
|
|
129
|
+
useEffect(() => {
|
|
130
|
+
if (props.pushProvisioningModule) {
|
|
131
|
+
UnitSDK.setPushProvisioningModule(props.pushProvisioningModule);
|
|
163
132
|
}
|
|
164
|
-
};
|
|
133
|
+
}, [props.pushProvisioningModule]);
|
|
165
134
|
|
|
166
135
|
return (
|
|
167
|
-
<View style={{ height }}>
|
|
136
|
+
<View style={{ height, width: '100%' }}>
|
|
168
137
|
<WebComponent
|
|
169
138
|
ref={webRef}
|
|
170
139
|
type={WebComponentType.card}
|
|
@@ -174,7 +143,6 @@ export const UNCardComponent = React.forwardRef<CardRef, UNCardComponentProps>(f
|
|
|
174
143
|
language={props.language}
|
|
175
144
|
script={getCardScript()}
|
|
176
145
|
onMessage={message => handleMessage(message)}
|
|
177
|
-
width={windowWidth}
|
|
178
146
|
isScrollable={false}
|
|
179
147
|
/>
|
|
180
148
|
</View>
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { DISPATCH_REQUEST_REFRESH } from './../../scripts/html/bodyScript';
|
|
2
2
|
import type WebView from 'react-native-webview';
|
|
3
3
|
import type { UNCardComponentProps } from './UNCardComponent';
|
|
4
|
-
import { WebComponentType } from '../../webComponent/WebComponent';
|
|
5
|
-
import type { NativeModules } from 'react-native';
|
|
6
|
-
import { getMobileWalletPayload } from './networking/requests/UNWalletPayloadRequest';
|
|
7
|
-
import { UNWallet, UNWalletCode, UNWalletName } from '../../../src/sharedTypes/wallet.types';
|
|
8
4
|
import type { RequestRefreshEvent } from '../../messages/webMessages/unitMessages';
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
5
|
+
import type { UNCardMenuAction } from '../../types/shared';
|
|
6
|
+
import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
11
7
|
|
|
12
8
|
export const getCardParams = (props: UNCardComponentProps) => {
|
|
13
9
|
return `
|
|
@@ -38,46 +34,3 @@ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRe
|
|
|
38
34
|
currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
|
|
39
35
|
}
|
|
40
36
|
};
|
|
41
|
-
|
|
42
|
-
export const launchGetWallets = async (customerToken: string, cardId: string, pushProvisioningModule: typeof NativeModules) => {
|
|
43
|
-
try {
|
|
44
|
-
const env = UnitSDK.getEnv();
|
|
45
|
-
if (!env) return null;
|
|
46
|
-
|
|
47
|
-
const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env);
|
|
48
|
-
if (!encryptedPayload) return null;
|
|
49
|
-
|
|
50
|
-
const walletsResponse = await pushProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
|
|
51
|
-
const parsedWalletsResponse = JSON.parse(walletsResponse);
|
|
52
|
-
const wallets = parsedWalletsResponse.wallets;
|
|
53
|
-
|
|
54
|
-
if (!wallets) return null;
|
|
55
|
-
if (wallets[0].code === UNWalletCode.Apple) {
|
|
56
|
-
return ({ name: UNWalletName.Apple, code: UNWalletCode.Apple, status: wallets[0].status });
|
|
57
|
-
} else {
|
|
58
|
-
const googleWallet = wallets.filter((wallet: { name: UNWalletName }) => {
|
|
59
|
-
return wallet.name === UNWalletName.Google;
|
|
60
|
-
});
|
|
61
|
-
if (!googleWallet) return;
|
|
62
|
-
return ({ name: UNWalletName.Google, code: UNWalletCode.Google, status: googleWallet[0].status });
|
|
63
|
-
}
|
|
64
|
-
} catch (error) {
|
|
65
|
-
return Promise.reject(error);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const launchStartCardProvisioning = async (pushProvisioningModule: typeof NativeModules, wallet: UNWallet | null) => {
|
|
71
|
-
try {
|
|
72
|
-
const response = await pushProvisioningModule.launchStartCardProvisioning(
|
|
73
|
-
JSON.stringify({
|
|
74
|
-
walletCode: wallet?.code,
|
|
75
|
-
walletName: wallet?.name
|
|
76
|
-
}));
|
|
77
|
-
return response;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
catch (error) {
|
|
81
|
-
return Promise.reject(error);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { View, NativeModules, Platform } from 'react-native';
|
|
3
|
-
import { WebComponent
|
|
4
|
-
import { PresentationMode } from '../../scripts/html/bodyHtml';
|
|
3
|
+
import { WebComponent } from '../../webComponent/WebComponent';
|
|
5
4
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
6
5
|
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
7
6
|
import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
8
7
|
import { getCheckDepositParams, getCheckDepositScript } from './UNCheckDepositComponent.utils';
|
|
9
8
|
import { CheckMessage } from '../../messages/webMessages/checkMessage';
|
|
10
|
-
import type { UNCheckDepositData } from '../../
|
|
11
|
-
import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../
|
|
9
|
+
import type { UNCheckDepositData } from '../../types/shared/checkDeposit.types';
|
|
10
|
+
import type { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
|
|
12
11
|
import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
12
|
+
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
13
13
|
|
|
14
14
|
const { Camera } = NativeModules;
|
|
15
15
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UNCardFlows } from './card/UNCardFlows';
|
|
2
|
+
import { UnitSDK } from '../unitSdkManager/UnitSdkManager';
|
|
3
|
+
|
|
4
|
+
export class UNFlows {
|
|
5
|
+
constructor() {
|
|
6
|
+
console.log('new Flows instance created');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
public async startPushProvisioning(cardId: string, customerToken: string) {
|
|
10
|
+
UnitSDK.setCustomerToken(customerToken);
|
|
11
|
+
UNCardFlows.startPushProvisioning(cardId, customerToken);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import EventBus from '../../helpers/EventBus';
|
|
2
|
+
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
3
|
+
import { BottomSheetRenderingType, type WebComponentData, type WebComponentRendering } from '../../types/internal/bottomSheet.types';
|
|
4
|
+
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
5
|
+
|
|
6
|
+
export class UNCardFlows {
|
|
7
|
+
public static startPushProvisioning = async (cardId: string, customerToken: string) => {
|
|
8
|
+
try {
|
|
9
|
+
const addToWalletComponentData: WebComponentData = {
|
|
10
|
+
type: WebComponentType.cardAction,
|
|
11
|
+
presentationMode: PresentationMode.CoverInjectedHeight,
|
|
12
|
+
params: `card-id=${cardId} customer-token=${customerToken} action=AddToWallet`,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const event: WebComponentRendering = {
|
|
16
|
+
type: BottomSheetRenderingType.WebComponent,
|
|
17
|
+
data: addToWalletComponentData,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
EventBus.Instance.event(BottomSheetNativeMessage.START_FLOW, event);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error(error);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import { UNWalletCode, type UNWallet, UNWalletName } from '../../../types/shared/wallet.types';
|
|
3
|
+
import { UnitSDK } from '../../../unitSdkManager/UnitSdkManager';
|
|
4
|
+
import { getMobileWalletPayload } from '../../../networking/requests/UNWalletPayloadRequest';
|
|
5
|
+
|
|
6
|
+
export type CardToEncryptedPayload = {
|
|
7
|
+
[cardId: string]: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const useCardWallet = (cardId: string) => {
|
|
11
|
+
const [currentUNWallet, setCurrentUNWallet] = useState<UNWallet>();
|
|
12
|
+
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const getEncryptedPayload = async () => {
|
|
15
|
+
const env = UnitSDK.getEnv();
|
|
16
|
+
const customerToken = UnitSDK.getCustomerToken();
|
|
17
|
+
if (!env || !customerToken) return;
|
|
18
|
+
|
|
19
|
+
const encryptedPayload = await getMobileWalletPayload(customerToken, cardId, env);
|
|
20
|
+
return encryptedPayload;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const getCardWalletData = async () => {
|
|
24
|
+
const currentProvisioningModule = UnitSDK.getPushProvisionModule();
|
|
25
|
+
if (!currentProvisioningModule) return;
|
|
26
|
+
try {
|
|
27
|
+
const encryptedPayload = await getEncryptedPayload();
|
|
28
|
+
const walletsResponse = await currentProvisioningModule.launchGetWallets(JSON.stringify({ encPayload: encryptedPayload }));
|
|
29
|
+
|
|
30
|
+
const unWallet: UNWallet | null = parseWalletsResponse(walletsResponse);
|
|
31
|
+
if (!unWallet) return;
|
|
32
|
+
setCurrentUNWallet(unWallet);
|
|
33
|
+
return;
|
|
34
|
+
} catch (error) {
|
|
35
|
+
return Promise.reject(error);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
getCardWalletData();
|
|
40
|
+
|
|
41
|
+
}, [cardId]);
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
currentUNWallet
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const parseWalletsResponse = (walletsResponse: string): UNWallet | null => {
|
|
50
|
+
try {
|
|
51
|
+
const parsedWalletsResponse = JSON.parse(walletsResponse);
|
|
52
|
+
const wallets = parsedWalletsResponse.wallets;
|
|
53
|
+
|
|
54
|
+
if (!wallets) return null;
|
|
55
|
+
if (wallets[0].code === UNWalletCode.Apple) {
|
|
56
|
+
return ({ name: UNWalletName.Apple, code: UNWalletCode.Apple, status: wallets[0].status });
|
|
57
|
+
} else {
|
|
58
|
+
const googleWallet = wallets.filter((wallet: { name: UNWalletName }) => {
|
|
59
|
+
return wallet.name === UNWalletName.Google;
|
|
60
|
+
});
|
|
61
|
+
if (!googleWallet) return null;
|
|
62
|
+
return ({ name: UNWalletName.Google, code: UNWalletCode.Google, status: googleWallet[0].status });
|
|
63
|
+
}
|
|
64
|
+
} catch (error) {
|
|
65
|
+
throw new Error('Error parsing wallet response');
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { UNWallet } from '../../types/shared/wallet.types';
|
|
2
|
+
import { UnitSDK } from '../../unitSdkManager/UnitSdkManager';
|
|
3
|
+
|
|
4
|
+
export const launchStartCardProvisioning = async (wallet: UNWallet | null) => {
|
|
5
|
+
const pushProvisioningModule = UnitSDK.getPushProvisionModule();
|
|
6
|
+
if (!pushProvisioningModule) return;
|
|
7
|
+
|
|
8
|
+
try {
|
|
9
|
+
const response = await pushProvisioningModule.launchStartCardProvisioning(
|
|
10
|
+
JSON.stringify({
|
|
11
|
+
walletCode: wallet?.code,
|
|
12
|
+
walletName: wallet?.name
|
|
13
|
+
}));
|
|
14
|
+
return response;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
catch (error) {
|
|
18
|
+
return Promise.reject(error);
|
|
19
|
+
}
|
|
20
|
+
};
|
package/src/index.tsx
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type {NativeComponentRendering, WebComponentRendering, SlotRendering } from '../../types/internal/bottomSheet.types';
|
|
2
|
+
|
|
3
|
+
export enum BottomSheetNativeMessage {
|
|
4
|
+
START_FLOW = 'startBottomSheetFlow',
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export enum CardAddToWalletErrors {
|
|
8
|
+
closedNativeWalletScreen = 'VP_ERROR_302'
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type StartBottomSheetFlowMessage = SlotRendering | WebComponentRendering | NativeComponentRendering
|
|
12
|
+
|
|
13
|
+
export type BottomSheetNativeEvent = |
|
|
14
|
+
StartBottomSheetFlowMessage
|
|
15
|
+
// BottomSheetChangeFlowMessage - probably, we want to add this message event in the future to alternate between flows
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export enum CardNativeMessage {
|
|
4
|
-
CARD_GET_ADD_TO_WALLET_STATUS = 'cardGetAddToWalletStatus',
|
|
5
|
-
CARD_UPDATE_ADD_TO_WALLET_STATUS = 'cardUpdateAddToWalletStatus',
|
|
6
|
-
CARD_START_PUSH_PROVISIONING = 'cardStartPushProvisioning'
|
|
7
|
-
}
|
|
8
|
-
|
|
1
|
+
// Should we remove it ?
|
|
9
2
|
export enum CardAddToWalletErrors {
|
|
10
3
|
closedNativeWalletScreen = 'VP_ERROR_302'
|
|
11
4
|
}
|
|
12
|
-
export interface UNCardAddToWalletStatusEvent {
|
|
13
|
-
status: UNCardAddToWalletStatus
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface CardGetAddToWalletStatusEvent {
|
|
17
|
-
cardId: string
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface CardStartPushProvisioningEvent {
|
|
21
|
-
cardId: string
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export type CardNativeEvent =
|
|
25
|
-
| UNCardAddToWalletStatusEvent
|
|
26
|
-
| CardGetAddToWalletStatusEvent
|
|
27
|
-
| CardStartPushProvisioningEvent
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BottomSheetNativeEvent, BottomSheetNativeMessage } from './bottomSheetMessage';
|
|
2
2
|
import type { SDKEvent, SDKMessage } from './sdkMessage';
|
|
3
3
|
|
|
4
4
|
export type NativeMessageType =
|
|
5
5
|
| SDKMessage
|
|
6
|
-
|
|
|
6
|
+
| BottomSheetNativeMessage
|
|
7
7
|
|
|
8
8
|
export type NativeEvent =
|
|
9
|
-
| CardNativeEvent
|
|
10
9
|
| SDKEvent
|
|
10
|
+
| BottomSheetNativeEvent
|
|
11
11
|
|
|
12
12
|
export interface NativeMessage {
|
|
13
13
|
type: NativeMessageType,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {UNAccountData, UNCounterpartyAccountData, UNCardData, UNError, UNOnLoadResponseData } from '../../
|
|
2
|
-
import type { UNAuthorizationData } from '../../
|
|
3
|
-
import type { UNTransactionData } from '../../
|
|
1
|
+
import type {UNAccountData, UNCounterpartyAccountData, UNCardData, UNError, UNOnLoadResponseData } from '../../types/shared';
|
|
2
|
+
import type { UNAuthorizationData } from '../../types/shared/authorization.types';
|
|
3
|
+
import type { UNTransactionData } from '../../types/shared/transactions.types';
|
|
4
4
|
|
|
5
5
|
export enum RESPONSE_KEYS {
|
|
6
6
|
errors = 'errors',
|
|
@@ -9,9 +9,10 @@ export enum UnitMessage {
|
|
|
9
9
|
UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload',
|
|
10
10
|
UNIT_PLAID_TOKEN_CREATED = 'unitPlaidLinkTokenCreated',
|
|
11
11
|
UNIT_REQUEST_EXTERNAL_SDK = 'unitRequestExternalSdk',
|
|
12
|
-
UNIT_PLAID_RESPONSE = 'unitPlaidResponse'
|
|
13
|
-
|
|
12
|
+
UNIT_PLAID_RESPONSE = 'unitPlaidResponse',
|
|
13
|
+
PAGE_HEIGHT = 'PAGE_HEIGHT'
|
|
14
14
|
}
|
|
15
|
+
|
|
15
16
|
export interface RequestRenderingEvent {
|
|
16
17
|
data: RequestRenderingEventData
|
|
17
18
|
}
|
package/src/{components/UNCardComponent/networking → networking}/requests/UNWalletPayloadRequest.ts
RENAMED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import { APIHeaders, UNIT_SECURE_URL } from '../common/UNNetworkConstants';
|
|
3
|
-
import { UnitSDK, UNEnvironment } from '
|
|
3
|
+
import { UnitSDK, UNEnvironment } from '../../unitSdkManager/UnitSdkManager';
|
|
4
|
+
|
|
5
|
+
// TODO: use apiClient class for handling requests.
|
|
4
6
|
|
|
5
7
|
export const getMobileWalletPayload = async (customerToken: string, cardId: string, env: UNEnvironment) => {
|
|
6
8
|
const headers = {
|
|
@@ -1,18 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export enum PresentationMode {
|
|
4
|
-
/*
|
|
5
|
-
CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.
|
|
6
|
-
|
|
7
|
-
Inherit - inherit the parent size by style of 100 view height
|
|
1
|
+
import { PresentationMode } from '../../types/internal/webComponent.types';
|
|
8
2
|
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
CoverInjectedHeight = 'coverInjectedHeight',
|
|
13
|
-
Inherit = 'inherit',
|
|
14
|
-
Default = 'deafult'
|
|
15
|
-
}
|
|
3
|
+
export const webViewId = 'webViewContainer';
|
|
16
4
|
|
|
17
5
|
export const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {
|
|
18
6
|
const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
|
|
2
|
+
import type { PresentationMode, WebComponentType } from './webComponent.types';
|
|
3
|
+
|
|
4
|
+
export enum BottomSheetRenderingType {
|
|
5
|
+
Slot,
|
|
6
|
+
WebComponent,
|
|
7
|
+
NativeComponent
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type BottomSheetSlotData = {
|
|
11
|
+
// The data that rendered by the web view
|
|
12
|
+
componentName?: WebComponentType,
|
|
13
|
+
componentResourceId?: string,
|
|
14
|
+
requestRenderingEvent: RequestRenderingEvent
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type WebComponentData = {
|
|
18
|
+
type: WebComponentType;
|
|
19
|
+
presentationMode?: PresentationMode,
|
|
20
|
+
params?: string;
|
|
21
|
+
theme?: string;
|
|
22
|
+
language?: string;
|
|
23
|
+
windowParams?: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type NativeComponentData = {
|
|
27
|
+
component: React.ReactNode,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface SlotRendering {
|
|
31
|
+
type: BottomSheetRenderingType.Slot,
|
|
32
|
+
data: BottomSheetSlotData
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface WebComponentRendering {
|
|
36
|
+
type: BottomSheetRenderingType.WebComponent,
|
|
37
|
+
data: WebComponentData
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface NativeComponentRendering {
|
|
41
|
+
type: BottomSheetRenderingType.NativeComponent,
|
|
42
|
+
data: NativeComponentData
|
|
43
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export enum WebComponentType {
|
|
2
|
+
card = 'unit-elements-card',
|
|
3
|
+
bookPayment = 'unit-elements-book-payment',
|
|
4
|
+
activity = 'unit-elements-activity',
|
|
5
|
+
slot = 'unit-elements-sdk-slot',
|
|
6
|
+
account = 'unit-elements-account',
|
|
7
|
+
checkDeposit = 'unit-elements-check-deposit',
|
|
8
|
+
achDebitPayment = 'unit-elements-ach-debit-payment',
|
|
9
|
+
achCreditPayment = 'unit-elements-ach-credit-payment',
|
|
10
|
+
|
|
11
|
+
cardAction = 'unit-elements-card-action',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export enum PresentationMode {
|
|
15
|
+
/*
|
|
16
|
+
CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.
|
|
17
|
+
|
|
18
|
+
Inherit - inherit the parent size by style of 100 view height
|
|
19
|
+
|
|
20
|
+
Default - return the unit component script
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
CoverInjectedHeight = 'coverInjectedHeight',
|
|
24
|
+
Inherit = 'inherit',
|
|
25
|
+
Default = 'deafult'
|
|
26
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESPONSE_KEYS } from '
|
|
1
|
+
import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
|
|
2
2
|
import type { UNAccountData, UNCounterpartyAccountData } from './account.types';
|
|
3
3
|
import type { UNAchCounterparty, UNCounterpartyVerificationMethod, UNPaymentStatus } from './payments.types';
|
|
4
4
|
import type { UNTags, UNRelationship } from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RESPONSE_KEYS } from '
|
|
1
|
+
import type { RESPONSE_KEYS } from '../../messages/webMessages/onLoadMessage';
|
|
2
2
|
import type { UNAuthorizationData } from './authorization.types';
|
|
3
3
|
import type { UNTransactionData } from './transactions.types';
|
|
4
4
|
|