Releases: tomharvey/pwinty3-rb
Allow missing arrivalDate attrs
The earliestEstimatedArrivalDate
and latestEstimatedArrivalDate
attributes have mysteriously vanished from the API v3 docs. And their absence is causing an error
This fixes issue #18
We also bump some dependancies up to stay updated with security releases.
Handle packingSlipUrl updates
As highlighted in #14 and tbuehlmann/dry-struct-setters#2 the use of optional key attributes? :packingSlipUrl
creates an invalid setter packingSlipUrl?=
While waiting for an update to dry-struct-setters, this version allows for the packingSlipUrl attribute to be updated.
Properly handle image exceptions
- Logs errors when attempting to add invalid images
- Adds .env use to manage development env variables
- Updates dependancies to avoid some security vulnerabilities
Properly handle packingSlipURl
There is an omitable key packingSlipUrl
in the order attributes, we can now accept that data.
Fix issue with partial Pwinty::Image.attributes hash
See #3 and #4 for the issue and the fix.
In short, sometimes the Pwinty API returns image data with attributes: nil
, sometimes with attributes: {}
and sometimes with attributes: {key: value}
and we need to be able to handle all of those cases.
We accomplish this with https://dry-rb.org/gems/dry-struct/1.0/recipes/#tolerance-to-missing-keys
Correct list API use
The API docs describe the use of count
and offset
as params to pass to the list endpoint while paging through the order list.
This is a mistake in the API docs. Now, the gem uses the correct limit
and start
params.
The Pwinty::Order.list
can also take a page_size
attribute which will set the size of each page while looping through them. I've defaulted to 50 as this was the fastest way to get 500 orders in the very limited speed testing I performed.
Updating rubygems metadata
v3.0.1 version bump
Targeting Pwinty API V3
Moving to release this under the Pwinty
ruby gem.
Initial functional release
Can perform all API operations on an order allowing you to create and manage an order in the entire lifecycle. You can also get the country list from the API.