You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using this plugin for a while, but with a custom patch in order to have a better error handling.
I had an issue in the past on Android where a basic Exception was thrown instead of a StripeException. In this case, calling error.getLocalizedMessage() fails and another exception is thrown.
So I added a _getLocalizedError function, which will test if the error is an instance of StripeException and thus call getLocalizedMessage(). It will also add Stripe's error code and decline code to the error returned.
Hi there!
I've been using this plugin for a while, but with a custom patch in order to have a better error handling.
I had an issue in the past on Android where a basic
Exception
was thrown instead of aStripeException
. In this case, callingerror.getLocalizedMessage()
fails and another exception is thrown.So I added a
_getLocalizedError
function, which will test if the error is an instance ofStripeException
and thus callgetLocalizedMessage()
. It will also add Stripe's error code and decline code to the error returned.Here is the function for Android:
And the one for iOS:
Then I replaced all these calls by my function:
I was wondering if you were interested to add this to the plugin. I would be glad to make a PR in that case :)
The text was updated successfully, but these errors were encountered: