jwietelmann / jar Goto Github PK
View Code? Open in Web Editor NEWAn API client for TaxJar in Elixir.
An API client for TaxJar in Elixir.
When using the address validation endpoint, I momentarily forgot to have my test POST any params. Instead of receiving any kind of error, I got a 204 No Content, which implies success. (This is something I'd consider a bug on TaxJar's end, but it would demand an API version bump if fixed, IMO.)
Anyway, my code's returning {:ok, _}
in this case. But it's not okay! What actually happened was the API server more or less rejected the request for lack of appropriate params.
(Cursory testing suggests the problem is probably limited to /addresses/validate
.)
I made notes of which sections of the API I originally skipped in the jar.ex
file, with TODO:
comments. Time to actually finish those up.
Passing a client struct to each call is good because it makes the lib more flexible, but ideally there should also be a way to use a global configuration. Rather than refactor to make the client
argument of API functions optional, I think it should suffice for now just to make something like this possible:
Jar.global() # instead of Jar.configure(options)
|> Jar.list_categories()
|> case do
# ...
end
The README is outdated and still refers to how things were before I updated to get rid of the test secrets thing.
The endpoint is not available in the Sandbox API, but nowhere does it say that.
They are:
Jar.list_customers/1
Jar.validate_address/2
Jar.validate_vat_number/2
They should probably get checked against the non-sandbox API at least once before everything in tests gets mocked (#1). Careful not to accidentally run the whole test suite against the live, non-sandbox API in the process.
Related to #8 maybe.
It probably doesn't make sense to go overboard on pre-validating everything possible.
What probably does make sense: If the API endpoint requires params, the Elixir function's signature shouldn't have an optional params
arg.`
There's a Tesla.Mock
adapter that looks promising for this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.