@stripe/stripe-react-native 0.13.1 → 0.16.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 (219) hide show
  1. package/.editorconfig +15 -0
  2. package/CHANGELOG.md +68 -11
  3. package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  4. package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
  5. package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
  6. package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/7.1/gc.properties +0 -0
  8. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  9. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  10. package/android/.gradle/checksums/checksums.lock +0 -0
  11. package/android/.gradle/vcs-1/gc.properties +0 -0
  12. package/android/.idea/gradle.xml +13 -0
  13. package/android/.idea/misc.xml +9 -0
  14. package/android/.idea/modules/android.iml +18 -0
  15. package/android/.idea/modules.xml +8 -0
  16. package/android/.idea/vcs.xml +6 -0
  17. package/android/build.gradle +6 -0
  18. package/android/local.properties +8 -0
  19. package/android/src/main/java/com/reactnativestripesdk/AuBECSDebitFormView.kt +2 -0
  20. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +28 -6
  21. package/android/src/main/java/com/reactnativestripesdk/CardFormView.kt +34 -3
  22. package/android/src/main/java/com/reactnativestripesdk/CollectBankAccountLauncherFragment.kt +5 -0
  23. package/android/src/main/java/com/reactnativestripesdk/GooglePayButtonView.kt +17 -7
  24. package/android/src/main/java/com/reactnativestripesdk/GooglePayFragment.kt +4 -0
  25. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +3 -0
  26. package/android/src/main/java/com/reactnativestripesdk/PaymentMethodCreateParamsFactory.kt +213 -367
  27. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetAppearance.kt +1 -0
  28. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +48 -28
  29. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +69 -23
  30. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/AddToWalletButtonView.kt +1 -2
  31. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/PushProvisioningProxy.kt +19 -7
  32. package/android/src/main/java/com/reactnativestripesdk/pushprovisioning/TapAndPayProxy.kt +46 -39
  33. package/android/src/main/java/com/reactnativestripesdk/{Errors.kt → utils/Errors.kt} +1 -1
  34. package/android/src/main/java/com/reactnativestripesdk/{Extensions.kt → utils/Extensions.kt} +1 -1
  35. package/android/src/main/java/com/reactnativestripesdk/{Mappers.kt → utils/Mappers.kt} +19 -1
  36. package/android/src/main/java/com/reactnativestripesdk/utils/PostalCodeUtilities.kt +18 -0
  37. package/android/src/main/res/{drawable-night/googlepay_button_background.xml → drawable/googlepay_button_background_dark.xml} +1 -1
  38. package/android/src/main/res/{drawable-night/googlepay_button_content.xml → drawable/googlepay_button_content_dark.xml} +0 -0
  39. package/android/src/main/res/{drawable-night/googlepay_button_overlay.xml → drawable/googlepay_button_overlay_dark.xml} +0 -0
  40. package/android/src/main/res/{drawable-night/pay_with_googlepay_button_content.xml → drawable/pay_with_googlepay_button_content_dark.xml} +0 -0
  41. 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
  42. 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
  43. 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
  44. 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
  45. 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
  46. 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
  47. 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
  48. 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
  49. 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
  50. 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
  51. 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
  52. 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
  53. 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
  54. 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
  55. 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
  56. 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
  57. 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
  58. 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
  59. 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
  60. 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
  61. 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
  62. 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
  63. 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
  64. 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
  65. 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
  66. 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
  67. 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
  68. 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
  69. 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
  70. 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
  71. 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
  72. package/android/src/main/res/{drawable-night-v21/googlepay_button_background.xml → drawable-v21/googlepay_button_background_dark.xml} +1 -1
  73. 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
  74. 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
  75. 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
  76. package/android/src/main/res/{layout-night/googlepay_button.xml → layout/googlepay_button_dark.xml} +4 -4
  77. package/android/src/main/res/{layout-night/pay_with_googlepay_button.xml → layout/pay_with_googlepay_button_dark.xml} +4 -4
  78. package/ios/ApplePayUtils.swift +159 -0
  79. package/ios/CardFieldView.swift +11 -8
  80. package/ios/CardFormView.swift +20 -0
  81. package/ios/Mappers.swift +8 -13
  82. package/ios/PaymentMethodFactory.swift +9 -0
  83. package/ios/StripeSdk.m +5 -0
  84. package/ios/StripeSdk.swift +60 -53
  85. package/ios/StripeSdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  86. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  87. package/ios/StripeSdk.xcodeproj/project.xcworkspace/xcuserdata/charliecruzan.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  88. package/ios/StripeSdk.xcodeproj/xcshareddata/xcschemes/Tests.xcscheme +52 -0
  89. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +22 -0
  90. package/ios/StripeSdk.xcodeproj/xcuserdata/charliecruzan.xcuserdatad/xcschemes/xcschememanagement.plist +27 -0
  91. package/ios/Tests/ApplePayUtilsTests.swift +214 -0
  92. package/ios/Tests/PushProvisioningTests.swift +49 -0
  93. package/ios/pushprovisioning/AddToWalletButtonView.swift +1 -5
  94. package/ios/pushprovisioning/PushProvisioningUtils.swift +64 -0
  95. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  96. package/lib/commonjs/components/AddToWalletButton.js +1 -1
  97. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  98. package/lib/commonjs/components/ApplePayButton.js +1 -1
  99. package/lib/commonjs/components/ApplePayButton.js.map +1 -1
  100. package/lib/commonjs/components/AuBECSDebitForm.js +1 -1
  101. package/lib/commonjs/components/AuBECSDebitForm.js.map +1 -1
  102. package/lib/commonjs/components/CardField.js +1 -1
  103. package/lib/commonjs/components/CardField.js.map +1 -1
  104. package/lib/commonjs/components/CardForm.js +1 -1
  105. package/lib/commonjs/components/CardForm.js.map +1 -1
  106. package/lib/commonjs/components/GooglePayButton.js +1 -1
  107. package/lib/commonjs/components/GooglePayButton.js.map +1 -1
  108. package/lib/commonjs/components/StripeContainer.js +1 -1
  109. package/lib/commonjs/components/StripeContainer.js.map +1 -1
  110. package/lib/commonjs/functions.js +1 -1
  111. package/lib/commonjs/functions.js.map +1 -1
  112. package/lib/commonjs/hooks/useStripe.js +1 -1
  113. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  114. package/lib/commonjs/types/index.js.map +1 -1
  115. package/lib/module/NativeStripeSdk.js.map +1 -1
  116. package/lib/module/components/AddToWalletButton.js +1 -1
  117. package/lib/module/components/AddToWalletButton.js.map +1 -1
  118. package/lib/module/components/ApplePayButton.js +1 -1
  119. package/lib/module/components/ApplePayButton.js.map +1 -1
  120. package/lib/module/components/AuBECSDebitForm.js +1 -1
  121. package/lib/module/components/AuBECSDebitForm.js.map +1 -1
  122. package/lib/module/components/CardField.js +1 -1
  123. package/lib/module/components/CardField.js.map +1 -1
  124. package/lib/module/components/CardForm.js +1 -1
  125. package/lib/module/components/CardForm.js.map +1 -1
  126. package/lib/module/components/GooglePayButton.js +1 -1
  127. package/lib/module/components/GooglePayButton.js.map +1 -1
  128. package/lib/module/components/StripeContainer.js +1 -1
  129. package/lib/module/components/StripeContainer.js.map +1 -1
  130. package/lib/module/functions.js +1 -1
  131. package/lib/module/functions.js.map +1 -1
  132. package/lib/module/hooks/useStripe.js +1 -1
  133. package/lib/module/hooks/useStripe.js.map +1 -1
  134. package/lib/module/types/index.js.map +1 -1
  135. package/lib/typescript/src/NativeStripeSdk.d.ts +2 -1
  136. package/lib/typescript/src/components/AddToWalletButton.d.ts +1 -1
  137. package/lib/typescript/src/components/CardForm.d.ts +1 -1
  138. package/lib/typescript/src/components/GooglePayButton.d.ts +2 -2
  139. package/lib/typescript/src/functions.d.ts +2 -1
  140. package/lib/typescript/src/hooks/useStripe.d.ts +2 -1
  141. package/lib/typescript/src/types/ApplePay.d.ts +31 -5
  142. package/lib/typescript/src/types/PaymentMethod.d.ts +9 -1
  143. package/lib/typescript/src/types/PaymentSheet.d.ts +19 -16
  144. package/lib/typescript/src/types/index.d.ts +20 -0
  145. package/package.json +7 -15
  146. package/src/NativeStripeSdk.tsx +5 -0
  147. package/src/components/AddToWalletButton.tsx +1 -1
  148. package/src/components/CardForm.tsx +2 -2
  149. package/src/components/GooglePayButton.tsx +8 -2
  150. package/src/functions.ts +25 -0
  151. package/src/hooks/useStripe.tsx +13 -0
  152. package/src/types/ApplePay.ts +39 -6
  153. package/src/types/PaymentMethod.ts +11 -1
  154. package/src/types/PaymentSheet.ts +34 -35
  155. package/src/types/index.ts +27 -0
  156. package/stripe-react-native.podspec +6 -1
  157. package/android/src/main/res/drawable-night/googlepay_button_no_shadow_background.xml +0 -6
  158. package/android/src/main/res/drawable-night-hdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  159. package/android/src/main/res/drawable-night-mdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  160. package/android/src/main/res/drawable-night-v21/googlepay_button_no_shadow_background.xml +0 -7
  161. package/android/src/main/res/drawable-night-xhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  162. package/android/src/main/res/drawable-night-xxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  163. package/android/src/main/res/drawable-night-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
  164. package/android/src/main/res/values-night/googlepay_strings.xml +0 -12
  165. package/lib/typescript/e2e/buyNowPayLater.test.d.ts +0 -1
  166. package/lib/typescript/e2e/helpers.d.ts +0 -5
  167. package/lib/typescript/e2e/payments.test.d.ts +0 -1
  168. package/lib/typescript/e2e/paymentsWithRedirects.test.d.ts +0 -1
  169. package/lib/typescript/e2e/screenObject/BasicPaymentScreen.d.ts +0 -17
  170. package/lib/typescript/e2e/screenObject/HomeScreen.d.ts +0 -6
  171. package/lib/typescript/e2e/screenObject/components/BECSForm.d.ts +0 -8
  172. package/lib/typescript/e2e/screenObject/components/CardField.d.ts +0 -10
  173. package/lib/typescript/example/server/index.d.ts +0 -1
  174. package/lib/typescript/example/server/utils.d.ts +0 -11
  175. package/lib/typescript/example/src/App.d.ts +0 -45
  176. package/lib/typescript/example/src/Config.d.ts +0 -2
  177. package/lib/typescript/example/src/colors.d.ts +0 -8
  178. package/lib/typescript/example/src/components/Button.d.ts +0 -11
  179. package/lib/typescript/example/src/components/Collapse.d.ts +0 -6
  180. package/lib/typescript/example/src/components/PaymentScreen.d.ts +0 -7
  181. package/lib/typescript/example/src/helpers.d.ts +0 -1
  182. package/lib/typescript/example/src/screens/ACHPaymentScreen.d.ts +0 -1
  183. package/lib/typescript/example/src/screens/ACHSetupScreen.d.ts +0 -1
  184. package/lib/typescript/example/src/screens/AfterpayClearpayPaymentScreen.d.ts +0 -1
  185. package/lib/typescript/example/src/screens/AlipayPaymentScreen.d.ts +0 -1
  186. package/lib/typescript/example/src/screens/ApplePayScreen.d.ts +0 -1
  187. package/lib/typescript/example/src/screens/AuBECSDebitPaymentScreen.d.ts +0 -1
  188. package/lib/typescript/example/src/screens/AuBECSDebitSetupPaymentScreen.d.ts +0 -1
  189. package/lib/typescript/example/src/screens/BancontactPaymentScreen.d.ts +0 -1
  190. package/lib/typescript/example/src/screens/BancontactSetupFuturePaymentScreen.d.ts +0 -1
  191. package/lib/typescript/example/src/screens/CVCReCollectionScreen.d.ts +0 -1
  192. package/lib/typescript/example/src/screens/CreateTokenScreen.d.ts +0 -1
  193. package/lib/typescript/example/src/screens/EPSPaymentScreen.d.ts +0 -1
  194. package/lib/typescript/example/src/screens/FPXPaymentScreen.d.ts +0 -1
  195. package/lib/typescript/example/src/screens/GiropayPaymentScreen.d.ts +0 -1
  196. package/lib/typescript/example/src/screens/GooglePayScreen.d.ts +0 -1
  197. package/lib/typescript/example/src/screens/GrabPayPaymentScreen.d.ts +0 -1
  198. package/lib/typescript/example/src/screens/HomeScreen.d.ts +0 -1
  199. package/lib/typescript/example/src/screens/IdealPaymentScreen.d.ts +0 -1
  200. package/lib/typescript/example/src/screens/IdealSetupFuturePaymentScreen.d.ts +0 -1
  201. package/lib/typescript/example/src/screens/KlarnaPaymentScreen.d.ts +0 -1
  202. package/lib/typescript/example/src/screens/MultilineWebhookPaymentScreen.d.ts +0 -1
  203. package/lib/typescript/example/src/screens/NoWebhookPaymentScreen.d.ts +0 -1
  204. package/lib/typescript/example/src/screens/OxxoPaymentScreen.d.ts +0 -1
  205. package/lib/typescript/example/src/screens/P24PaymentScreen.d.ts +0 -1
  206. package/lib/typescript/example/src/screens/PayPalScreen.d.ts +0 -1
  207. package/lib/typescript/example/src/screens/PaymentResultScreen.d.ts +0 -8
  208. package/lib/typescript/example/src/screens/PaymentSheetAppearance.d.ts +0 -3
  209. package/lib/typescript/example/src/screens/PaymentsUICompleteScreen.d.ts +0 -1
  210. package/lib/typescript/example/src/screens/PaymentsUICustomScreen.d.ts +0 -1
  211. package/lib/typescript/example/src/screens/SepaPaymentScreen.d.ts +0 -1
  212. package/lib/typescript/example/src/screens/SepaSetupFuturePaymentScreen.d.ts +0 -1
  213. package/lib/typescript/example/src/screens/SetupFuturePaymentScreen.d.ts +0 -1
  214. package/lib/typescript/example/src/screens/SofortPaymentScreen.d.ts +0 -1
  215. package/lib/typescript/example/src/screens/SofortSetupFuturePaymentScreen.d.ts +0 -1
  216. package/lib/typescript/example/src/screens/WebhookPaymentScreen.d.ts +0 -1
  217. package/lib/typescript/src/plugin/__tests__/withStripe-test.d.ts +0 -1
  218. package/src/plugin/__tests__/fixtures/sample-AndroidManifest.xml +0 -24
  219. package/src/plugin/__tests__/withStripe-test.ts +0 -111
@@ -1,5 +1,3 @@
1
- export type CartSummaryItemType = 'final' | 'pending';
2
-
3
1
  export type ContactFieldsType =
4
2
  | 'emailAddress'
5
3
  | 'name'
@@ -20,7 +18,7 @@ export type AddressFields =
20
18
  export interface ShippingMethod {
21
19
  label: string;
22
20
  amount: string;
23
- type?: CartSummaryItemType;
21
+ isPending?: boolean;
24
22
  identifier: string;
25
23
  detail?: string;
26
24
  }
@@ -51,11 +49,46 @@ export interface ShippingContact {
51
49
  phoneNumber?: number;
52
50
  postalAddress: PostalAddress;
53
51
  }
54
- export interface CartSummaryItem {
52
+
53
+ export type CartSummaryItem =
54
+ | DeferredCartSummaryItem
55
+ | ImmediateCartSummaryItem
56
+ | RecurringCartSummaryItem;
57
+
58
+ export type CartSummaryItemType = 'Deferred' | 'Immediate' | 'Recurring';
59
+
60
+ /** Use this type for a payment that occurs in the future, such as a pre-order. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem. */
61
+ export type DeferredCartSummaryItem = {
62
+ paymentType: 'Deferred';
63
+ /** The unix timestamp of the date, in the future, of the payment. Measured in seconds. */
64
+ deferredDate: number;
55
65
  label: string;
56
66
  amount: string;
57
- type?: CartSummaryItemType;
58
- }
67
+ };
68
+
69
+ /** Use this type for payments that will occur immediately. */
70
+ export type ImmediateCartSummaryItem = {
71
+ paymentType: 'Immediate';
72
+ /** When creating items for estimates or charges whose final value is not yet known, set this to true. */
73
+ isPending?: boolean;
74
+ label: string;
75
+ amount: string;
76
+ };
77
+
78
+ /** Use this type for payments that occur more than once, such as a subscription. Only available on iOS 15 and up, otherwise falls back to ImmediateCartSummaryItem.*/
79
+ export type RecurringCartSummaryItem = {
80
+ paymentType: 'Recurring';
81
+ /** The amount of time – in calendar units such as day, month, or year – that represents a fraction of the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months.*/
82
+ intervalUnit: 'minute' | 'hour' | 'day' | 'month' | 'year';
83
+ /** The number of interval units that make up the total payment interval. For example, if you set the intervalUnit to 'month' and intervalCount to 3, then the payment interval is three months.*/
84
+ intervalCount: number;
85
+ /** The unix timestamp of the start date. Measured in seconds. */
86
+ startDate?: number;
87
+ /** The unix timestamp of the end date. Measured in seconds. */
88
+ endDate?: number;
89
+ label: string;
90
+ amount: string;
91
+ };
59
92
 
60
93
  export interface PresentParams {
61
94
  cartItems: CartSummaryItem[];
@@ -42,7 +42,8 @@ export type CreateParams =
42
42
  // | WeChatPayParams
43
43
  | BancontactParams
44
44
  | USBankAccountParams
45
- | PayPalParams;
45
+ | PayPalParams
46
+ | AffirmParams;
46
47
 
47
48
  export type ConfirmParams = CreateParams;
48
49
 
@@ -175,6 +176,15 @@ export interface AuBecsDebitParams {
175
176
  paymentMethodData: { formDetails: FormDetails };
176
177
  }
177
178
 
179
+ export type AffirmParams = {
180
+ paymentMethodType: 'Affirm';
181
+ paymentMethodData?: {
182
+ /** Affirm requires that shipping is present for the payment to succeed because it significantly helps with loan approval rates. Shipping details can either be provided here or via the Payment Intent- https://stripe.com/docs/api/payment_intents/create#create_payment_intent-shipping. */
183
+ shippingDetails?: ShippingDetails;
184
+ billingDetails?: BillingDetails;
185
+ };
186
+ };
187
+
178
188
  /**
179
189
  * If paymentMethodData is null, it is assumed that the bank account details have already been attached
180
190
  * via `collectBankAccountForPayment` or `collectBankAccountForSetup`.
@@ -1,19 +1,24 @@
1
1
  import type { BillingDetails } from './Common';
2
+ import type { CartSummaryItem } from './ApplePay';
2
3
 
3
- export type SetupParams = ClientSecretParams &
4
- GooglePayParams &
5
- ApplePayParams & {
6
- customerId?: string;
7
- customerEphemeralKeySecret?: string;
8
- customFlow?: boolean;
9
- merchantDisplayName?: string;
10
- style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
11
- returnURL?: string;
12
- defaultBillingDetails?: BillingDetails;
13
- allowsDelayedPaymentMethods?: boolean;
14
- } & { appearance?: AppearanceParams };
4
+ export type SetupParams = ClientSecretParams & {
5
+ /** Your customer-facing business name. On Android, this is required and cannot be an empty string. */
6
+ merchantDisplayName: string;
7
+ customerId?: string;
8
+ customerEphemeralKeySecret?: string;
9
+ customFlow?: boolean;
10
+ /** iOS only. Enable Apple Pay in the Payment Sheet by passing an ApplePayParams object. */
11
+ applePay?: ApplePayParams;
12
+ /** Android only. Enable Google Pay in the Payment Sheet by passing a GooglePayParams object. */
13
+ googlePay?: GooglePayParams;
14
+ style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
15
+ returnURL?: string;
16
+ defaultBillingDetails?: BillingDetails;
17
+ allowsDelayedPaymentMethods?: boolean;
18
+ appearance?: AppearanceParams;
19
+ };
15
20
 
16
- type ClientSecretParams =
21
+ export type ClientSecretParams =
17
22
  | {
18
23
  paymentIntentClientSecret: string;
19
24
  setupIntentClientSecret?: undefined;
@@ -23,29 +28,23 @@ type ClientSecretParams =
23
28
  paymentIntentClientSecret?: undefined;
24
29
  };
25
30
 
26
- type ApplePayParams =
27
- | {
28
- applePay?: true;
29
- merchantCountryCode: string;
30
- }
31
- | {
32
- applePay?: false;
33
- merchantCountryCode?: string;
34
- };
31
+ export type ApplePayParams = {
32
+ /** The two-letter ISO 3166 code of the country of your business, e.g. "US" */
33
+ merchantCountryCode: string;
34
+ /**
35
+ * An array of CartSummaryItem item objects that summarize the amount of the payment. If you're using a SetupIntent
36
+ * for a recurring payment, you should set this to display the amount you intend to charge. */
37
+ paymentSummaryItems?: CartSummaryItem[];
38
+ };
35
39
 
36
- type GooglePayParams =
37
- | {
38
- googlePay?: true;
39
- merchantCountryCode: string;
40
- currencyCode?: string;
41
- testEnv?: boolean;
42
- }
43
- | {
44
- googlePay?: false;
45
- merchantCountryCode?: string;
46
- currencyCode?: string;
47
- testEnv?: boolean;
48
- };
40
+ export type GooglePayParams = {
41
+ /** The two-letter ISO 3166 code of the country of your business, e.g. "US" */
42
+ merchantCountryCode: string;
43
+ /** The three-letter ISO 4217 alphabetic currency code, e.g. "USD" or "EUR". Required in order to support Google Pay when processing a Setup Intent. */
44
+ currencyCode?: string;
45
+ /** Whether or not to use the Google Pay test environment. Set to `true` until you have applied for and been granted access to the Production environment. */
46
+ testEnv?: boolean;
47
+ };
49
48
 
50
49
  /**
51
50
  * Used to customize the appearance of your PaymentSheet
@@ -295,3 +295,30 @@ export type IsCardInWalletResult =
295
295
  token?: undefined;
296
296
  error: StripeError<GooglePayError>;
297
297
  };
298
+
299
+ export type CanAddCardToWalletParams = {
300
+ /** The `primary_account_identifier` value from the issued card. Can be an empty string. */
301
+ primaryAccountIdentifier: string | null;
302
+ /** Last 4 digits of the card number. */
303
+ cardLastFour: string;
304
+ /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If true, you must be using live cards, and have the proper iOS entitlement set up. See https://stripe.com/docs/issuing/cards/digital-wallets?platform=react-native#requesting-access-for-ios */
305
+ testEnv?: boolean;
306
+ };
307
+
308
+ export type CanAddCardToWalletResult =
309
+ | {
310
+ canAddCard: boolean;
311
+ details?: {
312
+ token?: GooglePayCardToken;
313
+ status?:
314
+ | 'MISSING_CONFIGURATION'
315
+ | 'UNSUPPORTED_DEVICE'
316
+ | 'CARD_ALREADY_EXISTS';
317
+ };
318
+ error?: undefined;
319
+ }
320
+ | {
321
+ canAddCard?: undefined;
322
+ details?: undefined;
323
+ error: StripeError<GooglePayError>;
324
+ };
@@ -1,7 +1,7 @@
1
1
  require 'json'
2
2
 
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
- stripe_version = '~> 22.4.0'
4
+ stripe_version = '~> 22.5.1'
5
5
 
6
6
  Pod::Spec.new do |s|
7
7
  s.name = 'stripe-react-native'
@@ -15,6 +15,11 @@ Pod::Spec.new do |s|
15
15
  s.source = { git: 'https://github.com/stripe/stripe-react-native.git', tag: s.version.to_s }
16
16
 
17
17
  s.source_files = 'ios/**/*.{h,m,mm,swift}'
18
+ s.exclude_files = 'ios/Tests/'
19
+
20
+ s.test_spec 'Tests' do |test_spec|
21
+ test_spec.source_files = 'ios/Tests/**/*.{m,swift}'
22
+ end
18
23
 
19
24
  s.dependency 'React-Core'
20
25
  s.dependency 'Stripe', stripe_version
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <selector xmlns:android="http://schemas.android.com/apk/res/android" >
3
- <item
4
- android:drawable="@drawable/googlepay_button_no_shadow_background_image" />
5
- </selector>
6
-
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <ripple xmlns:android="http://schemas.android.com/apk/res/android"
3
- android:color="#e0ffffff">
4
- <item
5
- android:drawable="@drawable/googlepay_button_no_shadow_background_image" />
6
- </ripple>
7
-
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <resources>
3
- <string name="googlepay_button_content_description">Google Pay</string>
4
- <string name="buy_with_googlepay_button_content_description">Buy with Google Pay</string>
5
- <string name="donate_with_googlepay_button_content_description">Donate With Google Pay</string>
6
- <string name="pay_with_googlepay_button_content_description">Pay With Google Pay</string>
7
- <string name="subscribe_with_googlepay_button_content_description">Subscribe With Google Pay</string>
8
- <string name="book_with_googlepay_button_content_description">Book With Google Pay</string>
9
- <string name="checkout_with_googlepay_button_content_description">Checkout With Google Pay</string>
10
- <string name="order_with_googlepay_button_content_description">Order With Google Pay</string>
11
- <string name="view_in_googlepay_button_content_description">View In Google Pay</string>
12
- </resources>
@@ -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,17 +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({ elementType, pause }?: {
9
- elementType?: string | undefined;
10
- pause?: number | undefined;
11
- }): void;
12
- checkStatus(status?: string): void;
13
- authorizeACH(): void;
14
- }
15
- export declare function getAllWebviewContexts(): string[];
16
- declare const _default: BasicPaymentScreen;
17
- 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>