getBeneficiaryApiSchema method
Future<Map>
getBeneficiaryApiSchema(
- String token,
- String? bankCountryCode,
- String? accountCurrency,
- String? paymentMethod,
- String? localClearingSystem,
- String? entityType,
override
Implementation
@override
Future<Map> getBeneficiaryApiSchema(
String token,
String? bankCountryCode,
String? accountCurrency,
String? paymentMethod,
String? localClearingSystem,
String? entityType) async {
final baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/api/v1/beneficiary_api_schemas/generate");
var bodyData = {};
if (accountCurrency != null) {
bodyData.addAll({"account_currency": accountCurrency});
}
if (bankCountryCode != null) {
bodyData.addAll({"bank_country_code": bankCountryCode});
}
if (entityType != null) {
bodyData.addAll({"entity_type": entityType});
}
if (localClearingSystem != null) {
bodyData.addAll({"local_clearing_system": localClearingSystem});
}
if (paymentMethod != null) {
bodyData.addAll({"payment_method": paymentMethod});
}
var jsonBody = jsonEncode(bodyData);
var response = await http.post(url,
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $token",
"headers": "[object Object]"
},
body: jsonBody);
var data = jsonDecode(response.body);
return data;
}