Fix SimpleSwap create exchange (#522)

* Check for status code 201 instead of 200 to follow SimpleSwap API documentation

* allow 200 and 201 success status code
This commit is contained in:
Omar Hatem 2022-09-26 23:12:32 +02:00 committed by GitHub
parent c921ad890a
commit 6b8e749abf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,7 +91,7 @@ class SimpleSwapExchangeProvider extends ExchangeProvider {
final response = await post(uri, headers: headers, body: json.encode(body));
if (response.statusCode != 200) {
if (response.statusCode != 200 && response.statusCode != 201) {
if (response.statusCode == 400) {
final responseJSON = json.decode(response.body) as Map<String, dynamic>;
final error = responseJSON['message'] as String;