Donation
The donation model represents monetary contributions made to campaigns. Donations can be one-time or recurring, and can be made by authenticated users or guests. Below, we outline the different properties associated with a donation.
Properties
- Name
id- Type
- integer
- Description
Unique identifier for the donation
- Name
institution_id- Type
- integer
- Description
Foreign key to the institution
- Name
campaign_id- Type
- integer
- Description
Foreign key to the campaign
- Name
user_id- Type
- integer | null
- Description
Foreign key to the user. Null for guest donations
- Name
subscription_id- Type
- integer | null
- Description
Foreign key to subscription if this is a recurring donation
- Name
donation_type- Type
- enum
- Description
Donation type:
one_time,recurring
- Name
donor_name- Type
- string | null
- Description
Name for guest donations
- Name
donor_email- Type
- string | null
- Description
Email for guest donations
- Name
is_anonymous- Type
- boolean
- Description
Whether the donation is anonymous
- Name
message- Type
- text | null
- Description
Optional donor message
- Name
amount- Type
- decimal
- Description
Donation amount in PHP
- Name
convenience_fee- Type
- decimal
- Description
Payment gateway processing fee
- Name
system_fee- Type
- decimal
- Description
Platform fee
- Name
total_amount- Type
- decimal
- Description
Total amount charged (amount + fees)
- Name
reference_number- Type
- uuid
- Description
Internal UUID reference
- Name
transaction_id- Type
- string | null
- Description
Payment gateway transaction ID
- Name
payment_gateway- Type
- string
- Description
Payment gateway used:
maya,magpie, etc.
- Name
payment_method- Type
- string | null
- Description
Payment method:
gcash,paymaya,card, etc.
- Name
status- Type
- enum
- Description
Donation status:
pending,completed,failed,cancelled,expired
- Name
paid_at- Type
- timestamp | null
- Description
Payment completion timestamp
- Name
billing_period_start- Type
- date | null
- Description
Start of billing period for recurring donations
- Name
billing_period_end- Type
- date | null
- Description
End of billing period for recurring donations
- Name
created_at- Type
- timestamp
- Description
Record creation timestamp
- Name
updated_at- Type
- timestamp
- Description
Record last update timestamp
Relationships
- Name
institution- Type
- Institution
- Description
The institution receiving the donation. See Institutions
- Name
campaign- Type
- Campaign
- Description
The campaign receiving the donation. See Campaigns
- Name
user- Type
- User | null
- Description
The user who made the donation. See Users
- Name
subscription- Type
- DonationSubscription | null
- Description
The subscription if recurring. See Subscriptions