@stripe/stripe-react-native 0.14.0 → 0.17.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 (281) hide show
  1. package/.editorconfig +15 -0
  2. package/.husky/pre-commit +4 -0
  3. package/CHANGELOG.md +55 -0
  4. package/android/build.gradle +1 -6
  5. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +2 -0
  6. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +27 -6
  7. package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +34 -3
  8. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +10 -1
  9. package/android/src/main/java/com/reactnativestripesdk/FinancialConnectionsSheetFragment.kt +284 -0
  10. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +17 -7
  11. package/android/src/main/java/com/reactnativestripesdk/GooglePayFragment.kt +8 -0
  12. package/android/src/main/java/com/reactnativestripesdk/GooglePayPaymentMethodLauncherFragment.kt +6 -2
  13. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +12 -11
  14. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +213 -367
  15. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +1 -0
  16. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +45 -28
  17. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +85 -46
  18. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +1 -1
  19. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +2 -2
  20. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +1 -1
  21. package/android/src/main/java/com/reactnativestripesdk/{Errors.kt → utils/Errors.kt} +5 -1
  22. package/android/src/main/java/com/reactnativestripesdk/{Extensions.kt → utils/Extensions.kt} +12 -1
  23. package/android/src/main/java/com/reactnativestripesdk/{Mappers.kt → utils/Mappers.kt} +8 -5
  24. package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +18 -0
  25. package/android/src/main/res/{drawable-night/googlepay_button_background.xml → drawable/googlepay_button_background_dark.xml} +1 -1
  26. package/android/src/main/res/{drawable-night/googlepay_button_content.xml → drawable/googlepay_button_content_dark.xml} +0 -0
  27. package/android/src/main/res/{drawable-night/googlepay_button_overlay.xml → drawable/googlepay_button_overlay_dark.xml} +0 -0
  28. package/android/src/main/res/{drawable-night/pay_with_googlepay_button_content.xml → drawable/pay_with_googlepay_button_content_dark.xml} +0 -0
  29. package/android/src/main/res/{drawable-ar-night/pay_with_googlepay_button_content.xml → drawable-ar/pay_with_googlepay_button_content_dark.xml} +0 -0
  30. package/android/src/main/res/{drawable-bg-night/pay_with_googlepay_button_content.xml → drawable-bg/pay_with_googlepay_button_content_dark.xml} +0 -0
  31. package/android/src/main/res/{drawable-ca-night/pay_with_googlepay_button_content.xml → drawable-ca/pay_with_googlepay_button_content_dark.xml} +0 -0
  32. package/android/src/main/res/{drawable-cs-night/pay_with_googlepay_button_content.xml → drawable-cs/pay_with_googlepay_button_content_dark.xml} +0 -0
  33. package/android/src/main/res/{drawable-da-night/pay_with_googlepay_button_content.xml → drawable-da/pay_with_googlepay_button_content_dark.xml} +0 -0
  34. package/android/src/main/res/{drawable-de-night/pay_with_googlepay_button_content.xml → drawable-de/pay_with_googlepay_button_content_dark.xml} +0 -0
  35. package/android/src/main/res/{drawable-el-night/pay_with_googlepay_button_content.xml → drawable-el/pay_with_googlepay_button_content_dark.xml} +0 -0
  36. package/android/src/main/res/{drawable-es-night/pay_with_googlepay_button_content.xml → drawable-es/pay_with_googlepay_button_content_dark.xml} +0 -0
  37. package/android/src/main/res/{drawable-et-night/pay_with_googlepay_button_content.xml → drawable-et/pay_with_googlepay_button_content_dark.xml} +0 -0
  38. package/android/src/main/res/{drawable-fi-night/pay_with_googlepay_button_content.xml → drawable-fi/pay_with_googlepay_button_content_dark.xml} +0 -0
  39. package/android/src/main/res/{drawable-fr-night/pay_with_googlepay_button_content.xml → drawable-fr/pay_with_googlepay_button_content_dark.xml} +0 -0
  40. package/android/src/main/res/{drawable-night-hdpi/googlepay_button_background_image.9.png → drawable-hdpi/googlepay_button_background_image_dark.9.png} +0 -0
  41. package/android/src/main/res/{drawable-hr-night/pay_with_googlepay_button_content.xml → drawable-hr/pay_with_googlepay_button_content_dark.xml} +0 -0
  42. package/android/src/main/res/{drawable-id-night/pay_with_googlepay_button_content.xml → drawable-id/pay_with_googlepay_button_content_dark.xml} +0 -0
  43. package/android/src/main/res/{drawable-it-night/pay_with_googlepay_button_content.xml → drawable-it/pay_with_googlepay_button_content_dark.xml} +0 -0
  44. package/android/src/main/res/{drawable-ja-night/pay_with_googlepay_button_content.xml → drawable-ja/pay_with_googlepay_button_content_dark.xml} +0 -0
  45. package/android/src/main/res/{drawable-ko-night/pay_with_googlepay_button_content.xml → drawable-ko/pay_with_googlepay_button_content_dark.xml} +0 -0
  46. package/android/src/main/res/{drawable-night-mdpi/googlepay_button_background_image.9.png → drawable-mdpi/googlepay_button_background_image_dark.9.png} +0 -0
  47. package/android/src/main/res/{drawable-ms-night/pay_with_googlepay_button_content.xml → drawable-ms/pay_with_googlepay_button_content_dark.xml} +0 -0
  48. package/android/src/main/res/{drawable-nl-night/pay_with_googlepay_button_content.xml → drawable-nl/pay_with_googlepay_button_content_dark.xml} +0 -0
  49. package/android/src/main/res/{drawable-no-night/pay_with_googlepay_button_content.xml → drawable-no/pay_with_googlepay_button_content_dark.xml} +0 -0
  50. package/android/src/main/res/{drawable-pl-night/pay_with_googlepay_button_content.xml → drawable-pl/pay_with_googlepay_button_content_dark.xml} +0 -0
  51. package/android/src/main/res/{drawable-pt-night/pay_with_googlepay_button_content.xml → drawable-pt/pay_with_googlepay_button_content_dark.xml} +0 -0
  52. package/android/src/main/res/{drawable-ru-night/pay_with_googlepay_button_content.xml → drawable-ru/pay_with_googlepay_button_content_dark.xml} +0 -0
  53. package/android/src/main/res/{drawable-sk-night/pay_with_googlepay_button_content.xml → drawable-sk/pay_with_googlepay_button_content_dark.xml} +0 -0
  54. package/android/src/main/res/{drawable-sl-night/pay_with_googlepay_button_content.xml → drawable-sl/pay_with_googlepay_button_content_dark.xml} +0 -0
  55. package/android/src/main/res/{drawable-sr-night/pay_with_googlepay_button_content.xml → drawable-sr/pay_with_googlepay_button_content_dark.xml} +0 -0
  56. package/android/src/main/res/{drawable-sv-night/pay_with_googlepay_button_content.xml → drawable-sv/pay_with_googlepay_button_content_dark.xml} +0 -0
  57. package/android/src/main/res/{drawable-th-night/pay_with_googlepay_button_content.xml → drawable-th/pay_with_googlepay_button_content_dark.xml} +0 -0
  58. package/android/src/main/res/{drawable-tr-night/pay_with_googlepay_button_content.xml → drawable-tr/pay_with_googlepay_button_content_dark.xml} +0 -0
  59. package/android/src/main/res/{drawable-uk-night/pay_with_googlepay_button_content.xml → drawable-uk/pay_with_googlepay_button_content_dark.xml} +0 -0
  60. package/android/src/main/res/{drawable-night-v21/googlepay_button_background.xml → drawable-v21/googlepay_button_background_dark.xml} +1 -1
  61. package/android/src/main/res/{drawable-night-xhdpi/googlepay_button_background_image.9.png → drawable-xhdpi/googlepay_button_background_image_dark.9.png} +0 -0
  62. package/android/src/main/res/{drawable-night-xxhdpi/googlepay_button_background_image.9.png → drawable-xxhdpi/googlepay_button_background_image_dark.9.png} +0 -0
  63. package/android/src/main/res/{drawable-night-xxxhdpi/googlepay_button_background_image.9.png → drawable-xxxhdpi/googlepay_button_background_image_dark.9.png} +0 -0
  64. package/android/src/main/res/{layout-night/googlepay_button.xml → layout/googlepay_button_dark.xml} +4 -4
  65. package/android/src/main/res/{layout-night/pay_with_googlepay_button.xml → layout/pay_with_googlepay_button_dark.xml} +4 -4
  66. package/ios/ApplePayUtils.swift +159 -0
  67. package/ios/CardFormView.swift +20 -0
  68. package/ios/Errors.swift +11 -0
  69. package/ios/FinancialConnections.swift +258 -0
  70. package/ios/Mappers.swift +20 -22
  71. package/ios/PaymentMethodFactory.swift +9 -0
  72. package/ios/StripeSdk.m +10 -1
  73. package/ios/StripeSdk.swift +67 -44
  74. package/ios/Tests/ApplePayUtilsTests.swift +214 -0
  75. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  76. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  77. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  78. package/lib/commonjs/components/ApplePayButton.js +1 -1
  79. package/lib/commonjs/components/ApplePayButton.js.map +1 -1
  80. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  81. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  82. package/lib/commonjs/components/CardField.js +1 -1
  83. package/lib/commonjs/components/CardField.js.map +1 -1
  84. package/lib/commonjs/components/CardForm.js +1 -1
  85. package/lib/commonjs/components/CardForm.js.map +1 -1
  86. package/lib/commonjs/components/GooglePayButton.js +1 -1
  87. package/lib/commonjs/components/GooglePayButton.js.map +1 -1
  88. package/lib/commonjs/components/StripeContainer.js +1 -1
  89. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  90. package/lib/commonjs/components/StripeProvider.js +1 -1
  91. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  92. package/lib/commonjs/functions.js +1 -1
  93. package/lib/commonjs/functions.js.map +1 -1
  94. package/lib/commonjs/hooks/useApplePay.js +1 -1
  95. package/lib/commonjs/hooks/useApplePay.js.map +1 -1
  96. package/lib/commonjs/hooks/useConfirmPayment.js +1 -1
  97. package/lib/commonjs/hooks/useConfirmPayment.js.map +1 -1
  98. package/lib/commonjs/hooks/useConfirmSetupIntent.js +1 -1
  99. package/lib/commonjs/hooks/useConfirmSetupIntent.js.map +1 -1
  100. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js +2 -0
  101. package/lib/commonjs/hooks/useFinancialConnectionsSheet.js.map +1 -0
  102. package/lib/commonjs/hooks/useGooglePay.js +1 -1
  103. package/lib/commonjs/hooks/useGooglePay.js.map +1 -1
  104. package/lib/commonjs/hooks/usePaymentSheet.js +1 -1
  105. package/lib/commonjs/hooks/usePaymentSheet.js.map +1 -1
  106. package/lib/commonjs/hooks/useStripe.js +1 -1
  107. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  108. package/lib/commonjs/index.js +1 -1
  109. package/lib/commonjs/index.js.map +1 -1
  110. package/lib/commonjs/plugin/withStripe.js +1 -1
  111. package/lib/commonjs/plugin/withStripe.js.map +1 -1
  112. package/lib/commonjs/types/FinancialConnections.js +2 -0
  113. package/lib/commonjs/types/FinancialConnections.js.map +1 -0
  114. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  115. package/lib/commonjs/types/SetupIntent.js.map +1 -1
  116. package/lib/commonjs/types/index.js +1 -1
  117. package/lib/commonjs/types/index.js.map +1 -1
  118. package/lib/module/NativeStripeSdk.js.map +1 -1
  119. package/lib/module/components/AddToWalletButton.js +1 -1
  120. package/lib/module/components/AddToWalletButton.js.map +1 -1
  121. package/lib/module/components/ApplePayButton.js +1 -1
  122. package/lib/module/components/ApplePayButton.js.map +1 -1
  123. package/lib/module/components/AuBECSDebitForm.js +1 -1
  124. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  125. package/lib/module/components/CardField.js +1 -1
  126. package/lib/module/components/CardField.js.map +1 -1
  127. package/lib/module/components/CardForm.js +1 -1
  128. package/lib/module/components/CardForm.js.map +1 -1
  129. package/lib/module/components/GooglePayButton.js +1 -1
  130. package/lib/module/components/GooglePayButton.js.map +1 -1
  131. package/lib/module/components/StripeContainer.js +1 -1
  132. package/lib/module/components/StripeContainer.js.map +1 -1
  133. package/lib/module/components/StripeProvider.js +1 -1
  134. package/lib/module/components/StripeProvider.js.map +1 -1
  135. package/lib/module/functions.js +1 -1
  136. package/lib/module/functions.js.map +1 -1
  137. package/lib/module/hooks/useApplePay.js +1 -1
  138. package/lib/module/hooks/useApplePay.js.map +1 -1
  139. package/lib/module/hooks/useConfirmPayment.js +1 -1
  140. package/lib/module/hooks/useConfirmPayment.js.map +1 -1
  141. package/lib/module/hooks/useConfirmSetupIntent.js +1 -1
  142. package/lib/module/hooks/useConfirmSetupIntent.js.map +1 -1
  143. package/lib/module/hooks/useFinancialConnectionsSheet.js +2 -0
  144. package/lib/module/hooks/useFinancialConnectionsSheet.js.map +1 -0
  145. package/lib/module/hooks/useGooglePay.js +1 -1
  146. package/lib/module/hooks/useGooglePay.js.map +1 -1
  147. package/lib/module/hooks/usePaymentSheet.js +1 -1
  148. package/lib/module/hooks/usePaymentSheet.js.map +1 -1
  149. package/lib/module/hooks/useStripe.js +1 -1
  150. package/lib/module/hooks/useStripe.js.map +1 -1
  151. package/lib/module/index.js +1 -1
  152. package/lib/module/index.js.map +1 -1
  153. package/lib/module/plugin/withStripe.js +1 -1
  154. package/lib/module/plugin/withStripe.js.map +1 -1
  155. package/lib/module/types/FinancialConnections.js +2 -0
  156. package/lib/module/types/FinancialConnections.js.map +1 -0
  157. package/lib/module/types/PaymentIntent.js.map +1 -1
  158. package/lib/module/types/SetupIntent.js.map +1 -1
  159. package/lib/module/types/index.js +1 -1
  160. package/lib/module/types/index.js.map +1 -1
  161. package/lib/typescript/src/NativeStripeSdk.d.ts +3 -1
  162. package/lib/typescript/src/components/CardForm.d.ts +1 -1
  163. package/lib/typescript/src/components/GooglePayButton.d.ts +2 -2
  164. package/lib/typescript/src/functions.d.ts +15 -1
  165. package/lib/typescript/src/hooks/useFinancialConnectionsSheet.d.ts +11 -0
  166. package/lib/typescript/src/hooks/useStripe.d.ts +3 -1
  167. package/lib/typescript/src/index.d.ts +1 -0
  168. package/lib/typescript/src/types/ApplePay.d.ts +31 -5
  169. package/lib/typescript/src/types/FinancialConnections.d.ts +100 -0
  170. package/lib/typescript/src/types/PaymentIntent.d.ts +1 -0
  171. package/lib/typescript/src/types/PaymentMethod.d.ts +9 -1
  172. package/lib/typescript/src/types/PaymentSheet.d.ts +17 -15
  173. package/lib/typescript/src/types/SetupIntent.d.ts +1 -0
  174. package/lib/typescript/src/types/Token.d.ts +18 -7
  175. package/lib/typescript/src/types/index.d.ts +2 -1
  176. package/package.json +11 -23
  177. package/src/NativeStripeSdk.tsx +7 -0
  178. package/src/components/CardForm.tsx +2 -2
  179. package/src/components/GooglePayButton.tsx +8 -2
  180. package/src/functions.ts +58 -0
  181. package/src/hooks/useFinancialConnectionsSheet.tsx +34 -0
  182. package/src/hooks/useStripe.tsx +21 -0
  183. package/src/index.tsx +1 -0
  184. package/src/types/ApplePay.ts +39 -6
  185. package/src/types/FinancialConnections.ts +126 -0
  186. package/src/types/PaymentIntent.ts +1 -0
  187. package/src/types/PaymentMethod.ts +11 -1
  188. package/src/types/PaymentSheet.ts +34 -36
  189. package/src/types/SetupIntent.ts +1 -0
  190. package/src/types/Token.ts +24 -7
  191. package/src/types/index.ts +2 -0
  192. package/android/.DS_Store +0 -0
  193. package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  194. package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
  195. package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
  196. package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  197. package/android/.gradle/7.1/gc.properties +0 -0
  198. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  199. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  200. package/android/.gradle/checksums/checksums.lock +0 -0
  201. package/android/.gradle/vcs-1/gc.properties +0 -0
  202. package/android/.idea/.gitignore +0 -3
  203. package/android/.idea/gradle.xml +0 -13
  204. package/android/.idea/misc.xml +0 -9
  205. package/android/.idea/modules/android.iml +0 -18
  206. package/android/.idea/modules.xml +0 -8
  207. package/android/.idea/vcs.xml +0 -6
  208. package/android/.idea/workspace.xml +0 -52
  209. package/android/local.properties +0 -8
  210. package/android/src/.DS_Store +0 -0
  211. package/android/src/androidTest/.DS_Store +0 -0
  212. package/android/src/androidTest/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxyTest.kt +0 -35
  213. package/android/src/main/res/drawable-night/googlepay_button_no_shadow_background.xml +0 -6
  214. package/android/src/main/res/drawable-night-hdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  215. package/android/src/main/res/drawable-night-mdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  216. package/android/src/main/res/drawable-night-v21/googlepay_button_no_shadow_background.xml +0 -7
  217. package/android/src/main/res/drawable-night-xhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  218. package/android/src/main/res/drawable-night-xxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  219. package/android/src/main/res/drawable-night-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  220. package/android/src/main/res/values-night/googlepay_strings.xml +0 -12
  221. package/ios/.DS_Store +0 -0
  222. package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  223. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  224. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  225. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +0 -22
  226. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +0 -27
  227. package/lib/typescript/e2e/buyNowPayLater.test.d.ts +0 -1
  228. package/lib/typescript/e2e/helpers.d.ts +0 -5
  229. package/lib/typescript/e2e/payments.test.d.ts +0 -1
  230. package/lib/typescript/e2e/paymentsWithRedirects.test.d.ts +0 -1
  231. package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +0 -16
  232. package/lib/typescript/e2e/screenObject/HomeScreen.d.ts +0 -6
  233. package/lib/typescript/e2e/screenObject/components/BECSForm.d.ts +0 -8
  234. package/lib/typescript/e2e/screenObject/components/CardField.d.ts +0 -10
  235. package/lib/typescript/example/server/index.d.ts +0 -1
  236. package/lib/typescript/example/server/utils.d.ts +0 -11
  237. package/lib/typescript/example/src/App.d.ts +0 -45
  238. package/lib/typescript/example/src/Config.d.ts +0 -2
  239. package/lib/typescript/example/src/colors.d.ts +0 -8
  240. package/lib/typescript/example/src/components/Button.d.ts +0 -11
  241. package/lib/typescript/example/src/components/Collapse.d.ts +0 -6
  242. package/lib/typescript/example/src/components/PaymentScreen.d.ts +0 -7
  243. package/lib/typescript/example/src/helpers.d.ts +0 -1
  244. package/lib/typescript/example/src/screens/ACHPaymentScreen.d.ts +0 -1
  245. package/lib/typescript/example/src/screens/ACHSetupScreen.d.ts +0 -1
  246. package/lib/typescript/example/src/screens/AfterpayClearpayPaymentScreen.d.ts +0 -1
  247. package/lib/typescript/example/src/screens/AlipayPaymentScreen.d.ts +0 -1
  248. package/lib/typescript/example/src/screens/ApplePayScreen.d.ts +0 -1
  249. package/lib/typescript/example/src/screens/AuBECSDebitPaymentScreen.d.ts +0 -1
  250. package/lib/typescript/example/src/screens/AuBECSDebitSetupPaymentScreen.d.ts +0 -1
  251. package/lib/typescript/example/src/screens/BancontactPaymentScreen.d.ts +0 -1
  252. package/lib/typescript/example/src/screens/BancontactSetupFuturePaymentScreen.d.ts +0 -1
  253. package/lib/typescript/example/src/screens/CVCReCollectionScreen.d.ts +0 -1
  254. package/lib/typescript/example/src/screens/CreateTokenScreen.d.ts +0 -1
  255. package/lib/typescript/example/src/screens/EPSPaymentScreen.d.ts +0 -1
  256. package/lib/typescript/example/src/screens/FPXPaymentScreen.d.ts +0 -1
  257. package/lib/typescript/example/src/screens/GiropayPaymentScreen.d.ts +0 -1
  258. package/lib/typescript/example/src/screens/GooglePayScreen.d.ts +0 -1
  259. package/lib/typescript/example/src/screens/GrabPayPaymentScreen.d.ts +0 -1
  260. package/lib/typescript/example/src/screens/HomeScreen.d.ts +0 -1
  261. package/lib/typescript/example/src/screens/IdealPaymentScreen.d.ts +0 -1
  262. package/lib/typescript/example/src/screens/IdealSetupFuturePaymentScreen.d.ts +0 -1
  263. package/lib/typescript/example/src/screens/KlarnaPaymentScreen.d.ts +0 -1
  264. package/lib/typescript/example/src/screens/MultilineWebhookPaymentScreen.d.ts +0 -1
  265. package/lib/typescript/example/src/screens/NoWebhookPaymentScreen.d.ts +0 -1
  266. package/lib/typescript/example/src/screens/OxxoPaymentScreen.d.ts +0 -1
  267. package/lib/typescript/example/src/screens/P24PaymentScreen.d.ts +0 -1
  268. package/lib/typescript/example/src/screens/PayPalScreen.d.ts +0 -1
  269. package/lib/typescript/example/src/screens/PaymentResultScreen.d.ts +0 -8
  270. package/lib/typescript/example/src/screens/PaymentSheetAppearance.d.ts +0 -3
  271. package/lib/typescript/example/src/screens/PaymentsUICompleteScreen.d.ts +0 -1
  272. package/lib/typescript/example/src/screens/PaymentsUICustomScreen.d.ts +0 -1
  273. package/lib/typescript/example/src/screens/SepaPaymentScreen.d.ts +0 -1
  274. package/lib/typescript/example/src/screens/SepaSetupFuturePaymentScreen.d.ts +0 -1
  275. package/lib/typescript/example/src/screens/SetupFuturePaymentScreen.d.ts +0 -1
  276. package/lib/typescript/example/src/screens/SofortPaymentScreen.d.ts +0 -1
  277. package/lib/typescript/example/src/screens/SofortSetupFuturePaymentScreen.d.ts +0 -1
  278. package/lib/typescript/example/src/screens/WebhookPaymentScreen.d.ts +0 -1
  279. package/lib/typescript/src/plugin/__tests__/withStripe-test.d.ts +0 -1
  280. package/src/plugin/__tests__/fixtures/sample-AndroidManifest.xml +0 -24
  281. package/src/plugin/__tests__/withStripe-test.ts +0 -111
@@ -1,22 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Bucket
3
- uuid = "18A7FEF5-1FA3-4609-B152-0287F2E115A0"
4
- type = "1"
5
- version = "2.0">
6
- <Breakpoints>
7
- <BreakpointProxy
8
- BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9
- <BreakpointContent
10
- uuid = "C0FB3E07-7654-41DA-96B5-07363EE2CDC7"
11
- shouldBeEnabled = "Yes"
12
- ignoreCount = "0"
13
- continueAfterRunningActions = "No"
14
- filePath = "ApplePayButtonManager.m"
15
- startingColumnNumber = "9223372036854775807"
16
- endingColumnNumber = "9223372036854775807"
17
- startingLineNumber = "11"
18
- endingLineNumber = "11">
19
- </BreakpointContent>
20
- </BreakpointProxy>
21
- </Breakpoints>
22
- </Bucket>
@@ -1,27 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
- <plist version="1.0">
4
- <dict>
5
- <key>SchemeUserState</key>
6
- <dict>
7
- <key>StripeSdk.xcscheme_^#shared#^_</key>
8
- <dict>
9
- <key>orderHint</key>
10
- <integer>0</integer>
11
- </dict>
12
- <key>Tests.xcscheme_^#shared#^_</key>
13
- <dict>
14
- <key>orderHint</key>
15
- <integer>1</integer>
16
- </dict>
17
- </dict>
18
- <key>SuppressBuildableAutocreation</key>
19
- <dict>
20
- <key>FC55C2D928620B7D00526360</key>
21
- <dict>
22
- <key>primary</key>
23
- <true/>
24
- </dict>
25
- </dict>
26
- </dict>
27
- </plist>
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- /// <reference types="webdriverio/sync" />
2
- export declare function getElementByText(text: string): WebdriverIO.Element;
3
- export declare function getElementByTextContaining(text: string): WebdriverIO.Element;
4
- export declare function getTextInputByPlaceholder(placeholder: string): WebdriverIO.Element;
5
- export declare function clickButtonContainingText(text: string): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- declare class BasicPaymentScreen {
2
- pay({ email, bankName, iban, buttonText, }: {
3
- email: string;
4
- bankName?: string;
5
- iban?: string;
6
- buttonText?: string;
7
- }): void;
8
- authorize({ pause }?: {
9
- pause?: number | undefined;
10
- }): void;
11
- checkStatus(status?: string): void;
12
- authorizeACH(): void;
13
- }
14
- export declare function getAllWebviewContexts(): string[];
15
- declare const _default: BasicPaymentScreen;
16
- export default _default;
@@ -1,6 +0,0 @@
1
- declare const SCREENS: readonly ["Accept a payment", "More payment scenarios", "Create tokens", "Set up future payments", "inalize payments on the server", "Bank Debits", "SEPA Direct Debit payment", "SEPA Direct Debit set up", "Bank redirects", "Bancontact Payment", "Bancontact SEPA Direct Debit set up", "EPS", "FPX", "giropay", "iDEAL payment", "iDEAL SEPA Direct Debit set up", "Przelewy24", "Sofort", "Sofort SEPA Direct Debit set up", "Buy now pay later", "Afterpay and Clearpay", "Klarna", "Vouchers", "Wallets", "Alipay", "Apple Pay", "GrabPay", "OXXO", "Finalize payments on the server", "Recollect a CVC", "Card element only", "BECS Direct Debit payment", "BECS Direct Debit set up", "WeChat Pay", "ACH payment", "ACH setup"];
2
- declare class HomeScreen {
3
- goTo(screen: typeof SCREENS[number]): void;
4
- }
5
- declare const _default: HomeScreen;
6
- export default _default;
@@ -1,8 +0,0 @@
1
- declare class BECSForm {
2
- setName(value: string): void;
3
- setEmail(value: string): void;
4
- setBSB(value: string): void;
5
- setAccountNumber(value: string): void;
6
- }
7
- declare const _default: BECSForm;
8
- export default _default;
@@ -1,10 +0,0 @@
1
- /// <reference types="webdriverio/sync" />
2
- declare class CardField {
3
- getEditTextElement(selector: string): WebdriverIO.Element;
4
- setCardNumber(value: string): void;
5
- setExpiryDate(value: string): void;
6
- setCvcNumber(value: string): void;
7
- setPostalCode(value: string): void;
8
- }
9
- declare const _default: CardField;
10
- export default _default;
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- import type Stripe from 'stripe';
2
- export declare const generateResponse: (intent: Stripe.PaymentIntent) => {
3
- clientSecret: string | null;
4
- requiresAction: boolean;
5
- status: string;
6
- } | {
7
- clientSecret: string | null;
8
- status: string;
9
- } | {
10
- error: string;
11
- };
@@ -1,45 +0,0 @@
1
- export declare type RootStackParamList = {
2
- WebhookPaymentScreen: undefined;
3
- HomeScreen: undefined;
4
- NoWebhookPaymentScreen: undefined;
5
- CreateTokenScreen: undefined;
6
- ApplePayScreen: undefined;
7
- SetupFuturePaymentScreen: undefined;
8
- PaymentsUICompleteScreen: undefined;
9
- PaymentsUICustomScreen: undefined;
10
- CVCReCollectionScreen: undefined;
11
- IdealPaymentScreen: undefined;
12
- IdealSetupFuturePaymentScreen: undefined;
13
- AlipayPaymentScreen: undefined;
14
- PaymentResultScreen: {
15
- url: string;
16
- };
17
- SofortPaymentScreen: undefined;
18
- SofortSetupFuturePaymentScreen: undefined;
19
- FPXPaymentScreen: undefined;
20
- BancontactPaymentScreen: undefined;
21
- BancontactSetupFuturePaymentScreen: undefined;
22
- SepaPaymentScreen: undefined;
23
- SepaSetupFuturePaymentScreen: undefined;
24
- OxxoPaymentScreen: undefined;
25
- GiropayPaymentScreen: undefined;
26
- EPSPaymentScreen: undefined;
27
- GrabPayPaymentScreen: undefined;
28
- P24PaymentScreen: undefined;
29
- AuBECSDebitPaymentScreen: undefined;
30
- AfterpayClearpayPaymentScreen: undefined;
31
- KlarnaPaymentScreen: undefined;
32
- AuBECSDebitSetupPaymentScreen: undefined;
33
- MultilineWebhookPaymentScreen: undefined;
34
- GooglePayScreen: undefined;
35
- ACHPaymentScreen: undefined;
36
- ACHSetupScreen: undefined;
37
- PayPalScreen: undefined;
38
- };
39
- declare global {
40
- namespace ReactNavigation {
41
- interface RootParamList extends RootStackParamList {
42
- }
43
- }
44
- }
45
- export default function App(): JSX.Element;
@@ -1,2 +0,0 @@
1
- export declare const LOCAL_URL: string;
2
- export declare const API_URL: string;
@@ -1,8 +0,0 @@
1
- export declare const colors: {
2
- blurple: string;
3
- blurple_dark: string;
4
- white: string;
5
- light_gray: string;
6
- dark_gray: string;
7
- slate: string;
8
- };
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { AccessibilityProps } from 'react-native';
3
- declare type Props = AccessibilityProps & {
4
- title?: string | React.ReactElement;
5
- variant?: 'default' | 'primary';
6
- disabled?: boolean;
7
- loading?: boolean;
8
- onPress(): void;
9
- };
10
- export default function Button({ title, variant, disabled, loading, onPress, ...props }: Props): JSX.Element;
11
- export {};
@@ -1,6 +0,0 @@
1
- import * as React from 'react';
2
- interface Props {
3
- title: string;
4
- }
5
- export declare const Collapse: React.FC<Props>;
6
- export {};
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- paymentMethod?: string;
4
- onInit?(): void;
5
- }
6
- declare const PaymentScreen: React.FC<Props>;
7
- export default PaymentScreen;
@@ -1 +0,0 @@
1
- export declare function fetchPublishableKey(paymentMethod?: string): Promise<string | null>;
@@ -1 +0,0 @@
1
- export default function ACHPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function ACHSetupScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function AfterpayClearpayPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function AlipayPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function ApplePayScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function AuBECSDebitPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function AuBECSDebitSetupPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function BancontactPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function BancontactSetupFuturePaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function CVCReCollectionScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function CreateTokenScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function EPSPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function FPXPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function GiropayPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function GooglePayScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function GrabPayPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function HomeScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function IdealPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function IdealSetupFuturePaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function KlarnaPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function MultilineWebhookPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function NoWebhookPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function OxxoPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function P24PaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function PayPalScreen(): JSX.Element;
@@ -1,8 +0,0 @@
1
- import type { RouteProp } from '@react-navigation/native';
2
- import type { RootStackParamList } from '../App';
3
- declare type ScreenRouteProp = RouteProp<RootStackParamList, 'PaymentResultScreen'>;
4
- declare type Props = {
5
- route: ScreenRouteProp;
6
- };
7
- export default function PaymentResultScreen({ route }: Props): JSX.Element;
8
- export {};
@@ -1,3 +0,0 @@
1
- import type { PaymentSheet } from '@stripe/stripe-react-native';
2
- declare const appearance: PaymentSheet.AppearanceParams;
3
- export default appearance;
@@ -1 +0,0 @@
1
- export default function PaymentsUICompleteScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function PaymentsUICustomScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function SepaPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function SepaSetupFuturePaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function SetupFuturePaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function SofortPaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function SofortSetupFuturePaymentScreen(): JSX.Element;
@@ -1 +0,0 @@
1
- export default function WebhookPaymentScreen(): JSX.Element;
@@ -1,24 +0,0 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
- package="com.expo.mycoolapp">
3
- <uses-permission android:name="android.permission.INTERNET" />
4
- <application
5
- android:name=".MainApplication"
6
- android:label="@string/app_name"
7
- android:icon="@mipmap/ic_launcher"
8
- android:roundIcon="@mipmap/ic_launcher_round"
9
- android:allowBackup="true"
10
- android:theme="@style/AppTheme">
11
- <activity
12
- android:name=".MainActivity"
13
- android:launchMode="singleTask"
14
- android:label="@string/app_name"
15
- android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
16
- android:windowSoftInputMode="adjustResize">
17
- <intent-filter>
18
- <action android:name="android.intent.action.MAIN" />
19
- <category android:name="android.intent.category.LAUNCHER" />
20
- </intent-filter>
21
- </activity>
22
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
23
- </application>
24
- </manifest>
@@ -1,111 +0,0 @@
1
- import { AndroidConfig } from '@expo/config-plugins';
2
- import { resolve } from 'path';
3
-
4
- import { setApplePayEntitlement, setGooglePayMetaData } from '../withStripe';
5
-
6
- jest.mock(
7
- '@stripe/stripe-react-native/package.json',
8
- () => ({
9
- name: 'stripe-react-native',
10
- version: '0.1.1',
11
- }),
12
- { virtual: true }
13
- );
14
-
15
- const { getMainApplicationOrThrow, readAndroidManifestAsync } =
16
- AndroidConfig.Manifest;
17
-
18
- const fixturesPath = resolve(__dirname, 'fixtures');
19
- const sampleManifestPath = resolve(fixturesPath, 'sample-AndroidManifest.xml');
20
-
21
- describe('setApplePayEntitlement', () => {
22
- it(`sets the apple pay entitlement when none exist`, () => {
23
- expect(setApplePayEntitlement('merchant.com.example', {})).toMatchObject({
24
- 'com.apple.developer.in-app-payments': ['merchant.com.example'],
25
- });
26
- });
27
-
28
- it(`sets the apple pay entitlement when some already exist`, () => {
29
- expect(
30
- setApplePayEntitlement('merchant.com.example', {
31
- 'com.apple.developer.in-app-payments': [
32
- 'some.other.merchantIdentifier',
33
- ],
34
- })
35
- ).toMatchObject({
36
- 'com.apple.developer.in-app-payments': [
37
- 'some.other.merchantIdentifier',
38
- 'merchant.com.example',
39
- ],
40
- });
41
- });
42
-
43
- it(`does not duplicate the merchantIdentifier in entitlements`, () => {
44
- expect(
45
- setApplePayEntitlement('merchant.com.example', {
46
- 'com.apple.developer.in-app-payments': ['merchant.com.example'],
47
- })
48
- ).toMatchObject({
49
- 'com.apple.developer.in-app-payments': ['merchant.com.example'],
50
- });
51
- });
52
-
53
- it(`does not add in-app-payments if no merchant ID is provided`, () => {
54
- expect(setApplePayEntitlement('', {})).toEqual({});
55
- expect(setApplePayEntitlement([], {})).toEqual({});
56
- expect(setApplePayEntitlement([''], {})).toEqual({});
57
- });
58
-
59
- it(`properly handles multiple merchantIdentifiers`, () => {
60
- expect(
61
- setApplePayEntitlement(['merchant.com.example', 'merchant.com.example'], {
62
- 'com.apple.developer.in-app-payments': ['merchant.com.example'],
63
- })
64
- ).toMatchObject({
65
- 'com.apple.developer.in-app-payments': ['merchant.com.example'],
66
- });
67
-
68
- expect(
69
- setApplePayEntitlement(
70
- ['merchant.com.example', 'merchant.com.example.different'],
71
- {
72
- 'com.apple.developer.in-app-payments': ['merchant.com.example'],
73
- }
74
- )
75
- ).toMatchObject({
76
- 'com.apple.developer.in-app-payments': [
77
- 'merchant.com.example',
78
- 'merchant.com.example.different',
79
- ],
80
- });
81
- });
82
- });
83
-
84
- describe('setGooglePayMetaData', () => {
85
- it(`Properly sets GooglePay metadata in AndroidManifest to true, then removes it when set to false`, async () => {
86
- let androidManifestJson = await readAndroidManifestAsync(
87
- sampleManifestPath
88
- );
89
- androidManifestJson = setGooglePayMetaData(true, androidManifestJson);
90
- let mainApplication = getMainApplicationOrThrow(androidManifestJson);
91
- if (!mainApplication['meta-data']) {
92
- throw new Error('Failed to add metadata to AndroidManifest.xml');
93
- }
94
- let apiKeyItem = mainApplication['meta-data'].filter(
95
- (e) => e.$['android:name'] === 'com.google.android.gms.wallet.api.enabled'
96
- );
97
- expect(apiKeyItem).toHaveLength(1);
98
- expect(apiKeyItem[0].$['android:value']).toMatch('true');
99
-
100
- // Now let's make sure we can set it back to false, and NOT add a new metadata item
101
- androidManifestJson = setGooglePayMetaData(false, androidManifestJson);
102
- mainApplication = getMainApplicationOrThrow(androidManifestJson);
103
- if (!mainApplication['meta-data']) {
104
- throw new Error('Failed to read metadata from AndroidManifest.xml');
105
- }
106
- apiKeyItem = mainApplication['meta-data'].filter(
107
- (e) => e.$['android:name'] === 'com.google.android.gms.wallet.api.enabled'
108
- );
109
- expect(apiKeyItem).toHaveLength(0);
110
- });
111
- });