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

Comments

Projects
None yet
3 participants
@mathetos
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

@mathetos mathetos added the 1-reported label May 7, 2018

DevinWalker added a commit that referenced this issue May 11, 2018

Merge pull request #3208 from ravinderk/issue/3191
fix(give-api): Make Earnings and Donations Types Respect Daterange as intended #3191
@ravinderk

This comment has been minimized.

Collaborator

ravinderk commented May 29, 2018

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

@ravinderk ravinderk reopened this May 29, 2018

ravinderk added a commit that referenced this issue May 29, 2018

Merge pull request #3273 from /issues/3191
fix(give-api): Make Donations Types Respect Daterange as intended #3191
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment