getConfigPaymentMethodTypes method
Future<Map>
getConfigPaymentMethodTypes(
- String token,
- String? active,
- String? countryCode,
- String? pageNumber,
- String? pageSize,
- String? transactionCurrency,
- String? transactionMode,
override
Implementation
@override
Future<Map> getConfigPaymentMethodTypes(
String token,
String? active,
String? countryCode,
String? pageNumber,
String? pageSize,
String? transactionCurrency,
String? transactionMode) async {
final String baseUrl = await getBaseUrl;
var filters = [];
var prefixes = [];
if (active != null) {
filters.add(active);
prefixes.add("active=");
}
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=");
}
if (transactionCurrency != null) {
filters.add(transactionCurrency);
prefixes.add("transaction_currency=");
}
if (transactionMode != null) {
filters.add(transactionMode);
prefixes.add("transaction_mode=");
}
String params = addFilter(filters, prefixes);
var url =
Uri.parse("$baseUrl/api/v1/pa/config/payment_method_types$params");
var response = await http.get(
url,
headers: {"Authorization": "Bearer $token"},
);
var data = jsonDecode(response.body);
return data;
}