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: getting unexpected JSON result from API #4071

Closed
1 of 4 tasks
ravinderk opened this issue Mar 29, 2019 · 0 comments
Closed
1 of 4 tasks

fix: getting unexpected JSON result from API #4071

ravinderk opened this issue Mar 29, 2019 · 0 comments
Assignees

Comments

@ravinderk
Copy link
Collaborator

Bug Report

User Story

As an admin, I want to get valid JSON result when doing a valid Give API query.

Current Behavior

I am getting two JSON object as an API result.

Expected Behavior

I am expecting one JSON object.

Bug Type

  • This bug describes functionality that once worked as expected in version X.X.X.
  • This bug describes functionality that never worked as expected.
  • I am not sure whether this functionality ever worked as expected.

Steps to Reproduce

image

You can use the above code to generate issue but replace key and token with valid API keys

Visuals

image

Possible Solution

https://github.com/impress-org/give/blob/b9cb4fc18bb1ff47a607be7200cfc0f52d113dc1/includes/api/class-give-api.php#L1785

give_die is wrapper function for wp_die which ouput JSON error for application/json request. We can use die instead of give_die.

Acceptance Criteria

  • We are getting single JSON object in API result.
@ravinderk ravinderk self-assigned this Mar 29, 2019
ravinderk added a commit that referenced this issue Apr 1, 2019
to prevent expected result output from wp_die

ref #4071
ravinderk added a commit that referenced this issue Apr 1, 2019
to prevent unexpected result output from wp_die

ref #4071
DevinWalker pushed a commit that referenced this issue Apr 2, 2019
fix: getting unexpected JSON result from API #4071
ravinderk added a commit that referenced this issue Apr 5, 2019
for issue #4071 we added to die which cause to stall phpunit tests to prevent that we start is give_die with additional update
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

1 participant