@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.
- package/android/gradle.properties +1 -1
- package/android/src/main/java/com/reactnativestripesdk/StripeSdkModule.kt +0 -11
- package/android/src/main/java/com/reactnativestripesdk/utils/Errors.kt +11 -6
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeOnrampSdkModuleSpec.java +1 -1
- package/android/src/oldarch/java/com/reactnativestripesdk/NativeStripeSdkModuleSpec.java +0 -4
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampErrors.kt +145 -0
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampMappers.kt +10 -1
- package/android/src/onramp/java/com/reactnativestripesdk/OnrampSdkModule.kt +45 -31
- package/android/src/test/java/com/reactnativestripesdk/OnrampErrorsTest.kt +168 -0
- package/ios/Mappers.swift +8 -6
- package/ios/OnrampErrors.swift +132 -0
- package/ios/StripeOnrampSdk.mm +3 -3
- package/ios/StripeSdk.mm +0 -13
- package/ios/StripeSdkImpl+Checkout.swift +0 -17
- package/ios/StripeSdkImpl.swift +34 -22
- package/lib/commonjs/components/StripeProvider.js +1 -1
- package/lib/commonjs/components/StripeProvider.js.map +1 -1
- package/lib/commonjs/hooks/useCheckout.js +1 -1
- package/lib/commonjs/hooks/useCheckout.js.map +1 -1
- package/lib/commonjs/hooks/useOnramp.js +1 -1
- package/lib/commonjs/hooks/useOnramp.js.map +1 -1
- package/lib/commonjs/internal/stripeConfig.js +2 -0
- package/lib/commonjs/internal/stripeConfig.js.map +1 -0
- package/lib/commonjs/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/commonjs/types/Errors.js +1 -1
- package/lib/commonjs/types/Errors.js.map +1 -1
- package/lib/commonjs/types/Onramp.js +1 -1
- package/lib/commonjs/types/Onramp.js.map +1 -1
- package/lib/module/components/StripeProvider.js +1 -1
- package/lib/module/components/StripeProvider.js.map +1 -1
- package/lib/module/hooks/useCheckout.js +1 -1
- package/lib/module/hooks/useCheckout.js.map +1 -1
- package/lib/module/hooks/useOnramp.js +1 -1
- package/lib/module/hooks/useOnramp.js.map +1 -1
- package/lib/module/internal/stripeConfig.js +2 -0
- package/lib/module/internal/stripeConfig.js.map +1 -0
- package/lib/module/specs/NativeStripeSdkModule.js.map +1 -1
- package/lib/module/types/Errors.js +1 -1
- package/lib/module/types/Errors.js.map +1 -1
- package/lib/module/types/Onramp.js +1 -1
- package/lib/module/types/Onramp.js.map +1 -1
- package/lib/typescript/src/components/StripeProvider.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useCheckout.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useOnramp.d.ts +13 -13
- package/lib/typescript/src/hooks/useOnramp.d.ts.map +1 -1
- package/lib/typescript/src/internal/stripeConfig.d.ts +3 -0
- package/lib/typescript/src/internal/stripeConfig.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts +1 -1
- package/lib/typescript/src/specs/NativeOnrampSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts +0 -1
- package/lib/typescript/src/specs/NativeStripeSdkModule.d.ts.map +1 -1
- package/lib/typescript/src/types/Checkout.d.ts +0 -8
- package/lib/typescript/src/types/Checkout.d.ts.map +1 -1
- package/lib/typescript/src/types/Errors.d.ts +0 -5
- package/lib/typescript/src/types/Errors.d.ts.map +1 -1
- package/lib/typescript/src/types/Onramp.d.ts +84 -19
- package/lib/typescript/src/types/Onramp.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/StripeProvider.tsx +2 -0
- package/src/hooks/useCheckout.tsx +0 -9
- package/src/hooks/useOnramp.tsx +101 -18
- package/src/internal/stripeConfig.ts +9 -0
- package/src/specs/NativeOnrampSdkModule.ts +1 -1
- package/src/specs/NativeStripeSdkModule.ts +0 -6
- package/src/types/Checkout.ts +0 -9
- package/src/types/Errors.ts +0 -6
- package/src/types/Onramp.ts +93 -19
- package/stripe-react-native.podspec +3 -3
package/src/hooks/useOnramp.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { EventSubscription, Platform } from 'react-native';
|
|
2
2
|
import NativeOnrampSdk from '../specs/NativeOnrampSdkModule';
|
|
3
|
-
import { Onramp
|
|
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?:
|
|
35
|
-
return
|
|
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?:
|
|
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?:
|
|
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
|
|
93
|
-
useCallback(async (): Promise<Onramp.
|
|
94
|
-
return requireOnrampModule().
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
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?:
|
|
287
|
+
error?: Onramp.CryptoOnrampError;
|
|
207
288
|
}> => {
|
|
208
289
|
return requireOnrampModule().logout();
|
|
209
290
|
}, []);
|
|
210
291
|
|
|
211
|
-
const _isAuthError = (error?:
|
|
212
|
-
const 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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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>>;
|
package/src/types/Checkout.ts
CHANGED
|
@@ -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.
|
package/src/types/Errors.ts
CHANGED
package/src/types/Onramp.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import type { Address } from './Common';
|
|
2
|
-
import type {
|
|
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:
|
|
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
|
|
280
|
-
|
|
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
|
-
|
|
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:
|
|
369
|
+
error: CryptoOnrampError;
|
|
296
370
|
};
|
|
297
371
|
|
|
298
372
|
/**
|
|
299
|
-
* Result of presenting
|
|
373
|
+
* Result of presenting user attestation.
|
|
300
374
|
*/
|
|
301
|
-
export type
|
|
375
|
+
export type UserAttestationResult =
|
|
302
376
|
| {
|
|
303
|
-
/** The customer accepted the
|
|
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
|
|
310
|
-
error:
|
|
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:
|
|
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?:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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.
|
|
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
|