getSettlements method
Future<Map>
getSettlements(
- String token,
- String currencyCode,
- String fromSettledAt,
- String status,
- String toSettledAt,
- String? pageNumber,
- String? pageSize,
override
Implementation
@override
Future<Map> getSettlements(
String token,
String currencyCode,
String fromSettledAt,
String status,
String toSettledAt,
String? pageNumber,
String? pageSize) async {
final baseUrl = await getBaseUrl;
var filters = [];
var prefixes = [];
filters.add(currencyCode);
prefixes.add("currency=");
filters.add(fromSettledAt);
prefixes.add("from_settled_at=");
if (pageNumber != null) {
filters.add(pageNumber);
prefixes.add("page_num=");
}
if (pageSize != null) {
filters.add(pageSize);
prefixes.add("page_size=");
}
String params = addFilter(filters, prefixes);
var url = Uri.parse("$baseUrl/api/v1/pa/financial/settlements$params");
var response = await http.get(
url,
headers: {"Authorization": "Bearer $token"},
);
var data = jsonDecode(response.body);
return data;
}