-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: add new routes for donations and donors #7699
base: epic/campaigns
Are you sure you want to change the base?
Feature: add new routes for donations and donors #7699
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool seeing headers and links for pagination! This is often overlooked, but good that we are starting to leverage this feature.
I added some feedback on the queries. In particular, we have the CampaignDonationQuery
which we should consider using - or at least update what is here to account for subscriptions and test payments.
Out of curiosity, is the |
@JasonTheAdams Yes, it's a pre-existing thing. |
I'm seriously considering recommending a |
Related to GIVE-1392 and GIVE-1393
Description
This PR implements 4 new REST API endpoints to retrieve
Donations
andDonors
. In the endpoints that return multiple entries, is possible to filter the returned data using custom parameters in the request and also is possible use pagination and sort the results using thepage
,per_page
,sort
anddirection
parameters.Another thing to consider is that sensitive data will be returned only if the user making the request is the site administrator.
Sensitive data for donations:
Sensitive data for donors:
The new endpoints to retrieve a single entry:
The new endpoints to retrieve multiple entries:
Important: These endpoints that return multiple entries allow filtering the returned data through the
campaignId
parameter. It's also possible to use thehideAnonymousDonations
orhideAnonymousDonors
parameter to exclude from the results the donations/donors that made anonymous donations. Beyond that, on the/give-api/v2/donors
endpoint, it is possible to use theonlyWithDonations
parameter to retrieve all donors or just the ones that have valid donations completed.Sample request including anonymous donations in the results:
Sample request including anonymous donors in the results:
Sample request to retrieve the 5 most recent donations:
Sample request to retrieve the top 5 donors:
Affects
GiveWP Rest API endpoints available for public use.
Testing Instructions
In your terminal, run the following commands:
Pre-review Checklist
@unreleased
tags included in DocBlocks