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 returns inconsistent amount formats #4073

Closed
1 task done
DevinWalker opened this issue Apr 2, 2019 · 1 comment
Closed
1 task done

fix: Give API returns inconsistent amount formats #4073

DevinWalker opened this issue Apr 2, 2019 · 1 comment
Assignees

Comments

@DevinWalker
Copy link
Member

DevinWalker commented Apr 2, 2019

Bug Report

The current version if the Give API has inconsistent amount formatting for multiple keys.

2019-04-02_01-38-38

  1. Some amounts have six decimals
  2. Some amounts are strings and others like total are integers
  3. The amounts don't respect other currency formats.
  4. Add-ons like Fee Recovery also have six decimals "_give_fee_donation_amount": "100.000000"

User Story

As a Give admin who wants to use Zapier, I want clear amount formatting within the API so that I can set properly pipe the data in need.

Possible Considerations

  1. Is there a standard for APIs to return amounts?
  2. What does Stripe and WooCommerce return for their amount fields?
  3. Should some of the duplicate

Bug Type

  • This bug describes functionality that never worked as expected.
@ravinderk
Copy link
Collaborator

ravinderk commented Apr 3, 2019

image
http://woocommerce.github.io/woocommerce-rest-api-docs/?php#list-all-orders

image
https://stripe.com/docs/api/plans/object

@DevinWalker As we can see Woocomerce output price item as string and format them as per the number of decimal set in Woocommerce setting while stripe output amount as the float.

As we discussed we can output price as Woocommerce doing

DevinWalker pushed a commit that referenced this issue Apr 4, 2019
fix: Give API returns inconsistent amount formats #4073 and feat: add unit test to check for valid JSON object returned in API #4074
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