-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make CoreSDKError Equatable #303
Conversation
I will also make other Error enums (eg. I haven't seen a case where merchant needs to act on any error other than cancellation, but I think it's consistent to make all error types public. |
@@ -47,7 +47,7 @@ class CardVaultViewModel: VaultViewModel { | |||
) | |||
) | |||
} else if let vaultError { | |||
if CardError.isThreeDSecureCanceled(vaultError) { | |||
if let error = vaultError as? CoreSDKError, error == CardError.threeDSecureCanceledError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: is it possible to make vaultError
a CoreSDKError?
to prevent needing a cast here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, good call. Actually, clientID
fetching can also throw an error in the vault function above, so that's why I cast it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome! 🔥
Summary of changes
CoreSDKError
Equatable and make static constants inCardError
andPayPalError
public so merchants can do this:Checklist
Authors