@primer-io/react-native 2.38.0 → 2.39.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.
Files changed (479) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +149 -0
  3. package/android/build.gradle +34 -83
  4. package/android/src/main/java/com/primerioreactnative/{PrimerRN.kt → DefaultNativePrimerModule.kt} +87 -79
  5. package/android/src/main/java/com/primerioreactnative/PrimerRNHeadlessUniversalCheckout.kt +4 -1
  6. package/android/src/main/java/com/primerioreactnative/PrimerSdkPackage.kt +117 -0
  7. package/android/src/main/java/com/primerioreactnative/components/manager/ach/PrimerRNAchMandateManager.kt +4 -1
  8. package/android/src/main/java/com/primerioreactnative/components/manager/ach/PrimerRNHeadlessUniversalCheckoutStripeAchUserDetailsComponent.kt +8 -4
  9. package/android/src/main/java/com/primerioreactnative/components/manager/asset/PrimerRNHeadlessUniversalCheckoutAssetManager.kt +7 -2
  10. package/android/src/main/java/com/primerioreactnative/components/manager/banks/PrimerRNHeadlessUniversalCheckoutBanksComponent.kt +7 -4
  11. package/android/src/main/java/com/primerioreactnative/components/manager/googlePay/PrimerGooglePayButtonConstantsModule.kt +3 -1
  12. package/android/src/main/java/com/primerioreactnative/components/manager/klarna/PrimerRNHeadlessUniversalCheckoutKlarnaComponent.kt +9 -5
  13. package/android/src/main/java/com/primerioreactnative/components/manager/nativeUi/PrimerRNHeadlessUniversalCheckoutNativeUiManager.kt +8 -2
  14. package/android/src/main/java/com/primerioreactnative/components/manager/raw/PrimerRNHeadlessUniversalCheckoutRawManager.kt +7 -3
  15. package/android/src/main/java/com/primerioreactnative/components/manager/vault/PrimerRNHeadlessUniversalCheckoutVaultManager.kt +7 -1
  16. package/android/src/main/java/com/primerioreactnative/datamodels/PrimerSettingsRN.kt +4 -5
  17. package/android/src/main/java/com/primerioreactnative/extensions/PrimerUIOptionsRN.kt +1 -2
  18. package/android/src/newarch/java/com/primerioreactnative/NativePrimerModule.kt +119 -0
  19. package/android/src/oldarch/java/com/primerioreactnative/NativePrimerModule.kt +135 -0
  20. package/ios/ReactNative.xcodeproj/project.pbxproj +14 -0
  21. package/ios/Sources/Headless Universal Checkout/Managers/Ach/PrimerRNHeadlessUniversalCheckoutStripeAchUserDetailsComponent.swift +1 -0
  22. package/ios/Sources/Headless Universal Checkout/Managers/Ach/RNTAchMandateManager.swift +0 -1
  23. package/ios/Sources/Headless Universal Checkout/Managers/Klarna/PrimerRNHeadlessUniversalCheckoutKlarnaComponent.swift +1 -2
  24. package/ios/Sources/Headless Universal Checkout/Managers/Payment Method Managers/RNPrimerHeadlessUniversalCheckoutVaultManager.swift +1 -0
  25. package/ios/Sources/Headless Universal Checkout/Managers/Payment Method Managers/RNTNativeUIManager.swift +1 -0
  26. package/ios/Sources/Headless Universal Checkout/Managers/Payment Method Managers/RNTRawDataManager.swift +1 -0
  27. package/ios/Sources/Headless Universal Checkout/Managers/RNTRedirectManager.swift +1 -0
  28. package/ios/Sources/NativePrimer/RCTNativePrimer.h +20 -0
  29. package/ios/Sources/NativePrimer/RCTNativePrimer.mm +222 -0
  30. package/ios/Sources/RNTPrimer.swift +27 -40
  31. package/ios/Sources/version.swift +1 -1
  32. package/lib/module/HeadlessUniversalCheckout/Components/NativeResourceView.js +11 -8
  33. package/lib/module/HeadlessUniversalCheckout/Components/NativeResourceView.js.map +1 -1
  34. package/lib/module/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.js +2 -0
  35. package/lib/module/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.js.map +1 -1
  36. package/lib/module/HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView.js +2 -0
  37. package/lib/module/HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView.js.map +1 -1
  38. package/lib/module/HeadlessUniversalCheckout/Managers/AssetsManager.js +2 -0
  39. package/lib/module/HeadlessUniversalCheckout/Managers/AssetsManager.js.map +1 -1
  40. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.js +15 -19
  41. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.js.map +1 -1
  42. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager.js +2 -0
  43. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager.js.map +1 -1
  44. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.js +15 -19
  45. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.js.map +1 -1
  46. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.js +15 -19
  47. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.js.map +1 -1
  48. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.js +2 -0
  49. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.js.map +1 -1
  50. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.js +11 -16
  51. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.js.map +1 -1
  52. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/Utils/EventType.js +2 -0
  53. package/lib/module/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/Utils/EventType.js.map +1 -1
  54. package/lib/module/HeadlessUniversalCheckout/Managers/VaultManager.js +3 -1
  55. package/lib/module/HeadlessUniversalCheckout/Managers/VaultManager.js.map +1 -1
  56. package/lib/module/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.js +30 -42
  57. package/lib/module/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.js.map +1 -1
  58. package/lib/module/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.js +2 -0
  59. package/lib/module/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.js.map +1 -1
  60. package/lib/module/HeadlessUniversalCheckout/types.js +1 -0
  61. package/lib/module/HeadlessUniversalCheckout/types.js.map +1 -1
  62. package/lib/module/Primer.js +14 -13
  63. package/lib/module/Primer.js.map +1 -1
  64. package/lib/module/RNPrimer.js +23 -26
  65. package/lib/module/RNPrimer.js.map +1 -1
  66. package/lib/module/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.js +2 -0
  67. package/lib/module/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.js.map +1 -1
  68. package/lib/module/index.js +28 -16
  69. package/lib/module/index.js.map +1 -1
  70. package/lib/module/models/IssuingBank.js +1 -1
  71. package/lib/module/models/IssuingBank.js.map +1 -1
  72. package/lib/module/models/NamedComponentStep.js +1 -1
  73. package/lib/module/models/NamedComponentStep.js.map +1 -1
  74. package/lib/module/models/NamedComponentValidatableData.js +1 -1
  75. package/lib/module/models/NamedComponentValidatableData.js.map +1 -1
  76. package/lib/module/models/PrimerCheckoutAdditionalInfo.js +1 -1
  77. package/lib/module/models/PrimerCheckoutAdditionalInfo.js.map +1 -1
  78. package/lib/module/models/PrimerCheckoutData.js +2 -0
  79. package/lib/module/models/PrimerCheckoutData.js.map +1 -1
  80. package/lib/module/models/PrimerCheckoutPaymentMethodData.js +1 -1
  81. package/lib/module/models/PrimerCheckoutPaymentMethodData.js.map +1 -1
  82. package/lib/module/models/PrimerClientSession.js +1 -1
  83. package/lib/module/models/PrimerClientSession.js.map +1 -1
  84. package/lib/module/models/PrimerComponentDataValidation.js +2 -0
  85. package/lib/module/models/PrimerComponentDataValidation.js.map +1 -1
  86. package/lib/module/models/PrimerError.js +2 -0
  87. package/lib/module/models/PrimerError.js.map +1 -1
  88. package/lib/module/models/PrimerHandlers.js +1 -1
  89. package/lib/module/models/PrimerHandlers.js.map +1 -1
  90. package/lib/module/models/PrimerHeadlessUniversalCheckoutPaymentMethod.js +1 -1
  91. package/lib/module/models/PrimerHeadlessUniversalCheckoutPaymentMethod.js.map +1 -1
  92. package/lib/module/models/PrimerImplementedRNCallbacks.js +1 -1
  93. package/lib/module/models/PrimerImplementedRNCallbacks.js.map +1 -1
  94. package/lib/module/models/PrimerInitializationData.js +2 -0
  95. package/lib/module/models/PrimerInitializationData.js.map +1 -1
  96. package/lib/module/models/PrimerInputElementType.js +2 -0
  97. package/lib/module/models/PrimerInputElementType.js.map +1 -1
  98. package/lib/module/models/PrimerInterfaces.js +2 -0
  99. package/lib/module/models/PrimerInterfaces.js.map +1 -1
  100. package/lib/module/models/PrimerPaymentMethodManagerCategory.js +2 -0
  101. package/lib/module/models/PrimerPaymentMethodManagerCategory.js.map +1 -1
  102. package/lib/module/models/PrimerPaymentMethodResource.js +1 -1
  103. package/lib/module/models/PrimerPaymentMethodResource.js.map +1 -1
  104. package/lib/module/models/PrimerPaymentMethodTokenData.js +2 -0
  105. package/lib/module/models/PrimerPaymentMethodTokenData.js.map +1 -1
  106. package/lib/module/models/PrimerRawData.js +1 -1
  107. package/lib/module/models/PrimerRawData.js.map +1 -1
  108. package/lib/module/models/PrimerSessionIntent.js +2 -0
  109. package/lib/module/models/PrimerSessionIntent.js.map +1 -1
  110. package/lib/module/models/PrimerSettings.js +2 -0
  111. package/lib/module/models/PrimerSettings.js.map +1 -1
  112. package/lib/module/models/PrimerTheme.js +1 -1
  113. package/lib/module/models/PrimerTheme.js.map +1 -1
  114. package/lib/module/models/PrimerValidationError.js +1 -1
  115. package/lib/module/models/PrimerValidationError.js.map +1 -1
  116. package/lib/module/models/PrimerValidationErrorResult.js +2 -0
  117. package/lib/module/models/PrimerValidationErrorResult.js.map +1 -1
  118. package/lib/module/models/PrimerVaultedPaymentMethod.js +2 -0
  119. package/lib/module/models/PrimerVaultedPaymentMethod.js.map +1 -1
  120. package/lib/module/models/PrimerVaultedPaymentMethodAdditionalData.js +1 -1
  121. package/lib/module/models/PrimerVaultedPaymentMethodAdditionalData.js.map +1 -1
  122. package/lib/module/models/PrimerVaultedPaymentMethodResult.js +2 -0
  123. package/lib/module/models/PrimerVaultedPaymentMethodResult.js.map +1 -1
  124. package/lib/module/models/RetailOutletsRetail.js +1 -1
  125. package/lib/module/models/RetailOutletsRetail.js.map +1 -1
  126. package/lib/module/models/ach/AchCollectableData.js +2 -0
  127. package/lib/module/models/ach/AchCollectableData.js.map +1 -1
  128. package/lib/module/models/ach/AchSteps.js +2 -0
  129. package/lib/module/models/ach/AchSteps.js.map +1 -1
  130. package/lib/module/models/banks/BanksCollectableData.js +2 -0
  131. package/lib/module/models/banks/BanksCollectableData.js.map +1 -1
  132. package/lib/module/models/banks/BanksSteps.js +2 -0
  133. package/lib/module/models/banks/BanksSteps.js.map +1 -1
  134. package/lib/module/models/klarna/KlarnaPaymentCategory.js +1 -1
  135. package/lib/module/models/klarna/KlarnaPaymentCategory.js.map +1 -1
  136. package/lib/module/models/klarna/KlarnaPaymentCollectableData.js +2 -0
  137. package/lib/module/models/klarna/KlarnaPaymentCollectableData.js.map +1 -1
  138. package/lib/module/models/klarna/KlarnaPaymentSteps.js +2 -0
  139. package/lib/module/models/klarna/KlarnaPaymentSteps.js.map +1 -1
  140. package/lib/module/package.json +1 -0
  141. package/lib/module/specs/NativePrimer.js +6 -0
  142. package/lib/module/specs/NativePrimer.js.map +1 -0
  143. package/lib/module/utils/index.js +5 -3
  144. package/lib/module/utils/index.js.map +1 -1
  145. package/lib/typescript/package.json +1 -0
  146. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Components/NativeResourceView.d.ts +1 -1
  147. package/lib/typescript/src/HeadlessUniversalCheckout/Components/NativeResourceView.d.ts.map +1 -0
  148. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Components/PrimerGooglePayButton.d.ts +1 -1
  149. package/lib/typescript/src/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.d.ts.map +1 -0
  150. package/lib/typescript/src/HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView.d.ts.map +1 -0
  151. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/AssetsManager.d.ts +2 -2
  152. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/AssetsManager.d.ts.map +1 -0
  153. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/AchManager.d.ts +6 -6
  154. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.d.ts.map +1 -0
  155. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager.d.ts.map +1 -0
  156. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/ComponentWithRedirectManager.d.ts +6 -6
  157. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.d.ts.map +1 -0
  158. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/KlarnaManager.d.ts +7 -7
  159. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.d.ts.map +1 -0
  160. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/NativeUIManager.d.ts +1 -1
  161. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.d.ts.map +1 -0
  162. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/RawDataManager.d.ts +2 -2
  163. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.d.ts.map +1 -0
  164. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/Utils/EventType.d.ts.map +1 -0
  165. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/VaultManager.d.ts +3 -3
  166. package/lib/typescript/src/HeadlessUniversalCheckout/Managers/VaultManager.d.ts.map +1 -0
  167. package/lib/typescript/src/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.d.ts.map +1 -0
  168. package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/RNPrimerHeadlessUniversalCheckout.d.ts +1 -2
  169. package/lib/typescript/src/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.d.ts.map +1 -0
  170. package/lib/typescript/src/HeadlessUniversalCheckout/types.d.ts.map +1 -0
  171. package/lib/typescript/src/Primer.d.ts.map +1 -0
  172. package/lib/typescript/{RNPrimer.d.ts → src/RNPrimer.d.ts} +2 -7
  173. package/lib/typescript/src/RNPrimer.d.ts.map +1 -0
  174. package/lib/typescript/src/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.d.ts.map +1 -0
  175. package/lib/typescript/{index.d.ts → src/index.d.ts} +35 -16
  176. package/lib/typescript/src/index.d.ts.map +1 -0
  177. package/lib/typescript/src/models/IssuingBank.d.ts.map +1 -0
  178. package/lib/typescript/src/models/NamedComponentStep.d.ts.map +1 -0
  179. package/lib/typescript/src/models/NamedComponentValidatableData.d.ts.map +1 -0
  180. package/lib/typescript/src/models/PrimerCheckoutAdditionalInfo.d.ts.map +1 -0
  181. package/lib/typescript/src/models/PrimerCheckoutData.d.ts.map +1 -0
  182. package/lib/typescript/src/models/PrimerCheckoutPaymentMethodData.d.ts.map +1 -0
  183. package/lib/typescript/src/models/PrimerClientSession.d.ts.map +1 -0
  184. package/lib/typescript/{models → src/models}/PrimerComponentDataValidation.d.ts +2 -2
  185. package/lib/typescript/src/models/PrimerComponentDataValidation.d.ts.map +1 -0
  186. package/lib/typescript/src/models/PrimerError.d.ts.map +1 -0
  187. package/lib/typescript/src/models/PrimerHandlers.d.ts.map +1 -0
  188. package/lib/typescript/src/models/PrimerHeadlessUniversalCheckoutPaymentMethod.d.ts.map +1 -0
  189. package/lib/typescript/src/models/PrimerImplementedRNCallbacks.d.ts.map +1 -0
  190. package/lib/typescript/src/models/PrimerInitializationData.d.ts.map +1 -0
  191. package/lib/typescript/src/models/PrimerInputElementType.d.ts.map +1 -0
  192. package/lib/typescript/src/models/PrimerInterfaces.d.ts.map +1 -0
  193. package/lib/typescript/src/models/PrimerPaymentMethodManagerCategory.d.ts.map +1 -0
  194. package/lib/typescript/src/models/PrimerPaymentMethodResource.d.ts.map +1 -0
  195. package/lib/typescript/src/models/PrimerPaymentMethodTokenData.d.ts.map +1 -0
  196. package/lib/typescript/src/models/PrimerRawData.d.ts.map +1 -0
  197. package/lib/typescript/src/models/PrimerSessionIntent.d.ts.map +1 -0
  198. package/lib/typescript/src/models/PrimerSettings.d.ts.map +1 -0
  199. package/lib/typescript/src/models/PrimerTheme.d.ts.map +1 -0
  200. package/lib/typescript/src/models/PrimerValidationError.d.ts.map +1 -0
  201. package/lib/typescript/{models → src/models}/PrimerValidationErrorResult.d.ts +1 -1
  202. package/lib/typescript/src/models/PrimerValidationErrorResult.d.ts.map +1 -0
  203. package/lib/typescript/{models → src/models}/PrimerVaultedPaymentMethod.d.ts +1 -1
  204. package/lib/typescript/src/models/PrimerVaultedPaymentMethod.d.ts.map +1 -0
  205. package/lib/typescript/src/models/PrimerVaultedPaymentMethodAdditionalData.d.ts.map +1 -0
  206. package/lib/typescript/{models → src/models}/PrimerVaultedPaymentMethodResult.d.ts +1 -1
  207. package/lib/typescript/src/models/PrimerVaultedPaymentMethodResult.d.ts.map +1 -0
  208. package/lib/typescript/src/models/RetailOutletsRetail.d.ts.map +1 -0
  209. package/lib/typescript/{models → src/models}/ach/AchCollectableData.d.ts +1 -1
  210. package/lib/typescript/src/models/ach/AchCollectableData.d.ts.map +1 -0
  211. package/lib/typescript/{models → src/models}/ach/AchSteps.d.ts +1 -1
  212. package/lib/typescript/src/models/ach/AchSteps.d.ts.map +1 -0
  213. package/lib/typescript/{models → src/models}/banks/BanksCollectableData.d.ts +1 -1
  214. package/lib/typescript/src/models/banks/BanksCollectableData.d.ts.map +1 -0
  215. package/lib/typescript/{models → src/models}/banks/BanksSteps.d.ts +2 -2
  216. package/lib/typescript/src/models/banks/BanksSteps.d.ts.map +1 -0
  217. package/lib/typescript/src/models/klarna/KlarnaPaymentCategory.d.ts.map +1 -0
  218. package/lib/typescript/{models → src/models}/klarna/KlarnaPaymentCollectableData.d.ts +2 -2
  219. package/lib/typescript/src/models/klarna/KlarnaPaymentCollectableData.d.ts.map +1 -0
  220. package/lib/typescript/{models → src/models}/klarna/KlarnaPaymentSteps.d.ts +2 -2
  221. package/lib/typescript/src/models/klarna/KlarnaPaymentSteps.d.ts.map +1 -0
  222. package/lib/typescript/src/specs/NativePrimer.d.ts +27 -0
  223. package/lib/typescript/src/specs/NativePrimer.d.ts.map +1 -0
  224. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  225. package/package.json +68 -26
  226. package/primer-io-react-native.podspec +2 -0
  227. package/src/HeadlessUniversalCheckout/Components/NativeResourceView.tsx +2 -1
  228. package/src/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.tsx +2 -1
  229. package/src/HeadlessUniversalCheckout/Managers/AssetsManager.ts +2 -2
  230. package/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.ts +9 -7
  231. package/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.ts +9 -7
  232. package/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.ts +13 -8
  233. package/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.ts +1 -1
  234. package/src/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.ts +3 -2
  235. package/src/HeadlessUniversalCheckout/Managers/VaultManager.ts +5 -5
  236. package/src/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.ts +2 -2
  237. package/src/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.ts +2 -2
  238. package/src/RNPrimer.ts +27 -45
  239. package/src/index.tsx +43 -18
  240. package/src/models/PrimerComponentDataValidation.ts +2 -2
  241. package/src/models/PrimerValidationErrorResult.ts +1 -1
  242. package/src/models/PrimerVaultedPaymentMethod.ts +1 -1
  243. package/src/models/PrimerVaultedPaymentMethodResult.ts +1 -1
  244. package/src/models/ach/AchCollectableData.ts +1 -1
  245. package/src/models/ach/AchSteps.ts +1 -1
  246. package/src/models/banks/BanksCollectableData.ts +1 -1
  247. package/src/models/banks/BanksSteps.ts +2 -2
  248. package/src/models/klarna/KlarnaPaymentCollectableData.ts +2 -2
  249. package/src/models/klarna/KlarnaPaymentSteps.ts +2 -2
  250. package/src/specs/NativePrimer.ts +43 -0
  251. package/src/utils/index.ts +3 -3
  252. package/android/.editorconfig +0 -2
  253. package/android/.project +0 -34
  254. package/android/.settings/org.eclipse.buildship.core.prefs +0 -13
  255. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  256. package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
  257. package/android/gradlew +0 -183
  258. package/android/gradlew.bat +0 -100
  259. package/android/src/main/java/com/primerioreactnative/ReactNativePackage.kt +0 -49
  260. package/ios/Pods/Manifest.lock +0 -3
  261. package/ios/Pods/Pods.xcodeproj/project.pbxproj +0 -352
  262. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative-acknowledgements.markdown +0 -3
  263. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative-acknowledgements.plist +0 -29
  264. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative-dummy.m +0 -5
  265. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative.debug.xcconfig +0 -8
  266. package/ios/Pods/Target Support Files/Pods-ReactNative/Pods-ReactNative.release.xcconfig +0 -8
  267. package/ios/Sources/RNTPrimer.m +0 -86
  268. package/lib/commonjs/HeadlessUniversalCheckout/Components/NativeResourceView.js +0 -30
  269. package/lib/commonjs/HeadlessUniversalCheckout/Components/NativeResourceView.js.map +0 -1
  270. package/lib/commonjs/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.js +0 -9
  271. package/lib/commonjs/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.js.map +0 -1
  272. package/lib/commonjs/HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView.js +0 -9
  273. package/lib/commonjs/HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView.js.map +0 -1
  274. package/lib/commonjs/HeadlessUniversalCheckout/Managers/AssetsManager.js +0 -90
  275. package/lib/commonjs/HeadlessUniversalCheckout/Managers/AssetsManager.js.map +0 -1
  276. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.js +0 -106
  277. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.js.map +0 -1
  278. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager.js +0 -38
  279. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager.js.map +0 -1
  280. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.js +0 -109
  281. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.js.map +0 -1
  282. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.js +0 -105
  283. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.js.map +0 -1
  284. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.js +0 -34
  285. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.js.map +0 -1
  286. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.js +0 -148
  287. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.js.map +0 -1
  288. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/Utils/EventType.js +0 -8
  289. package/lib/commonjs/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/Utils/EventType.js.map +0 -1
  290. package/lib/commonjs/HeadlessUniversalCheckout/Managers/VaultManager.js +0 -107
  291. package/lib/commonjs/HeadlessUniversalCheckout/Managers/VaultManager.js.map +0 -1
  292. package/lib/commonjs/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.js +0 -269
  293. package/lib/commonjs/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.js.map +0 -1
  294. package/lib/commonjs/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.js +0 -120
  295. package/lib/commonjs/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.js.map +0 -1
  296. package/lib/commonjs/HeadlessUniversalCheckout/types.js +0 -34
  297. package/lib/commonjs/HeadlessUniversalCheckout/types.js.map +0 -1
  298. package/lib/commonjs/Primer.js +0 -269
  299. package/lib/commonjs/Primer.js.map +0 -1
  300. package/lib/commonjs/RNPrimer.js +0 -219
  301. package/lib/commonjs/RNPrimer.js.map +0 -1
  302. package/lib/commonjs/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.js +0 -12
  303. package/lib/commonjs/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.js.map +0 -1
  304. package/lib/commonjs/index.js +0 -125
  305. package/lib/commonjs/index.js.map +0 -1
  306. package/lib/commonjs/models/IssuingBank.js +0 -2
  307. package/lib/commonjs/models/IssuingBank.js.map +0 -1
  308. package/lib/commonjs/models/NamedComponentStep.js +0 -2
  309. package/lib/commonjs/models/NamedComponentStep.js.map +0 -1
  310. package/lib/commonjs/models/NamedComponentValidatableData.js +0 -2
  311. package/lib/commonjs/models/NamedComponentValidatableData.js.map +0 -1
  312. package/lib/commonjs/models/PrimerCheckoutAdditionalInfo.js +0 -2
  313. package/lib/commonjs/models/PrimerCheckoutAdditionalInfo.js.map +0 -1
  314. package/lib/commonjs/models/PrimerCheckoutData.js +0 -11
  315. package/lib/commonjs/models/PrimerCheckoutData.js.map +0 -1
  316. package/lib/commonjs/models/PrimerCheckoutPaymentMethodData.js +0 -2
  317. package/lib/commonjs/models/PrimerCheckoutPaymentMethodData.js.map +0 -1
  318. package/lib/commonjs/models/PrimerClientSession.js +0 -2
  319. package/lib/commonjs/models/PrimerClientSession.js.map +0 -1
  320. package/lib/commonjs/models/PrimerComponentDataValidation.js +0 -6
  321. package/lib/commonjs/models/PrimerComponentDataValidation.js.map +0 -1
  322. package/lib/commonjs/models/PrimerCountryCode.js +0 -4
  323. package/lib/commonjs/models/PrimerCountryCode.js.map +0 -1
  324. package/lib/commonjs/models/PrimerCurrencyCode.js +0 -4
  325. package/lib/commonjs/models/PrimerCurrencyCode.js.map +0 -1
  326. package/lib/commonjs/models/PrimerError.js +0 -18
  327. package/lib/commonjs/models/PrimerError.js.map +0 -1
  328. package/lib/commonjs/models/PrimerHandlers.js +0 -2
  329. package/lib/commonjs/models/PrimerHandlers.js.map +0 -1
  330. package/lib/commonjs/models/PrimerHeadlessUniversalCheckoutPaymentMethod.js +0 -2
  331. package/lib/commonjs/models/PrimerHeadlessUniversalCheckoutPaymentMethod.js.map +0 -1
  332. package/lib/commonjs/models/PrimerImplementedRNCallbacks.js +0 -2
  333. package/lib/commonjs/models/PrimerImplementedRNCallbacks.js.map +0 -1
  334. package/lib/commonjs/models/PrimerInitializationData.js +0 -6
  335. package/lib/commonjs/models/PrimerInitializationData.js.map +0 -1
  336. package/lib/commonjs/models/PrimerInputElementType.js +0 -19
  337. package/lib/commonjs/models/PrimerInputElementType.js.map +0 -1
  338. package/lib/commonjs/models/PrimerInterfaces.js +0 -6
  339. package/lib/commonjs/models/PrimerInterfaces.js.map +0 -1
  340. package/lib/commonjs/models/PrimerPaymentMethodManagerCategory.js +0 -13
  341. package/lib/commonjs/models/PrimerPaymentMethodManagerCategory.js.map +0 -1
  342. package/lib/commonjs/models/PrimerPaymentMethodResource.js +0 -2
  343. package/lib/commonjs/models/PrimerPaymentMethodResource.js.map +0 -1
  344. package/lib/commonjs/models/PrimerPaymentMethodTokenData.js +0 -12
  345. package/lib/commonjs/models/PrimerPaymentMethodTokenData.js.map +0 -1
  346. package/lib/commonjs/models/PrimerRawData.js +0 -2
  347. package/lib/commonjs/models/PrimerRawData.js.map +0 -1
  348. package/lib/commonjs/models/PrimerSessionIntent.js +0 -12
  349. package/lib/commonjs/models/PrimerSessionIntent.js.map +0 -1
  350. package/lib/commonjs/models/PrimerSettings.js +0 -6
  351. package/lib/commonjs/models/PrimerSettings.js.map +0 -1
  352. package/lib/commonjs/models/PrimerTheme.js +0 -2
  353. package/lib/commonjs/models/PrimerTheme.js.map +0 -1
  354. package/lib/commonjs/models/PrimerValidationError.js +0 -2
  355. package/lib/commonjs/models/PrimerValidationError.js.map +0 -1
  356. package/lib/commonjs/models/PrimerValidationErrorResult.js +0 -6
  357. package/lib/commonjs/models/PrimerValidationErrorResult.js.map +0 -1
  358. package/lib/commonjs/models/PrimerVaultedPaymentMethod.js +0 -6
  359. package/lib/commonjs/models/PrimerVaultedPaymentMethod.js.map +0 -1
  360. package/lib/commonjs/models/PrimerVaultedPaymentMethodAdditionalData.js +0 -2
  361. package/lib/commonjs/models/PrimerVaultedPaymentMethodAdditionalData.js.map +0 -1
  362. package/lib/commonjs/models/PrimerVaultedPaymentMethodResult.js +0 -6
  363. package/lib/commonjs/models/PrimerVaultedPaymentMethodResult.js.map +0 -1
  364. package/lib/commonjs/models/RetailOutletsRetail.js +0 -2
  365. package/lib/commonjs/models/RetailOutletsRetail.js.map +0 -1
  366. package/lib/commonjs/models/ach/AchCollectableData.js +0 -6
  367. package/lib/commonjs/models/ach/AchCollectableData.js.map +0 -1
  368. package/lib/commonjs/models/ach/AchSteps.js +0 -6
  369. package/lib/commonjs/models/ach/AchSteps.js.map +0 -1
  370. package/lib/commonjs/models/banks/BanksCollectableData.js +0 -6
  371. package/lib/commonjs/models/banks/BanksCollectableData.js.map +0 -1
  372. package/lib/commonjs/models/banks/BanksSteps.js +0 -6
  373. package/lib/commonjs/models/banks/BanksSteps.js.map +0 -1
  374. package/lib/commonjs/models/klarna/KlarnaPaymentCategory.js +0 -2
  375. package/lib/commonjs/models/klarna/KlarnaPaymentCategory.js.map +0 -1
  376. package/lib/commonjs/models/klarna/KlarnaPaymentCollectableData.js +0 -6
  377. package/lib/commonjs/models/klarna/KlarnaPaymentCollectableData.js.map +0 -1
  378. package/lib/commonjs/models/klarna/KlarnaPaymentSteps.js +0 -6
  379. package/lib/commonjs/models/klarna/KlarnaPaymentSteps.js.map +0 -1
  380. package/lib/commonjs/utils/index.js +0 -39
  381. package/lib/commonjs/utils/index.js.map +0 -1
  382. package/lib/module/models/PrimerCountryCode.js +0 -2
  383. package/lib/module/models/PrimerCountryCode.js.map +0 -1
  384. package/lib/module/models/PrimerCurrencyCode.js +0 -2
  385. package/lib/module/models/PrimerCurrencyCode.js.map +0 -1
  386. package/lib/typescript/HeadlessUniversalCheckout/Components/NativeResourceView.d.ts.map +0 -1
  387. package/lib/typescript/HeadlessUniversalCheckout/Components/PrimerGooglePayButton.d.ts.map +0 -1
  388. package/lib/typescript/HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView.d.ts.map +0 -1
  389. package/lib/typescript/HeadlessUniversalCheckout/Managers/AssetsManager.d.ts.map +0 -1
  390. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager.d.ts.map +0 -1
  391. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager.d.ts.map +0 -1
  392. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager.d.ts.map +0 -1
  393. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/KlarnaManager.d.ts.map +0 -1
  394. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/NativeUIManager.d.ts.map +0 -1
  395. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/RawDataManager.d.ts.map +0 -1
  396. package/lib/typescript/HeadlessUniversalCheckout/Managers/PaymentMethodManagers/Utils/EventType.d.ts.map +0 -1
  397. package/lib/typescript/HeadlessUniversalCheckout/Managers/VaultManager.d.ts.map +0 -1
  398. package/lib/typescript/HeadlessUniversalCheckout/PrimerHeadlessUniversalCheckout.d.ts.map +0 -1
  399. package/lib/typescript/HeadlessUniversalCheckout/RNPrimerHeadlessUniversalCheckout.d.ts.map +0 -1
  400. package/lib/typescript/HeadlessUniversalCheckout/types.d.ts.map +0 -1
  401. package/lib/typescript/Primer.d.ts.map +0 -1
  402. package/lib/typescript/RNPrimer.d.ts.map +0 -1
  403. package/lib/typescript/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.d.ts.map +0 -1
  404. package/lib/typescript/index.d.ts.map +0 -1
  405. package/lib/typescript/models/IssuingBank.d.ts.map +0 -1
  406. package/lib/typescript/models/NamedComponentStep.d.ts.map +0 -1
  407. package/lib/typescript/models/NamedComponentValidatableData.d.ts.map +0 -1
  408. package/lib/typescript/models/PrimerCheckoutAdditionalInfo.d.ts.map +0 -1
  409. package/lib/typescript/models/PrimerCheckoutData.d.ts.map +0 -1
  410. package/lib/typescript/models/PrimerCheckoutPaymentMethodData.d.ts.map +0 -1
  411. package/lib/typescript/models/PrimerClientSession.d.ts.map +0 -1
  412. package/lib/typescript/models/PrimerComponentDataValidation.d.ts.map +0 -1
  413. package/lib/typescript/models/PrimerCountryCode.d.ts +0 -4
  414. package/lib/typescript/models/PrimerCountryCode.d.ts.map +0 -1
  415. package/lib/typescript/models/PrimerCurrencyCode.d.ts +0 -4
  416. package/lib/typescript/models/PrimerCurrencyCode.d.ts.map +0 -1
  417. package/lib/typescript/models/PrimerError.d.ts.map +0 -1
  418. package/lib/typescript/models/PrimerHandlers.d.ts.map +0 -1
  419. package/lib/typescript/models/PrimerHeadlessUniversalCheckoutPaymentMethod.d.ts.map +0 -1
  420. package/lib/typescript/models/PrimerImplementedRNCallbacks.d.ts.map +0 -1
  421. package/lib/typescript/models/PrimerInitializationData.d.ts.map +0 -1
  422. package/lib/typescript/models/PrimerInputElementType.d.ts.map +0 -1
  423. package/lib/typescript/models/PrimerInterfaces.d.ts.map +0 -1
  424. package/lib/typescript/models/PrimerPaymentMethodManagerCategory.d.ts.map +0 -1
  425. package/lib/typescript/models/PrimerPaymentMethodResource.d.ts.map +0 -1
  426. package/lib/typescript/models/PrimerPaymentMethodTokenData.d.ts.map +0 -1
  427. package/lib/typescript/models/PrimerRawData.d.ts.map +0 -1
  428. package/lib/typescript/models/PrimerSessionIntent.d.ts.map +0 -1
  429. package/lib/typescript/models/PrimerSettings.d.ts.map +0 -1
  430. package/lib/typescript/models/PrimerTheme.d.ts.map +0 -1
  431. package/lib/typescript/models/PrimerValidationError.d.ts.map +0 -1
  432. package/lib/typescript/models/PrimerValidationErrorResult.d.ts.map +0 -1
  433. package/lib/typescript/models/PrimerVaultedPaymentMethod.d.ts.map +0 -1
  434. package/lib/typescript/models/PrimerVaultedPaymentMethodAdditionalData.d.ts.map +0 -1
  435. package/lib/typescript/models/PrimerVaultedPaymentMethodResult.d.ts.map +0 -1
  436. package/lib/typescript/models/RetailOutletsRetail.d.ts.map +0 -1
  437. package/lib/typescript/models/ach/AchCollectableData.d.ts.map +0 -1
  438. package/lib/typescript/models/ach/AchSteps.d.ts.map +0 -1
  439. package/lib/typescript/models/banks/BanksCollectableData.d.ts.map +0 -1
  440. package/lib/typescript/models/banks/BanksSteps.d.ts.map +0 -1
  441. package/lib/typescript/models/klarna/KlarnaPaymentCategory.d.ts.map +0 -1
  442. package/lib/typescript/models/klarna/KlarnaPaymentCollectableData.d.ts.map +0 -1
  443. package/lib/typescript/models/klarna/KlarnaPaymentSteps.d.ts.map +0 -1
  444. package/lib/typescript/utils/index.d.ts.map +0 -1
  445. package/src/models/PrimerCountryCode.ts +0 -249
  446. package/src/models/PrimerCurrencyCode.ts +0 -182
  447. /package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Components/PrimerKlarnaPaymentView.d.ts +0 -0
  448. /package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/AchMandateManager.d.ts +0 -0
  449. /package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/Managers/PaymentMethodManagers/Utils/EventType.d.ts +0 -0
  450. /package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/PrimerHeadlessUniversalCheckout.d.ts +0 -0
  451. /package/lib/typescript/{HeadlessUniversalCheckout → src/HeadlessUniversalCheckout}/types.d.ts +0 -0
  452. /package/lib/typescript/{Primer.d.ts → src/Primer.d.ts} +0 -0
  453. /package/lib/typescript/{RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.d.ts → src/RNTPrimerHeadlessUniversalCheckoutCardFormUIManager.d.ts} +0 -0
  454. /package/lib/typescript/{models → src/models}/IssuingBank.d.ts +0 -0
  455. /package/lib/typescript/{models → src/models}/NamedComponentStep.d.ts +0 -0
  456. /package/lib/typescript/{models → src/models}/NamedComponentValidatableData.d.ts +0 -0
  457. /package/lib/typescript/{models → src/models}/PrimerCheckoutAdditionalInfo.d.ts +0 -0
  458. /package/lib/typescript/{models → src/models}/PrimerCheckoutData.d.ts +0 -0
  459. /package/lib/typescript/{models → src/models}/PrimerCheckoutPaymentMethodData.d.ts +0 -0
  460. /package/lib/typescript/{models → src/models}/PrimerClientSession.d.ts +0 -0
  461. /package/lib/typescript/{models → src/models}/PrimerError.d.ts +0 -0
  462. /package/lib/typescript/{models → src/models}/PrimerHandlers.d.ts +0 -0
  463. /package/lib/typescript/{models → src/models}/PrimerHeadlessUniversalCheckoutPaymentMethod.d.ts +0 -0
  464. /package/lib/typescript/{models → src/models}/PrimerImplementedRNCallbacks.d.ts +0 -0
  465. /package/lib/typescript/{models → src/models}/PrimerInitializationData.d.ts +0 -0
  466. /package/lib/typescript/{models → src/models}/PrimerInputElementType.d.ts +0 -0
  467. /package/lib/typescript/{models → src/models}/PrimerInterfaces.d.ts +0 -0
  468. /package/lib/typescript/{models → src/models}/PrimerPaymentMethodManagerCategory.d.ts +0 -0
  469. /package/lib/typescript/{models → src/models}/PrimerPaymentMethodResource.d.ts +0 -0
  470. /package/lib/typescript/{models → src/models}/PrimerPaymentMethodTokenData.d.ts +0 -0
  471. /package/lib/typescript/{models → src/models}/PrimerRawData.d.ts +0 -0
  472. /package/lib/typescript/{models → src/models}/PrimerSessionIntent.d.ts +0 -0
  473. /package/lib/typescript/{models → src/models}/PrimerSettings.d.ts +0 -0
  474. /package/lib/typescript/{models → src/models}/PrimerTheme.d.ts +0 -0
  475. /package/lib/typescript/{models → src/models}/PrimerValidationError.d.ts +0 -0
  476. /package/lib/typescript/{models → src/models}/PrimerVaultedPaymentMethodAdditionalData.d.ts +0 -0
  477. /package/lib/typescript/{models → src/models}/RetailOutletsRetail.d.ts +0 -0
  478. /package/lib/typescript/{models → src/models}/klarna/KlarnaPaymentCategory.d.ts +0 -0
  479. /package/lib/typescript/{utils → src/utils}/index.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BanksCollectableData.d.ts","sourceRoot":"","sources":["../../../../../src/models/banks/BanksCollectableData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAEtF,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,MAAM,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,mBAAmB,EAAE,gBAAgB,CAAC;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,6BAA6B,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,mBAAmB,EAAE,QAAQ,CAAC;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ,GAAG,6BAA6B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { IssuingBank } from '../IssuingBank';
2
- import { NamedComponentStep } from '../NamedComponentStep';
1
+ import type { IssuingBank } from '../IssuingBank';
2
+ import type { NamedComponentStep } from '../NamedComponentStep';
3
3
  export type BanksStep = BanksLoading | BanksRetrieved;
4
4
  /**
5
5
  * A type representing the loading of the bank list.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BanksSteps.d.ts","sourceRoot":"","sources":["../../../../../src/models/banks/BanksSteps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,cAAc,CAAC;AAEtD;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,EAAE,cAAc,CAAC;CAC1B,GAAG,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;OAEG;IACH,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KlarnaPaymentCategory.d.ts","sourceRoot":"","sources":["../../../../../src/models/klarna/KlarnaPaymentCategory.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC;AAE3D;;GAEG;AACH,UAAU,sBAAsB;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
@@ -1,5 +1,5 @@
1
- import { NamedComponentValidatableData } from '../NamedComponentValidatableData';
2
- import { KlarnaPaymentCategory } from './KlarnaPaymentCategory';
1
+ import type { NamedComponentValidatableData } from '../NamedComponentValidatableData';
2
+ import type { KlarnaPaymentCategory } from './KlarnaPaymentCategory';
3
3
  export type KlarnaPaymentValidatableData = KlarnaPaymentOptions | KlarnaPaymentFinalization;
4
4
  /**
5
5
  * A type representing Klarna payment options required for configuring the {@link KlarnaComponent}.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KlarnaPaymentCollectableData.d.ts","sourceRoot":"","sources":["../../../../../src/models/klarna/KlarnaPaymentCollectableData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACtF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,GAAG,yBAAyB,CAAC;AAE5F;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,mBAAmB,EAAE,sBAAsB,CAAC;IAE5C;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,eAAe,EAAE,qBAAqB,CAAC;CACxC,GAAG,6BAA6B,CAAC;AAElC;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,mBAAmB,EAAE,2BAA2B,CAAC;CAClD,GAAG,6BAA6B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { NamedComponentStep } from './../NamedComponentStep';
2
- import { KlarnaPaymentCategory } from './KlarnaPaymentCategory';
1
+ import type { NamedComponentStep } from './../NamedComponentStep';
2
+ import type { KlarnaPaymentCategory } from './KlarnaPaymentCategory';
3
3
  export type KlarnaPaymentStep = PaymentSessionCreated | PaymentViewLoaded | PaymentSessionAuthorized | PaymentSessionFinalized;
4
4
  /**
5
5
  * A type that indicates that the payment view is loaded and ready to be displayed.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"KlarnaPaymentSteps.d.ts","sourceRoot":"","sources":["../../../../../src/models/klarna/KlarnaPaymentSteps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,MAAM,iBAAiB,GACzB,qBAAqB,GACrB,iBAAiB,GACjB,wBAAwB,GACxB,uBAAuB,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAAE,QAAQ,EAAE,mBAAmB,CAAA;CAAE,GAAG,kBAAkB,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,uBAAuB,CAAC;IAClC;;OAEG;IACH,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;CAC5C,GAAG,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,EAAE,0BAA0B,CAAC;IACrC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,kBAAkB,CAAC;AAEvB;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAAE,QAAQ,EAAE,yBAAyB,CAAA;CAAE,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { TurboModule, CodegenTypes } from 'react-native';
2
+ export type EmittedEvent = {
3
+ eventType: string;
4
+ data: string;
5
+ };
6
+ export interface Spec extends TurboModule {
7
+ configure(settings?: string): Promise<void>;
8
+ showUniversalCheckoutWithClientToken(clientToken: string): Promise<void>;
9
+ showVaultManagerWithClientToken(clientToken: string): Promise<void>;
10
+ showPaymentMethod(paymentMethod: string, intent: string, clientToken: string): Promise<void>;
11
+ dismiss(): Promise<void>;
12
+ cleanUp(): Promise<void>;
13
+ handleTokenizationNewClientToken(newClientToken: string): Promise<void>;
14
+ handleTokenizationSuccess(): Promise<void>;
15
+ handleTokenizationFailure(errorMessage: string): Promise<void>;
16
+ handleResumeWithNewClientToken(newClientToken: string): Promise<void>;
17
+ handleResumeSuccess(): Promise<void>;
18
+ handleResumeFailure(errorMessage: string): Promise<void>;
19
+ handlePaymentCreationAbort(errorMessage: string): Promise<void>;
20
+ handlePaymentCreationContinue(): Promise<void>;
21
+ showErrorMessage(errorMessage: string): Promise<void>;
22
+ setImplementedRNCallbacks(implementedRNCallbacks: string): Promise<void>;
23
+ readonly onEvent: CodegenTypes.EventEmitter<EmittedEvent>;
24
+ }
25
+ declare const _default: Spec;
26
+ export default _default;
27
+ //# sourceMappingURL=NativePrimer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativePrimer.d.ts","sourceRoot":"","sources":["../../../../src/specs/NativePrimer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG9D,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,SAAS,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG5C,oCAAoC,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,+BAA+B,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACpE,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7F,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAGzB,gCAAgC,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxE,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,yBAAyB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAG/D,8BAA8B,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtE,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGzD,0BAA0B,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,6BAA6B,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAG/C,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD,yBAAyB,CAAC,sBAAsB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzE,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;CAC3D;;AAGD,wBAAsE"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAwBxD;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,QAOrE"}
package/package.json CHANGED
@@ -1,33 +1,47 @@
1
1
  {
2
2
  "name": "@primer-io/react-native",
3
- "version": "2.38.0",
3
+ "version": "2.39.1",
4
4
  "description": "Primer SDK for RN",
5
- "main": "lib/commonjs/index",
6
- "module": "lib/module/index",
7
- "types": "lib/typescript/index.d.ts",
8
- "react-native": "src/index",
9
- "source": "src/index",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
10
15
  "files": [
11
16
  "src",
12
17
  "lib",
13
18
  "android",
14
19
  "ios",
15
- "primer-io-react-native.podspec",
16
- "!android/build",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
17
23
  "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
18
29
  "!**/__tests__",
19
30
  "!**/__fixtures__",
20
- "!**/__mocks__"
31
+ "!**/__mocks__",
32
+ "!**/.*"
21
33
  ],
22
34
  "scripts": {
23
- "test": "jest",
24
35
  "typescript": "tsc --noEmit",
25
36
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
26
37
  "build": "bob build",
27
38
  "prepare": "bob build",
28
39
  "release": "release-it",
29
- "example": "yarn --cwd example",
30
- "bootstrap": "yarn example && yarn && yarn pods"
40
+ "example": "yarn workspace @primer-io/react-native-example",
41
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
42
+ "bootstrap": "yarn example pods",
43
+ "test": "jest src/__tests__ --coverage",
44
+ "test:unit:coverage:lcov": "yarn test && node scripts/aggregate-coverage.js && nyc report --reporter lcov"
31
45
  },
32
46
  "keywords": [
33
47
  "react-native",
@@ -49,26 +63,33 @@
49
63
  "access": "public"
50
64
  },
51
65
  "devDependencies": {
52
- "@commitlint/config-conventional": "^11.0.0",
66
+ "@commitlint/config-conventional": "^19.8.1",
67
+ "@eslint/compat": "^1.4.0",
68
+ "@react-native-community/cli": "20.0.0",
53
69
  "@react-native-community/eslint-config": "^2.0.0",
54
70
  "@release-it/conventional-changelog": "^5.1.1",
55
71
  "@tsconfig/react-native": "^3.0.0",
56
- "@types/jest": "^26.0.0",
72
+ "@types/jest": "^29.5.14",
57
73
  "@types/react": "^19.1.0",
58
- "@types/react-native": "0.72.2",
59
- "commitlint": "^11.0.0",
60
- "eslint": "^7.0.0",
61
- "eslint-config-prettier": "^7.0.0",
62
- "eslint-plugin-prettier": "5.2.1",
63
- "husky": "^4.2.5",
74
+ "commitlint": "^19.8.1",
75
+ "danger": "^13.0.4",
76
+ "del-cli": "^6.0.0",
77
+ "eslint": "^9.35.0",
78
+ "eslint-config-prettier": "^10.1.8",
79
+ "eslint-plugin-prettier": "^5.5.4",
64
80
  "jest": "^29.7.0",
81
+ "nyc": "^15.1.0",
65
82
  "pod-install": "^0.1.0",
66
- "prettier": "3.4.2",
67
- "react-native-builder-bob": "^0.20.1",
83
+ "prettier": "3.6.2",
84
+ "react": "19.1.0",
85
+ "react-native": "0.81.1",
86
+ "react-native-builder-bob": "^0.40.13",
68
87
  "react-test-renderer": "19.1.0",
69
- "typescript": "^5.8.3",
88
+ "slack-message-builder": "^1.2.1",
70
89
  "ts-jest": "^29.1.2",
71
- "nyc": "^15.1.0"
90
+ "turbo": "^2.5.6",
91
+ "typescript": "^5.9.2",
92
+ "typescript-eslint": "^8.46.1"
72
93
  },
73
94
  "peerDependencies": {
74
95
  "react": ">=16.8.0",
@@ -77,6 +98,10 @@
77
98
  "engines": {
78
99
  "node": ">=20"
79
100
  },
101
+ "workspaces": [
102
+ "example"
103
+ ],
104
+ "packageManager": "yarn@3.6.1",
80
105
  "release-it": {
81
106
  "git": {
82
107
  "commitMessage": "chore: release ${version}",
@@ -129,8 +154,12 @@
129
154
  "source": "src",
130
155
  "output": "lib",
131
156
  "targets": [
132
- "commonjs",
133
- "module",
157
+ [
158
+ "module",
159
+ {
160
+ "esm": true
161
+ }
162
+ ],
134
163
  [
135
164
  "typescript",
136
165
  {
@@ -138,5 +167,18 @@
138
167
  }
139
168
  ]
140
169
  ]
170
+ },
171
+ "codegenConfig": {
172
+ "name": "NativePrimerSpec",
173
+ "type": "modules",
174
+ "jsSrcsDir": "src/specs",
175
+ "android": {
176
+ "javaPackageName": "com.primerioreactnative"
177
+ },
178
+ "ios": {
179
+ "modulesProvider": {
180
+ "NativePrimer": "RCTNativePrimer"
181
+ }
182
+ }
141
183
  }
142
184
  }
@@ -21,4 +21,6 @@ Pod::Spec.new do |s|
21
21
  s.pod_target_xcconfig = {
22
22
  "SWIFT_ENABLE_EXPLICIT_MODULES" => "NO"
23
23
  }
24
+
25
+ install_modules_dependencies(s)
24
26
  end
@@ -1,4 +1,5 @@
1
- import { GestureResponderEvent, StyleSheet, TouchableOpacity, ViewStyle, NativeModules } from 'react-native';
1
+ import { StyleSheet, TouchableOpacity, NativeModules } from 'react-native';
2
+ import type { GestureResponderEvent, ViewStyle } from 'react-native';
2
3
  import { PrimerGooglePayButton } from './PrimerGooglePayButton';
3
4
  import React from 'react';
4
5
 
@@ -1,4 +1,5 @@
1
- import { requireNativeComponent, ViewProps } from 'react-native';
1
+ import { requireNativeComponent } from 'react-native';
2
+ import type { ViewProps } from 'react-native';
2
3
 
3
4
  interface PrimerGooglePayButtonProps extends ViewProps {}
4
5
 
@@ -1,5 +1,5 @@
1
- import { Resource } from 'src';
2
- import { IPrimerAsset as Asset } from '../../models/PrimerPaymentMethodResource';
1
+ import type { IPrimerPaymentMethodResource as Resource } from '../../models/PrimerPaymentMethodResource';
2
+ import type { IPrimerAsset as Asset } from '../../models/PrimerPaymentMethodResource';
3
3
  import { NativeModules } from 'react-native';
4
4
 
5
5
  const { RNTPrimerHeadlessUniversalCheckoutAssetsManager } = NativeModules;
@@ -1,14 +1,16 @@
1
- import { NativeEventEmitter, NativeModules, EmitterSubscription } from 'react-native';
2
- import {
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import type { EmitterSubscription } from 'react-native';
3
+ import type {
3
4
  PrimerComponentDataValidationError,
4
5
  PrimerInvalidComponentData,
5
6
  PrimerValidComponentData,
6
7
  PrimerValidatingComponentData,
7
- } from 'src/models/PrimerComponentDataValidation';
8
- import { PrimerError } from 'src/models/PrimerError';
9
- import { EventType, eventTypes } from './Utils/EventType';
10
- import { AchStep } from 'src/models/ach/AchSteps';
11
- import { AchValidatableData } from 'src/models/ach/AchCollectableData';
8
+ } from '../../../models/PrimerComponentDataValidation';
9
+ import { PrimerError } from '../../../models/PrimerError';
10
+ import { eventTypes } from './Utils/EventType';
11
+ import type { EventType } from './Utils/EventType';
12
+ import type { AchStep } from '../../../models/ach/AchSteps';
13
+ import type { AchValidatableData } from '../../../models/ach/AchCollectableData';
12
14
 
13
15
  const { RNTPrimerHeadlessUniversalCheckoutStripeAchUserDetailsComponent } = NativeModules;
14
16
 
@@ -1,14 +1,16 @@
1
- import { NativeEventEmitter, NativeModules, EmitterSubscription } from 'react-native';
2
- import { BanksValidatableData } from 'src/models/banks/BanksCollectableData';
3
- import {
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import type { EmitterSubscription } from 'react-native';
3
+ import type { BanksValidatableData } from '../../../models/banks/BanksCollectableData';
4
+ import type {
4
5
  PrimerComponentDataValidationError,
5
6
  PrimerInvalidComponentData,
6
7
  PrimerValidComponentData,
7
8
  PrimerValidatingComponentData,
8
- } from 'src/models/PrimerComponentDataValidation';
9
- import { PrimerError } from 'src/models/PrimerError';
10
- import { BanksStep } from 'src/models/banks/BanksSteps';
11
- import { EventType, eventTypes } from './Utils/EventType';
9
+ } from '../../../models/PrimerComponentDataValidation';
10
+ import { PrimerError } from '../../../models/PrimerError';
11
+ import type { BanksStep } from '../../../models/banks/BanksSteps';
12
+ import { eventTypes } from './Utils/EventType';
13
+ import type { EventType } from './Utils/EventType';
12
14
 
13
15
  const { RNTPrimerHeadlessUniversalCheckoutBanksComponent } = NativeModules;
14
16
 
@@ -1,15 +1,20 @@
1
- import { NativeEventEmitter, NativeModules, EmitterSubscription } from 'react-native';
2
- import {
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import type { EmitterSubscription } from 'react-native';
3
+ import type {
3
4
  PrimerComponentDataValidationError,
4
5
  PrimerInvalidComponentData,
5
6
  PrimerValidComponentData,
6
7
  PrimerValidatingComponentData,
7
- } from 'src/models/PrimerComponentDataValidation';
8
- import { PrimerError } from 'src/models/PrimerError';
9
- import { KlarnaPaymentOptions, KlarnaPaymentValidatableData } from 'src/models/klarna/KlarnaPaymentCollectableData';
10
- import { KlarnaPaymentStep } from 'src/models/klarna/KlarnaPaymentSteps';
11
- import { EventType, eventTypes } from './Utils/EventType';
12
- import { PrimerSessionIntent } from 'src/models/PrimerSessionIntent';
8
+ } from '../../../models/PrimerComponentDataValidation';
9
+ import { PrimerError } from '../../../models/PrimerError';
10
+ import type {
11
+ KlarnaPaymentOptions,
12
+ KlarnaPaymentValidatableData,
13
+ } from '../../../models/klarna/KlarnaPaymentCollectableData';
14
+ import type { KlarnaPaymentStep } from '../../../models/klarna/KlarnaPaymentSteps';
15
+ import { eventTypes } from './Utils/EventType';
16
+ import type { EventType } from './Utils/EventType';
17
+ import { PrimerSessionIntent } from '../../../models/PrimerSessionIntent';
13
18
 
14
19
  const { RNTPrimerHeadlessUniversalCheckoutKlarnaComponent } = NativeModules;
15
20
 
@@ -1,5 +1,5 @@
1
1
  import { NativeModules } from 'react-native';
2
- import type { PrimerSessionIntent } from 'src/models/PrimerSessionIntent';
2
+ import type { PrimerSessionIntent } from '../../../models/PrimerSessionIntent';
3
3
 
4
4
  const { RNTPrimerHeadlessUniversalPaymentMethodNativeUIManager } = NativeModules;
5
5
 
@@ -1,6 +1,7 @@
1
1
  import { type PrimerRawData as RawData } from '../../../models/PrimerRawData';
2
- import { NativeEventEmitter, NativeModules, EmitterSubscription, EventSubscription } from 'react-native';
3
- import type { PrimerInitializationData } from 'src/models/PrimerInitializationData';
2
+ import { NativeEventEmitter, NativeModules } from 'react-native';
3
+ import type { EmitterSubscription, EventSubscription } from 'react-native';
4
+ import type { PrimerInitializationData } from '../../../models/PrimerInitializationData';
4
5
  import { PrimerError } from '../../../models/PrimerError';
5
6
  import type { PrimerInputElementType } from '../../../models/PrimerInputElementType';
6
7
 
@@ -1,9 +1,9 @@
1
1
  import { NativeModules } from 'react-native';
2
- import { PrimerValidationError as ValidationError } from 'src/models/PrimerValidationError';
3
- import { PrimerVaultedPaymentMethod as VaultedPaymentMethod } from 'src/models/PrimerVaultedPaymentMethod';
4
- import { PrimerVaultedPaymentMethodAdditionalData as VaultedPaymentMethodAdditionalData } from 'src/models/PrimerVaultedPaymentMethodAdditionalData';
5
- import { PrimerVaultedPaymentMethodResult } from 'src/models/PrimerVaultedPaymentMethodResult';
6
- import { PrimerValidationErrorResult } from 'src/models/PrimerValidationErrorResult';
2
+ import type { PrimerValidationError as ValidationError } from '../../models/PrimerValidationError';
3
+ import type { PrimerVaultedPaymentMethod as VaultedPaymentMethod } from '../../models/PrimerVaultedPaymentMethod';
4
+ import type { PrimerVaultedPaymentMethodAdditionalData as VaultedPaymentMethodAdditionalData } from '../../models/PrimerVaultedPaymentMethodAdditionalData';
5
+ import type { PrimerVaultedPaymentMethodResult } from '../../models/PrimerVaultedPaymentMethodResult';
6
+ import type { PrimerValidationErrorResult } from '../../models/PrimerValidationErrorResult';
7
7
 
8
8
  const { RNPrimerHeadlessUniversalCheckoutVaultManager } = NativeModules;
9
9
 
@@ -6,12 +6,12 @@ import type { PrimerSettings } from '../models/PrimerSettings';
6
6
  import type { PrimerClientSession } from '../models/PrimerClientSession';
7
7
  import { PrimerError } from '../models/PrimerError';
8
8
  import type { PrimerPaymentMethodTokenData } from '../models/PrimerPaymentMethodTokenData';
9
- import type { PrimerImplementedRNCallbacks } from 'src/models/PrimerImplementedRNCallbacks';
9
+ import type { PrimerImplementedRNCallbacks } from '../models/PrimerImplementedRNCallbacks';
10
10
  import type { IPrimerHeadlessUniversalCheckoutPaymentMethod } from '../models/PrimerHeadlessUniversalCheckoutPaymentMethod';
11
11
  import type {
12
12
  PrimerHeadlessUniversalCheckoutResumeHandler,
13
13
  PrimerPaymentCreationHandler,
14
- } from 'src/models/PrimerHandlers';
14
+ } from '../models/PrimerHandlers';
15
15
 
16
16
  ///////////////////////////////////////////
17
17
  // DECISION HANDLERS
@@ -1,6 +1,6 @@
1
- import { NativeEventEmitter, NativeModules, EmitterSubscription } from 'react-native';
1
+ import { NativeEventEmitter, NativeModules } from 'react-native';
2
+ import type { EmitterSubscription, EventSubscription } from 'react-native';
2
3
  import type { PrimerSettings } from '../models/PrimerSettings';
3
- import { EventSubscription } from 'react-native';
4
4
 
5
5
  const { PrimerHeadlessUniversalCheckout } = NativeModules;
6
6
 
package/src/RNPrimer.ts CHANGED
@@ -1,9 +1,14 @@
1
- import { NativeEventEmitter, NativeModules, EmitterSubscription } from 'react-native';
2
1
  import type { PrimerSettings } from './models/PrimerSettings';
3
- import { EventSubscription } from 'react-native';
2
+ import type { EventSubscription } from 'react-native';
3
+ import NativePrimer from './specs/NativePrimer';
4
4
 
5
- const { NativePrimer } = NativeModules;
6
- const eventEmitter = new NativeEventEmitter(NativePrimer);
5
+ import { NativeEventEmitter, NativeModules } from 'react-native';
6
+
7
+ // Create the event emitter instance for old architecture
8
+ const nativeEventEmitter = new NativeEventEmitter(NativeModules.NativePrimer);
9
+
10
+ // Subscriptions
11
+ let subscriptions: EventSubscription[] = [];
7
12
 
8
13
  type EventType =
9
14
  | 'onCheckoutComplete'
@@ -24,39 +29,29 @@ export interface IPrimerError {
24
29
  recoverySuggestion?: string;
25
30
  }
26
31
 
27
- const eventTypes: EventType[] = [
28
- 'onCheckoutComplete',
29
- 'onBeforeClientSessionUpdate',
30
- 'onClientSessionUpdate',
31
- 'onBeforePaymentCreate',
32
- 'onError',
33
- 'onDismiss',
34
- 'onTokenizeSuccess',
35
- 'onResumeSuccess',
36
- 'onCheckoutReceivedAdditionalInfo',
37
- 'onResumePending',
38
- 'detectImplementedRNCallbacks',
39
- ];
40
-
41
32
  const RNPrimer = {
42
33
  ///////////////////////////////////////////
43
34
  // Event Emitter
44
35
  ///////////////////////////////////////////
45
36
 
46
- addListener(eventType: EventType, listener: (...args: any[]) => any): EventSubscription {
47
- return eventEmitter.addListener(eventType, listener);
48
- },
49
-
50
- removeListener(subscription: EmitterSubscription) {
51
- subscription.remove();
37
+ addListener(eventType: EventType, listener: (data: any) => void) {
38
+ if (NativePrimer.onEvent) {
39
+ // New Architecture
40
+ subscriptions.push(
41
+ NativePrimer.onEvent((emittedEvent: any) => {
42
+ if (emittedEvent.eventType === eventType) {
43
+ listener(emittedEvent.data);
44
+ }
45
+ })
46
+ );
47
+ } else {
48
+ // Old Architecture - listen to individual events
49
+ subscriptions.push(nativeEventEmitter.addListener(eventType, listener));
50
+ }
52
51
  },
53
-
54
- removeAllListenersForEvent(eventType: EventType) {
55
- eventEmitter.removeAllListeners(eventType);
56
- },
57
-
58
52
  removeAllListeners() {
59
- eventTypes.forEach((eventType) => RNPrimer.removeAllListenersForEvent(eventType));
53
+ subscriptions.forEach((subscription) => subscription.remove());
54
+ subscriptions = [];
60
55
  },
61
56
 
62
57
  ///////////////////////////////////////////
@@ -84,7 +79,7 @@ const RNPrimer = {
84
79
  });
85
80
  },
86
81
 
87
- showVaultManager: (clientToken: string | undefined): Promise<void> => {
82
+ showVaultManager: (clientToken: string): Promise<void> => {
88
83
  return new Promise(async (resolve, reject) => {
89
84
  try {
90
85
  await NativePrimer.showVaultManagerWithClientToken(clientToken);
@@ -194,7 +189,7 @@ const RNPrimer = {
194
189
  handleResumeFailure: (errorMessage: string | null): Promise<void> => {
195
190
  return new Promise(async (resolve, reject) => {
196
191
  try {
197
- await NativePrimer.handleTokenizationFailure(errorMessage || '');
192
+ await NativePrimer.handleResumeFailure(errorMessage || '');
198
193
  resolve();
199
194
  } catch (err) {
200
195
  reject(err);
@@ -227,7 +222,6 @@ const RNPrimer = {
227
222
  },
228
223
 
229
224
  // Error Handler
230
-
231
225
  showErrorMessage: (errorMessage: string | null): Promise<void> => {
232
226
  return new Promise(async (resolve, reject) => {
233
227
  try {
@@ -239,19 +233,7 @@ const RNPrimer = {
239
233
  });
240
234
  },
241
235
 
242
- handleSuccess: (): Promise<void> => {
243
- return new Promise(async (resolve, reject) => {
244
- try {
245
- await NativePrimer.handleSuccess();
246
- resolve();
247
- } catch (err) {
248
- reject(err);
249
- }
250
- });
251
- },
252
-
253
236
  // HELPERS
254
-
255
237
  setImplementedRNCallbacks: (implementedRNCallbacks: any): Promise<void> => {
256
238
  return new Promise(async (resolve, reject) => {
257
239
  try {
package/src/index.tsx CHANGED
@@ -33,7 +33,7 @@ export type {
33
33
  PrimerCheckoutDataPayment as CheckoutDataPayment,
34
34
  } from './models/PrimerCheckoutData';
35
35
  export type { PrimerCheckoutPaymentMethodData as CheckoutPaymentMethodData } from './models/PrimerCheckoutPaymentMethodData';
36
- export { PrimerError } from './models/PrimerError';
36
+ export type { PrimerError } from './models/PrimerError';
37
37
  export type { PrimerPaymentMethodAsset as Asset } from './models/PrimerPaymentMethodResource';
38
38
  export type {
39
39
  IPrimerPaymentMethodResource as Resource,
@@ -71,34 +71,59 @@ export type {
71
71
  KlarnaPaymentFinalization,
72
72
  KlarnaPaymentValidatableData,
73
73
  } from './models/klarna/KlarnaPaymentCollectableData';
74
- export type {
74
+ import type {
75
75
  PaymentSessionCreated,
76
76
  PaymentSessionAuthorized,
77
77
  PaymentSessionFinalized,
78
78
  PaymentViewLoaded,
79
79
  KlarnaPaymentStep,
80
80
  } from './models/klarna/KlarnaPaymentSteps';
81
- export { PrimerKlarnaPaymentView } from './HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView';
82
- export {
83
- NativeResourceView,
84
- PrimerGooglePayButtonConstants,
85
- } from './HeadlessUniversalCheckout/Components/NativeResourceView';
86
- export { PrimerGooglePayButton } from './HeadlessUniversalCheckout/Components/PrimerGooglePayButton';
87
- export type { UserDetailsRetrieved as CollectUserDetails, UserDetailsCollected, AchStep } from './models/ach/AchSteps';
88
- export type { AchFirstName, AchLastName, AchEmailAddress, AchValidatableData } from './models/ach/AchCollectableData';
89
- export { PrimerHeadlessUniversalCheckoutAchManager as AchManager } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager';
90
81
  export type {
82
+ PaymentSessionCreated,
83
+ PaymentSessionAuthorized,
84
+ PaymentSessionFinalized,
85
+ PaymentViewLoaded,
86
+ KlarnaPaymentStep,
87
+ };
88
+ import { PrimerKlarnaPaymentView } from './HeadlessUniversalCheckout/Components/PrimerKlarnaPaymentView';
89
+ export { PrimerKlarnaPaymentView };
90
+ import { NativeResourceView } from './HeadlessUniversalCheckout/Components/NativeResourceView';
91
+ export { NativeResourceView };
92
+ import { PrimerGooglePayButtonConstants } from './HeadlessUniversalCheckout/Components/NativeResourceView';
93
+ export { PrimerGooglePayButtonConstants };
94
+ import { PrimerGooglePayButton } from './HeadlessUniversalCheckout/Components/PrimerGooglePayButton';
95
+ export { PrimerGooglePayButton };
96
+ import type { UserDetailsRetrieved, UserDetailsCollected, AchStep } from './models/ach/AchSteps';
97
+ export type { UserDetailsRetrieved as CollectUserDetails, UserDetailsCollected, AchStep };
98
+ import type { AchFirstName, AchLastName, AchEmailAddress, AchValidatableData } from './models/ach/AchCollectableData';
99
+ export type { AchFirstName, AchLastName, AchEmailAddress, AchValidatableData };
100
+ import { PrimerHeadlessUniversalCheckoutAchManager } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager';
101
+ import type {
91
102
  StripeAchUserDetailsComponent,
92
103
  AchManagerProps,
93
104
  } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchManager';
94
- export { PrimerHeadlessUniversalCheckoutAchMandateManager as AchMandateManager } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager';
95
105
 
96
- export { PrimerHeadlessUniversalCheckoutComponentWithRedirectManager as ComponentWithRedirectManager } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager';
97
- export type {
106
+ import { PrimerHeadlessUniversalCheckoutAchMandateManager } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/AchMandateManager';
107
+ export { PrimerHeadlessUniversalCheckoutAchMandateManager as AchMandateManager };
108
+ export { PrimerHeadlessUniversalCheckoutAchManager as AchManager };
109
+ export type { StripeAchUserDetailsComponent, AchManagerProps };
110
+
111
+ import { PrimerHeadlessUniversalCheckoutComponentWithRedirectManager } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager';
112
+ import type {
98
113
  BanksComponent,
99
114
  ComponentWithRedirectManagerProps,
100
115
  } from './HeadlessUniversalCheckout/Managers/PaymentMethodManagers/ComponentWithRedirectManager';
101
- export type { IssuingBank } from './models/IssuingBank';
102
- export type { BankId, BankListFilter, BanksValidatableData } from './models/banks/BanksCollectableData';
103
- export type { BanksLoading, BanksRetrieved, BanksStep } from './models/banks/BanksSteps';
104
- export type { NamedComponentValidatableData } from './models/NamedComponentValidatableData';
116
+ export { PrimerHeadlessUniversalCheckoutComponentWithRedirectManager as ComponentWithRedirectManager };
117
+ export type { BanksComponent, ComponentWithRedirectManagerProps };
118
+ import type { IssuingBank } from './models/IssuingBank';
119
+ export type { IssuingBank };
120
+ import type { BankId, BankListFilter, BanksValidatableData } from './models/banks/BanksCollectableData';
121
+ export type { BankId, BankListFilter, BanksValidatableData };
122
+ import type { BanksLoading, BanksRetrieved, BanksStep } from './models/banks/BanksSteps';
123
+ export type { BanksLoading, BanksRetrieved, BanksStep };
124
+ import type { NamedComponentValidatableData } from './models/NamedComponentValidatableData';
125
+ export type { NamedComponentValidatableData };
126
+
127
+ // must be exported in order to support the old architecture
128
+ const nativeModule = require('./specs/NativePrimer').default;
129
+ export default nativeModule;
@@ -1,6 +1,6 @@
1
- import { NamedComponentValidatableData } from './NamedComponentValidatableData';
1
+ import type { NamedComponentValidatableData } from './NamedComponentValidatableData';
2
2
  import { PrimerError } from './PrimerError';
3
- import { PrimerValidationError } from './PrimerValidationError';
3
+ import type { PrimerValidationError } from './PrimerValidationError';
4
4
 
5
5
  export type PrimerValidatingComponentData<T extends NamedComponentValidatableData> = IPrimerValidatingComponentData<T>;
6
6
  export type PrimerValidComponentData<T extends NamedComponentValidatableData> = IPrimerValidComponentData<T>;