@stripe/stripe-react-native 0.22.1 → 0.23.1

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 (83) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/android/gradle.properties +1 -1
  3. package/android/src/main/java/com/reactnativestripesdk/CardFieldView.kt +1 -0
  4. package/android/src/main/java/com/reactnativestripesdk/GooglePayRequestHelper.kt +21 -9
  5. package/android/src/main/java/com/reactnativestripesdk/PaymentLauncherFragment.kt +2 -2
  6. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +6 -4
  7. package/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt +67 -65
  8. package/android/src/main/res/layout/googlepay_mark_button.xml +0 -2
  9. package/ios/ApplePayViewController.swift +25 -15
  10. package/ios/Mappers.swift +11 -9
  11. package/ios/PaymentMethodFactory.swift +1 -1
  12. package/ios/StripeSdk.m +1 -0
  13. package/ios/StripeSdk.swift +8 -5
  14. package/ios/Tests/ApplePayUtilsTests.swift +0 -1
  15. package/jest/mock.js +6 -0
  16. package/lib/commonjs/NativeStripeSdk.js.map +1 -1
  17. package/lib/commonjs/components/AddToWalletButton.js.map +1 -1
  18. package/lib/commonjs/functions.js +1 -1
  19. package/lib/commonjs/functions.js.map +1 -1
  20. package/lib/commonjs/hooks/useApplePay.js +1 -1
  21. package/lib/commonjs/hooks/useApplePay.js.map +1 -1
  22. package/lib/commonjs/hooks/usePlatformPay.js +1 -1
  23. package/lib/commonjs/hooks/usePlatformPay.js.map +1 -1
  24. package/lib/commonjs/hooks/useStripe.js +1 -1
  25. package/lib/commonjs/hooks/useStripe.js.map +1 -1
  26. package/lib/commonjs/index.js +1 -1
  27. package/lib/commonjs/index.js.map +1 -1
  28. package/lib/commonjs/types/PaymentIntent.js.map +1 -1
  29. package/lib/commonjs/types/PaymentMethod.js.map +1 -1
  30. package/lib/commonjs/types/PaymentSheet.js.map +1 -1
  31. package/lib/commonjs/types/PlatformPay.js.map +1 -1
  32. package/lib/commonjs/types/PushProvisioning.js.map +1 -1
  33. package/lib/commonjs/types/SetupIntent.js.map +1 -1
  34. package/lib/commonjs/types/index.js +1 -1
  35. package/lib/commonjs/types/index.js.map +1 -1
  36. package/lib/module/NativeStripeSdk.js.map +1 -1
  37. package/lib/module/components/AddToWalletButton.js.map +1 -1
  38. package/lib/module/functions.js +1 -1
  39. package/lib/module/functions.js.map +1 -1
  40. package/lib/module/hooks/useApplePay.js +1 -1
  41. package/lib/module/hooks/useApplePay.js.map +1 -1
  42. package/lib/module/hooks/usePlatformPay.js +1 -1
  43. package/lib/module/hooks/usePlatformPay.js.map +1 -1
  44. package/lib/module/hooks/useStripe.js +1 -1
  45. package/lib/module/hooks/useStripe.js.map +1 -1
  46. package/lib/module/index.js +1 -1
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/module/types/PaymentIntent.js.map +1 -1
  49. package/lib/module/types/PaymentMethod.js.map +1 -1
  50. package/lib/module/types/PaymentSheet.js.map +1 -1
  51. package/lib/module/types/PlatformPay.js.map +1 -1
  52. package/lib/module/types/PushProvisioning.js.map +1 -1
  53. package/lib/module/types/SetupIntent.js.map +1 -1
  54. package/lib/module/types/index.js +1 -1
  55. package/lib/module/types/index.js.map +1 -1
  56. package/lib/typescript/src/NativeStripeSdk.d.ts +1 -1
  57. package/lib/typescript/src/components/AddToWalletButton.d.ts +1 -1
  58. package/lib/typescript/src/functions.d.ts +8 -2
  59. package/lib/typescript/src/hooks/usePlatformPay.d.ts +6 -0
  60. package/lib/typescript/src/hooks/useStripe.d.ts +1 -0
  61. package/lib/typescript/src/index.d.ts +22 -11
  62. package/lib/typescript/src/types/PaymentIntent.d.ts +2 -0
  63. package/lib/typescript/src/types/PaymentMethod.d.ts +1 -0
  64. package/lib/typescript/src/types/PaymentSheet.d.ts +1 -1
  65. package/lib/typescript/src/types/PlatformPay.d.ts +6 -1
  66. package/lib/typescript/src/types/PushProvisioning.d.ts +1 -1
  67. package/lib/typescript/src/types/SetupIntent.d.ts +2 -0
  68. package/lib/typescript/src/types/index.d.ts +1 -1
  69. package/package.json +2 -2
  70. package/src/NativeStripeSdk.tsx +3 -2
  71. package/src/components/AddToWalletButton.tsx +1 -1
  72. package/src/functions.ts +35 -4
  73. package/src/hooks/useApplePay.tsx +1 -2
  74. package/src/hooks/usePlatformPay.tsx +19 -0
  75. package/src/hooks/useStripe.tsx +11 -0
  76. package/src/index.tsx +22 -36
  77. package/src/types/PaymentIntent.ts +2 -0
  78. package/src/types/PaymentMethod.ts +1 -0
  79. package/src/types/PaymentSheet.ts +1 -1
  80. package/src/types/PlatformPay.ts +9 -1
  81. package/src/types/PushProvisioning.ts +1 -1
  82. package/src/types/SetupIntent.ts +2 -0
  83. package/src/types/index.ts +1 -1
@@ -18,7 +18,7 @@ export declare type SetupParams = ClientSecretParams & {
18
18
  style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
19
19
  /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
20
20
  returnURL?: string;
21
- /** PaymentSheet pre-populates the billing fields with the values provided. */
21
+ /** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */
22
22
  defaultBillingDetails?: BillingDetails;
23
23
  /**
24
24
  * The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.
@@ -262,10 +262,15 @@ export declare type ShippingContact = ApplePayShippingContact;
262
262
  export declare type IsGooglePaySupportedParams = IsSupportedParams;
263
263
  export declare type PaymentMethodResult = {
264
264
  paymentMethod: PaymentMethod;
265
- token: Token;
266
265
  error?: undefined;
267
266
  } | {
268
267
  paymentMethod?: undefined;
268
+ error: StripeError<PlatformPayError>;
269
+ };
270
+ export declare type TokenResult = {
271
+ token: Token;
272
+ error?: undefined;
273
+ } | {
269
274
  token?: undefined;
270
275
  error: StripeError<PlatformPayError>;
271
276
  };
@@ -35,7 +35,7 @@ export declare type CanAddCardToWalletParams = {
35
35
  primaryAccountIdentifier: string | null;
36
36
  /** Last 4 digits of the card number. */
37
37
  cardLastFour: string;
38
- /** 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 */
38
+ /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, 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 */
39
39
  testEnv?: boolean;
40
40
  /** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */
41
41
  hasPairedAppleWatch?: boolean;
@@ -9,7 +9,9 @@ export interface Result {
9
9
  /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */
10
10
  created: string | null;
11
11
  livemode: boolean;
12
+ /** @deprecated Use paymentMethod.id instead. */
12
13
  paymentMethodId: string | null;
14
+ paymentMethod: PaymentMethod.Result | null;
13
15
  status: Status;
14
16
  paymentMethodTypes: Type[];
15
17
  usage: FutureUsage;
@@ -17,7 +17,7 @@ import * as PlatformPay from './PlatformPay';
17
17
  export { ApplePay, PaymentIntent, PaymentMethod, PaymentSheet, SetupIntent, ThreeDSecure, GooglePay, ApplePayButtonComponent, GooglePayButtonComponent, AuBECSDebitFormComponent, CardFieldInput, CardFormView, Token, FinancialConnections, PlatformPay, };
18
18
  export * from './PushProvisioning';
19
19
  export * from './Errors';
20
- export { Address, BillingDetails, AddressDetails } from './Common';
20
+ export type { Address, BillingDetails, AddressDetails } from './Common';
21
21
  /**
22
22
  * @ignore
23
23
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stripe/stripe-react-native",
3
- "version": "0.22.1",
3
+ "version": "0.23.1",
4
4
  "author": "Stripe",
5
5
  "description": "Stripe SDK for React Native",
6
6
  "main": "lib/commonjs/index",
@@ -12,7 +12,7 @@
12
12
  "test": "jest",
13
13
  "typescript": "tsc --noEmit",
14
14
  "lint": "eslint \"**/*.{js,ts,tsx}\" --ignore-pattern \"docs/api-reference/*\" --ignore-path .gitignore",
15
- "prepare": "bob build",
15
+ "prepare": "bob build && husky install",
16
16
  "release": "./scripts/publish",
17
17
  "example": "yarn --cwd example",
18
18
  "pods": "cd example && npx pod-install --quiet",
@@ -111,8 +111,9 @@ type NativeStripeSdkType = {
111
111
  googlePay?: GooglePay.IsSupportedParams;
112
112
  }): Promise<boolean>;
113
113
  createPlatformPayPaymentMethod(
114
- params: PlatformPay.PaymentMethodParams
115
- ): Promise<PlatformPay.PaymentMethodResult>;
114
+ params: PlatformPay.PaymentMethodParams,
115
+ usesDeprecatedTokenFlow: boolean
116
+ ): Promise<PlatformPay.PaymentMethodResult | PlatformPay.TokenResult>;
116
117
  dismissPlatformPay(): Promise<boolean>;
117
118
  updatePlatformPaySheet(
118
119
  summaryItems: Array<ApplePay.CartSummaryItem>,
@@ -27,7 +27,7 @@ export interface Props extends AccessibilityProps {
27
27
  /** The image asset to use as the Google Pay button. Downloadable from https://developers.google.com/pay/issuers/apis/push-provisioning/android/downloads/flutter/googlepay_flutter_buttons.zip */
28
28
  androidAssetSource: ImageSourcePropType;
29
29
  testID?: string;
30
- /** 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 */
30
+ /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, 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 */
31
31
  testEnv?: boolean;
32
32
  /** Details of the Issued Card you'd like added to the device's wallet */
33
33
  cardDetails: {
package/src/functions.ts CHANGED
@@ -810,16 +810,19 @@ export const dismissPlatformPay = async (): Promise<boolean> => {
810
810
  };
811
811
 
812
812
  /**
813
- * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods) and [token](https://stripe.com/docs/api/tokens).
813
+ * Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [PaymentMethod](https://stripe.com/docs/api/payment_methods).
814
814
  * @param params an object describing the Apple Pay and Google Pay configurations.
815
- * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.
815
+ * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `paymentMethod` field.
816
816
  */
817
817
  export const createPlatformPayPaymentMethod = async (
818
818
  params: PlatformPay.PaymentMethodParams
819
819
  ): Promise<PlatformPay.PaymentMethodResult> => {
820
820
  try {
821
- const { error, paymentMethod, token } =
822
- await NativeStripeSdk.createPlatformPayPaymentMethod(params);
821
+ const { error, paymentMethod } =
822
+ (await NativeStripeSdk.createPlatformPayPaymentMethod(
823
+ params,
824
+ false
825
+ )) as PlatformPay.PaymentMethodResult;
823
826
  if (error) {
824
827
  return {
825
828
  error,
@@ -827,6 +830,34 @@ export const createPlatformPayPaymentMethod = async (
827
830
  }
828
831
  return {
829
832
  paymentMethod: paymentMethod!,
833
+ };
834
+ } catch (error: any) {
835
+ return {
836
+ error,
837
+ };
838
+ }
839
+ };
840
+
841
+ /**
842
+ * @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
843
+ * @param params an object describing the Apple Pay and Google Pay configurations.
844
+ * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
845
+ */
846
+ export const createPlatformPayToken = async (
847
+ params: PlatformPay.PaymentMethodParams
848
+ ): Promise<PlatformPay.TokenResult> => {
849
+ try {
850
+ const { error, token } =
851
+ (await NativeStripeSdk.createPlatformPayPaymentMethod(
852
+ params,
853
+ true
854
+ )) as PlatformPay.TokenResult;
855
+ if (error) {
856
+ return {
857
+ error,
858
+ };
859
+ }
860
+ return {
830
861
  token: token!,
831
862
  };
832
863
  } catch (error: any) {
@@ -3,8 +3,6 @@ import { useCallback, useEffect, useState } from 'react';
3
3
  import { useStripe } from './useStripe';
4
4
  import { NativeEventEmitter, NativeModules } from 'react-native';
5
5
 
6
- const eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);
7
-
8
6
  export interface Props {
9
7
  /**
10
8
  *
@@ -105,6 +103,7 @@ export function useApplePay({
105
103
  );
106
104
 
107
105
  useEffect(() => {
106
+ const eventEmitter = new NativeEventEmitter(NativeModules.StripeSdk);
108
107
  const didSetShippingMethodListener = eventEmitter.addListener(
109
108
  SET_SHIPPING_METHOD_CALLBACK_NAME,
110
109
  onDidSetShippingMethod
@@ -15,6 +15,7 @@ export function usePlatformPay() {
15
15
  confirmPlatformPaySetupIntent,
16
16
  confirmPlatformPayPayment,
17
17
  createPlatformPayPaymentMethod,
18
+ createPlatformPayToken,
18
19
  dismissPlatformPay,
19
20
  updatePlatformPaySheet,
20
21
  canAddCardToWallet,
@@ -70,6 +71,18 @@ export function usePlatformPay() {
70
71
  [createPlatformPayPaymentMethod]
71
72
  );
72
73
 
74
+ const _createPlatformPayToken = useCallback(
75
+ async (params: PlatformPay.PaymentMethodParams) => {
76
+ setLoading(true);
77
+
78
+ const result = await createPlatformPayToken(params);
79
+ setLoading(false);
80
+
81
+ return result;
82
+ },
83
+ [createPlatformPayToken]
84
+ );
85
+
73
86
  const _dismissPlatformPay = useCallback(async () => {
74
87
  setLoading(true);
75
88
 
@@ -143,6 +156,12 @@ export function usePlatformPay() {
143
156
  * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with both `paymentMethod` and `token` fields.
144
157
  */
145
158
  createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,
159
+ /**
160
+ * @deprecated The Tokens API is deprecated, you should use Payment Methods and `createPlatformPayPaymentMethod` instead. Launches the relevant native wallet sheet (Apple Pay on iOS, Google Pay on Android) in order to create a Stripe [token](https://stripe.com/docs/api/tokens).
161
+ * @param params an object describing the Apple Pay and Google Pay configurations.
162
+ * @returns An object with an error field if something went wrong or the flow was cancelled, otherwise an object with a `token` field.
163
+ */
164
+ createPlatformPayToken: _createPlatformPayToken,
146
165
  /**
147
166
  * Dismiss the Apple Pay sheet if it is open. iOS only, this is a no-op on Android.
148
167
  * @returns A boolean indicating whether or not the sheet was successfully closed. Will return false if the Apple Pay sheet was not open.
@@ -72,6 +72,7 @@ import {
72
72
  confirmPlatformPayPayment,
73
73
  dismissPlatformPay,
74
74
  createPlatformPayPaymentMethod,
75
+ createPlatformPayToken,
75
76
  updatePlatformPaySheet,
76
77
  openPlatformPaySetup,
77
78
  } from '../functions';
@@ -367,6 +368,15 @@ export function useStripe() {
367
368
  []
368
369
  );
369
370
 
371
+ const _createPlatformPayToken = useCallback(
372
+ async (
373
+ params: PlatformPay.PaymentMethodParams
374
+ ): Promise<PlatformPay.TokenResult> => {
375
+ return createPlatformPayToken(params);
376
+ },
377
+ []
378
+ );
379
+
370
380
  const _updatePlatformPaySheet = useCallback(
371
381
  async (params: {
372
382
  applePay: {
@@ -426,6 +436,7 @@ export function useStripe() {
426
436
  confirmPlatformPayPayment: _confirmPlatformPayPayment,
427
437
  dismissPlatformPay: _dismissPlatformPay,
428
438
  createPlatformPayPaymentMethod: _createPlatformPayPaymentMethod,
439
+ createPlatformPayToken: _createPlatformPayToken,
429
440
  updatePlatformPaySheet: _updatePlatformPaySheet,
430
441
  openPlatformPaySetup: _openPlatformPaySetup,
431
442
  };
package/src/index.tsx CHANGED
@@ -3,47 +3,33 @@ export { useConfirmPayment } from './hooks/useConfirmPayment';
3
3
  export { useConfirmSetupIntent } from './hooks/useConfirmSetupIntent';
4
4
  export { useStripe } from './hooks/useStripe';
5
5
  export { usePlatformPay } from './hooks/usePlatformPay';
6
- export { useApplePay, Props as UseApplePayProps } from './hooks/useApplePay';
6
+ export { useApplePay } from './hooks/useApplePay';
7
+ export type { Props as UseApplePayProps } from './hooks/useApplePay';
7
8
  export { usePaymentSheet } from './hooks/usePaymentSheet';
8
9
  export { useGooglePay } from './hooks/useGooglePay';
9
10
  export { useFinancialConnectionsSheet } from './hooks/useFinancialConnectionsSheet';
10
11
 
11
12
  //components
12
- export {
13
- initStripe,
14
- StripeProvider,
15
- Props as StripeProviderProps,
16
- } from './components/StripeProvider';
17
- export { CardField, Props as CardFieldProps } from './components/CardField';
18
- export { CardForm, Props as CardFormProps } from './components/CardForm';
19
- export {
20
- ApplePayButton,
21
- Props as ApplePayButtonProps,
22
- } from './components/ApplePayButton';
23
- export {
24
- AuBECSDebitForm,
25
- Props as AuBECSDebitFormProps,
26
- } from './components/AuBECSDebitForm';
27
- export {
28
- StripeContainer,
29
- Props as StripeContainerProps,
30
- } from './components/StripeContainer';
31
- export {
32
- GooglePayButton,
33
- Props as GooglePayButtonProps,
34
- } from './components/GooglePayButton';
35
- export {
36
- AddToWalletButton,
37
- Props as AddToWalletButtonProps,
38
- } from './components/AddToWalletButton';
39
- export {
40
- AddressSheet,
41
- Props as AddressSheetProps,
42
- } from './components/AddressSheet';
43
- export {
44
- PlatformPayButton,
45
- Props as PlatformPayButtonProps,
46
- } from './components/PlatformPayButton';
13
+ export { initStripe, StripeProvider } from './components/StripeProvider';
14
+ export type { Props as StripeProviderProps } from './components/StripeProvider';
15
+ export { CardField } from './components/CardField';
16
+ export type { Props as CardFieldProps } from './components/CardField';
17
+ export { CardForm } from './components/CardForm';
18
+ export type { Props as CardFormProps } from './components/CardForm';
19
+ export { ApplePayButton } from './components/ApplePayButton';
20
+ export type { Props as ApplePayButtonProps } from './components/ApplePayButton';
21
+ export { AuBECSDebitForm } from './components/AuBECSDebitForm';
22
+ export type { Props as AuBECSDebitFormProps } from './components/AuBECSDebitForm';
23
+ export { StripeContainer } from './components/StripeContainer';
24
+ export type { Props as StripeContainerProps } from './components/StripeContainer';
25
+ export { GooglePayButton } from './components/GooglePayButton';
26
+ export type { Props as GooglePayButtonProps } from './components/GooglePayButton';
27
+ export { AddToWalletButton } from './components/AddToWalletButton';
28
+ export type { Props as AddToWalletButtonProps } from './components/AddToWalletButton';
29
+ export { AddressSheet } from './components/AddressSheet';
30
+ export type { Props as AddressSheetProps } from './components/AddressSheet';
31
+ export { PlatformPayButton } from './components/PlatformPayButton';
32
+ export type { Props as PlatformPayButtonProps } from './components/PlatformPayButton';
47
33
 
48
34
  export * from './functions';
49
35
 
@@ -16,7 +16,9 @@ export interface Result {
16
16
  canceledAt: string | null;
17
17
  clientSecret: string;
18
18
  livemode: boolean;
19
+ /** @deprecated Use paymentMethod.id instead. */
19
20
  paymentMethodId: string;
21
+ paymentMethod: PaymentMethodResult | null;
20
22
  captureMethod: 'Automatic' | 'Manual';
21
23
  confirmationMethod: 'Automatic' | 'Manual';
22
24
  lastPaymentError: LastPaymentError | null;
@@ -146,6 +146,7 @@ export type KlarnaParams = {
146
146
  billingDetails: Pick<Required<BillingDetails>, 'email'> & {
147
147
  address: Pick<Required<Address>, 'country'>;
148
148
  } & BillingDetails;
149
+ shippingDetails?: ShippingDetails;
149
150
  };
150
151
  };
151
152
 
@@ -19,7 +19,7 @@ export type SetupParams = ClientSecretParams & {
19
19
  style?: 'alwaysLight' | 'alwaysDark' | 'automatic';
20
20
  /** A URL that redirects back to your app that PaymentSheet can use to auto-dismiss web views used for additional authentication, e.g. 3DS2 */
21
21
  returnURL?: string;
22
- /** PaymentSheet pre-populates the billing fields with the values provided. */
22
+ /** PaymentSheet pre-populates the billing fields that are displayed in the Payment Sheet (only country and postal code, as of this version) with the values provided. */
23
23
  defaultBillingDetails?: BillingDetails;
24
24
  /**
25
25
  * The shipping information for the customer. If set, PaymentSheet will pre-populate the form fields with the values provided.
@@ -296,11 +296,19 @@ export type IsGooglePaySupportedParams = IsSupportedParams;
296
296
  export type PaymentMethodResult =
297
297
  | {
298
298
  paymentMethod: PaymentMethod;
299
- token: Token;
300
299
  error?: undefined;
301
300
  }
302
301
  | {
303
302
  paymentMethod?: undefined;
303
+ error: StripeError<PlatformPayError>;
304
+ };
305
+
306
+ export type TokenResult =
307
+ | {
308
+ token: Token;
309
+ error?: undefined;
310
+ }
311
+ | {
304
312
  token?: undefined;
305
313
  error: StripeError<PlatformPayError>;
306
314
  };
@@ -41,7 +41,7 @@ export type CanAddCardToWalletParams = {
41
41
  primaryAccountIdentifier: string | null;
42
42
  /** Last 4 digits of the card number. */
43
43
  cardLastFour: string;
44
- /** 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 */
44
+ /** iOS only. Set this to `true` until shipping through TestFlight || App Store. If false, 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 */
45
45
  testEnv?: boolean;
46
46
  /** iOS only. Set this to `true` if: your user has an Apple Watch device currently paired, and you want to check that device for the presence of the specified card. */
47
47
  hasPairedAppleWatch?: boolean;
@@ -9,7 +9,9 @@ export interface Result {
9
9
  /** The UNIX timestamp (in milliseconds) of the date this Setup Intent was created. */
10
10
  created: string | null;
11
11
  livemode: boolean;
12
+ /** @deprecated Use paymentMethod.id instead. */
12
13
  paymentMethodId: string | null;
14
+ paymentMethod: PaymentMethod.Result | null;
13
15
  status: Status;
14
16
  paymentMethodTypes: Type[];
15
17
  usage: FutureUsage;
@@ -49,7 +49,7 @@ export {
49
49
 
50
50
  export * from './PushProvisioning';
51
51
  export * from './Errors';
52
- export { Address, BillingDetails, AddressDetails } from './Common';
52
+ export type { Address, BillingDetails, AddressDetails } from './Common';
53
53
 
54
54
  /**
55
55
  * @ignore