Contribution

A sponsorship (GitHub) or order (Open Collective) to one of the configured targets.

On this page

A sponsorship (GitHub) or order (Open Collective) to one of the configured targets.

namespace Sponsorkit;

public sealed class Contribution

Constructors#

MemberDescription
Contribution()Creates an instance with every property at its default; set the properties with an object initializer.

Contribution()#

public Contribution()

Creates an instance with every property at its default; set the properties with an object initializer.

Properties#

MemberDescription
IdStable id derived from the provider and the provider's external id.
ProviderThe provider (see Providers).
TargetThe target string, for example github:octocat.
SponsorWho pays.
Viadirect or organization.
Kindrecurring or one_time (see ContributionKinds).
FrequencySee Frequencies.
StatusSee ContributionStatuses.
AmountThe amount per charge, in minor units.
TierThe provider tier, when known.
FlagsFlags such as via_patreon.
IsPrivateWhether the provider marks the contribution private or incognito.
StartedAtWhen the contribution started.
EndedAtWhen the contribution ended, if it has.
LastChargedAtOpen Collective only: the last charge.
NextChargeAtOpen Collective only: the next charge.
TotalContributedOpen Collective only: the total contributed so far.
IsActivetrue when Status is active.

Id#

public string Id { get; set; } = "";

Stable id derived from the provider and the provider's external id.

Type: string · Default: "" · JSON: id

Provider#

public string Provider { get; set; } = "";

The provider (see Providers).

Type: string · Default: "" · JSON: provider

Target#

public string Target { get; set; } = "";

The target string, for example github:octocat.

Type: string · Default: "" · JSON: target

public SponsorEntity Sponsor { get; set; } = new();

Who pays.

Type: SponsorEntity · Default: new() · JSON: sponsor

Via#

public string Via { get; set; } = "";

direct or organization.

Type: string · Default: "" · JSON: via

Kind#

public string Kind { get; set; } = "";

recurring or one_time (see ContributionKinds).

Type: string · Default: "" · JSON: kind

Frequency#

public string Frequency { get; set; } = "";

See Frequencies.

Type: string · Default: "" · JSON: frequency

Status#

public string Status { get; set; } = "";

See ContributionStatuses.

Type: string · Default: "" · JSON: status

Amount#

public Money Amount { get; set; } = new();

The amount per charge, in minor units.

Type: Money · Default: new() · JSON: amount

Tier#

public Tier? Tier { get; set; }

The provider tier, when known.

Type: Tier? · JSON: tier

Flags#

public IReadOnlyList<string> Flags { get; set; } = Array.Empty<string>();

Flags such as via_patreon.

Type: IReadOnlyList<string> · Default: Array.Empty<string>() · JSON: flags

IsPrivate#

public bool IsPrivate { get; set; }

Whether the provider marks the contribution private or incognito.

Type: bool · JSON: private

StartedAt#

public DateTimeOffset? StartedAt { get; set; }

When the contribution started.

Type: DateTimeOffset? · JSON: startedAt

EndedAt#

public DateTimeOffset? EndedAt { get; set; }

When the contribution ended, if it has.

Type: DateTimeOffset? · JSON: endedAt

LastChargedAt#

public DateTimeOffset? LastChargedAt { get; set; }

Open Collective only: the last charge.

Type: DateTimeOffset? · JSON: lastChargedAt

NextChargeAt#

public DateTimeOffset? NextChargeAt { get; set; }

Open Collective only: the next charge.

Type: DateTimeOffset? · JSON: nextChargeAt

TotalContributed#

public Money? TotalContributed { get; set; }

Open Collective only: the total contributed so far.

Type: Money? · JSON: totalContributed

IsActive#

public bool IsActive { get; }

true when Status is active.

Type: bool · Not serialized