getAllFromPersonAndPaymentMethod static method

Future<PcoCollection<PcoGivingRecurringDonation>> getAllFromPersonAndPaymentMethod(
  1. String personId,
  2. String paymentMethodId, {
  3. String? id,
  4. PcoGivingRecurringDonationQuery? query,
  5. bool includeDesignations = false,
})

Will get a PcoCollection containing ALL PcoGivingRecurringDonation objects (expecting many) using a path like this: /giving/v2/people/$personId/payment_methods/$paymentMethodId/recurring_donations

Additional options may be specified by using the query argument, but some query options are also available as boolean flags in this function call too.

This function forces the query.getAll to be true.

Implementation

static Future<PcoCollection<PcoGivingRecurringDonation>>
    getAllFromPersonAndPaymentMethod(
  String personId,
  String paymentMethodId, {
  String? id,
  PcoGivingRecurringDonationQuery? query,
  bool includeDesignations = false,
}) async {
  query ??= PcoGivingRecurringDonationQuery();
  query.getAll = true;

  if (includeDesignations) query.include.add('designations');
  var url =
      '/giving/v2/people/$personId/payment_methods/$paymentMethodId/recurring_donations';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGivingRecurringDonation>(url,
      query: query, apiVersion: kApiVersion);
}