getSingleFromPerson static method

Future<PcoGivingPaymentMethod?> getSingleFromPerson(
  1. String personId,
  2. String id,
  3. {PcoGivingPaymentMethodQuery? query}
)

Will get a single PcoGivingPaymentMethod object using a path like this: /giving/v2/people/$personId/payment_methods/[id]

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.

Implementation

static Future<PcoGivingPaymentMethod?> getSingleFromPerson(
  String personId,
  String id, {
  PcoGivingPaymentMethodQuery? query,
}) async {
  query ??= PcoGivingPaymentMethodQuery();

  var url = '/giving/v2/people/$personId/payment_methods/$id';
  var retval = await PcoCollection.fromApiCall<PcoGivingPaymentMethod>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}