retrieveAllCheckouts property
Future<List<CheckoutObject> >
get
retrieveAllCheckouts
Returns all Charges
Implementation
Future<List<CheckoutObject>> get retrieveAllCheckouts async {
List<CheckoutObject> coinbaseResponse;
List data;
Map response = await getFromDB(
api: 'https://api.commerce.coinbase.com/checkouts',
apiKey: _apiKey,
);
if (response.containsKey('error')) {
data = response['error'];
} else {
data = response['data'];
}
coinbaseResponse = List.generate(
data.length, (index) => CheckoutObject.fromJson(data[index]));
Logger(debug).displayLog(coinbaseResponse.toString());
return coinbaseResponse;
}