@stripe/stripe-react-native 0.42.0 → 0.44.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 (309) hide show
  1. package/.husky/pre-commit +0 -3
  2. package/CHANGELOG.md +26 -0
  3. package/android/.gradle/8.11.1/checksums/checksums.lock +0 -0
  4. package/android/.gradle/8.11.1/checksums/md5-checksums.bin +0 -0
  5. package/android/.gradle/8.11.1/checksums/sha1-checksums.bin +0 -0
  6. package/android/.gradle/8.11.1/executionHistory/executionHistory.lock +0 -0
  7. package/android/.gradle/8.11.1/fileHashes/fileHashes.lock +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -2
  10. package/android/.project +0 -11
  11. package/android/.settings/org.eclipse.buildship.core.prefs +3 -3
  12. package/android/build.gradle +8 -1
  13. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  14. package/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  15. package/android/gradle.properties +4 -1
  16. package/android/gradlew +249 -0
  17. package/android/gradlew.bat +92 -0
  18. package/android/spotless.gradle +19 -0
  19. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +30 -34
  20. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormViewManager.kt +20 -10
  21. package/android/src/main/java/com/reactnativestripesdk/CardChangedEvent.kt +12 -13
  22. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +242 -105
  23. package/android/src/main/java/com/reactnativestripesdk/CardFieldViewManager.kt +58 -20
  24. package/android/src/main/java/com/reactnativestripesdk/CardFocusEvent.kt +8 -11
  25. package/android/src/main/java/com/reactnativestripesdk/CardFormCompleteEvent.kt +10 -12
  26. package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +135 -87
  27. package/android/src/main/java/com/reactnativestripesdk/CardFormViewManager.kt +57 -22
  28. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +33 -24
  29. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +107 -85
  30. package/android/src/main/java/com/reactnativestripesdk/FormCompleteEvent.kt +9 -11
  31. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonManager.kt +16 -9
  32. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +36 -28
  33. package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +67 -43
  34. package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +21 -16
  35. package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +101 -56
  36. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +244 -166
  37. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +137 -156
  38. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +181 -57
  39. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +422 -258
  40. package/android/src/main/java/com/reactnativestripesdk/StripeContainerManager.kt +11 -4
  41. package/android/src/main/java/com/reactnativestripesdk/StripeContainerView.kt +5 -1
  42. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +656 -299
  43. package/android/src/main/java/com/reactnativestripesdk/StripeSdkPackage.kt +12 -14
  44. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressLauncherFragment.kt +42 -37
  45. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetEvent.kt +12 -11
  46. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetView.kt +29 -29
  47. package/android/src/main/java/com/reactnativestripesdk/addresssheet/AddressSheetViewManager.kt +50 -18
  48. package/android/src/main/java/com/reactnativestripesdk/customersheet/CustomerSheetFragment.kt +227 -147
  49. package/android/src/main/java/com/reactnativestripesdk/customersheet/ReactNativeCustomerAdapter.kt +15 -18
  50. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonManager.kt +33 -15
  51. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +63 -37
  52. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletCompleteEvent.kt +9 -13
  53. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/EphemeralKeyProvider.kt +15 -17
  54. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +76 -60
  55. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +71 -47
  56. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +117 -51
  57. package/android/src/main/java/com/reactnativestripesdk/utils/Extensions.kt +4 -3
  58. package/android/src/main/java/com/reactnativestripesdk/utils/KeepJsAwakeTask.kt +39 -0
  59. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +295 -258
  60. package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +2 -11
  61. package/ios/CustomerSheet/CustomerSheetUtils.swift +13 -7
  62. package/ios/FinancialConnections.swift +6 -2
  63. package/ios/StripeSdk+CustomerSheet.swift +3 -1
  64. package/ios/StripeSdk+PaymentSheet.swift +86 -21
  65. package/ios/StripeSdk.m +2 -0
  66. package/ios/StripeSdk.swift +72 -11
  67. package/lib/commonjs/NativeStripeSdk.js +1 -1
  68. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  69. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  70. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  71. package/lib/commonjs/components/AddressSheet.js +1 -1
  72. package/lib/commonjs/components/AddressSheet.js.map +1 -1
  73. package/lib/commonjs/components/ApplePayButtonNative.js +1 -1
  74. package/lib/commonjs/components/ApplePayButtonNative.js.map +1 -1
  75. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  76. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  77. package/lib/commonjs/components/CardField.js +1 -1
  78. package/lib/commonjs/components/CardField.js.map +1 -1
  79. package/lib/commonjs/components/CardForm.js +1 -1
  80. package/lib/commonjs/components/CardForm.js.map +1 -1
  81. package/lib/commonjs/components/CustomerSheet.js +1 -1
  82. package/lib/commonjs/components/CustomerSheet.js.map +1 -1
  83. package/lib/commonjs/components/GooglePayButtonNative.js +1 -1
  84. package/lib/commonjs/components/GooglePayButtonNative.js.map +1 -1
  85. package/lib/commonjs/components/PlatformPayButton.js +1 -1
  86. package/lib/commonjs/components/PlatformPayButton.js.map +1 -1
  87. package/lib/commonjs/components/StripeContainer.js +1 -1
  88. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  89. package/lib/commonjs/components/StripeProvider.js +1 -1
  90. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  91. package/lib/commonjs/functions.js +1 -1
  92. package/lib/commonjs/functions.js.map +1 -1
  93. package/lib/commonjs/helpers.js +1 -1
  94. package/lib/commonjs/helpers.js.map +1 -1
  95. package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
  96. package/lib/commonjs/hooks/useConfirmSetupIntent.js.map +1 -1
  97. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -1
  98. package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
  99. package/lib/commonjs/hooks/usePlatformPay.js.map +1 -1
  100. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  101. package/lib/commonjs/index.js.map +1 -1
  102. package/lib/commonjs/package.json +1 -0
  103. package/lib/commonjs/plugin/withStripe.js +1 -1
  104. package/lib/commonjs/plugin/withStripe.js.map +1 -1
  105. package/lib/commonjs/types/ApplePay.js.map +1 -1
  106. package/lib/commonjs/types/Common.js +1 -1
  107. package/lib/commonjs/types/Common.js.map +1 -1
  108. package/lib/commonjs/types/CustomerSheet.js.map +1 -1
  109. package/lib/commonjs/types/Errors.js +1 -1
  110. package/lib/commonjs/types/Errors.js.map +1 -1
  111. package/lib/commonjs/types/FinancialConnections.js +1 -1
  112. package/lib/commonjs/types/FinancialConnections.js.map +1 -1
  113. package/lib/commonjs/types/NextAction.js.map +1 -1
  114. package/lib/commonjs/types/PaymentIntent.js +1 -1
  115. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  116. package/lib/commonjs/types/PaymentMethod.js.map +1 -1
  117. package/lib/commonjs/types/PaymentSheet.js +1 -1
  118. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  119. package/lib/commonjs/types/PlatformPay.js +1 -1
  120. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  121. package/lib/commonjs/types/PushProvisioning.js +1 -1
  122. package/lib/commonjs/types/PushProvisioning.js.map +1 -1
  123. package/lib/commonjs/types/SetupIntent.js +1 -1
  124. package/lib/commonjs/types/SetupIntent.js.map +1 -1
  125. package/lib/commonjs/types/ThreeDSecure.js +1 -1
  126. package/lib/commonjs/types/ThreeDSecure.js.map +1 -1
  127. package/lib/commonjs/types/Token.js.map +1 -1
  128. package/lib/commonjs/types/components/ApplePayButtonComponent.js.map +1 -1
  129. package/lib/commonjs/types/components/AuBECSDebitFormComponent.js.map +1 -1
  130. package/lib/commonjs/types/components/CardFieldInput.js +1 -1
  131. package/lib/commonjs/types/components/CardFieldInput.js.map +1 -1
  132. package/lib/commonjs/types/components/CardFormView.js.map +1 -1
  133. package/lib/commonjs/types/components/GooglePayButtonComponent.js.map +1 -1
  134. package/lib/commonjs/types/index.js +1 -1
  135. package/lib/commonjs/types/index.js.map +1 -1
  136. package/lib/module/NativeStripeSdk.js +1 -1
  137. package/lib/module/NativeStripeSdk.js.map +1 -1
  138. package/lib/module/components/AddToWalletButton.js +1 -1
  139. package/lib/module/components/AddToWalletButton.js.map +1 -1
  140. package/lib/module/components/AddressSheet.js +1 -1
  141. package/lib/module/components/AddressSheet.js.map +1 -1
  142. package/lib/module/components/ApplePayButtonNative.js +1 -1
  143. package/lib/module/components/ApplePayButtonNative.js.map +1 -1
  144. package/lib/module/components/AuBECSDebitForm.js +1 -1
  145. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  146. package/lib/module/components/CardField.js +1 -1
  147. package/lib/module/components/CardField.js.map +1 -1
  148. package/lib/module/components/CardForm.js +1 -1
  149. package/lib/module/components/CardForm.js.map +1 -1
  150. package/lib/module/components/CustomerSheet.js +1 -1
  151. package/lib/module/components/CustomerSheet.js.map +1 -1
  152. package/lib/module/components/GooglePayButtonNative.js +1 -1
  153. package/lib/module/components/GooglePayButtonNative.js.map +1 -1
  154. package/lib/module/components/PlatformPayButton.js +1 -1
  155. package/lib/module/components/PlatformPayButton.js.map +1 -1
  156. package/lib/module/components/StripeContainer.js +1 -1
  157. package/lib/module/components/StripeContainer.js.map +1 -1
  158. package/lib/module/components/StripeProvider.js +1 -1
  159. package/lib/module/components/StripeProvider.js.map +1 -1
  160. package/lib/module/functions.js +1 -1
  161. package/lib/module/functions.js.map +1 -1
  162. package/lib/module/helpers.js +1 -1
  163. package/lib/module/helpers.js.map +1 -1
  164. package/lib/module/hooks/useConfirmPayment.js.map +1 -1
  165. package/lib/module/hooks/useConfirmSetupIntent.js.map +1 -1
  166. package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -1
  167. package/lib/module/hooks/usePaymentSheet.js.map +1 -1
  168. package/lib/module/hooks/usePlatformPay.js.map +1 -1
  169. package/lib/module/hooks/useStripe.js.map +1 -1
  170. package/lib/module/index.js.map +1 -1
  171. package/lib/module/package.json +1 -0
  172. package/lib/module/plugin/withStripe.js +1 -1
  173. package/lib/module/plugin/withStripe.js.map +1 -1
  174. package/lib/module/types/ApplePay.js.map +1 -1
  175. package/lib/module/types/Common.js +1 -1
  176. package/lib/module/types/Common.js.map +1 -1
  177. package/lib/module/types/CustomerSheet.js.map +1 -1
  178. package/lib/module/types/Errors.js +1 -1
  179. package/lib/module/types/Errors.js.map +1 -1
  180. package/lib/module/types/FinancialConnections.js +1 -1
  181. package/lib/module/types/FinancialConnections.js.map +1 -1
  182. package/lib/module/types/NextAction.js.map +1 -1
  183. package/lib/module/types/PaymentIntent.js +1 -1
  184. package/lib/module/types/PaymentIntent.js.map +1 -1
  185. package/lib/module/types/PaymentMethod.js.map +1 -1
  186. package/lib/module/types/PaymentSheet.js +1 -1
  187. package/lib/module/types/PaymentSheet.js.map +1 -1
  188. package/lib/module/types/PlatformPay.js +1 -1
  189. package/lib/module/types/PlatformPay.js.map +1 -1
  190. package/lib/module/types/PushProvisioning.js +1 -1
  191. package/lib/module/types/PushProvisioning.js.map +1 -1
  192. package/lib/module/types/SetupIntent.js +1 -1
  193. package/lib/module/types/SetupIntent.js.map +1 -1
  194. package/lib/module/types/ThreeDSecure.js +1 -1
  195. package/lib/module/types/ThreeDSecure.js.map +1 -1
  196. package/lib/module/types/Token.js.map +1 -1
  197. package/lib/module/types/components/ApplePayButtonComponent.js.map +1 -1
  198. package/lib/module/types/components/AuBECSDebitFormComponent.js.map +1 -1
  199. package/lib/module/types/components/CardFieldInput.js +1 -1
  200. package/lib/module/types/components/CardFieldInput.js.map +1 -1
  201. package/lib/module/types/components/CardFormView.js.map +1 -1
  202. package/lib/module/types/components/GooglePayButtonComponent.js.map +1 -1
  203. package/lib/module/types/index.js +1 -1
  204. package/lib/module/types/index.js.map +1 -1
  205. package/lib/typescript/src/NativeStripeSdk.d.ts +4 -3
  206. package/lib/typescript/src/NativeStripeSdk.d.ts.map +1 -0
  207. package/lib/typescript/src/components/AddToWalletButton.d.ts +3 -1
  208. package/lib/typescript/src/components/AddToWalletButton.d.ts.map +1 -0
  209. package/lib/typescript/src/components/AddressSheet.d.ts +4 -2
  210. package/lib/typescript/src/components/AddressSheet.d.ts.map +1 -0
  211. package/lib/typescript/src/components/ApplePayButtonNative.d.ts +1 -0
  212. package/lib/typescript/src/components/ApplePayButtonNative.d.ts.map +1 -0
  213. package/lib/typescript/src/components/AuBECSDebitForm.d.ts +3 -1
  214. package/lib/typescript/src/components/AuBECSDebitForm.d.ts.map +1 -0
  215. package/lib/typescript/src/components/CardField.d.ts +1 -0
  216. package/lib/typescript/src/components/CardField.d.ts.map +1 -0
  217. package/lib/typescript/src/components/CardForm.d.ts +1 -0
  218. package/lib/typescript/src/components/CardForm.d.ts.map +1 -0
  219. package/lib/typescript/src/components/CustomerSheet.d.ts +2 -1
  220. package/lib/typescript/src/components/CustomerSheet.d.ts.map +1 -0
  221. package/lib/typescript/src/components/GooglePayButtonNative.d.ts +1 -0
  222. package/lib/typescript/src/components/GooglePayButtonNative.d.ts.map +1 -0
  223. package/lib/typescript/src/components/PlatformPayButton.d.ts +3 -1
  224. package/lib/typescript/src/components/PlatformPayButton.d.ts.map +1 -0
  225. package/lib/typescript/src/components/StripeContainer.d.ts +2 -1
  226. package/lib/typescript/src/components/StripeContainer.d.ts.map +1 -0
  227. package/lib/typescript/src/components/StripeProvider.d.ts +3 -2
  228. package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -0
  229. package/lib/typescript/src/functions.d.ts +6 -5
  230. package/lib/typescript/src/functions.d.ts.map +1 -0
  231. package/lib/typescript/src/helpers.d.ts +1 -0
  232. package/lib/typescript/src/helpers.d.ts.map +1 -0
  233. package/lib/typescript/src/hooks/useConfirmPayment.d.ts +2 -1
  234. package/lib/typescript/src/hooks/useConfirmPayment.d.ts.map +1 -0
  235. package/lib/typescript/src/hooks/useConfirmSetupIntent.d.ts +1 -0
  236. package/lib/typescript/src/hooks/useConfirmSetupIntent.d.ts.map +1 -0
  237. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +3 -2
  238. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts.map +1 -0
  239. package/lib/typescript/src/hooks/usePaymentSheet.d.ts +2 -1
  240. package/lib/typescript/src/hooks/usePaymentSheet.d.ts.map +1 -0
  241. package/lib/typescript/src/hooks/usePlatformPay.d.ts +4 -3
  242. package/lib/typescript/src/hooks/usePlatformPay.d.ts.map +1 -0
  243. package/lib/typescript/src/hooks/useStripe.d.ts +11 -8
  244. package/lib/typescript/src/hooks/useStripe.d.ts.map +1 -0
  245. package/lib/typescript/src/index.d.ts +1 -0
  246. package/lib/typescript/src/index.d.ts.map +1 -0
  247. package/lib/typescript/src/plugin/withStripe.d.ts +2 -1
  248. package/lib/typescript/src/plugin/withStripe.d.ts.map +1 -0
  249. package/lib/typescript/src/types/ApplePay.d.ts +6 -5
  250. package/lib/typescript/src/types/ApplePay.d.ts.map +1 -0
  251. package/lib/typescript/src/types/Common.d.ts +4 -1
  252. package/lib/typescript/src/types/Common.d.ts.map +1 -0
  253. package/lib/typescript/src/types/CustomerSheet.d.ts +16 -4
  254. package/lib/typescript/src/types/CustomerSheet.d.ts.map +1 -0
  255. package/lib/typescript/src/types/Errors.d.ts +2 -1
  256. package/lib/typescript/src/types/Errors.d.ts.map +1 -0
  257. package/lib/typescript/src/types/FinancialConnections.d.ts +21 -17
  258. package/lib/typescript/src/types/FinancialConnections.d.ts.map +1 -0
  259. package/lib/typescript/src/types/NextAction.d.ts +9 -8
  260. package/lib/typescript/src/types/NextAction.d.ts.map +1 -0
  261. package/lib/typescript/src/types/PaymentIntent.d.ts +16 -15
  262. package/lib/typescript/src/types/PaymentIntent.d.ts.map +1 -0
  263. package/lib/typescript/src/types/PaymentMethod.d.ts +21 -16
  264. package/lib/typescript/src/types/PaymentMethod.d.ts.map +1 -0
  265. package/lib/typescript/src/types/PaymentSheet.d.ts +91 -22
  266. package/lib/typescript/src/types/PaymentSheet.d.ts.map +1 -0
  267. package/lib/typescript/src/types/PlatformPay.d.ts +22 -21
  268. package/lib/typescript/src/types/PlatformPay.d.ts.map +1 -0
  269. package/lib/typescript/src/types/PushProvisioning.d.ts +5 -4
  270. package/lib/typescript/src/types/PushProvisioning.d.ts.map +1 -0
  271. package/lib/typescript/src/types/SetupIntent.d.ts +4 -3
  272. package/lib/typescript/src/types/SetupIntent.d.ts.map +1 -0
  273. package/lib/typescript/src/types/ThreeDSecure.d.ts +1 -0
  274. package/lib/typescript/src/types/ThreeDSecure.d.ts.map +1 -0
  275. package/lib/typescript/src/types/Token.d.ts +10 -9
  276. package/lib/typescript/src/types/Token.d.ts.map +1 -0
  277. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts +3 -2
  278. package/lib/typescript/src/types/components/ApplePayButtonComponent.d.ts.map +1 -0
  279. package/lib/typescript/src/types/components/AuBECSDebitFormComponent.d.ts +1 -0
  280. package/lib/typescript/src/types/components/AuBECSDebitFormComponent.d.ts.map +1 -0
  281. package/lib/typescript/src/types/components/CardFieldInput.d.ts +8 -5
  282. package/lib/typescript/src/types/components/CardFieldInput.d.ts.map +1 -0
  283. package/lib/typescript/src/types/components/CardFormView.d.ts +9 -6
  284. package/lib/typescript/src/types/components/CardFormView.d.ts.map +1 -0
  285. package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts +1 -0
  286. package/lib/typescript/src/types/components/GooglePayButtonComponent.d.ts.map +1 -0
  287. package/lib/typescript/src/types/index.d.ts +24 -23
  288. package/lib/typescript/src/types/index.d.ts.map +1 -0
  289. package/package.json +32 -40
  290. package/src/NativeStripeSdk.tsx +4 -2
  291. package/src/components/CardField.tsx +1 -1
  292. package/src/components/CardForm.tsx +12 -9
  293. package/src/components/CustomerSheet.tsx +4 -6
  294. package/src/components/StripeProvider.tsx +17 -0
  295. package/src/functions.ts +13 -14
  296. package/src/helpers.ts +2 -1
  297. package/src/types/Common.ts +3 -0
  298. package/src/types/CustomerSheet.ts +11 -0
  299. package/src/types/FinancialConnections.ts +3 -0
  300. package/src/types/PaymentMethod.ts +5 -1
  301. package/src/types/PaymentSheet.ts +85 -4
  302. package/src/types/components/CardFieldInput.ts +8 -4
  303. package/src/types/components/CardFormView.ts +8 -4
  304. package/stripe-react-native.podspec +2 -1
  305. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  306. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  307. package/android/.gradle/8.9/gc.properties +0 -0
  308. /package/android/.gradle/{8.9 → 8.11.1}/fileChanges/last-build.bin +0 -0
  309. /package/android/.gradle/{8.9/dependencies-accessors → 8.11.1}/gc.properties +0 -0
@@ -21,7 +21,7 @@ export { PaymentMethodLayout } from './PaymentSheet';
21
21
  /**
22
22
  * @ignore
23
23
  */
24
- export declare type Dictionary<T> = {
24
+ export type Dictionary<T> = {
25
25
  [key: string]: T;
26
26
  };
27
27
  export interface AppInfo {
@@ -30,84 +30,84 @@ export interface AppInfo {
30
30
  url?: string;
31
31
  version?: string;
32
32
  }
33
- export declare type CreatePaymentMethodResult = {
33
+ export type CreatePaymentMethodResult = {
34
34
  paymentMethod: PaymentMethod.Result;
35
35
  error?: undefined;
36
36
  } | {
37
37
  paymentMethod?: undefined;
38
38
  error: StripeError<CreatePaymentMethodError>;
39
39
  };
40
- export declare type RetrievePaymentIntentResult = {
40
+ export type RetrievePaymentIntentResult = {
41
41
  paymentIntent: PaymentIntent.Result;
42
42
  error?: undefined;
43
43
  } | {
44
44
  paymentIntent?: undefined;
45
45
  error: StripeError<RetrievePaymentIntentError>;
46
46
  };
47
- export declare type RetrieveSetupIntentResult = {
47
+ export type RetrieveSetupIntentResult = {
48
48
  setupIntent: SetupIntent.Result;
49
49
  error?: undefined;
50
50
  } | {
51
51
  setupIntent?: undefined;
52
52
  error: StripeError<RetrieveSetupIntentError>;
53
53
  };
54
- export declare type ConfirmPaymentResult = {
54
+ export type ConfirmPaymentResult = {
55
55
  paymentIntent: PaymentIntent.Result;
56
56
  error?: undefined;
57
57
  } | {
58
58
  paymentIntent?: undefined;
59
59
  error: StripeError<ConfirmPaymentError>;
60
60
  };
61
- export declare type HandleNextActionResult = {
61
+ export type HandleNextActionResult = {
62
62
  paymentIntent: PaymentIntent.Result;
63
63
  error?: undefined;
64
64
  } | {
65
65
  paymentIntent?: undefined;
66
66
  error: StripeError<CardActionError>;
67
67
  };
68
- export declare type HandleNextActionForSetupResult = {
68
+ export type HandleNextActionForSetupResult = {
69
69
  setupIntent: SetupIntent.Result;
70
70
  error?: undefined;
71
71
  } | {
72
72
  setupIntent?: undefined;
73
73
  error: StripeError<CardActionError>;
74
74
  };
75
- export declare type ConfirmSetupIntentResult = {
75
+ export type ConfirmSetupIntentResult = {
76
76
  setupIntent: SetupIntent.Result;
77
77
  error?: undefined;
78
78
  } | {
79
79
  setupIntent?: undefined;
80
80
  error: StripeError<ConfirmSetupIntentError>;
81
81
  };
82
- export declare type CreateTokenForCVCUpdateResult = {
82
+ export type CreateTokenForCVCUpdateResult = {
83
83
  tokenId: string;
84
84
  error?: undefined;
85
85
  } | {
86
86
  tokenId?: undefined;
87
87
  error: StripeError<ConfirmSetupIntentError>;
88
88
  };
89
- export declare type InitPaymentSheetResult = {
89
+ export type InitPaymentSheetResult = {
90
90
  paymentOption?: PaymentSheet.PaymentOption;
91
91
  error?: undefined;
92
92
  } | {
93
93
  paymentOption?: undefined;
94
94
  error: StripeError<PaymentSheetError>;
95
95
  };
96
- export declare type PresentPaymentSheetResult = {
96
+ export type PresentPaymentSheetResult = {
97
97
  paymentOption?: PaymentSheet.PaymentOption | undefined;
98
98
  error?: StripeError<PaymentSheetError> | undefined;
99
99
  };
100
- export declare type CreateTokenResult = {
100
+ export type CreateTokenResult = {
101
101
  token: Token.Result;
102
102
  error?: undefined;
103
103
  } | {
104
104
  token?: undefined;
105
105
  error: StripeError<CreateTokenError>;
106
106
  };
107
- export declare type ConfirmPaymentSheetPaymentResult = {
107
+ export type ConfirmPaymentSheetPaymentResult = {
108
108
  error?: StripeError<PaymentSheetError>;
109
109
  };
110
- export declare type ApplePayResult = {
110
+ export type ApplePayResult = {
111
111
  paymentMethod: PaymentMethod.Result;
112
112
  error?: undefined;
113
113
  } | {
@@ -125,60 +125,61 @@ export interface InitStripeParams {
125
125
  export interface InitialiseParams extends InitStripeParams {
126
126
  appInfo: AppInfo;
127
127
  }
128
- export declare type GooglePayInitResult = {
128
+ export type GooglePayInitResult = {
129
129
  error?: undefined;
130
130
  } | {
131
131
  error: StripeError<GooglePayError>;
132
132
  };
133
- export declare type PayWithGooglePayResult = {
133
+ export type PayWithGooglePayResult = {
134
134
  error?: undefined;
135
135
  } | {
136
136
  error: StripeError<GooglePayError>;
137
137
  };
138
- export declare type CreateGooglePayPaymentMethodResult = {
138
+ export type CreateGooglePayPaymentMethodResult = {
139
139
  paymentMethod: PaymentMethod.Result;
140
140
  error?: undefined;
141
141
  } | {
142
142
  paymentMethod?: undefined;
143
143
  error: StripeError<GooglePayError>;
144
144
  };
145
- export declare type OpenApplePaySetupResult = {
145
+ export type OpenApplePaySetupResult = {
146
146
  error?: undefined;
147
147
  } | {
148
148
  error: StripeError<ApplePayError>;
149
149
  };
150
- export declare type VerifyMicrodepositsParams = {
150
+ export type VerifyMicrodepositsParams = {
151
151
  amounts: number[];
152
152
  descriptorCode?: undefined;
153
153
  } | {
154
154
  amounts?: undefined;
155
155
  descriptorCode: string;
156
156
  };
157
- export declare type VerifyMicrodepositsForPaymentResult = {
157
+ export type VerifyMicrodepositsForPaymentResult = {
158
158
  paymentIntent: PaymentIntent.Result;
159
159
  error?: undefined;
160
160
  } | {
161
161
  paymentIntent?: undefined;
162
162
  error: StripeError<VerifyMicrodepositsError>;
163
163
  };
164
- export declare type VerifyMicrodepositsForSetupResult = {
164
+ export type VerifyMicrodepositsForSetupResult = {
165
165
  setupIntent: SetupIntent.Result;
166
166
  error?: undefined;
167
167
  } | {
168
168
  setupIntent?: undefined;
169
169
  error: StripeError<VerifyMicrodepositsError>;
170
170
  };
171
- export declare type CollectBankAccountForPaymentResult = {
171
+ export type CollectBankAccountForPaymentResult = {
172
172
  paymentIntent: PaymentIntent.Result;
173
173
  error?: undefined;
174
174
  } | {
175
175
  paymentIntent?: undefined;
176
176
  error: StripeError<CollectBankAccountError>;
177
177
  };
178
- export declare type CollectBankAccountForSetupResult = {
178
+ export type CollectBankAccountForSetupResult = {
179
179
  setupIntent: SetupIntent.Result;
180
180
  error?: undefined;
181
181
  } | {
182
182
  setupIntent?: undefined;
183
183
  error: StripeError<CollectBankAccountError>;
184
184
  };
185
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","s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EAAE,WAAW,CAAC,uBAAuB,CAAC,CAAC;CAC7C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-react-native",
3
- "version": "0.42.0",
3
+ "version": "0.44.0",
4
4
  "author": "Stripe",
5
5
  "description": "Stripe SDK for React Native",
6
6
  "main": "lib/commonjs/index",
@@ -12,7 +12,7 @@
12
12
  "test": "jest",
13
13
  "typescript": "tsc --noEmit",
14
14
  "lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-path .gitignore",
15
- "prepare": "bob build && husky install",
15
+ "prepare": "bob build && husky",
16
16
  "release": "./scripts/publish",
17
17
  "example": "yarn --cwd example",
18
18
  "pods": "cd example && npx pod-install --quiet",
@@ -20,14 +20,18 @@
20
20
  "bootstrap": "yarn example && yarn && yarn pods",
21
21
  "bootstrap-no-pods": "yarn example && yarn",
22
22
  "docs": "yarn typedoc ./src/index.tsx --out ./docs/api-reference --tsconfig ./tsconfig.json --readme none --sort source-order",
23
- "run-example-ios": "cd example;react-native run-ios --configuration Release --simulator \"iPhone 15 (17.2)\"",
24
- "run-example-android": "cd example;react-native run-android --variant=release",
23
+ "run-example-ios": "cd example && yarn ios --simulator \"iPhone 16\"",
24
+ "run-example-ios:release": "cd example && yarn build:ios && yarn ios --mode Release --simulator \"iPhone 16\" --no-packager",
25
+ "run-example-android": "cd example && yarn android",
26
+ "run-example-android:release": "cd example && yarn build:android && yarn android --mode=release --no-packager",
25
27
  "test:e2e:ios": "bash ./scripts/run-maestro-tests ios",
26
28
  "test:e2e:android": "bash ./scripts/run-maestro-tests android",
27
- "test:unit:ios": "xcodebuild test -workspace example/ios/StripeSdkExample.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 15' -scheme UnitTests",
29
+ "test:unit:ios": "xcodebuild test -workspace example/ios/example.xcworkspace -destination 'platform=iOS Simulator,name=iPhone 16' -scheme stripe-react-native-Unit-Tests",
28
30
  "test:unit:android": "cd example/android && ./gradlew connectedAndroidTest",
29
31
  "test-ios": "maestro test -e APP_ID=com.stripe.react.native",
30
- "test-android": "maestro test -e APP_ID=com.example.reactnativestripesdk"
32
+ "test-android": "maestro test -e APP_ID=com.stripe.react.native",
33
+ "format:android:check": "cd android && ./gradlew spotlessCheck",
34
+ "format:android:write": "cd android && ./gradlew spotlessApply"
31
35
  },
32
36
  "keywords": [
33
37
  "react-native",
@@ -42,26 +46,23 @@
42
46
  "homepage": "https://github.com/stripe/stripe-react-native/#readme",
43
47
  "dependencies": {},
44
48
  "devDependencies": {
45
- "@babel/plugin-transform-typescript": "^7.13.0",
46
- "@expo/config-types": "^47.0.0",
47
- "@react-native-community/bob": "^0.16.2",
48
- "@react-native-community/eslint-config": "^3.0.0",
49
- "@types/jest": "^26.0.23",
50
- "@types/react": "^16.9.19",
51
- "@types/react-native": "0.62.13",
52
- "eslint": "^7.32.0",
53
- "eslint-config-prettier": "^6.11.0",
54
- "eslint-plugin-prettier": "^3.1.3",
55
- "expo": "^47.0.8",
56
- "husky": "^8.0.0",
57
- "jest": "^26.6.3",
58
- "metro-react-native-babel-preset": "^0.70.3",
59
- "prettier": "^2.0.5",
60
- "react": "18.0.0",
61
- "react-native": "0.69.12",
62
- "ts-node": "^9.1.1",
63
- "typedoc": "^0.22.12",
64
- "typescript": "~4.4.4"
49
+ "@expo/config-plugins": "^9.0.16",
50
+ "@react-native/babel-preset": "^0.78.0",
51
+ "@react-native/eslint-config": "^0.78.0",
52
+ "@types/jest": "^29.5.14",
53
+ "@types/react": "^19.0.10",
54
+ "eslint": "^8.57.0",
55
+ "eslint-config-prettier": "^9.1.0",
56
+ "eslint-plugin-prettier": "^5.1.3",
57
+ "husky": "^9.1.7",
58
+ "jest": "^29.7.0",
59
+ "prettier": "^3.5.2",
60
+ "react": "^19.0.0",
61
+ "react-native": "^0.78.0",
62
+ "react-native-builder-bob": "^0.37.0",
63
+ "ts-node": "^10.9.2",
64
+ "typedoc": "^0.27.9",
65
+ "typescript": "^5.7.3"
65
66
  },
66
67
  "peerDependencies": {
67
68
  "expo": ">=46.0.9",
@@ -83,24 +84,14 @@
83
84
  },
84
85
  "eslintConfig": {
85
86
  "extends": [
86
- "@react-native-community",
87
- "prettier"
87
+ "@react-native",
88
+ "plugin:prettier/recommended"
88
89
  ],
89
90
  "rules": {
90
91
  "no-shadow": "off",
91
92
  "@typescript-eslint/no-shadow": [
92
93
  "error"
93
94
  ],
94
- "prettier/prettier": [
95
- "error",
96
- {
97
- "quoteProps": "consistent",
98
- "singleQuote": true,
99
- "tabWidth": 2,
100
- "trailingComma": "es5",
101
- "useTabs": false
102
- }
103
- ],
104
95
  "no-restricted-syntax": [
105
96
  "error",
106
97
  {
@@ -113,7 +104,8 @@
113
104
  "eslintIgnore": [
114
105
  "node_modules/",
115
106
  "lib/",
116
- "dist/"
107
+ "dist/",
108
+ "server-dist/"
117
109
  ],
118
110
  "prettier": {
119
111
  "quoteProps": "consistent",
@@ -122,7 +114,7 @@
122
114
  "trailingComma": "es5",
123
115
  "useTabs": false
124
116
  },
125
- "@react-native-community/bob": {
117
+ "react-native-builder-bob": {
126
118
  "source": "src",
127
119
  "output": "lib",
128
120
  "targets": [
@@ -94,10 +94,12 @@ type NativeStripeSdkType = {
94
94
  cardLastFour: string;
95
95
  }): Promise<IsCardInWalletResult>;
96
96
  collectBankAccountToken(
97
- clientSecret: string
97
+ clientSecret: string,
98
+ params: PaymentMethod.CollectBankAccountTokenParams
98
99
  ): Promise<FinancialConnections.TokenResult>;
99
100
  collectFinancialConnectionsAccounts(
100
- clientSecret: string
101
+ clientSecret: string,
102
+ params: FinancialConnections.CollectFinancialConnectionsAccountsParams
101
103
  ): Promise<FinancialConnections.SessionResult>;
102
104
  resetPaymentSheetCustomer(): Promise<null>;
103
105
  isPlatformPaySupported(params: {
@@ -124,7 +124,7 @@ export const CardField = forwardRef<CardFieldInput.Methods, Props>(
124
124
  );
125
125
 
126
126
  const onFocusHandler = useCallback(
127
- (event) => {
127
+ (event: CardFieldInput.OnFocusChangeEvent) => {
128
128
  const { focusedField } = event.nativeEvent;
129
129
  if (focusedField) {
130
130
  focusInput(inputRef.current);
@@ -140,15 +140,18 @@ export const CardForm = forwardRef<CardFormView.Methods, Props>(
140
140
  blur,
141
141
  }));
142
142
 
143
- const onFocusHandler = useCallback((event) => {
144
- const { focusedField } = event.nativeEvent;
145
- if (focusedField) {
146
- focusInput(inputRef.current);
147
- // onFocus?.(focusedField);
148
- } else {
149
- // onBlur?.();
150
- }
151
- }, []);
143
+ const onFocusHandler = useCallback(
144
+ (event: CardFormView.OnFocusChangeEvent) => {
145
+ const { focusedField } = event.nativeEvent;
146
+ if (focusedField) {
147
+ focusInput(inputRef.current);
148
+ // onFocus?.(focusedField);
149
+ } else {
150
+ // onBlur?.();
151
+ }
152
+ },
153
+ []
154
+ );
152
155
 
153
156
  useLayoutEffect(() => {
154
157
  const inputRefValue = inputRef.current;
@@ -78,9 +78,8 @@ const configureCustomerAdapterEventListeners = (
78
78
  'onCustomerAdapterAttachPaymentMethodCallback',
79
79
  async ({ paymentMethodId }: { paymentMethodId: string }) => {
80
80
  if (customerAdapter.attachPaymentMethod) {
81
- const paymentMethod = await customerAdapter.attachPaymentMethod(
82
- paymentMethodId
83
- );
81
+ const paymentMethod =
82
+ await customerAdapter.attachPaymentMethod(paymentMethodId);
84
83
  await NativeStripeSdk.customerAdapterAttachPaymentMethodCallback(
85
84
  paymentMethod
86
85
  );
@@ -99,9 +98,8 @@ const configureCustomerAdapterEventListeners = (
99
98
  'onCustomerAdapterDetachPaymentMethodCallback',
100
99
  async ({ paymentMethodId }: { paymentMethodId: string }) => {
101
100
  if (customerAdapter.detachPaymentMethod) {
102
- const paymentMethod = await customerAdapter.detachPaymentMethod(
103
- paymentMethodId
104
- );
101
+ const paymentMethod =
102
+ await customerAdapter.detachPaymentMethod(paymentMethodId);
105
103
  await NativeStripeSdk.customerAdapterDetachPaymentMethodCallback(
106
104
  paymentMethod
107
105
  );
@@ -4,6 +4,7 @@ import NativeStripeSdk from '../NativeStripeSdk';
4
4
  import { isAndroid, shouldAttributeExpo } from '../helpers';
5
5
  import type { AppInfo, InitStripeParams, InitialiseParams } from '../types';
6
6
  import pjson from '../../package.json';
7
+ import { AppRegistry, Platform } from 'react-native';
7
8
 
8
9
  const EXPO_PARTNER_ID = 'pp_partner_JBN7LkABco2yUu';
9
10
 
@@ -27,6 +28,22 @@ const appInfo: AppInfo = {
27
28
  };
28
29
 
29
30
  export const initStripe = async (params: InitStripeParams): Promise<void> => {
31
+ // On Android when the activity is paused, JS timers are paused,
32
+ // which causes network requests to hang indefinitely on new arch.
33
+ // To work around this, we register a headless task that will keep
34
+ // the JS runtime running while the Stripe UI is opened.
35
+ // This task is started and stopped by the native module.
36
+ if (Platform.OS === 'android') {
37
+ function stripeHeadlessTask() {
38
+ return new Promise<void>(() => {});
39
+ }
40
+
41
+ AppRegistry.registerHeadlessTask(
42
+ 'StripeKeepJsAwakeTask',
43
+ () => stripeHeadlessTask
44
+ );
45
+ }
46
+
30
47
  const extendedParams: InitialiseParams = { ...params, appInfo };
31
48
  NativeStripeSdk.initialise(extendedParams);
32
49
  };
package/src/functions.ts CHANGED
@@ -121,9 +121,8 @@ export const retrieveSetupIntent = async (
121
121
  clientSecret: string
122
122
  ): Promise<RetrieveSetupIntentResult> => {
123
123
  try {
124
- const { setupIntent, error } = await NativeStripeSdk.retrieveSetupIntent(
125
- clientSecret
126
- );
124
+ const { setupIntent, error } =
125
+ await NativeStripeSdk.retrieveSetupIntent(clientSecret);
127
126
  if (error) {
128
127
  return {
129
128
  error,
@@ -271,9 +270,8 @@ export const createTokenForCVCUpdate = async (
271
270
  cvc: string
272
271
  ): Promise<CreateTokenForCVCUpdateResult> => {
273
272
  try {
274
- const { tokenId, error } = await NativeStripeSdk.createTokenForCVCUpdate(
275
- cvc
276
- );
273
+ const { tokenId, error } =
274
+ await NativeStripeSdk.createTokenForCVCUpdate(cvc);
277
275
  if (error) {
278
276
  return {
279
277
  error,
@@ -423,9 +421,8 @@ export const presentPaymentSheet = async (
423
421
  options: PaymentSheet.PresentOptions = {}
424
422
  ): Promise<PresentPaymentSheetResult> => {
425
423
  try {
426
- const { paymentOption, error } = await NativeStripeSdk.presentPaymentSheet(
427
- options
428
- );
424
+ const { paymentOption, error } =
425
+ await NativeStripeSdk.presentPaymentSheet(options);
429
426
  if (error) {
430
427
  return {
431
428
  error,
@@ -565,7 +562,7 @@ export const collectBankAccountToken = async (
565
562
 
566
563
  try {
567
564
  const { session, token, error } =
568
- await NativeStripeSdk.collectBankAccountToken(clientSecret);
565
+ await NativeStripeSdk.collectBankAccountToken(clientSecret, params);
569
566
 
570
567
  financialConnectionsEventListener?.remove();
571
568
 
@@ -608,7 +605,10 @@ export const collectFinancialConnectionsAccounts = async (
608
605
 
609
606
  try {
610
607
  const { session, error } =
611
- await NativeStripeSdk.collectFinancialConnectionsAccounts(clientSecret);
608
+ await NativeStripeSdk.collectFinancialConnectionsAccounts(
609
+ clientSecret,
610
+ params
611
+ );
612
612
 
613
613
  financialConnectionsEventListener?.remove();
614
614
 
@@ -662,9 +662,8 @@ export const isCardInWallet = async (params: {
662
662
  cardLastFour: string;
663
663
  }): Promise<IsCardInWalletResult> => {
664
664
  try {
665
- const { isInWallet, token, error } = await NativeStripeSdk.isCardInWallet(
666
- params
667
- );
665
+ const { isInWallet, token, error } =
666
+ await NativeStripeSdk.isCardInWallet(params);
668
667
 
669
668
  if (error) {
670
669
  return {
package/src/helpers.ts CHANGED
@@ -2,7 +2,8 @@ import type React from 'react';
2
2
  import type { StripeError } from './types';
3
3
 
4
4
  import { Platform, NativeModules } from 'react-native';
5
- const TextInputState = require('react-native/Libraries/Components/TextInput/TextInputState');
5
+ // @ts-ignore TextInputState has no type definition
6
+ import TextInputState from 'react-native/Libraries/Components/TextInput/TextInputState';
6
7
 
7
8
  /**
8
9
  * Determines whether or not this library is being used inside of
@@ -38,3 +38,6 @@ export enum CardBrand {
38
38
  Visa = 7,
39
39
  Unknown = 8,
40
40
  }
41
+
42
+ /** Theme options for colors used in our UI. */
43
+ export type UserInterfaceStyle = 'alwaysLight' | 'alwaysDark' | 'automatic';
@@ -47,6 +47,17 @@ export type CustomerSheetInitParams = {
47
47
  * If false, the customer can't delete if they only have one saved payment method remaining.
48
48
  */
49
49
  allowsRemovalOfLastSavedPaymentMethod?: boolean;
50
+ /** (Private Preview) This parameter is expected to be removed once we GA this feature
51
+ * When using customerSessions, allow users to update their saved cards
52
+ */
53
+ updatePaymentMethodEnabled?: boolean;
54
+ /**
55
+ * By default, CustomerSheet will accept all supported cards by Stripe.
56
+ * You can specify card brands CustomerSheet should block or allow payment for by providing an array of those card brands.
57
+ * Note: This is only a client-side solution.
58
+ * Note: Card brand filtering is not currently supported in Link.
59
+ */
60
+ cardBrandAcceptance?: PaymentSheet.CardBrandAcceptance;
50
61
  };
51
62
 
52
63
  export type CustomerSheetPresentParams = {
@@ -1,7 +1,10 @@
1
+ import type { UserInterfaceStyle } from './Common';
1
2
  import type { BankAccount } from './Token';
2
3
  import type { StripeError } from './Errors';
3
4
 
4
5
  export type CollectFinancialConnectionsAccountsParams = {
6
+ /** iOS Only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. */
7
+ style?: UserInterfaceStyle;
5
8
  /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
6
9
  onEvent?: (event: FinancialConnectionsEvent) => void;
7
10
  };
@@ -5,7 +5,7 @@ import type {
5
5
  BankAcccountType,
6
6
  } from './Token';
7
7
  import type { FutureUsage } from './PaymentIntent';
8
- import type { Address, BillingDetails } from './Common';
8
+ import type { Address, BillingDetails, UserInterfaceStyle } from './Common';
9
9
  import type { FinancialConnectionsEvent } from './FinancialConnections';
10
10
 
11
11
  export interface Result {
@@ -314,11 +314,15 @@ export type CollectBankAccountParams = {
314
314
  email?: string;
315
315
  };
316
316
  };
317
+ /** iOS only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. */
318
+ style?: UserInterfaceStyle;
317
319
  /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
318
320
  onEvent?: (event: FinancialConnectionsEvent) => void;
319
321
  };
320
322
 
321
323
  export type CollectBankAccountTokenParams = {
324
+ /** iOS only. Style options for colors in Financial Connections. By default, the bank account collector will automatically switch between light and dark mode compatible colors based on device settings. */
325
+ style?: UserInterfaceStyle;
322
326
  /** An optional event listener to receive @type {FinancialConnectionEvent} for specific events during the process of a user connecting their financial accounts. */
323
327
  onEvent?: (event: FinancialConnectionsEvent) => void;
324
328
  };