quoteAmendment method
Future<Map>
quoteAmendment(
- String token,
- String? chargeCurrency,
- String conversionId,
- Map<
String, dynamic> ? metadata, - String requestId,
- String type,
override
Implementation
@override
Future<Map> quoteAmendment(
String token,
String? chargeCurrency,
String conversionId,
Map<String, dynamic>? metadata,
String requestId,
String type) async {
final String baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/api/v1/conversion_amendments/quote");
Map<String, dynamic> bodyData = {
"conversion_id": conversionId,
"request_id": requestId,
"type": type
};
if (chargeCurrency != null) {
bodyData.addAll({"charge_currency": chargeCurrency});
}
if (metadata != null) {
bodyData.addAll({"metadata": metadata});
}
var jsonBody = jsonEncode(bodyData);
var response = await http.post(
url,
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $token"
},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}