@stripe/stripe-react-native 0.31.1 → 0.33.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 (30) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/reactnativestripesdk/GooglePayLauncherFragment.kt +6 -2
  4. package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +10 -0
  5. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +2 -0
  6. package/android/src/main/java/com/reactnativestripesdk/PaymentSheetFragment.kt +5 -1
  7. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +33 -5
  8. package/ios/ApplePayViewController.swift +24 -5
  9. package/ios/Mappers.swift +10 -8
  10. package/ios/StripeSdk+PaymentSheet.swift +4 -0
  11. package/ios/StripeSdk.swift +15 -11
  12. package/lib/commonjs/functions.js +1 -1
  13. package/lib/commonjs/functions.js.map +1 -1
  14. package/lib/commonjs/types/NextAction.js.map +1 -1
  15. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  16. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  17. package/lib/module/functions.js +1 -1
  18. package/lib/module/functions.js.map +1 -1
  19. package/lib/module/types/NextAction.js.map +1 -1
  20. package/lib/module/types/PaymentSheet.js.map +1 -1
  21. package/lib/module/types/PlatformPay.js.map +1 -1
  22. package/lib/typescript/src/types/NextAction.d.ts +4 -2
  23. package/lib/typescript/src/types/PaymentSheet.d.ts +6 -0
  24. package/lib/typescript/src/types/PlatformPay.d.ts +8 -3
  25. package/package.json +1 -1
  26. package/src/functions.ts +4 -2
  27. package/src/types/NextAction.ts +5 -2
  28. package/src/types/PaymentSheet.ts +6 -0
  29. package/src/types/PlatformPay.ts +8 -3
  30. package/stripe-react-native.podspec +1 -1
@@ -193,11 +193,13 @@ export type GooglePayBaseParams = {
193
193
  /** Defines what address fields to collect. Defaults to BillingAddressFormat.Min */
194
194
  format?: BillingAddressFormat;
195
195
  };
196
+ /** An optional label to display with the amount. Google Pay may or may not display this label depending on its own internal logic. Defaults to a generic label if none is provided. */
197
+ label?: string;
198
+ /** An optional amount to display for setup intents. Google Pay may or may not display this amount depending on its own internal logic. Defaults to 0 if none is provided. */
199
+ amount?: number;
196
200
  };
197
201
 
198
202
  export type GooglePayPaymentMethodParams = {
199
- /** Total monetary value of the transaction. */
200
- amount: number;
201
203
  /** Describes the configuration for shipping address collection in the Google Pay sheet. */
202
204
  shippingAddressConfig?: {
203
205
  /** Set to true if shipping address is required for payment. Defaults to false. */
@@ -376,7 +378,6 @@ interface ContactName {
376
378
  nickname?: string;
377
379
  }
378
380
 
379
- /** iOS only. */
380
381
  export interface ShippingContact {
381
382
  emailAddress?: string;
382
383
  name: ContactName;
@@ -398,20 +399,24 @@ export type IsGooglePaySupportedParams = {
398
399
  export type PaymentMethodResult =
399
400
  | {
400
401
  paymentMethod: PaymentMethod;
402
+ shippingContact?: ShippingContact;
401
403
  error?: undefined;
402
404
  }
403
405
  | {
404
406
  paymentMethod?: undefined;
407
+ shippingContact?: undefined;
405
408
  error: StripeError<PlatformPayError>;
406
409
  };
407
410
 
408
411
  export type TokenResult =
409
412
  | {
410
413
  token: Token;
414
+ shippingContact?: ShippingContact;
411
415
  error?: undefined;
412
416
  }
413
417
  | {
414
418
  token?: undefined;
419
+ shippingContact?: undefined;
415
420
  error: StripeError<PlatformPayError>;
416
421
  };
417
422
 
@@ -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 = '~> 23.15.0'
5
+ stripe_version = '~> 23.16.0'
6
6
 
7
7
  Pod::Spec.new do |s|
8
8
  s.name = 'stripe-react-native'