@stripe/stripe-react-native 0.42.0 → 0.43.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 (308) hide show
  1. package/.husky/pre-commit +0 -3
  2. package/CHANGELOG.md +14 -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 +7 -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 +402 -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 +654 -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 +3 -1
  62. package/ios/FinancialConnections.swift +6 -2
  63. package/ios/StripeSdk+CustomerSheet.swift +2 -1
  64. package/ios/StripeSdk+PaymentSheet.swift +42 -0
  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 +12 -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 +72 -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/types/Common.ts +3 -0
  297. package/src/types/CustomerSheet.ts +7 -0
  298. package/src/types/FinancialConnections.ts +3 -0
  299. package/src/types/PaymentMethod.ts +5 -1
  300. package/src/types/PaymentSheet.ts +64 -4
  301. package/src/types/components/CardFieldInput.ts +8 -4
  302. package/src/types/components/CardFormView.ts +8 -4
  303. package/stripe-react-native.podspec +2 -1
  304. package/android/.gradle/8.9/checksums/checksums.lock +0 -0
  305. package/android/.gradle/8.9/fileHashes/fileHashes.lock +0 -0
  306. package/android/.gradle/8.9/gc.properties +0 -0
  307. /package/android/.gradle/{8.9 → 8.11.1}/fileChanges/last-build.bin +0 -0
  308. /package/android/.gradle/{8.9/dependencies-accessors → 8.11.1}/gc.properties +0 -0
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 {
@@ -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,13 @@ 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
+ /**
51
+ * By default, CustomerSheet will accept all supported cards by Stripe.
52
+ * You can specify card brands CustomerSheet should block or allow payment for by providing an array of those card brands.
53
+ * Note: This is only a client-side solution.
54
+ * Note: Card brand filtering is not currently supported in Link.
55
+ */
56
+ cardBrandAcceptance?: PaymentSheet.CardBrandAcceptance;
50
57
  };
51
58
 
52
59
  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
  };
@@ -1,4 +1,9 @@
1
- import type { BillingDetails, AddressDetails, CardBrand } from './Common';
1
+ import type {
2
+ BillingDetails,
3
+ AddressDetails,
4
+ CardBrand,
5
+ UserInterfaceStyle,
6
+ } from './Common';
2
7
  import type { CartSummaryItem } from './ApplePay';
3
8
  import type {
4
9
  ButtonType,
@@ -23,7 +28,7 @@ export type SetupParamsBase = IntentParams & {
23
28
  /** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */
24
29
  googlePay?: GooglePayParams;
25
30
  /** The color styling to use for PaymentSheet UI. Defaults to 'automatic'. */
26
- style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
31
+ style?: UserInterfaceStyle;
27
32
  /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
28
33
  returnURL?: string;
29
34
  /** Configuration for how billing details are collected during checkout. */
@@ -70,6 +75,13 @@ export type SetupParamsBase = IntentParams & {
70
75
  * - Note: Defaults to `Automatic` if not set
71
76
  */
72
77
  paymentMethodLayout?: PaymentMethodLayout;
78
+ /**
79
+ * By default, PaymentSheet will accept all supported cards by Stripe.
80
+ * You can specify card brands PaymentSheet should block or allow payment for by providing an array of those card brands.
81
+ * Note: This is only a client-side solution.
82
+ * Note: Card brand filtering is not currently supported in Link.
83
+ */
84
+ cardBrandAcceptance?: CardBrandAcceptance;
73
85
  };
74
86
 
75
87
  export type SetupParams =
@@ -303,8 +315,8 @@ type RecursivePartial<T> = {
303
315
  [P in keyof T]?: T[P] extends (infer U)[]
304
316
  ? RecursivePartial<U>[]
305
317
  : T[P] extends object
306
- ? RecursivePartial<T[P]>
307
- : T[P];
318
+ ? RecursivePartial<T[P]>
319
+ : T[P];
308
320
  };
309
321
  export interface PaymentOption {
310
322
  label: string;
@@ -441,3 +453,51 @@ export enum PaymentMethodLayout {
441
453
  */
442
454
  Automatic = 'Automatic',
443
455
  }
456
+
457
+ /** Card brand categories that can be allowed or disallowed */
458
+ export enum CardBrandCategory {
459
+ /** Visa branded cards */
460
+ Visa = 'visa',
461
+ /** Mastercard branded cards */
462
+ Mastercard = 'mastercard',
463
+ /** American Express branded cards */
464
+ Amex = 'amex',
465
+ /**
466
+ * Discover branded cards
467
+ * Note: Encompasses all of Discover Global Network (Discover, Diners, JCB, UnionPay, Elo)
468
+ */
469
+ Discover = 'discover',
470
+ }
471
+
472
+ /** Filter types for card brand acceptance */
473
+ export enum CardBrandAcceptanceFilter {
474
+ /** Accept all card brands supported by Stripe */
475
+ All = 'all',
476
+ /** Accept only the specified card brands */
477
+ Allowed = 'allowed',
478
+ /** Accept all card brands except the specified ones */
479
+ Disallowed = 'disallowed',
480
+ }
481
+
482
+ /** Options to block certain card brands on the client */
483
+ export type CardBrandAcceptance =
484
+ | {
485
+ /** Accept all card brands supported by Stripe */
486
+ filter: CardBrandAcceptanceFilter.All;
487
+ }
488
+ | {
489
+ /** Accept only the specified card brands */
490
+ filter: CardBrandAcceptanceFilter.Allowed;
491
+ /** List of card brands to accept
492
+ * Note: Any card brands that do not map to a CardBrandCategory will be blocked when using an allow list
493
+ */
494
+ brands: CardBrandCategory[];
495
+ }
496
+ | {
497
+ /** Accept all card brands except the specified ones */
498
+ filter: CardBrandAcceptanceFilter.Disallowed;
499
+ /** List of card brands to block
500
+ * Note: Any card brands that do not map to a CardBrandCategory will be accepted when using a disallow list
501
+ */
502
+ brands: CardBrandCategory[];
503
+ };
@@ -51,6 +51,12 @@ export interface Placeholders {
51
51
  postalCode?: string;
52
52
  }
53
53
 
54
+ export type OnFocusChangeEvent = NativeSyntheticEvent<{
55
+ focusedField: FieldName | null;
56
+ }>;
57
+
58
+ export type OnCardChangeEvent = NativeSyntheticEvent<Details>;
59
+
54
60
  /**
55
61
  * @ignore
56
62
  */
@@ -60,10 +66,8 @@ export interface NativeProps {
60
66
  postalCodeEnabled?: boolean;
61
67
  autofocus?: boolean;
62
68
  countryCode: string | null;
63
- onCardChange(event: NativeSyntheticEvent<Details>): void;
64
- onFocusChange(
65
- event: NativeSyntheticEvent<{ focusedField: FieldName | null }>
66
- ): void;
69
+ onCardChange(event: OnCardChangeEvent): void;
70
+ onFocusChange(event: OnFocusChangeEvent): void;
67
71
  cardStyle?: Styles;
68
72
  placeholders?: Placeholders;
69
73
  disabled?: boolean;
@@ -49,6 +49,12 @@ export type DefaultValues = {
49
49
  countryCode?: string;
50
50
  };
51
51
 
52
+ export type OnFocusChangeEvent = NativeSyntheticEvent<{
53
+ focusedField: FieldName | null;
54
+ }>;
55
+
56
+ export type OnFormCompleteEvent = NativeSyntheticEvent<Details>;
57
+
52
58
  /**
53
59
  * @ignore
54
60
  */
@@ -61,10 +67,8 @@ export interface NativeProps {
61
67
  /** Android only */
62
68
  defaultValues?: DefaultValues;
63
69
  // postalCodeEnabled: boolean;
64
- onFocusChange(
65
- event: NativeSyntheticEvent<{ focusedField: FieldName | null }>
66
- ): void;
67
- onFormComplete(event: NativeSyntheticEvent<Details>): void;
70
+ onFocusChange(event: OnFocusChangeEvent): void;
71
+ onFormComplete(event: OnFormCompleteEvent): void;
68
72
  disabled?: boolean;
69
73
  }
70
74
 
@@ -2,7 +2,7 @@ require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
  # Keep stripe_version in sync with https://github.com/stripe/stripe-identity-react-native/blob/main/stripe-identity-react-native.podspec
5
- stripe_version = '~> 24.4.0'
5
+ stripe_version = '~> 24.7.0'
6
6
 
7
7
  Pod::Spec.new do |s|
8
8
  s.name = 'stripe-react-native'
@@ -19,6 +19,7 @@ Pod::Spec.new do |s|
19
19
  s.exclude_files = 'ios/Tests/'
20
20
 
21
21
  s.test_spec 'Tests' do |test_spec|
22
+ test_spec.platforms = { ios: '15.1' }
22
23
  test_spec.source_files = 'ios/Tests/**/*.{m,swift}'
23
24
  end
24
25
 
File without changes