Skip to content

Commit 45f7983

Browse files
committed
Removes the uncategorized SDK error type, since we don’t map to it.
1 parent d2e1e21 commit 45f7983

7 files changed

Lines changed: 5 additions & 22 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
**Changes**
55
* [Changed] Renamed the Crypto Onramp error status enum from `OnrampError` to `OnrampErrorStatus`. Existing generic Onramp errors now use `StripeError<OnrampErrorStatus>`.
66
* [Changed] Split rich Crypto Onramp errors into `OnrampSdkError` for SDK-level diagnostics and `OnrampApiError` for API-specific context. `OnrampSdkError` now includes an `onrampErrorType` discriminator typed as `OnrampErrorType`, and `OnrampApiError` narrows it to `OnrampApiErrorType`.
7-
* [Added] Added `LegacyConfigureAppAttestationError` and `UncategorizedSdkError` Crypto Onramp error types for React Native compatibility errors and native SDK errors that have not yet been modeled more specifically.
7+
* [Added] Added `LegacyConfigureAppAttestationError` for React Native compatibility app attestation errors.
88

99
**Fixes**
1010
* [Fixed] Manual bank-account entry in ConnectAccountOnboarding now creates an external account on iOS/Android by collecting a bank-account token instead of only Financial Connections accounts.

android/src/onramp/java/com/reactnativestripesdk/OnrampErrors.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private fun createNonApiOnrampError(
6868
localizedMessage = error.localizedMessage,
6969
stripeErrorCode = onrampError.code,
7070
) {
71-
putCommonOnrampFields(onrampError, "UncategorizedSdkError")
71+
putCommonOnrampFields(onrampError)
7272
}
7373
}
7474

android/src/test/java/com/reactnativestripesdk/OnrampErrorsTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ class OnrampErrorsTest {
131131
assertEquals("Failed", details!!.getString("code"))
132132
assertEquals("Something went wrong.", details.getString("message"))
133133
assertEquals("Something went wrong.", details.getString("localizedMessage"))
134-
assertEquals("UncategorizedSdkError", details.getString("onrampErrorType"))
135134
assertEquals("Developer message.", details.getString("developerMessage"))
136135
assertEquals("Something went wrong.", details.getString("userMessage"))
137136
assertEquals("sdk_error", details.getString("stripeErrorCode"))

etc/stripe-react-native.api.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ type CryptoOnrampError = (StripeError<OnrampErrorStatus> & {
14351435
onrampErrorType?: never;
14361436
developerMessage?: never;
14371437
userMessage?: never;
1438-
}) | AppAttestationError | UncategorizedApiError | UncategorizedSdkError | LegacyConfigureAppAttestationError;
1438+
}) | AppAttestationError | UncategorizedApiError | LegacyConfigureAppAttestationError;
14391439

14401440
// @public
14411441
type CryptoPaymentToken = {
@@ -2595,7 +2595,6 @@ declare namespace Onramp {
25952595
OnrampApiError,
25962596
AppAttestationError,
25972597
UncategorizedApiError,
2598-
UncategorizedSdkError,
25992598
LegacyConfigureAppAttestationError,
26002599
CryptoOnrampError,
26012600
RetrieveMissingIdentifiersResult,
@@ -2643,7 +2642,7 @@ enum OnrampErrorStatus {
26432642
}
26442643

26452644
// @public
2646-
type OnrampErrorType = OnrampApiErrorType | 'UncategorizedSdkError' | 'LegacyConfigureAppAttestationError';
2645+
type OnrampErrorType = OnrampApiErrorType | 'LegacyConfigureAppAttestationError';
26472646

26482647
// @public
26492648
type OnrampGooglePayParams = {
@@ -3938,11 +3937,6 @@ type UncategorizedApiError = OnrampApiError & {
39383937
onrampErrorType: 'UncategorizedApiError';
39393938
};
39403939

3941-
// @public
3942-
type UncategorizedSdkError = OnrampSdkError & {
3943-
onrampErrorType: 'UncategorizedSdkError';
3944-
};
3945-
39463940
// @public
39473941
export const updatePlatformPaySheet: (params: {
39483942
applePay: {

ios/OnrampErrors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ enum OnrampErrors {
4141
message: onrampError.userMessage,
4242
localizedMessage: onrampError.localizedDescription,
4343
stripeErrorCode: onrampError.code,
44-
additionalFields: commonOnrampFields(error: onrampError, onrampErrorType: "UncategorizedSdkError")
44+
additionalFields: commonOnrampFields(error: onrampError)
4545
)
4646
}
4747

ios/Tests/OnrampErrorsTests.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ class OnrampErrorsTests: XCTestCase {
130130
XCTAssertEqual(details["code"] as? String, "Failed")
131131
XCTAssertEqual(details["message"] as? String, error.userMessage)
132132
XCTAssertEqual(details["localizedMessage"] as? String, error.localizedDescription)
133-
XCTAssertEqual(details["onrampErrorType"] as? String, "UncategorizedSdkError")
134133
XCTAssertEqual(details["developerMessage"] as? String, error.developerMessage)
135134
XCTAssertEqual(details["userMessage"] as? String, error.userMessage)
136135
XCTAssertEqual(details["stripeErrorCode"] as? String, error.code)

src/types/Onramp.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ export type OnrampApiErrorType =
280280
*/
281281
export type OnrampErrorType =
282282
| OnrampApiErrorType
283-
| 'UncategorizedSdkError'
284283
| 'LegacyConfigureAppAttestationError';
285284

286285
/**
@@ -334,13 +333,6 @@ export type UncategorizedApiError = OnrampApiError & {
334333
onrampErrorType: 'UncategorizedApiError';
335334
};
336335

337-
/**
338-
* A typed Crypto Onramp SDK error that did not map to a narrower category.
339-
*/
340-
export type UncategorizedSdkError = OnrampSdkError & {
341-
onrampErrorType: 'UncategorizedSdkError';
342-
};
343-
344336
/**
345337
* A compatibility error for older native SDKs that returned app attestation setup
346338
* failures as legacy configure errors.
@@ -364,7 +356,6 @@ export type CryptoOnrampError =
364356
})
365357
| AppAttestationError
366358
| UncategorizedApiError
367-
| UncategorizedSdkError
368359
| LegacyConfigureAppAttestationError;
369360

370361
/**

0 commit comments

Comments
 (0)