saveToFunds method
Future<PlanningCenterApiResponse<PlanningCenterApiData> >
saveToFunds(
- List<
PcoGivingFundMap> funds
each donation must be designated to one or more funds
Make sure you have already set the person_id
before calling this
Implementation
Future<PlanningCenterApiResponse> saveToFunds(
List<PcoGivingFundMap> funds) async {
// convert the funds to designation objects
var designations = <PcoGivingDesignation>[];
for (var f in funds) {
designations.add(PcoGivingDesignation(
amountCents: f.amountCents,
withRelationships: {
'fund': [PcoGivingFund(id: f.fundId)]
},
));
}
return saveWithDesignations(designations);
}