createGlobalAccount method
Future<Map>
createGlobalAccount(
- String token,
- String countryCode,
- String currencyCode,
- String nickname,
- List<
String> paymentMethods, - String requestId,
override
Implementation
@override
Future<Map> createGlobalAccount(
String token,
String countryCode,
String currencyCode,
String nickname,
List<String> paymentMethods,
String requestId) async {
final baseUrl = await getBaseUrl;
var url = Uri.parse("$baseUrl/api/v1/global_accounts/create");
var bodyData = {
"country_code": countryCode,
"currency": currencyCode,
"nick_name": nickname,
"payment_methods": paymentMethods,
"request_id": requestId
};
var jsonBody = jsonEncode(bodyData);
var response = await http.post(
url,
headers: {
"Authorization": "Bearer $token",
"Content-Type": "application/json"
},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}