diff --git a/lib/services/buy/simplex/simplex_api.dart b/lib/services/buy/simplex/simplex_api.dart index 0b6666fa3..4060567f0 100644 --- a/lib/services/buy/simplex/simplex_api.dart +++ b/lib/services/buy/simplex/simplex_api.dart @@ -188,7 +188,10 @@ class SimplexAPI { } final jsonArray = jsonDecode(res.body); if (jsonArray.containsKey('error') as bool) { - throw Exception('getQuote exception: ${jsonArray['error']}'); + if (jsonArray['error'] == true || jsonArray['error'] == 'true') { + // jsonArray['error'] as bool == true? + throw Exception('getQuote exception: ${jsonArray['error']}'); + } } jsonArray['quote'] = quote; // Add and pass this on @@ -273,10 +276,11 @@ class SimplexAPI { throw Exception('newOrder exception: statusCode= ${res.statusCode}'); } final jsonArray = jsonDecode(res.body); // TODO check if valid json + if (jsonArray.containsKey('error') as bool) { if (jsonArray['error'] == true || jsonArray['error'] == 'true') { - print('error'); throw Exception(jsonArray['message']); } + } SimplexOrder _order = SimplexOrder( quote: quote,