getAvailableMandatesDetails method
Implementation
@override
Future<Map> getAvailableMandatesDetails(String token, String? pageNumber,
String? pageSize, String? paymentMethodType, String? version) async {
final baseUrl = await getBaseUrl;
var filters = [];
var prefixes = [];
if (pageNumber != null) {
filters.add(pageNumber);
prefixes.add("page_num=");
}
if (paymentMethodType != null) {
filters.add(paymentMethodType);
prefixes.add("payment_method_type=");
}
if (pageSize != null) {
filters.add(pageSize);
prefixes.add("page_size=");
}
if (version != null) {
filters.add(version);
prefixes.add("version=");
}
String params = addFilter(filters, prefixes);
var url = Uri.parse("$baseUrl/api/v1/pa/config/mandates$params");
var response = await http.get(
url,
headers: {"Authorization": "Bearer $token"},
);
var data = jsonDecode(response.body);
return data;
}