@stripe/stripe-react-native 0.66.0 → 0.67.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 (68) hide show
  1. package/android/gradle.properties +1 -1
  2. package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +0 -11
  3. package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +11 -6
  4. package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +1 -1
  5. package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +0 -4
  6. package/android/src/onramp/java/com/reactnativestripesdk/OnrampErrors.kt +145 -0
  7. package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +10 -1
  8. package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +45 -31
  9. package/android/src/test/java/com/reactnativestripesdk/OnrampErrorsTest.kt +168 -0
  10. package/ios/Mappers.swift +8 -6
  11. package/ios/OnrampErrors.swift +132 -0
  12. package/ios/StripeOnrampSdk.mm +3 -3
  13. package/ios/StripeSdk.mm +0 -13
  14. package/ios/StripeSdkImpl+Checkout.swift +0 -17
  15. package/ios/StripeSdkImpl.swift +34 -22
  16. package/lib/commonjs/components/StripeProvider.js +1 -1
  17. package/lib/commonjs/components/StripeProvider.js.map +1 -1
  18. package/lib/commonjs/hooks/useCheckout.js +1 -1
  19. package/lib/commonjs/hooks/useCheckout.js.map +1 -1
  20. package/lib/commonjs/hooks/useOnramp.js +1 -1
  21. package/lib/commonjs/hooks/useOnramp.js.map +1 -1
  22. package/lib/commonjs/internal/stripeConfig.js +2 -0
  23. package/lib/commonjs/internal/stripeConfig.js.map +1 -0
  24. package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
  25. package/lib/commonjs/types/Errors.js +1 -1
  26. package/lib/commonjs/types/Errors.js.map +1 -1
  27. package/lib/commonjs/types/Onramp.js +1 -1
  28. package/lib/commonjs/types/Onramp.js.map +1 -1
  29. package/lib/module/components/StripeProvider.js +1 -1
  30. package/lib/module/components/StripeProvider.js.map +1 -1
  31. package/lib/module/hooks/useCheckout.js +1 -1
  32. package/lib/module/hooks/useCheckout.js.map +1 -1
  33. package/lib/module/hooks/useOnramp.js +1 -1
  34. package/lib/module/hooks/useOnramp.js.map +1 -1
  35. package/lib/module/internal/stripeConfig.js +2 -0
  36. package/lib/module/internal/stripeConfig.js.map +1 -0
  37. package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
  38. package/lib/module/types/Errors.js +1 -1
  39. package/lib/module/types/Errors.js.map +1 -1
  40. package/lib/module/types/Onramp.js +1 -1
  41. package/lib/module/types/Onramp.js.map +1 -1
  42. package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
  43. package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -1
  44. package/lib/typescript/src/hooks/useOnramp.d.ts +13 -13
  45. package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
  46. package/lib/typescript/src/internal/stripeConfig.d.ts +3 -0
  47. package/lib/typescript/src/internal/stripeConfig.d.ts.map +1 -0
  48. package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +1 -1
  49. package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
  50. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +0 -1
  51. package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
  52. package/lib/typescript/src/types/Checkout.d.ts +0 -8
  53. package/lib/typescript/src/types/Checkout.d.ts.map +1 -1
  54. package/lib/typescript/src/types/Errors.d.ts +0 -5
  55. package/lib/typescript/src/types/Errors.d.ts.map +1 -1
  56. package/lib/typescript/src/types/Onramp.d.ts +84 -19
  57. package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
  58. package/package.json +1 -1
  59. package/src/components/StripeProvider.tsx +2 -0
  60. package/src/hooks/useCheckout.tsx +0 -9
  61. package/src/hooks/useOnramp.tsx +101 -18
  62. package/src/internal/stripeConfig.ts +9 -0
  63. package/src/specs/NativeOnrampSdkModule.ts +1 -1
  64. package/src/specs/NativeStripeSdkModule.ts +0 -6
  65. package/src/types/Checkout.ts +0 -9
  66. package/src/types/Errors.ts +0 -6
  67. package/src/types/Onramp.ts +93 -19
  68. package/stripe-react-native.podspec +3 -3
@@ -1,10 +1,12 @@
1
1
  import { EventSubscription, Platform } from 'react-native';
2
2
  import NativeOnrampSdk from '../specs/NativeOnrampSdkModule';
3
- import { Onramp, OnrampError, StripeError } from '../types';
3
+ import { Onramp } from '../types';
4
4
  import type { Address } from '../types';
5
5
  import { useCallback } from 'react';
6
6
  import { addOnrampListener } from '../events';
7
7
  import { CryptoPaymentToken } from '../types/Onramp';
8
+ import { getCurrentPublishableKey } from '../internal/stripeConfig';
9
+ import pjson from '../../package.json';
8
10
 
9
11
  export function requireOnrampModule() {
10
12
  if (NativeOnrampSdk == null) {
@@ -24,6 +26,83 @@ export function requireOnrampModule() {
24
26
  let onCheckoutClientSecretRequestedSubscription: EventSubscription | null =
25
27
  null;
26
28
 
29
+ const legacyAppAttestationUnavailableMessages = [
30
+ 'App attestation is missing or device cannot use native Link.',
31
+ 'Native Link is not available',
32
+ ];
33
+ const cryptoOnrampAppAttestationUnavailableCode = 'app_attestation_unavailable';
34
+
35
+ function isLegacyAppAttestationUnavailableMessage(message?: string): boolean {
36
+ return (
37
+ message != null && legacyAppAttestationUnavailableMessages.includes(message)
38
+ );
39
+ }
40
+
41
+ function publishableKeyMode(): 'live' | 'test' | undefined {
42
+ const publishableKey = getCurrentPublishableKey();
43
+ if (publishableKey?.startsWith('pk_live_')) {
44
+ return 'live';
45
+ }
46
+ if (publishableKey?.startsWith('pk_test_')) {
47
+ return 'test';
48
+ }
49
+ return undefined;
50
+ }
51
+
52
+ // Temporary React Native shim: iOS/Android currently surface this configure/create
53
+ // failure as a legacy SDK-level message instead of a typed rich error. This can be
54
+ // removed once the native SDKs map it themselves, though keeping it is harmless as
55
+ // a compatibility fallback for older native SDK versions.
56
+ function mapLegacyConfigureAppAttestationError(result: {
57
+ error?: Onramp.CryptoOnrampError;
58
+ }): { error?: Onramp.CryptoOnrampError } {
59
+ const error = result.error;
60
+ if (
61
+ error == null ||
62
+ error.onrampErrorType != null ||
63
+ (!isLegacyAppAttestationUnavailableMessage(error.message) &&
64
+ !isLegacyAppAttestationUnavailableMessage(error.localizedMessage))
65
+ ) {
66
+ return result;
67
+ }
68
+
69
+ const userMessage =
70
+ "This app couldn't be verified. Contact the app developer for help.";
71
+ const mode = publishableKeyMode();
72
+
73
+ const context = [
74
+ 'Context:',
75
+ ' operation: configure',
76
+ mode != null ? ` mode: ${mode}` : undefined,
77
+ ].filter((line): line is string => line != null);
78
+ const appAttestationError = {
79
+ ...error,
80
+ message: userMessage,
81
+ localizedMessage: userMessage,
82
+ stripeErrorCode: cryptoOnrampAppAttestationUnavailableCode,
83
+ developerMessage: [
84
+ "App attestation unavailable: this app isn't configured to use Stripe Crypto Onramp.",
85
+ '',
86
+ "This usually means app attestation isn't enabled for this Stripe account, or this app isn't registered as a trusted application. Use your iOS bundle ID or Android package name and contact Stripe to enable app attestation or register the app for this account.",
87
+ '',
88
+ ...context,
89
+ '',
90
+ `Code: ${cryptoOnrampAppAttestationUnavailableCode}`,
91
+ '',
92
+ 'Next step: confirm app attestation is enabled for this Stripe account and that the app identifier is registered as trusted, then call configure again.',
93
+ `SDK: stripe-react-native@${pjson.version}`,
94
+ ].join('\n'),
95
+ userMessage,
96
+ operation: 'configure',
97
+ mode,
98
+ } as unknown as Onramp.CryptoOnrampError;
99
+
100
+ return {
101
+ ...result,
102
+ error: appAttestationError,
103
+ };
104
+ }
105
+
27
106
  /**
28
107
  * useOnramp hook
29
108
  */
@@ -31,8 +110,10 @@ export function useOnramp() {
31
110
  const _configure = useCallback(
32
111
  async (
33
112
  config: Onramp.Configuration
34
- ): Promise<{ error?: StripeError<OnrampError> }> => {
35
- return requireOnrampModule().configureOnramp(config);
113
+ ): Promise<{ error?: Onramp.CryptoOnrampError }> => {
114
+ return mapLegacyConfigureAppAttestationError(
115
+ await requireOnrampModule().configureOnramp(config)
116
+ );
36
117
  },
37
118
  []
38
119
  );
@@ -57,7 +138,7 @@ export function useOnramp() {
57
138
  async (
58
139
  walletAddress: string,
59
140
  network: Onramp.CryptoNetwork
60
- ): Promise<{ error?: StripeError<OnrampError> }> => {
141
+ ): Promise<{ error?: Onramp.CryptoOnrampError }> => {
61
142
  return requireOnrampModule().registerWalletAddress(
62
143
  walletAddress,
63
144
  network
@@ -69,7 +150,7 @@ export function useOnramp() {
69
150
  const _attachKycInfo = useCallback(
70
151
  async (
71
152
  kycInfo: Onramp.KycInfo
72
- ): Promise<{ error?: StripeError<OnrampError> }> => {
153
+ ): Promise<{ error?: Onramp.CryptoOnrampError }> => {
73
154
  return requireOnrampModule().attachKycInfo(kycInfo);
74
155
  },
75
156
  []
@@ -89,9 +170,9 @@ export function useOnramp() {
89
170
  []
90
171
  );
91
172
 
92
- const _presentCRSCARFDeclaration =
93
- useCallback(async (): Promise<Onramp.CRSCARFDeclarationResult> => {
94
- return requireOnrampModule().presentCRSCARFDeclaration();
173
+ const _presentUserAttestation =
174
+ useCallback(async (): Promise<Onramp.UserAttestationResult> => {
175
+ return requireOnrampModule().presentUserAttestation();
95
176
  }, []);
96
177
 
97
178
  const _presentKycInfoVerification = useCallback(
@@ -104,7 +185,7 @@ export function useOnramp() {
104
185
  const _authenticateUserWithToken = useCallback(
105
186
  async (
106
187
  linkAuthTokenClientSecret: string
107
- ): Promise<{ error?: StripeError<OnrampError> }> => {
188
+ ): Promise<{ error?: Onramp.CryptoOnrampError }> => {
108
189
  return requireOnrampModule().authenticateUserWithToken(
109
190
  linkAuthTokenClientSecret
110
191
  );
@@ -113,14 +194,14 @@ export function useOnramp() {
113
194
  );
114
195
 
115
196
  const _updatePhoneNumber = useCallback(
116
- async (phone: string): Promise<{ error?: StripeError<OnrampError> }> => {
197
+ async (phone: string): Promise<{ error?: Onramp.CryptoOnrampError }> => {
117
198
  return requireOnrampModule().updatePhoneNumber(phone);
118
199
  },
119
200
  []
120
201
  );
121
202
 
122
203
  const _verifyIdentity = useCallback(async (): Promise<{
123
- error?: StripeError<OnrampError>;
204
+ error?: Onramp.CryptoOnrampError;
124
205
  }> => {
125
206
  return requireOnrampModule().verifyIdentity();
126
207
  }, []);
@@ -168,7 +249,7 @@ export function useOnramp() {
168
249
  async (
169
250
  onrampSessionId: string,
170
251
  provideCheckoutClientSecret: () => Promise<string | null>
171
- ): Promise<{ error?: StripeError<OnrampError> }> => {
252
+ ): Promise<{ error?: Onramp.CryptoOnrampError }> => {
172
253
  onCheckoutClientSecretRequestedSubscription?.remove();
173
254
  onCheckoutClientSecretRequestedSubscription = addOnrampListener(
174
255
  'onCheckoutClientSecretRequested',
@@ -203,13 +284,15 @@ export function useOnramp() {
203
284
  );
204
285
 
205
286
  const _logOut = useCallback(async (): Promise<{
206
- error?: StripeError<OnrampError>;
287
+ error?: Onramp.CryptoOnrampError;
207
288
  }> => {
208
289
  return requireOnrampModule().logout();
209
290
  }, []);
210
291
 
211
- const _isAuthError = (error?: StripeError<OnrampError>): boolean => {
212
- const stripeErrorCode = error?.stripeErrorCode;
292
+ const _isAuthError = (error?: Onramp.CryptoOnrampError): boolean => {
293
+ const stripeErrorCode =
294
+ error?.stripeErrorCode ??
295
+ (error?.onrampErrorType ? error.apiErrorCode : undefined);
213
296
  if (stripeErrorCode == null) {
214
297
  return false;
215
298
  }
@@ -276,17 +359,17 @@ export function useOnramp() {
276
359
  * Requires an authenticated Link user.
277
360
  *
278
361
  * @param identifiers The compliance identifiers to submit
279
- * @returns Promise that resolves to whether the submission was valid, any remaining requirements, invalid identifiers, or error
362
+ * @returns Promise that resolves to whether collection is complete, any remaining requirements, CARF TIN state, invalid identifiers, or error
280
363
  */
281
364
  submitIdentifiers: _submitIdentifiers,
282
365
 
283
366
  /**
284
- * Presents UI for the current Link user to accept the CRS/CARF declaration.
367
+ * Presents UI for the current Link user to accept user attestation.
285
368
  * Requires an authenticated Link user.
286
369
  *
287
370
  * @returns Promise that resolves to `Confirmed` when accepted, or error
288
371
  */
289
- presentCRSCARFDeclaration: _presentCRSCARFDeclaration,
372
+ presentUserAttestation: _presentUserAttestation,
290
373
 
291
374
  /**
292
375
  * Presents UI to verify KYC information for the current Link user.
@@ -0,0 +1,9 @@
1
+ let currentPublishableKey: string | undefined;
2
+
3
+ export function setCurrentPublishableKey(publishableKey: string): void {
4
+ currentPublishableKey = publishableKey;
5
+ }
6
+
7
+ export function getCurrentPublishableKey(): string | undefined {
8
+ return currentPublishableKey;
9
+ }
@@ -23,7 +23,7 @@ export interface Spec extends TurboModule {
23
23
  submitIdentifiers(
24
24
  identifiers: ReadonlyArray<UnsafeObject<Onramp.ComplianceIdentifier>>
25
25
  ): Promise<Onramp.SubmitIdentifiersResult>;
26
- presentCRSCARFDeclaration(): Promise<Onramp.CRSCARFDeclarationResult>;
26
+ presentUserAttestation(): Promise<Onramp.UserAttestationResult>;
27
27
  presentKycInfoVerification: (
28
28
  updatedAddress: UnsafeObject<Address> | null
29
29
  ) => Promise<Onramp.VerifyKycResult>;
@@ -256,12 +256,6 @@ export interface Spec extends TurboModule {
256
256
  id: string
257
257
  ): Promise<UnsafeObject<Checkout.State>>;
258
258
 
259
- checkoutUpdateTaxId(
260
- sessionKey: string,
261
- type: string,
262
- value: string
263
- ): Promise<UnsafeObject<Checkout.State>>;
264
-
265
259
  checkoutRunServerUpdateStart(
266
260
  sessionKey: string
267
261
  ): Promise<UnsafeObject<Checkout.State>>;
@@ -557,15 +557,6 @@ export interface Checkout {
557
557
  */
558
558
  selectShippingOption(id: string): Promise<void>;
559
559
 
560
- /**
561
- * Sets the customer's tax ID on the session.
562
- * @param type - The tax ID type (e.g. `"eu_vat"`).
563
- * @param value - The tax ID value (e.g. `"DE123456789"`).
564
- * - Throws: `CheckoutError` if updating the tax ID fails.
565
- * @internal
566
- */
567
- updateTaxId(type: string, value: string): Promise<void>;
568
-
569
560
  /**
570
561
  * Runs an async operation that updates the Checkout Session on your server,
571
562
  * then automatically refreshes the local session state.
@@ -44,12 +44,6 @@ export enum PaymentSheetError {
44
44
  Timeout = 'Timeout',
45
45
  }
46
46
 
47
- export enum OnrampError {
48
- Failed = 'Failed',
49
- Canceled = 'Canceled',
50
- Unknown = 'Unknown',
51
- }
52
-
53
47
  export type ErrorType =
54
48
  | 'api_connection_error'
55
49
  | 'api_error'
@@ -1,10 +1,19 @@
1
1
  import type { Address } from './Common';
2
- import type { OnrampError, StripeError } from './Errors';
2
+ import type { StripeError } from './Errors';
3
3
  import type {
4
4
  ApplePayBaseParams,
5
5
  ApplePayPaymentMethodParams,
6
6
  } from './PlatformPay';
7
7
 
8
+ /**
9
+ * Generic error codes returned by Crypto Onramp APIs.
10
+ */
11
+ export enum OnrampError {
12
+ Failed = 'Failed',
13
+ Canceled = 'Canceled',
14
+ Unknown = 'Unknown',
15
+ }
16
+
8
17
  /**
9
18
  * Configuration used to initialize and customize the crypto onramp experience.
10
19
  *
@@ -255,7 +264,68 @@ export type ComplianceIdentifierRequirements = {
255
264
  identifiers: ComplianceIdentifierRequirement[];
256
265
  /** Alternative identifier groups that may satisfy one or more requirements. */
257
266
  alternatives: ComplianceIdentifierAlternativeGroup[];
267
+ /** Whether at least one CRS/CARF tax identification number still needs to be collected. */
268
+ carfTinRequired: boolean;
269
+ };
270
+
271
+ /**
272
+ * Typed Crypto Onramp error discriminants returned by newer native SDKs.
273
+ */
274
+ export type OnrampErrorType = 'AppAttestationError' | 'UncategorizedApiError';
275
+
276
+ /**
277
+ * A native SDK component and version included in Crypto Onramp diagnostics.
278
+ */
279
+ export type SDKVersion = {
280
+ /** The SDK component name. */
281
+ name: string;
282
+ /** The SDK component version. */
283
+ version: string;
284
+ };
285
+
286
+ export type OnrampApiError = StripeError<OnrampError> & {
287
+ onrampErrorType: string;
288
+ developerMessage: string;
289
+ userMessage: string;
290
+ reason?: string;
291
+ operation: string;
292
+ appPackageName: string;
293
+ mode?: 'live' | 'test';
294
+ sdkVersions?: SDKVersion[];
295
+ requestId?: string;
296
+ apiErrorCode?: string;
297
+ apiErrorType?: string;
298
+ apiErrorMessage?: string;
299
+ apiUserMessage?: string;
300
+ docUrl?: string;
258
301
  };
302
+ /**
303
+ * A typed Crypto Onramp app attestation failure.
304
+ */
305
+ export type AppAttestationError = OnrampApiError & {
306
+ onrampErrorType: 'AppAttestationError';
307
+ };
308
+
309
+ /**
310
+ * A typed Crypto Onramp API error that did not map to a narrower category.
311
+ */
312
+ export type UncategorizedApiError = OnrampApiError & {
313
+ onrampErrorType: 'UncategorizedApiError';
314
+ };
315
+
316
+ /**
317
+ * Error returned by Crypto Onramp APIs.
318
+ *
319
+ * Most failures use the generic Stripe error envelope. Newer native SDK
320
+ * versions may instead return typed SDK-owned errors via
321
+ * `onrampErrorType`.
322
+ */
323
+ export type CryptoOnrampError =
324
+ | (StripeError<OnrampError> & {
325
+ onrampErrorType?: undefined;
326
+ })
327
+ | AppAttestationError
328
+ | UncategorizedApiError;
259
329
 
260
330
  /**
261
331
  * Result of retrieving missing compliance identifiers.
@@ -267,8 +337,9 @@ export type RetrieveMissingIdentifiersResult =
267
337
  | {
268
338
  identifiers?: undefined;
269
339
  alternatives?: undefined;
340
+ carfTinRequired?: undefined;
270
341
  /** Present if retrieval failed with an error. */
271
- error: StripeError<OnrampError>;
342
+ error: CryptoOnrampError;
272
343
  };
273
344
 
274
345
  /**
@@ -276,38 +347,41 @@ export type RetrieveMissingIdentifiersResult =
276
347
  */
277
348
  export type SubmitIdentifiersResult =
278
349
  | {
279
- /** Whether all required identifiers were accepted. */
280
- valid: boolean;
350
+ /** Whether all required MiCA identifiers and CRS/CARF tax identification numbers have been submitted. */
351
+ completed: boolean;
281
352
  /** Any identifiers that still need to be collected. */
282
353
  identifiers: ComplianceIdentifierRequirement[];
283
354
  /** Alternative identifier groups that may satisfy one or more requirements. */
284
355
  alternatives: ComplianceIdentifierAlternativeGroup[];
356
+ /** Whether at least one CRS/CARF tax identification number still needs to be collected. */
357
+ carfTinRequired: boolean;
285
358
  /** Submitted identifier types whose values were invalid. */
286
359
  invalidIdentifiers: ComplianceIdentifierType[];
287
360
  error?: undefined;
288
361
  }
289
362
  | {
290
- valid?: undefined;
363
+ completed?: undefined;
291
364
  identifiers?: undefined;
292
365
  alternatives?: undefined;
366
+ carfTinRequired?: undefined;
293
367
  invalidIdentifiers?: undefined;
294
368
  /** Present if submission failed with an error. */
295
- error: StripeError<OnrampError>;
369
+ error: CryptoOnrampError;
296
370
  };
297
371
 
298
372
  /**
299
- * Result of presenting the CRS/CARF declaration.
373
+ * Result of presenting user attestation.
300
374
  */
301
- export type CRSCARFDeclarationResult =
375
+ export type UserAttestationResult =
302
376
  | {
303
- /** The customer accepted the declaration. */
377
+ /** The customer accepted the attestation. */
304
378
  status: 'Confirmed';
305
379
  error?: undefined;
306
380
  }
307
381
  | {
308
382
  status?: undefined;
309
- /** Present if the declaration failed or was cancelled. */
310
- error: StripeError<OnrampError>;
383
+ /** Present if attestation failed or was cancelled. */
384
+ error: CryptoOnrampError;
311
385
  };
312
386
 
313
387
  /**
@@ -327,7 +401,7 @@ export type VerifyKycResult =
327
401
  | {
328
402
  status?: undefined;
329
403
  /** Present if the verification failed with an error. */
330
- error: StripeError<OnrampError>;
404
+ error: CryptoOnrampError;
331
405
  };
332
406
 
333
407
  /**
@@ -335,7 +409,7 @@ export type VerifyKycResult =
335
409
  */
336
410
  export type VoidResult = {
337
411
  /** Present if the operation failed. */
338
- error?: StripeError<OnrampError>;
412
+ error?: CryptoOnrampError;
339
413
  };
340
414
 
341
415
  /**
@@ -363,7 +437,7 @@ export type AuthorizeResult =
363
437
  status?: undefined;
364
438
  customerId?: undefined;
365
439
  /** Present if the authorization failed with an error. */
366
- error: StripeError<OnrampError>;
440
+ error: CryptoOnrampError;
367
441
  };
368
442
 
369
443
  /**
@@ -378,7 +452,7 @@ export type HasLinkAccountResult =
378
452
  | {
379
453
  hasLinkAccount?: undefined;
380
454
  /** Present if the lookup failed with an error. */
381
- error: StripeError<OnrampError>;
455
+ error: CryptoOnrampError;
382
456
  };
383
457
 
384
458
  /**
@@ -393,7 +467,7 @@ export type RegisterLinkUserResult =
393
467
  | {
394
468
  customerId?: undefined;
395
469
  /** Present if registration failed with an error. */
396
- error: StripeError<OnrampError>;
470
+ error: CryptoOnrampError;
397
471
  };
398
472
 
399
473
  /**
@@ -428,7 +502,7 @@ export type CollectPaymentMethodResult =
428
502
  displayData?: undefined;
429
503
  kycInfo?: undefined;
430
504
  /** Present if collection/selection failed with an error. */
431
- error: StripeError<OnrampError>;
505
+ error: CryptoOnrampError;
432
506
  };
433
507
 
434
508
  /**
@@ -443,7 +517,7 @@ export type CreateCryptoPaymentTokenResult =
443
517
  | {
444
518
  cryptoPaymentToken?: undefined;
445
519
  /** Present if token creation failed with an error. */
446
- error: StripeError<OnrampError>;
520
+ error: CryptoOnrampError;
447
521
  };
448
522
 
449
523
  /**
@@ -484,5 +558,5 @@ export type PaymentDisplayDataResult =
484
558
  | {
485
559
  displayData?: undefined;
486
560
  /** Present if collection/selection failed with an error. */
487
- error: StripeError<OnrampError>;
561
+ error: CryptoOnrampError;
488
562
  };
@@ -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 = '~> 25.15.0'
5
+ stripe_version = '~> 25.17.0'
6
6
 
7
7
  fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
8
8
 
@@ -38,7 +38,7 @@ Pod::Spec.new do |s|
38
38
 
39
39
  s.subspec 'Core' do |core|
40
40
  core.source_files = 'ios/**/*.{h,m,mm,swift}'
41
- core.exclude_files = [ 'ios/Tests/', 'ios/NewArch/', 'ios/StripeOnrampSdk.h', 'ios/StripeOnrampSdk.mm' ]
41
+ core.exclude_files = [ 'ios/Tests/', 'ios/NewArch/', 'ios/StripeOnrampSdk.h', 'ios/StripeOnrampSdk.mm', 'ios/OnrampErrors.swift' ]
42
42
  # These headers contain c++ code so make sure they are private to avoid
43
43
  # being exported to the umbrella header, which is used by swift interop.
44
44
  # StripeSwiftInterop.h will cause circular dependency issues.
@@ -53,7 +53,7 @@ Pod::Spec.new do |s|
53
53
  end
54
54
 
55
55
  s.subspec 'Onramp' do |onramp|
56
- onramp.source_files = [ 'ios/StripeOnrampSdk.h', 'ios/StripeOnrampSdk.mm' ]
56
+ onramp.source_files = [ 'ios/StripeOnrampSdk.h', 'ios/StripeOnrampSdk.mm', 'ios/OnrampErrors.swift' ]
57
57
  onramp.dependency 'stripe-react-native/Core'
58
58
  onramp.dependency 'StripeCryptoOnramp', stripe_version
59
59
  end