Giter Club home page Giter Club logo

taxjar-go's People

Contributors

fastdivision avatar hownowstephen avatar scottrudiger avatar sethobey avatar sethobey-stripe avatar smolentzov-stripe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

taxjar-go's Issues

Can't update order dollar amounts to 0

This type

type UpdateOrderParams struct {
    TransactionID   string          `json:"transaction_id,omitempty"`
    TransactionDate string          `json:"transaction_date,omitempty"`
    FromCountry     string          `json:"from_country,omitempty"`
    FromZip         string          `json:"from_zip,omitempty"`
    FromState       string          `json:"from_state,omitempty"`
    FromCity        string          `json:"from_city,omitempty"`
    FromStreet      string          `json:"from_street,omitempty"`
    ToCountry       string          `json:"to_country,omitempty"`
    ToZip           string          `json:"to_zip,omitempty"`
    ToState         string          `json:"to_state,omitempty"`
    ToCity          string          `json:"to_city,omitempty"`
    ToStreet        string          `json:"to_street,omitempty"`
    Amount          float64         `json:"amount,omitempty"`
    Shipping        float64         `json:"shipping,omitempty"`
    SalesTax        float64         `json:"sales_tax,omitempty"`
    CustomerID      string          `json:"customer_id,omitempty"`
    ExemptionType   string          `json:"exemption_type,omitempty"`
    LineItems       []OrderLineItem `json:"line_items,omitempty"`
}

Has amount, shipping, and salesTax as omitemptyed, but this means that you can't actually update the values to zero.

Use case, is super common; Customer gives us tax exempt information after the order processed, we update a transaction as exempt, and set the sales tax to zero, but the sales tax update never goes through because it's being dropped from the marshalled json. So we have a few transactions that look like we charged tax on orders we shouldn't have, but we really didn't.

My suggestion here would be to make at least those three fields pointers, so we can optionally send a zero if needed, or nothing and still work with the optionalness of the API. PR: #14


Also, weird other issue that's not completely related, but if I try to create a refund transaction to remove the sales tax instead, I get this error

taxjar: 400 Bad Request - exemption_type must be 'non_exempt' or 'marketplace' if any present sales_tax parameter values are non-zero

This is my request.

{
  "amount": 0,
  "exemption_type": "government",
  "from_city": "My City",
  "from_country": "US",
  "from_state": "FL",
  "from_street": "My Street",
  "from_zip": "32707",
  "line_items": [
    {
      "description": "Cool Product",
      "id": "1",
      "quantity": 150,
      "unit_price": 5.75
    },
    {
      "description": "Sales Tax Exempt",
      "id": "10",
      "quantity": 1
    },
    {
      "description": "Shipping",
      "id": "11",
      "quantity": 1
    }
  ],
  "sales_tax": -95.2,
  "shipping": 0,
  "to_city": "Some City",
  "to_country": "US",
  "to_state": "GA",
  "to_street": "12354 Their Street"
  "to_zip": "32707",
  "transaction_date": "2022/01/04",
  "transaction_id": "adbc1234"
}

Seems like it's telling me that I can't have an exemption on the order if the tax amount is "non zero", which is technically true with this request because I'm trying to give it a negative number for the tax (which is non zero), but then I have no way of removing the tax for this transaction? Do I have to remove the exemption, then remove the sales tax, then put the exemption back?

v2.0.0 isn't fully published

Issue: Although v2.0.0 was released on github, it is not released to go.pkg.dev. Reference the below screenshot. go get github.com/taxjar/taxjar-go@latest results in v1.1.1 being added to go.mod.

https://pkg.go.dev/github.com/taxjar/taxjar-go

2024-01-03_13-02-46

Workaround: I can pin the v2.0.0 commit in my go.mod file. But this is not ideal.

github.com/taxjar/taxjar-go v1.1.2-0.20231030152100-dda5556387a5 // pinned to v2.0.0 commit

Proposed solution: Publish the v2.0.0 release to go.pkg.dev.

Optional Parameters Are Not Optional

Calling CreateOrder() with CreateOrderParams{}:

// CreateOrderParams should be passed to `CreateOrder` to create an order․
type CreateOrderParams struct {
	...
	Amount          float64         `json:"amount"`
	Shipping        float64         `json:"shipping"`
	SalesTax        float64         `json:"sales_tax"`
	...
}

Amount is an optional field in the API, however this will always be the zero value of the struct member when posting to the endpoint (so, 0)

This could possibly be solved by making this a pointer to float64 and checking for nil, as I am now required to work out this before calling CreateOrder() or I will get an error.

Can not validate addresses

Hello TaxJar folks. I am running into an issue where I am attempting to validate an address via the Go SDK. I am using the *taxjar.Config.ValidateAddress(taxjar.ValidateAddressParams{...}) method, and I am getting the following error:

0 Not Found - No such route 'POST /v2/addresses/validate'

A few pertinent details:

  • this is on the sandbox API.
  • using v1.1.0 of the Go client.
  • the input to the call is a completely valid address, using alpha-2 codes for country and state (it is a US address).
  • the associated TaxJar plan is a Professional level plan.

OrderLineItem is json.Number but the API specifies string

Updating to the latest version of taxjar go broke our existing integration with this commit: 04f3fd0

The line item IDs are strings per the TaxJar Documentation:

Screenshot 2022-09-07 at 10 21 56

We currently use UUIDs for our line items and so switching to json.Number would not be an insignificant refactor with our integration, as well as not being per the API documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.