react-native-unit-components 1.13.0 → 1.15.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.
Files changed (382) hide show
  1. package/android/src/main/java/com/unitreactnativecomponents/UnitAddToWalletButtonViewManager.kt +1 -0
  2. package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +9 -1
  3. package/android/src/main/java/com/unitreactnativecomponents/extensions/ContextExtensions.kt +2 -0
  4. package/android/src/main/java/com/unitreactnativecomponents/secureView/UNSecureViewManager.kt +19 -0
  5. package/android/src/main/java/com/unitreactnativecomponents/security/UNSecurityHelper.kt +37 -0
  6. package/android/src/main/java/com/unitreactnativecomponents/unSnapshotProtectionManager/UNSnapshotProtectionManager.kt +42 -0
  7. package/ios/UNSecurity/UNSecurityHelper.swift +90 -0
  8. package/ios/UNSecurity/UNSecurityHelperExportModule.m +7 -0
  9. package/ios/UNSharedServicesProvider/UNAppStateService.swift +38 -0
  10. package/ios/UNSharedServicesProvider/UNGlobalSnapshotProtectionService.swift +96 -0
  11. package/ios/UNSharedServicesProvider/UNPresentationService.swift +37 -0
  12. package/ios/UNSharedServicesProvider/UNSharedServicesProviderManager.swift +45 -0
  13. package/ios/UNSnapshotProtectionManager/UNSnapshotProtectionManager.swift +20 -0
  14. package/ios/UNSnapshotProtectionManager/UNSnapshotProtectionManagerExportModule.m +5 -0
  15. package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +16 -0
  16. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +22 -21
  17. package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  18. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +22 -21
  19. package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  20. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +4 -3
  21. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  22. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +19 -20
  23. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  24. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +24 -21
  25. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  26. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  27. package/lib/commonjs/components/UNCardActionComponent/UNCardActionComponent.js +71 -0
  28. package/lib/commonjs/components/UNCardActionComponent/UNCardActionComponent.js.map +1 -0
  29. package/lib/commonjs/components/UNCardActionComponent/UNCardActionComponent.utils.js +22 -0
  30. package/lib/commonjs/components/UNCardActionComponent/UNCardActionComponent.utils.js.map +1 -0
  31. package/lib/commonjs/components/UNCardActionComponent/index.js +21 -0
  32. package/lib/commonjs/components/UNCardActionComponent/index.js.map +1 -0
  33. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +26 -3
  34. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  35. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +2 -1
  36. package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  37. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +18 -19
  38. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  39. package/lib/commonjs/components/UNFundAccountPaymentComponent/UNFundAccountPaymentComponent.js +7 -1
  40. package/lib/commonjs/components/UNFundAccountPaymentComponent/UNFundAccountPaymentComponent.js.map +1 -1
  41. package/lib/commonjs/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.js +79 -0
  42. package/lib/commonjs/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.js.map +1 -0
  43. package/lib/commonjs/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.js +32 -0
  44. package/lib/commonjs/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.js.map +1 -0
  45. package/lib/commonjs/components/UNMultiFactorAuthenticationComponent/index.js +21 -0
  46. package/lib/commonjs/components/UNMultiFactorAuthenticationComponent/index.js.map +1 -0
  47. package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +19 -20
  48. package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -1
  49. package/lib/commonjs/components/UNNextRepaymentComponent/UNNextRepaymentComponent.js +4 -3
  50. package/lib/commonjs/components/UNNextRepaymentComponent/UNNextRepaymentComponent.js.map +1 -1
  51. package/lib/commonjs/components/UNNextRepaymentComponent/UNNextRepaymentComponent.utils.js +1 -1
  52. package/lib/commonjs/components/UNNextRepaymentComponent/UNNextRepaymentComponent.utils.js.map +1 -1
  53. package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js +24 -2
  54. package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -1
  55. package/lib/commonjs/components/UNProgramDetailsComponent/UNProgramDetailsComponent.js +4 -3
  56. package/lib/commonjs/components/UNProgramDetailsComponent/UNProgramDetailsComponent.js.map +1 -1
  57. package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +7 -2
  58. package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -1
  59. package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.js +91 -0
  60. package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.js.map +1 -0
  61. package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js +29 -0
  62. package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js.map +1 -0
  63. package/lib/commonjs/components/UNWirePaymentComponent/index.js +21 -0
  64. package/lib/commonjs/components/UNWirePaymentComponent/index.js.map +1 -0
  65. package/lib/commonjs/components/index.js +33 -0
  66. package/lib/commonjs/components/index.js.map +1 -1
  67. package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +2 -1
  68. package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
  69. package/lib/commonjs/hooks/useIsJailbrokeDevice.js +22 -0
  70. package/lib/commonjs/hooks/useIsJailbrokeDevice.js.map +1 -0
  71. package/lib/commonjs/hooks/useSnapshotProtection.js +31 -0
  72. package/lib/commonjs/hooks/useSnapshotProtection.js.map +1 -0
  73. package/lib/commonjs/messages/webMessages/multiFactorAuthenticationMessage.js +11 -0
  74. package/lib/commonjs/messages/webMessages/multiFactorAuthenticationMessage.js.map +1 -0
  75. package/lib/commonjs/messages/webMessages/onLoadMessage.js +1 -0
  76. package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
  77. package/lib/commonjs/messages/webMessages/unitMessages.js +1 -0
  78. package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
  79. package/lib/commonjs/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js +6 -1
  80. package/lib/commonjs/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js.map +1 -1
  81. package/lib/commonjs/nativeComponents/UNBaseView/UNBaseView.js +39 -0
  82. package/lib/commonjs/nativeComponents/UNBaseView/UNBaseView.js.map +1 -0
  83. package/lib/commonjs/nativeComponents/UNBaseView/index.js +14 -0
  84. package/lib/commonjs/nativeComponents/UNBaseView/index.js.map +1 -0
  85. package/lib/commonjs/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.js +26 -0
  86. package/lib/commonjs/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.js.map +1 -0
  87. package/lib/commonjs/nativeModulesHelpers/UNSecurityHelper.js +39 -0
  88. package/lib/commonjs/nativeModulesHelpers/UNSecurityHelper.js.map +1 -0
  89. package/lib/commonjs/networking/common/UNNetworkConstants.js +2 -1
  90. package/lib/commonjs/networking/common/UNNetworkConstants.js.map +1 -1
  91. package/lib/commonjs/scripts/html/bodyScript.js +18 -5
  92. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  93. package/lib/commonjs/types/internal/webComponent.types.js +3 -0
  94. package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
  95. package/lib/commonjs/types/shared/env.types.js +1 -0
  96. package/lib/commonjs/types/shared/env.types.js.map +1 -1
  97. package/lib/commonjs/types/shared/index.js +11 -0
  98. package/lib/commonjs/types/shared/index.js.map +1 -1
  99. package/lib/commonjs/types/shared/multiFactorAuthentication.types.js +2 -0
  100. package/lib/commonjs/types/shared/multiFactorAuthentication.types.js.map +1 -0
  101. package/lib/commonjs/types/shared/payeeManagement.types.js.map +1 -1
  102. package/lib/commonjs/types/shared/payments.types.js +1 -0
  103. package/lib/commonjs/types/shared/payments.types.js.map +1 -1
  104. package/lib/commonjs/types/shared/securitySettings.js +12 -0
  105. package/lib/commonjs/types/shared/securitySettings.js.map +1 -0
  106. package/lib/commonjs/types/shared/wirePayment.types.js +6 -0
  107. package/lib/commonjs/types/shared/wirePayment.types.js.map +1 -0
  108. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +7 -2
  109. package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -1
  110. package/lib/commonjs/unitSdkManager/UnitSdkManager.js +25 -5
  111. package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
  112. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +2 -0
  113. package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -1
  114. package/lib/commonjs/utils/onLoadMessages.utils.js +10 -0
  115. package/lib/commonjs/utils/onLoadMessages.utils.js.map +1 -0
  116. package/lib/commonjs/webComponent/WebComponent.js +11 -5
  117. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  118. package/lib/commonjs/webComponent/WebComponent.utils.js +5 -1
  119. package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
  120. package/lib/commonjs/webComponent/html.js +2 -0
  121. package/lib/commonjs/webComponent/html.js.map +1 -1
  122. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +23 -22
  123. package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
  124. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +23 -22
  125. package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
  126. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +4 -3
  127. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  128. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +20 -21
  129. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  130. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +24 -21
  131. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  132. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  133. package/lib/module/components/UNCardActionComponent/UNCardActionComponent.js +63 -0
  134. package/lib/module/components/UNCardActionComponent/UNCardActionComponent.js.map +1 -0
  135. package/lib/module/components/UNCardActionComponent/UNCardActionComponent.utils.js +14 -0
  136. package/lib/module/components/UNCardActionComponent/UNCardActionComponent.utils.js.map +1 -0
  137. package/lib/module/components/UNCardActionComponent/index.js +2 -0
  138. package/lib/module/components/UNCardActionComponent/index.js.map +1 -0
  139. package/lib/module/components/UNCardComponent/UNCardComponent.js +26 -3
  140. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  141. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +2 -1
  142. package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
  143. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +19 -20
  144. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
  145. package/lib/module/components/UNFundAccountPaymentComponent/UNFundAccountPaymentComponent.js +7 -1
  146. package/lib/module/components/UNFundAccountPaymentComponent/UNFundAccountPaymentComponent.js.map +1 -1
  147. package/lib/module/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.js +71 -0
  148. package/lib/module/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.js.map +1 -0
  149. package/lib/module/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.js +24 -0
  150. package/lib/module/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.js.map +1 -0
  151. package/lib/module/components/UNMultiFactorAuthenticationComponent/index.js +2 -0
  152. package/lib/module/components/UNMultiFactorAuthenticationComponent/index.js.map +1 -0
  153. package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +20 -21
  154. package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -1
  155. package/lib/module/components/UNNextRepaymentComponent/UNNextRepaymentComponent.js +4 -3
  156. package/lib/module/components/UNNextRepaymentComponent/UNNextRepaymentComponent.js.map +1 -1
  157. package/lib/module/components/UNNextRepaymentComponent/UNNextRepaymentComponent.utils.js +1 -1
  158. package/lib/module/components/UNNextRepaymentComponent/UNNextRepaymentComponent.utils.js.map +1 -1
  159. package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js +24 -2
  160. package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -1
  161. package/lib/module/components/UNProgramDetailsComponent/UNProgramDetailsComponent.js +4 -3
  162. package/lib/module/components/UNProgramDetailsComponent/UNProgramDetailsComponent.js.map +1 -1
  163. package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +7 -2
  164. package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -1
  165. package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.js +83 -0
  166. package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.js.map +1 -0
  167. package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js +21 -0
  168. package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js.map +1 -0
  169. package/lib/module/components/UNWirePaymentComponent/index.js +2 -0
  170. package/lib/module/components/UNWirePaymentComponent/index.js.map +1 -0
  171. package/lib/module/components/index.js +3 -0
  172. package/lib/module/components/index.js.map +1 -1
  173. package/lib/module/helpers/BottomSheet/BottomSheet.js +2 -1
  174. package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
  175. package/lib/module/hooks/useIsJailbrokeDevice.js +14 -0
  176. package/lib/module/hooks/useIsJailbrokeDevice.js.map +1 -0
  177. package/lib/module/hooks/useSnapshotProtection.js +23 -0
  178. package/lib/module/hooks/useSnapshotProtection.js.map +1 -0
  179. package/lib/module/messages/webMessages/multiFactorAuthenticationMessage.js +5 -0
  180. package/lib/module/messages/webMessages/multiFactorAuthenticationMessage.js.map +1 -0
  181. package/lib/module/messages/webMessages/onLoadMessage.js +1 -0
  182. package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
  183. package/lib/module/messages/webMessages/unitMessages.js +1 -0
  184. package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
  185. package/lib/module/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js +6 -1
  186. package/lib/module/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js.map +1 -1
  187. package/lib/module/nativeComponents/UNBaseView/UNBaseView.js +31 -0
  188. package/lib/module/nativeComponents/UNBaseView/UNBaseView.js.map +1 -0
  189. package/lib/module/nativeComponents/UNBaseView/index.js +2 -0
  190. package/lib/module/nativeComponents/UNBaseView/index.js.map +1 -0
  191. package/lib/module/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.js +20 -0
  192. package/lib/module/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.js.map +1 -0
  193. package/lib/module/nativeModulesHelpers/UNSecurityHelper.js +33 -0
  194. package/lib/module/nativeModulesHelpers/UNSecurityHelper.js.map +1 -0
  195. package/lib/module/networking/common/UNNetworkConstants.js +2 -1
  196. package/lib/module/networking/common/UNNetworkConstants.js.map +1 -1
  197. package/lib/module/scripts/html/bodyScript.js +17 -4
  198. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  199. package/lib/module/types/internal/webComponent.types.js +3 -0
  200. package/lib/module/types/internal/webComponent.types.js.map +1 -1
  201. package/lib/module/types/shared/env.types.js +1 -0
  202. package/lib/module/types/shared/env.types.js.map +1 -1
  203. package/lib/module/types/shared/index.js +1 -0
  204. package/lib/module/types/shared/index.js.map +1 -1
  205. package/lib/module/types/shared/multiFactorAuthentication.types.js +2 -0
  206. package/lib/module/types/shared/multiFactorAuthentication.types.js.map +1 -0
  207. package/lib/module/types/shared/payeeManagement.types.js.map +1 -1
  208. package/lib/module/types/shared/payments.types.js +1 -0
  209. package/lib/module/types/shared/payments.types.js.map +1 -1
  210. package/lib/module/types/shared/securitySettings.js +6 -0
  211. package/lib/module/types/shared/securitySettings.js.map +1 -0
  212. package/lib/module/types/shared/wirePayment.types.js +2 -0
  213. package/lib/module/types/shared/wirePayment.types.js.map +1 -0
  214. package/lib/module/unitSdkManager/UnitSdk.constants.js +7 -2
  215. package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -1
  216. package/lib/module/unitSdkManager/UnitSdkManager.js +25 -5
  217. package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
  218. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +2 -0
  219. package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -1
  220. package/lib/module/utils/onLoadMessages.utils.js +4 -0
  221. package/lib/module/utils/onLoadMessages.utils.js.map +1 -0
  222. package/lib/module/webComponent/WebComponent.js +12 -6
  223. package/lib/module/webComponent/WebComponent.js.map +1 -1
  224. package/lib/module/webComponent/WebComponent.utils.js +3 -0
  225. package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
  226. package/lib/module/webComponent/html.js +3 -1
  227. package/lib/module/webComponent/html.js.map +1 -1
  228. package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts.map +1 -1
  229. package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts.map +1 -1
  230. package/lib/typescript/src/components/UNAccountComponent/UNAccountComponent.d.ts.map +1 -1
  231. package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.d.ts.map +1 -1
  232. package/lib/typescript/src/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +1 -1
  233. package/lib/typescript/src/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts.map +1 -1
  234. package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts.map +1 -1
  235. package/lib/typescript/src/components/UNCardActionComponent/UNCardActionComponent.d.ts +14 -0
  236. package/lib/typescript/src/components/UNCardActionComponent/UNCardActionComponent.d.ts.map +1 -0
  237. package/lib/typescript/src/components/UNCardActionComponent/UNCardActionComponent.utils.d.ts +4 -0
  238. package/lib/typescript/src/components/UNCardActionComponent/UNCardActionComponent.utils.d.ts.map +1 -0
  239. package/lib/typescript/src/components/UNCardActionComponent/index.d.ts +2 -0
  240. package/lib/typescript/src/components/UNCardActionComponent/index.d.ts.map +1 -0
  241. package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts +3 -1
  242. package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts.map +1 -1
  243. package/lib/typescript/src/components/UNCardComponent/UNCardComponent.utils.d.ts.map +1 -1
  244. package/lib/typescript/src/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts.map +1 -1
  245. package/lib/typescript/src/components/UNFundAccountPaymentComponent/UNFundAccountPaymentComponent.d.ts.map +1 -1
  246. package/lib/typescript/src/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.d.ts +14 -0
  247. package/lib/typescript/src/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.d.ts.map +1 -0
  248. package/lib/typescript/src/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.d.ts +4 -0
  249. package/lib/typescript/src/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.d.ts.map +1 -0
  250. package/lib/typescript/src/components/UNMultiFactorAuthenticationComponent/index.d.ts +2 -0
  251. package/lib/typescript/src/components/UNMultiFactorAuthenticationComponent/index.d.ts.map +1 -0
  252. package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts.map +1 -1
  253. package/lib/typescript/src/components/UNNextRepaymentComponent/UNNextRepaymentComponent.d.ts.map +1 -1
  254. package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts +2 -1
  255. package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts.map +1 -1
  256. package/lib/typescript/src/components/UNProgramDetailsComponent/UNProgramDetailsComponent.d.ts.map +1 -1
  257. package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.d.ts.map +1 -1
  258. package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.d.ts +20 -0
  259. package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.d.ts.map +1 -0
  260. package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.d.ts +4 -0
  261. package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.d.ts.map +1 -0
  262. package/lib/typescript/src/components/UNWirePaymentComponent/index.d.ts +2 -0
  263. package/lib/typescript/src/components/UNWirePaymentComponent/index.d.ts.map +1 -0
  264. package/lib/typescript/src/components/index.d.ts +3 -0
  265. package/lib/typescript/src/components/index.d.ts.map +1 -1
  266. package/lib/typescript/src/helpers/BottomSheet/BottomSheet.d.ts.map +1 -1
  267. package/lib/typescript/src/hooks/useIsJailbrokeDevice.d.ts +2 -0
  268. package/lib/typescript/src/hooks/useIsJailbrokeDevice.d.ts.map +1 -0
  269. package/lib/typescript/src/hooks/useSnapshotProtection.d.ts +2 -0
  270. package/lib/typescript/src/hooks/useSnapshotProtection.d.ts.map +1 -0
  271. package/lib/typescript/src/messages/webMessages/index.d.ts +2 -1
  272. package/lib/typescript/src/messages/webMessages/index.d.ts.map +1 -1
  273. package/lib/typescript/src/messages/webMessages/multiFactorAuthenticationMessage.d.ts +4 -0
  274. package/lib/typescript/src/messages/webMessages/multiFactorAuthenticationMessage.d.ts.map +1 -0
  275. package/lib/typescript/src/messages/webMessages/onLoadMessage.d.ts +8 -4
  276. package/lib/typescript/src/messages/webMessages/onLoadMessage.d.ts.map +1 -1
  277. package/lib/typescript/src/messages/webMessages/unitMessages.d.ts +11 -1
  278. package/lib/typescript/src/messages/webMessages/unitMessages.d.ts.map +1 -1
  279. package/lib/typescript/src/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.d.ts.map +1 -1
  280. package/lib/typescript/src/nativeComponents/UNBaseView/UNBaseView.d.ts +11 -0
  281. package/lib/typescript/src/nativeComponents/UNBaseView/UNBaseView.d.ts.map +1 -0
  282. package/lib/typescript/src/nativeComponents/UNBaseView/index.d.ts +2 -0
  283. package/lib/typescript/src/nativeComponents/UNBaseView/index.d.ts.map +1 -0
  284. package/lib/typescript/src/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.d.ts +6 -0
  285. package/lib/typescript/src/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.d.ts.map +1 -0
  286. package/lib/typescript/src/nativeModulesHelpers/UNSecurityHelper.d.ts +12 -0
  287. package/lib/typescript/src/nativeModulesHelpers/UNSecurityHelper.d.ts.map +1 -0
  288. package/lib/typescript/src/networking/common/UNNetworkConstants.d.ts +1 -0
  289. package/lib/typescript/src/networking/common/UNNetworkConstants.d.ts.map +1 -1
  290. package/lib/typescript/src/scripts/html/bodyScript.d.ts +1 -0
  291. package/lib/typescript/src/scripts/html/bodyScript.d.ts.map +1 -1
  292. package/lib/typescript/src/slices/SharedEventsSlice.d.ts +2 -2
  293. package/lib/typescript/src/slices/SharedEventsSlice.d.ts.map +1 -1
  294. package/lib/typescript/src/store/store.d.ts +2 -2
  295. package/lib/typescript/src/types/internal/webComponent.types.d.ts +4 -1
  296. package/lib/typescript/src/types/internal/webComponent.types.d.ts.map +1 -1
  297. package/lib/typescript/src/types/shared/achCredit.types.d.ts +1 -1
  298. package/lib/typescript/src/types/shared/achCredit.types.d.ts.map +1 -1
  299. package/lib/typescript/src/types/shared/env.types.d.ts +2 -1
  300. package/lib/typescript/src/types/shared/env.types.d.ts.map +1 -1
  301. package/lib/typescript/src/types/shared/index.d.ts +1 -0
  302. package/lib/typescript/src/types/shared/index.d.ts.map +1 -1
  303. package/lib/typescript/src/types/shared/multiFactorAuthentication.types.d.ts +15 -0
  304. package/lib/typescript/src/types/shared/multiFactorAuthentication.types.d.ts.map +1 -0
  305. package/lib/typescript/src/types/shared/payeeManagement.types.d.ts +32 -0
  306. package/lib/typescript/src/types/shared/payeeManagement.types.d.ts.map +1 -1
  307. package/lib/typescript/src/types/shared/payments.types.d.ts +2 -1
  308. package/lib/typescript/src/types/shared/payments.types.d.ts.map +1 -1
  309. package/lib/typescript/src/types/shared/securitySettings.d.ts +8 -0
  310. package/lib/typescript/src/types/shared/securitySettings.d.ts.map +1 -0
  311. package/lib/typescript/src/types/shared/wirePayment.types.d.ts +42 -0
  312. package/lib/typescript/src/types/shared/wirePayment.types.d.ts.map +1 -0
  313. package/lib/typescript/src/unitSdkManager/UnitSdk.constants.d.ts +2 -0
  314. package/lib/typescript/src/unitSdkManager/UnitSdk.constants.d.ts.map +1 -1
  315. package/lib/typescript/src/unitSdkManager/UnitSdkManager.d.ts +6 -2
  316. package/lib/typescript/src/unitSdkManager/UnitSdkManager.d.ts.map +1 -1
  317. package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts.map +1 -1
  318. package/lib/typescript/src/utils/onLoadMessages.utils.d.ts +2 -0
  319. package/lib/typescript/src/utils/onLoadMessages.utils.d.ts.map +1 -0
  320. package/lib/typescript/src/webComponent/WebComponent.d.ts.map +1 -1
  321. package/lib/typescript/src/webComponent/WebComponent.utils.d.ts +3 -1
  322. package/lib/typescript/src/webComponent/WebComponent.utils.d.ts.map +1 -1
  323. package/lib/typescript/src/webComponent/html.d.ts.map +1 -1
  324. package/package.json +1 -1
  325. package/react-native-unit-components.podspec +1 -1
  326. package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +11 -16
  327. package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +11 -17
  328. package/src/components/UNAccountComponent/UNAccountComponent.tsx +3 -3
  329. package/src/components/UNActivityComponent/UNActivityComponent.tsx +7 -14
  330. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +14 -17
  331. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +0 -1
  332. package/src/components/UNCardActionComponent/UNCardActionComponent.tsx +81 -0
  333. package/src/components/UNCardActionComponent/UNCardActionComponent.utils.ts +16 -0
  334. package/src/components/UNCardActionComponent/index.ts +1 -0
  335. package/src/components/UNCardComponent/UNCardComponent.tsx +28 -4
  336. package/src/components/UNCardComponent/UNCardComponent.utils.ts +2 -1
  337. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +7 -14
  338. package/src/components/UNFundAccountPaymentComponent/UNFundAccountPaymentComponent.tsx +16 -12
  339. package/src/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.tsx +86 -0
  340. package/src/components/UNMultiFactorAuthenticationComponent/UNMultiFactorAuthenticationComponent.utils.ts +27 -0
  341. package/src/components/UNMultiFactorAuthenticationComponent/index.ts +1 -0
  342. package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +6 -14
  343. package/src/components/UNNextRepaymentComponent/UNNextRepaymentComponent.tsx +3 -3
  344. package/src/components/UNNextRepaymentComponent/UNNextRepaymentComponent.utils.ts +1 -1
  345. package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.tsx +37 -12
  346. package/src/components/UNProgramDetailsComponent/UNProgramDetailsComponent.tsx +3 -3
  347. package/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.tsx +14 -11
  348. package/src/components/UNWirePaymentComponent/UNWirePaymentComponent.tsx +109 -0
  349. package/src/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.ts +23 -0
  350. package/src/components/UNWirePaymentComponent/index.ts +1 -0
  351. package/src/components/index.ts +3 -0
  352. package/src/helpers/BottomSheet/BottomSheet.tsx +3 -4
  353. package/src/hooks/useIsJailbrokeDevice.ts +17 -0
  354. package/src/hooks/useSnapshotProtection.ts +25 -0
  355. package/src/messages/webMessages/index.ts +2 -0
  356. package/src/messages/webMessages/multiFactorAuthenticationMessage.ts +3 -0
  357. package/src/messages/webMessages/onLoadMessage.ts +9 -2
  358. package/src/messages/webMessages/unitMessages.ts +14 -2
  359. package/src/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.tsx +12 -11
  360. package/src/nativeComponents/UNBaseView/UNBaseView.tsx +50 -0
  361. package/src/nativeComponents/UNBaseView/index.ts +1 -0
  362. package/src/nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper.ts +21 -0
  363. package/src/nativeModulesHelpers/UNSecurityHelper.ts +35 -0
  364. package/src/networking/common/UNNetworkConstants.ts +2 -1
  365. package/src/scripts/html/bodyScript.ts +18 -4
  366. package/src/slices/SharedEventsSlice.ts +2 -2
  367. package/src/types/internal/webComponent.types.ts +3 -0
  368. package/src/types/shared/achCredit.types.ts +1 -1
  369. package/src/types/shared/env.types.ts +2 -1
  370. package/src/types/shared/index.ts +1 -0
  371. package/src/types/shared/multiFactorAuthentication.types.ts +17 -0
  372. package/src/types/shared/payeeManagement.types.ts +31 -0
  373. package/src/types/shared/payments.types.ts +1 -0
  374. package/src/types/shared/securitySettings.ts +8 -0
  375. package/src/types/shared/wirePayment.types.ts +43 -0
  376. package/src/unitSdkManager/UnitSdk.constants.ts +7 -1
  377. package/src/unitSdkManager/UnitSdkManager.ts +37 -7
  378. package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +3 -0
  379. package/src/utils/onLoadMessages.utils.ts +3 -0
  380. package/src/webComponent/WebComponent.tsx +14 -6
  381. package/src/webComponent/WebComponent.utils.ts +6 -1
  382. package/src/webComponent/html.ts +4 -1
@@ -0,0 +1,86 @@
1
+ import React, { useState } from 'react';
2
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
3
+ import { WebComponent } from '../../webComponent/WebComponent';
4
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
5
+ import { withReduxStore } from '../../helpers/store/helpers';
6
+ import { getMultiFactorAuthenticationParams, getMultiFactorAuthenticationScript } from './UNMultiFactorAuthenticationComponent.utils';
7
+ import type { WebViewMessage } from '../../messages/webMessages';
8
+ import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
9
+ import { MultiFactorAuthenticationFinishedEvent, UnitMessage } from '../../messages/webMessages/unitMessages';
10
+ import { UNError, UNOnLoadResponse } from '../../types/shared';
11
+ import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
12
+ import { MultiFactorAuthenticationMessage } from '../../messages/webMessages/multiFactorAuthenticationMessage';
13
+ import { UNCustomerTokenVerification, UNMultiFactorAuthenticationFinished } from '../../types/shared/multiFactorAuthentication.types';
14
+
15
+ export interface UNMultiFactorAuthenticationComponentProps {
16
+ // inputs
17
+ customerToken: string;
18
+
19
+ // ui
20
+ theme?: string;
21
+ language?: string;
22
+
23
+ // callbacks
24
+ onLoad?: (response: UNOnLoadResponse<undefined>) => void
25
+ onVerificationTokenCreated?: (data: UNCustomerTokenVerification) => void
26
+ onAuthenticationFinished?: (data: UNMultiFactorAuthenticationFinished) => void
27
+ }
28
+
29
+ const UNMultiFactorAuthenticationComponent = (props: UNMultiFactorAuthenticationComponentProps) => {
30
+ const [height, setHeight] = useState<number>(0);
31
+ const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
32
+
33
+ const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
34
+ if (!props.onLoad) {
35
+ return;
36
+ }
37
+
38
+ if (RESPONSE_KEYS.errors in response) {
39
+ props.onLoad(response as UNError);
40
+ return;
41
+ }
42
+
43
+ props.onLoad({ data: undefined });
44
+ };
45
+
46
+ const handleWebViewMessage = (message: WebViewMessage) => {
47
+ if (!message || !message.details) return;
48
+
49
+ switch (message.type) {
50
+ case UnitMessage.UNIT_ON_LOAD:
51
+ handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);
52
+ break;
53
+ case PageMessage.PAGE_HEIGHT: {
54
+ const currentHeight = (message.details as HeightEvent).height;
55
+ setHeight(currentHeight);
56
+ if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {
57
+ setPresentationMode(PresentationMode.Default);
58
+ }
59
+ break;
60
+ }
61
+ case MultiFactorAuthenticationMessage.UNIT_MFA_VERIFICATION_TOKEN_CREATED:
62
+ props.onVerificationTokenCreated && props.onVerificationTokenCreated(message.details as UNCustomerTokenVerification);
63
+ break;
64
+ case UnitMessage.UNIT_MULTI_FACTOR_AUTH_FINISHED: {
65
+ const data = JSON.parse((message.details as MultiFactorAuthenticationFinishedEvent).unitVerifiedCustomerTokenString);
66
+ props.onAuthenticationFinished && props.onAuthenticationFinished(data as UNMultiFactorAuthenticationFinished);
67
+ break;
68
+ }
69
+ }
70
+ };
71
+
72
+ const style = presentationMode === PresentationMode.Inherit ? { flex: 1 } : { height: height };
73
+ return <UNBaseView style={style} onLoadError={handleUnitOnLoad}>
74
+ <WebComponent
75
+ type={WebComponentType.multiFactorAuthentication}
76
+ presentationMode={PresentationMode.Inherit}
77
+ params={getMultiFactorAuthenticationParams(props)}
78
+ script={getMultiFactorAuthenticationScript()}
79
+ onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
80
+ theme={props.theme}
81
+ language={props.language}
82
+ />
83
+ </UNBaseView>;
84
+ };
85
+
86
+ export default withReduxStore<UNMultiFactorAuthenticationComponentProps>(UNMultiFactorAuthenticationComponent);
@@ -0,0 +1,27 @@
1
+ import { MultiFactorAuthenticationMessage } from '../../messages/webMessages/multiFactorAuthenticationMessage';
2
+ import { UNMultiFactorAuthenticationComponentProps } from './UNMultiFactorAuthenticationComponent';
3
+
4
+ export const getMultiFactorAuthenticationParams = (props: UNMultiFactorAuthenticationComponentProps) => {
5
+ return `
6
+ customer-token="${props.customerToken}"
7
+ `;
8
+ };
9
+
10
+ const MULTI_FACTOR_AUTHENTICATION_LISTENERS = {
11
+ verificationTokenCreated: `
12
+ window.addEventListener("${MultiFactorAuthenticationMessage.UNIT_MFA_VERIFICATION_TOKEN_CREATED}", (e) => {
13
+ const response = e.detail
14
+ response.then((data) => {
15
+ postMessageToSDK({ type: "${MultiFactorAuthenticationMessage.UNIT_MFA_VERIFICATION_TOKEN_CREATED}", details: data.data })
16
+ }).catch((e) => {
17
+ console.log(e)
18
+ })
19
+ });
20
+ `
21
+ };
22
+
23
+ export const getMultiFactorAuthenticationScript = () => {
24
+ return `
25
+ ${MULTI_FACTOR_AUTHENTICATION_LISTENERS.verificationTokenCreated}
26
+ `;
27
+ };
@@ -0,0 +1 @@
1
+ export { default as UNMultiFactorAuthenticationComponent, UNMultiFactorAuthenticationComponentProps } from './UNMultiFactorAuthenticationComponent';
@@ -1,5 +1,5 @@
1
1
  import React, { useRef, useState } from 'react';
2
- import { Dimensions, View } from 'react-native';
2
+ import { Dimensions } from 'react-native';
3
3
  import type { WebViewMessage } from '../../messages/webMessages';
4
4
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
5
5
  import { WebComponent } from '../../webComponent/WebComponent';
@@ -21,6 +21,7 @@ import type {
21
21
  UNOnLoadResponseData,
22
22
  } from '../../types/shared';
23
23
  import { MultipleCardsCardClickedEvent, MultipleCardsMessage } from '../../messages/webMessages/multipleCardsMessage';
24
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
24
25
 
25
26
  const DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;
26
27
 
@@ -90,8 +91,9 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
90
91
  }
91
92
  };
92
93
 
93
- const renderMultipleCardsWebView = () => {
94
- return (
94
+ const style = defaultHeight ? { height: defaultHeight } : { flex: 1};
95
+ return (
96
+ <UNBaseView style={style} onLoadError={ handleUnitOnLoad }>
95
97
  <WebComponent
96
98
  ref={webRef}
97
99
  type={WebComponentType.multipleCards}
@@ -103,17 +105,7 @@ const UNMultipleCardsComponent = (props: UNMultipleCardsComponentProps) => {
103
105
  theme={props.theme}
104
106
  language={props.language}
105
107
  />
106
- );
107
- };
108
-
109
- if (!defaultHeight) {
110
- return renderMultipleCardsWebView();
111
- }
112
-
113
- return (
114
- <View style={{ height: defaultHeight }}>
115
- {renderMultipleCardsWebView()}
116
- </View>
108
+ </UNBaseView>
117
109
  );
118
110
  };
119
111
 
@@ -1,5 +1,4 @@
1
1
  import React, { useState } from 'react';
2
- import { View } from 'react-native';
3
2
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
4
3
  import { UnitMessage } from '../../messages/webMessages/unitMessages';
5
4
  import { WebComponent } from '../../webComponent/WebComponent';
@@ -12,6 +11,7 @@ import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessag
12
11
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
13
12
  import { withReduxStore } from '../../helpers/store/helpers';
14
13
  import { UNRepaymentData } from '../../types/shared/repayment.types';
14
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
15
15
 
16
16
  export interface UNNextRepaymentComponentProps {
17
17
  // inputs
@@ -63,7 +63,7 @@ const UNNextRepaymentComponent = (props: UNNextRepaymentComponentProps) => {
63
63
  };
64
64
 
65
65
  return (
66
- <View style={{ height, width: '100%' }}>
66
+ <UNBaseView style={{ height, width: '100%' }} onLoadError={ handleUnitOnLoad }>
67
67
  <WebComponent
68
68
  type={WebComponentType.nextRepayment}
69
69
  presentationMode={PresentationMode.Default}
@@ -73,7 +73,7 @@ const UNNextRepaymentComponent = (props: UNNextRepaymentComponentProps) => {
73
73
  onMessage={message => handleMessage(message)}
74
74
  isScrollable={false}
75
75
  />
76
- </View>
76
+ </UNBaseView>
77
77
  );
78
78
  };
79
79
 
@@ -5,6 +5,6 @@ export const getNextRepaymentParams = (props: UNNextRepaymentComponentProps) =>
5
5
  return `
6
6
  customer-token="${props.customerToken}"
7
7
  account-id="${props.accountId}"
8
- hide-actions-menu-button="${props.hideTitle || false}"
8
+ hide-title="${props.hideTitle || false}"
9
9
  `;
10
10
  };
@@ -8,7 +8,7 @@ import { WebComponent } from '../../webComponent/WebComponent';
8
8
  import type { WebViewMessage } from '../../messages/webMessages';
9
9
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
10
10
  import { withReduxStore } from '../../helpers/store/helpers';
11
- import { UNPayeeConnectedAccount, UNPayeeCounterparty, UNPayeeManagementComponentPaginationType, UNPayeeManagementMenuItem, UNPlaidAccountFilter } from '../../types/shared';
11
+ import { UNError, UNOnLoadResponse, UNPayeeConnectedAccount, UNPayeeCounterparty, UNPayeeManagementComponentPaginationType, UNPayeeManagementMenuItem, UNPlaidAccountFilter } from '../../types/shared';
12
12
  import { getPayeeParams, getPayeeManagementScript, injectRefreshEventIfNeeded, injectUnitPlaidResponse, injectUnitOpenPlaid, injectUnitPlaidExit } from './UNPayeeManagementComponent.utils';
13
13
  import { BottomSheetRenderingType, BottomSheetSlotData, SlotRendering } from '../../types/internal/bottomSheet.types';
14
14
  import { RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
@@ -19,6 +19,8 @@ import { useListenerToEvent } from '../../hooks/useListenerToEvent';
19
19
  import { LinkSuccess, openLink } from 'react-native-plaid-link-sdk';
20
20
  import { OpenPlaidEvent, PlaidMessage } from '../../messages/webMessages/plaidMessages';
21
21
  import { PayeeConnectedAccountEvent, PayeeCounterpartyEvent, PayeeManagementMessage, PayeeMicroDepositeConnectionEvent } from '../../messages/webMessages/payeeManagementMessage';
22
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
23
+ import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
22
24
 
23
25
  export interface UNPayeeManagementComponentProps {
24
26
  // inputs
@@ -44,6 +46,7 @@ export interface UNPayeeManagementComponentProps {
44
46
  plaidLinkCustomizationName?: string;
45
47
 
46
48
  // events
49
+ onLoad?: (response: UNOnLoadResponse<[UNPayeeCounterparty]>) => void;
47
50
  onCounterpartyCreated?: (counterparty: UNPayeeCounterparty) => void;
48
51
  onCounterpartyDeleted?: (counterparty: UNPayeeCounterparty) => void;
49
52
 
@@ -102,6 +105,25 @@ const UNPayeeManagementComponent = (props: UNPayeeManagementComponentProps) => {
102
105
  }
103
106
  };
104
107
 
108
+ const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
109
+ if (!props.onLoad) {
110
+ return;
111
+ }
112
+
113
+ if (RESPONSE_KEYS.errors in response) {
114
+ props.onLoad(response as UNError);
115
+ return;
116
+ }
117
+
118
+ if (RESPONSE_KEYS.counterpartiesResult in response) {
119
+ props.onLoad(response[RESPONSE_KEYS.counterpartiesResult] as UNOnLoadResponse<[UNPayeeCounterparty]>);
120
+ return;
121
+ }
122
+
123
+ console.error('On Load Error: unexpected response type');
124
+ return;
125
+ };
126
+
105
127
  const handleMessage = (message: WebViewMessage) => {
106
128
  switch (message.type) {
107
129
  case UnitMessage.UNIT_REQUEST_RENDERING: {
@@ -110,6 +132,7 @@ const UNPayeeManagementComponent = (props: UNPayeeManagementComponentProps) => {
110
132
  break;
111
133
  }
112
134
  case UnitMessage.UNIT_ON_LOAD: {
135
+ handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);
113
136
  break;
114
137
  }
115
138
  case PayeeManagementMessage.UNIT_CONNECTED_ACCOUNT_CREATED: {
@@ -136,17 +159,19 @@ const UNPayeeManagementComponent = (props: UNPayeeManagementComponentProps) => {
136
159
  };
137
160
 
138
161
  return (
139
- <WebComponent
140
- ref={webRef}
141
- type={WebComponentType.payeeManagement}
142
- presentationMode={PresentationMode.Inherit}
143
- params={getPayeeParams(props)}
144
- script={getPayeeManagementScript()}
145
- theme={props.theme}
146
- nestedScrollEnabled={true}
147
- language={props.language}
148
- onMessage={message => handleMessage(message)}
149
- />
162
+ <UNBaseView style={{ height: '100%' }}>
163
+ <WebComponent
164
+ ref={webRef}
165
+ type={WebComponentType.payeeManagement}
166
+ presentationMode={PresentationMode.Inherit}
167
+ params={getPayeeParams(props)}
168
+ script={getPayeeManagementScript()}
169
+ theme={props.theme}
170
+ nestedScrollEnabled={true}
171
+ language={props.language}
172
+ onMessage={message => handleMessage(message)}
173
+ />
174
+ </UNBaseView>
150
175
  );
151
176
  };
152
177
 
@@ -1,5 +1,4 @@
1
1
  import React, { useState } from 'react';
2
- import { View } from 'react-native';
3
2
  import { WebComponent } from '../../webComponent/WebComponent';
4
3
  import { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
5
4
  import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
@@ -9,6 +8,7 @@ import { withReduxStore } from '../../helpers/store/helpers';
9
8
  import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
10
9
  import { UnitMessage } from '../../messages/webMessages/unitMessages';
11
10
  import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
11
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
12
12
 
13
13
  export interface UNProgramDetailsComponentProps {
14
14
  // inputs
@@ -61,7 +61,7 @@ const UNProgramDetailsComponent = (props: UNProgramDetailsComponentProps) => {
61
61
  };
62
62
 
63
63
  return (
64
- <View style={{ height, width: '100%' }}>
64
+ <UNBaseView style={{ height, width: '100%' }} onLoadError={ handleUnitOnLoad }>
65
65
  <WebComponent
66
66
  type={WebComponentType.programDetails}
67
67
  presentationMode={PresentationMode.Default}
@@ -70,7 +70,7 @@ const UNProgramDetailsComponent = (props: UNProgramDetailsComponentProps) => {
70
70
  language={props.language}
71
71
  onMessage={handleMessage}
72
72
  />
73
- </View>
73
+ </UNBaseView>
74
74
  );
75
75
  };
76
76
 
@@ -24,6 +24,7 @@ import { PageMessage } from '../../messages/webMessages/pageMessage';
24
24
  import UNStoreManagerHelper from '../../nativeModulesHelpers/UNStoreManagerHelper/UNStoreManagerHelper';
25
25
  import { ActivityMessage } from '../../messages/webMessages/activityMessage';
26
26
  import { setItemInWindowUnitStore } from '../../utils/windowUnitStore';
27
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
27
28
 
28
29
  export interface UNWhiteLabelAppComponentProps {
29
30
  // inputs
@@ -102,17 +103,19 @@ const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
102
103
 
103
104
  const renderWebView = () => {
104
105
  return (
105
- <WebComponent
106
- ref={webRef}
107
- type={WebComponentType.whiteLabelApp}
108
- presentationMode={PresentationMode.Inherit}
109
- params={getWhiteLabelAppParams(props)}
110
- onMessage={handleWebViewMessage}
111
- isScrollable={true}
112
- theme={props.theme}
113
- language={props.language}
114
- script={getWhiteLabelAppScript()}
115
- />
106
+ <UNBaseView style={{ flex: 1 }}>
107
+ <WebComponent
108
+ ref={webRef}
109
+ type={WebComponentType.whiteLabelApp}
110
+ presentationMode={PresentationMode.Inherit}
111
+ params={getWhiteLabelAppParams(props)}
112
+ onMessage={handleWebViewMessage}
113
+ isScrollable={true}
114
+ theme={props.theme}
115
+ language={props.language}
116
+ script={getWhiteLabelAppScript()}
117
+ />
118
+ </UNBaseView>
116
119
  );
117
120
  };
118
121
 
@@ -0,0 +1,109 @@
1
+ import { WebComponent } from '../../webComponent/WebComponent';
2
+ import React, { useState } from 'react';
3
+ import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
4
+ import { withReduxStore } from '../../helpers/store/helpers';
5
+ import { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
6
+ import { UNAccountData, UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../types/shared';
7
+ import { WebViewMessage } from '../../messages/webMessages';
8
+ import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
9
+ import { UnitMessage } from '../../messages/webMessages/unitMessages';
10
+ import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
11
+ import { getWirePaymentParams, getWirePaymentScript } from './UNWirePaymentComponent.utils';
12
+ import { UNWirePaymentData, WirePaymentCreatedEvent } from '../../types/shared/wirePayment.types';
13
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
14
+ import { ensureArray } from '../../utils/onLoadMessages.utils';
15
+
16
+ export interface UNWirePaymentComponentProps {
17
+ // inputs
18
+ customerToken: string;
19
+ accountId?: string;
20
+ fee?: number;
21
+
22
+ // ui
23
+ theme?: string;
24
+ language?: string;
25
+
26
+ isAutoFocus?: boolean;
27
+ initialStageBackButton?: boolean;
28
+ finalStageDoneButton?: boolean;
29
+
30
+ // events
31
+ onPaymentCreated?: (data: UNWirePaymentData) => void;
32
+ onLoad?: (response: UNOnLoadResponse<[UNAccountData]>) => void;
33
+ onInitialStageBackButtonClicked?: () => void;
34
+ onFinalStageDoneButtonClicked?: () => void;
35
+ }
36
+
37
+ const UNWirePaymentComponent = (props: UNWirePaymentComponentProps) => {
38
+ const [height, setHeight] = useState<number>(0);
39
+ const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
40
+
41
+ const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {
42
+ if (!props.onLoad) {
43
+ return;
44
+ }
45
+
46
+ if (RESPONSE_KEYS.errors in response) {
47
+ props.onLoad(response as UNError);
48
+ return;
49
+ }
50
+
51
+ if (RESPONSE_KEYS.account in response) {
52
+ const account = response[RESPONSE_KEYS.account].data;
53
+ const paymentOnLoad: UNOnLoadResponseData<[UNAccountData]> = {
54
+ data: ensureArray(account),
55
+ };
56
+ props.onLoad(paymentOnLoad);
57
+ return;
58
+ }
59
+
60
+ console.error('On Load Error: unexpected response type');
61
+ return;
62
+ };
63
+
64
+ const handleWebViewMessage = (message: WebViewMessage) => {
65
+ if (!message || !message.details) return;
66
+ switch (message.type) {
67
+ case PaymentMessage.INITIAL_STAGE_BACK_BUTTON_CLICKED: {
68
+ props.onInitialStageBackButtonClicked && props.onInitialStageBackButtonClicked();
69
+ break;
70
+ }
71
+ case PaymentMessage.FINAL_STAGE_DONE_BUTTON_CLICKED: {
72
+ props.onFinalStageDoneButtonClicked && props.onFinalStageDoneButtonClicked();
73
+ break;
74
+ }
75
+ case PaymentMessage.PAYMENT_CREATED:
76
+ props.onPaymentCreated && props.onPaymentCreated((message.details as WirePaymentCreatedEvent).data);
77
+ break;
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
+ setHeight(currentHeight);
84
+ if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {
85
+ setPresentationMode(PresentationMode.Default);
86
+ }
87
+ break;
88
+ }
89
+ }
90
+ };
91
+
92
+ const style = presentationMode === PresentationMode.Inherit ? { flex: 1 } : { height: height };
93
+ return (
94
+ <UNBaseView style={style}>
95
+ <WebComponent
96
+ type={WebComponentType.wirePayment}
97
+ presentationMode={presentationMode}
98
+ params={getWirePaymentParams(props)}
99
+ script={getWirePaymentScript()}
100
+ onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
101
+ isScrollable={true}
102
+ theme={props.theme}
103
+ language={props.language}
104
+ />
105
+ </UNBaseView>
106
+ );
107
+ };
108
+
109
+ export default withReduxStore<UNWirePaymentComponentProps>(UNWirePaymentComponent);
@@ -0,0 +1,23 @@
1
+ import { LISTENERS } from '../../scripts/html/bodyScript';
2
+ import { UNWirePaymentComponentProps } from './UNWirePaymentComponent';
3
+
4
+ export const getWirePaymentParams = (props: UNWirePaymentComponentProps) => {
5
+ const accountIdParam = props.accountId ? `account-id="${props.accountId}"` : '';
6
+ const feeParam = props.fee ? `fee="${props.fee}"` : '';
7
+ return `
8
+ ${accountIdParam}
9
+ customer-token="${props.customerToken}"
10
+ ${feeParam}
11
+ is-auto-focus="${props.isAutoFocus || false}"
12
+ initial-stage-back-button="${props.initialStageBackButton ?? false}"
13
+ final-stage-done-button="${props.finalStageDoneButton ?? false}"
14
+ `;
15
+ };
16
+
17
+ export const getWirePaymentScript = () => {
18
+ return `
19
+ ${LISTENERS.unitPaymentCreated}
20
+ ${LISTENERS.unitPaymentInitialStageBackButtonClicked}
21
+ ${LISTENERS.unitPaymentFinalStageDoneButtonClicked}
22
+ `;
23
+ };
@@ -0,0 +1 @@
1
+ export { default as UNWirePaymentComponent, UNWirePaymentComponentProps } from './UNWirePaymentComponent';
@@ -12,3 +12,6 @@ export * from './UNProgramDetailsComponent';
12
12
  export * from './UNNextRepaymentComponent';
13
13
  export * from './UNWhiteLabelAppComponent';
14
14
  export * from './UNPayeeManagementComponent';
15
+ export * from './UNWirePaymentComponent';
16
+ export * from './UNMultiFactorAuthenticationComponent';
17
+ export * from './UNCardActionComponent';
@@ -20,6 +20,7 @@ import {
20
20
  import { getStylesObject } from './BottomSheet.styles';
21
21
  import { useAppStateListener } from '../../hooks/useAppStateListener';
22
22
  import { BottomSheetNativePlaceType } from '../../types/internal/bottomSheet.types';
23
+ import { UNBaseView } from '../../nativeComponents/UNBaseView';
23
24
 
24
25
  export interface BottomSheetProps {
25
26
  isOpen: boolean,
@@ -223,11 +224,9 @@ const BottomSheet = (props: BottomSheetProps) => {
223
224
  <View
224
225
  onLayout={_setSize}
225
226
  >
226
- <View
227
- style={{ height: props.height }}
228
- >
227
+ <UNBaseView style={{ height: props.height }}>
229
228
  {children}
230
- </View>
229
+ </UNBaseView>
231
230
 
232
231
  </View>
233
232
  </View>
@@ -0,0 +1,17 @@
1
+ import { useEffect, useState } from 'react';
2
+ import UNSecurityManagerHelper from '../nativeModulesHelpers/UNSecurityHelper';
3
+
4
+ export const useIsJailbrokeDevice = () => {
5
+ const [isJailbroke, setIsJailbroke] = useState(false);
6
+
7
+ useEffect(() => {
8
+ const isDeviceJailbroke = async () => {
9
+ const isDeviceJailbroke = await UNSecurityManagerHelper.isDeviceJailbroke();
10
+ setIsJailbroke(isDeviceJailbroke);
11
+ };
12
+
13
+ isDeviceJailbroke();
14
+ }, []);
15
+
16
+ return isJailbroke;
17
+ };
@@ -0,0 +1,25 @@
1
+ import { Platform } from 'react-native';
2
+ import UNSnapshotProtectionHelper from '../nativeModulesHelpers/UNSanpshotProtectionHelper/UNSnapshotProtectionHelper';
3
+ import { UnitSDK } from '../unitSdkManager/UnitSdkManager';
4
+ import { UNSnapshotProtectionStrategy } from '../types/shared/securitySettings';
5
+ import { useEffect } from 'react';
6
+
7
+ export const useSnapshotProtection = () => {
8
+ /**
9
+ * This hook provides snapshot protection specifically for Android.
10
+ * For iOS, a native service is utilized instead.
11
+ */
12
+ useEffect(() => {
13
+ if (!UnitSDK.isInitialized()) {
14
+ return;
15
+ }
16
+
17
+ if (UnitSDK.getSecuritySettings().snapshotProtectionStrategy == UNSnapshotProtectionStrategy.None) {
18
+ return;
19
+ }
20
+
21
+ if (Platform.OS == 'android') {
22
+ UNSnapshotProtectionHelper.setAndroidSecurity();
23
+ }
24
+ }, []);
25
+ };
@@ -12,6 +12,7 @@ import type { MultipleCardsEvent, MultipleCardsMessage } from './multipleCardsMe
12
12
  import { FundAccountPaymentEvent } from './fundAccountPaymentMessage';
13
13
  import { PlaidEvent, PlaidMessage } from './plaidMessages';
14
14
  import { PayeeManagementMessage, PayeeManagementEvent } from './payeeManagementMessage';
15
+ import { MultiFactorAuthenticationMessage } from './multiFactorAuthenticationMessage';
15
16
 
16
17
  export type WebViewMessageType =
17
18
  | PageMessage
@@ -24,6 +25,7 @@ export type WebViewMessageType =
24
25
  | ActivityMessage
25
26
  | PlaidMessage
26
27
  | PayeeManagementMessage
28
+ | MultiFactorAuthenticationMessage
27
29
 
28
30
  type WebViewEvent =
29
31
  | PageEvent
@@ -0,0 +1,3 @@
1
+ export enum MultiFactorAuthenticationMessage {
2
+ UNIT_MFA_VERIFICATION_TOKEN_CREATED = 'unitMultiFactorAuthVerificationTokenCreated'
3
+ }
@@ -4,6 +4,7 @@ import type {
4
4
  UNCardData,
5
5
  UNError,
6
6
  UNOnLoadResponseData,
7
+ UNPayeeCounterparty
7
8
  } from '../../types/shared';
8
9
  import type { UNAuthorizationData } from '../../types/shared/authorization.types';
9
10
  import type { UNTransactionData } from '../../types/shared/transactions.types';
@@ -19,7 +20,8 @@ export enum RESPONSE_KEYS {
19
20
  authorizations = 'authorizationsResult',
20
21
  repayment = 'repaymentResult',
21
22
  astraExternalCard = 'astraCardsResult',
22
- accountCards = 'accountCardsResult'
23
+ accountCards = 'accountCardsResult',
24
+ counterpartiesResult = 'counterpartiesResult'
23
25
  }
24
26
 
25
27
  export type CardsOnLoadResponse = {
@@ -38,7 +40,7 @@ export type AccountsOnLoadResponse = {
38
40
  }
39
41
 
40
42
  export type ACHOnLoadResponse = {
41
- [RESPONSE_KEYS.account]: UNOnLoadResponseData<UNAccountData>,
43
+ [RESPONSE_KEYS.account]: UNOnLoadResponseData<UNAccountData> | UNOnLoadResponseData<[UNAccountData]>,
42
44
  [RESPONSE_KEYS.counterpartyAccount]: UNOnLoadResponseData<[UNCounterpartyAccountData]>
43
45
  }
44
46
 
@@ -54,6 +56,10 @@ export type FundAccountPaymentOnLoadResponse = {
54
56
  [RESPONSE_KEYS.accountCards]?: UNOnLoadResponseData<[UNCardData]>
55
57
  }
56
58
 
59
+ export type PayeeManagementOnLoadResponse = {
60
+ [RESPONSE_KEYS.counterpartiesResult]: UNOnLoadResponseData<[UNPayeeCounterparty]>
61
+ }
62
+
57
63
  export type UnitOnLoadResponseSuccessData =
58
64
  | CardOnLoadResponse
59
65
  | CardsOnLoadResponse
@@ -62,6 +68,7 @@ export type UnitOnLoadResponseSuccessData =
62
68
  | AccountOnLoadResponse
63
69
  | ActivityOnLoadResponse
64
70
  | FundAccountPaymentOnLoadResponse
71
+ | PayeeManagementOnLoadResponse
65
72
 
66
73
  export type UnitOnLoadResponseEvent =
67
74
  | UNError