Open craigcartmell opened 6 years ago
Example of response which we're attempting to JSON serialise:
{
BTCustomerInputBraintreeValidationErrorsKey = {
error = {
message = "Credit card is invalid";
};
fieldErrors = (
{
field = creditCard;
fieldErrors = (
{
code = 81703;
field = number;
message = "Credit card type is not accepted by this merchant account";
}
);
}
);
};
Feel free to use https://github.com/craigcartmell/react-native-braintree-xplat/commit/32a25239a99d2453db3064cf530120457f7ed252 if you're finding the same issue and are desperate for a solution.
It will just return a single failure string, e.g. Credit card type is not accepted by this merchant account
+1
+1
Issue Calling getCardNonce on an iOS device causes the full app to crash when an error message is returned from the request.
This appears to be an error in the way the library is attempting to serialise the response from the getCardNonce request.
Maybe it needs to use NSJSONSerialization isValidObject (Disclaimer, I'm no objective-c expert)?
Step to replicate Send any invalid data to
BTClient.getCardNonce()
, e.g. an empty object or invalid card number.Versions react-native@0.53.3 react-native-braintree-xplat@4.0.0
Stacktrace