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