createTransfer method
Future<Map>
createTransfer(
- String token,
- String amount,
- String currencyCode,
- String destination,
- String reason,
- String reference,
- String requestId,
override
Implementation
@override
Future<Map> createTransfer(
String token,
String amount,
String currencyCode,
String destination,
String reason,
String reference,
String requestId) async {
final String baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/api/v1/transfers/create");
var bodyData = {
"amount": amount,
"currency": currencyCode,
"destination": destination,
"reason": reason,
"reference": reference,
"request_id": requestId
};
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;
}