PcoGivingDonation constructor
PcoGivingDonation({
- required String batchId,
- String? id,
- DateTime? createdAt,
- DateTime? updatedAt,
- String? paymentMethodSub,
- String? paymentLast4,
- String? paymentBrand,
- int? paymentCheckNumber,
- String? paymentCheckDatedAt,
- int? feeCents,
- String? paymentMethod,
- DateTime? receivedAt,
- int? amountCents,
- String? paymentStatus,
- DateTime? completedAt,
- String? amountCurrency,
- String? feeCurrency,
- bool? isRefunded,
- bool? isRefundable,
- String? personId,
- String? paymentSourceId,
- String? campusId,
- Map<
String, List< ? withRelationships,PcoResource> > - List<
PcoResource> ? withIncluded,
Create a new PcoGivingDonation object using this endpoint: https://api.planningcenteronline.com/giving/v2/batches/$batchId/donations
NOTES:
- Creating an instance of a class this way does not save it on the server.
- Call
save()
on the object to save it to the server. - Only set the
id
field if you know what you are doing. Save operations will overwrite data when theid
is set. - Dummy data can be supplied for a required parameter, but if so,
.save()
should not be called on the object - FIELDS USED WHEN CREATING:
paymentMethodSub
,paymentLast4
,paymentBrand
,paymentCheckNumber
,paymentCheckDatedAt
,feeCents
,paymentMethod
,receivedAt
,personId
,paymentSourceId
,campusId
- FIELDS USED WHEN UPDATING:
paymentMethodSub
,paymentLast4
,paymentBrand
,paymentCheckNumber
,paymentCheckDatedAt
,feeCents
,paymentMethod
,receivedAt
,personId
,paymentSourceId
,campusId
Implementation
factory PcoGivingDonation(
{required String batchId,
String? id,
DateTime? createdAt,
DateTime? updatedAt,
String? paymentMethodSub,
String? paymentLast4,
String? paymentBrand,
int? paymentCheckNumber,
String? paymentCheckDatedAt,
int? feeCents,
String? paymentMethod,
DateTime? receivedAt,
int? amountCents,
String? paymentStatus,
DateTime? completedAt,
String? amountCurrency,
String? feeCurrency,
bool? isRefunded,
bool? isRefundable,
String? personId,
String? paymentSourceId,
String? campusId,
Map<String, List<PcoResource>>? withRelationships,
List<PcoResource>? withIncluded}) {
var obj = PcoGivingDonation.empty();
obj._id = id;
obj._apiPathOverride =
'https://api.planningcenteronline.com/giving/v2/batches/$batchId/donations';
if (createdAt != null)
obj._attributes['created_at'] = createdAt.toIso8601String();
if (updatedAt != null)
obj._attributes['updated_at'] = updatedAt.toIso8601String();
if (paymentMethodSub != null)
obj._attributes['payment_method_sub'] = paymentMethodSub;
if (paymentLast4 != null) obj._attributes['payment_last4'] = paymentLast4;
if (paymentBrand != null) obj._attributes['payment_brand'] = paymentBrand;
if (paymentCheckNumber != null)
obj._attributes['payment_check_number'] = paymentCheckNumber;
if (paymentCheckDatedAt != null)
obj._attributes['payment_check_dated_at'] = paymentCheckDatedAt;
if (feeCents != null) obj._attributes['fee_cents'] = feeCents;
if (paymentMethod != null)
obj._attributes['payment_method'] = paymentMethod;
if (receivedAt != null)
obj._attributes['received_at'] = receivedAt.toIso8601String();
if (amountCents != null) obj._attributes['amount_cents'] = amountCents;
if (paymentStatus != null)
obj._attributes['payment_status'] = paymentStatus;
if (completedAt != null)
obj._attributes['completed_at'] = completedAt.toIso8601String();
if (amountCurrency != null)
obj._attributes['amount_currency'] = amountCurrency;
if (feeCurrency != null) obj._attributes['fee_currency'] = feeCurrency;
if (isRefunded != null) obj._attributes['refunded'] = isRefunded;
if (isRefundable != null) obj._attributes['refundable'] = isRefundable;
if (personId != null) obj._attributes['person_id'] = personId;
if (paymentSourceId != null)
obj._attributes['payment_source_id'] = paymentSourceId;
if (campusId != null) obj._attributes['campus_id'] = campusId;
if (withRelationships != null) {
for (var r in withRelationships.entries) {
obj._relationships[r.key] = r.value;
}
obj._hasManualRelationships = true;
}
if (withIncluded != null) {
obj._included.addAll(withIncluded);
obj._hasManualIncluded = true;
}
return obj;
}