getAvailableBanks method
Implementation
@override
Future<Map> getAvailableBanks(String token, String paymentMethodType,
String? countryCode, String? pageNumber, String? pageSize) async {
final String baseUrl = await getBaseUrl;
var filters = [];
var prefixes = [];
filters.add(paymentMethodType);
prefixes.add("payment_method_type=");
if (countryCode != null) {
filters.add(countryCode);
prefixes.add("country_code=");
}
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/config/banks$params");
var response = await http.get(
url,
headers: {"Authorization": "Bearer $token"},
);
var data = jsonDecode(response.body);
return data;
}