Skip to content
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

fix(give-api): Make Earnings and Donations Types Respect Daterange as intended #3191

Closed
mathetos opened this issue May 7, 2018 · 1 comment
Assignees

Comments

@mathetos
Copy link
Member

mathetos commented May 7, 2018

User Story

As a Give Admin, I want to pull data from Give over the API within a specific range. Currently, according to the online documentation, I should be able to do that with the stats endpoint, and either the donations or earnings types.

But that doesn't seem to be the case currently.

Current Behavior

I currently am trying to get that information with the following URL:

https://givewp.com/give-api/v1/stats/?key=<my_key>&token=<my_token>&form=173418&date=range&startdate=20180504&enddate=20180506&type=earnings

But this is the result:

{
    "earnings": [
        {
            "multiple-payment-gateways": "3410"
        }
    ],
    "request_speed": 0.017750024795532
}

Here's the form in the Admin:
image

You can see that the API response is just giving me the TOTAL earnings, not the earning respective of the daterange I entered.

Expected Behavior

I expect to be able to query a specific form, and for a specific date-range, get the following information:

  • The income raised during that date range
  • The number of donations received in that date range
  • Potentially a list of donors who gave to that form in that date range.

It's possible all those things are already possible with the API, and our Documentation is just wrong -- but I don't believe so because I inspected the code pretty closely too.

Steps to Reproduce

  1. #GiveTeam members can use their Givewp.com account to query that URL above with their own unique key and token.
  2. Try different query parameters according to the code.

Related

Internal links for #GiveTeam members only

@ravinderk
Copy link
Collaborator

Reopening this issue because in Donations Types date range not working as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants