Table of Contents

Class Donation

Namespace
Crews.PlanningCenter.Api.Giving.V2019_10_18
Assembly
Crews.PlanningCenter.Api.dll

Attributes for the Donation resource.

public record Donation : IEquatable<Donation>
Inheritance
Donation
Implements
Inherited Members

Constructors

Donation()

public Donation()

Donation(Donation)

protected Donation(Donation original)

Parameters

original Donation

Properties

AmountCents

The number of cents being donated. Derived from the total of all of a donation's associated designation's amount_cents values.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("amount_cents")]
public int? AmountCents { get; init; }

Property Value

int?

AmountCurrency

The currency of amount_cents. Based on the organization's currency.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("amount_currency")]
public string? AmountCurrency { get; init; }

Property Value

string

CompletedAt

The date and time at which a donation was completely processed. For card and ACH donations processed by Stripe, this is the moment when the donation was marked as fully processed by Stripe. For committed batch donations, this is the moment that the batch was committed. For uncommitted batch donations, this should return null. Example: 2000-01-01T12:00:00Z

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("completed_at")]
public DateTime? CompletedAt { get; init; }

Property Value

DateTime?

CreatedAt

The date and time at which a donation was created. Example: 2000-01-01T12:00:00Z

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("created_at")]
public DateTime? CreatedAt { get; init; }

Property Value

DateTime?

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

FeeCents

The fee to process a donation. This should either be 0 or a negative integer. For a donation processed by Giving via Stripe, this is the amount the associated organization paid Stripe to process it. For donations not processed by Stripe, this can be used to record fees from other systems. Note: while amount_cents is assigned via a donation's designations, fee_cents is set here, and used by Giving to distribute fees across all designations in proportion to the amount of each designation.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fee_cents")]
public int? FeeCents { get; init; }

Property Value

int?

FeeCovered

A boolean indicating whether the donor chose to cover the Stripe processing fee for this donation.Note that fee_covered can only be true for donations processed through Stripe.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fee_covered")]
public bool? FeeCovered { get; init; }

Property Value

bool?

FeeCurrency

The currency of fee_cents. Based on the organization's currency.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("fee_currency")]
public string? FeeCurrency { get; init; }

Property Value

string

Memo

An optional short note donors can add to specify their gift intention (e.g. "In memory of..."). Only available when enabled by the church for specific funds.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("memo")]
public string? Memo { get; init; }

Property Value

string

PaymentBrand

For cards, this is the card brand (eg Visa, Mastercard, etc). For checks and bank accounts, this is the bank name. For cash donations, this should be null.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_brand")]
public string? PaymentBrand { get; init; }

Property Value

string

PaymentChannel

The channel through which the donation was created.

Possible values: api, sms, mobile_app, web, admin, or other

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_channel")]
public string? PaymentChannel { get; init; }

Property Value

string

PaymentCheckDatedAt

The check date for donations made by check. Example: 2000-01-01

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_check_dated_at")]
public DateOnly? PaymentCheckDatedAt { get; init; }

Property Value

DateOnly?

PaymentCheckNumber

The check number for donations made by check.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_check_number")]
public int? PaymentCheckNumber { get; init; }

Property Value

int?

PaymentLast4

The last 4 digits of a donation's payment method number. For cards, this is the last 4 digits of the card number. For bank accounts, this is the last 4 digits of the bank account number. For cash and check donations, this should be null. Note: In cases where we don't have all 4 digits on file, a * will be used to pad the number. For example: *321

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_last4")]
public string? PaymentLast4 { get; init; }

Property Value

string

PaymentMethod

Required. The payment method used to make a donation.

Possible values: ach, cash, check, or card

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_method")]
public string? PaymentMethod { get; init; }

Property Value

string

PaymentMethodSub

For cards, this will be the card subtype. Will be null for other payment method types.

Possible values: credit, debit, prepaid, or unknown

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_method_sub")]
public string? PaymentMethodSub { get; init; }

Property Value

string

PaymentStatus

For Stripe donations, this is the payment status. For batch donations, pending means that the donation has not yet been committed, whereas succeeded refers to a committed donation.

Possible values: pending, succeeded, or failed

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("payment_status")]
public string? PaymentStatus { get; init; }

Property Value

string

ReceivedAt

The date and time at which a donation was received. For card and ACH donations processed by Stripe, this is the moment when the donation was created in Giving. For batch donations, this is a customizable value that can be set via the Giving UI or API to any date. This allows for batch donations recieved on a previous day to be dated in the past, as well as for postdated checks to have a date in the future. It is important to ensure that this attribute is set accurately, as this is the date used to filter donations in the Giving admin UI. When creating new donations via the API, this attribute will default to the current date and time. Example: 2000-01-01T12:00:00Z

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("received_at")]
public DateTime? ReceivedAt { get; init; }

Property Value

DateTime?

Refundable

A boolean indicating whether this donation can be refunded via the API. Note that for some donations, this may be false, even though the donation can be refunded in the UI.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("refundable")]
public bool? Refundable { get; init; }

Property Value

bool?

Refunded

Returns true if a donation has been refunded, or false if it hasn't.

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("refunded")]
public bool? Refunded { get; init; }

Property Value

bool?

UpdatedAt

The date and time at which a donation was last updated. Example: 2000-01-01T12:00:00Z

[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonPropertyName("updated_at")]
public DateTime? UpdatedAt { get; init; }

Property Value

DateTime?

Methods

Equals(Donation?)

public virtual bool Equals(Donation? other)

Parameters

other Donation

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

Operators

operator ==(Donation?, Donation?)

public static bool operator ==(Donation? left, Donation? right)

Parameters

left Donation
right Donation

Returns

bool

operator !=(Donation?, Donation?)

public static bool operator !=(Donation? left, Donation? right)

Parameters

left Donation
right Donation

Returns

bool