getAll method

Future<List<QuickbooksPayment>> getAll({
  1. required String accessToken,
  2. required String companyId,
  3. String? conditions,
})

Gets all QuickbooksPayment in the Quickbooks API for the given accessToken and companyId

Implementation

Future<List<QuickbooksPayment>> getAll({
  required String accessToken,
  required String companyId,
  String? conditions,
}) async {
  List<Map<String, dynamic>> items = await getMany(
    accessToken: accessToken,
    companyId: companyId,
    conditions: conditions,
    location: 'Payment',
  );

  List<QuickbooksPayment> results = [];

  for (var item in items) {
    try {
      results.add(QuickbooksPayment.fromMap(item));
    } catch (e) {
      print(e);
    }
  }
  return results;
}