-
Notifications
You must be signed in to change notification settings - Fork 72
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
V3 updates #50
V3 updates #50
Conversation
# "messages" => [], | ||
# "carrier_account" => "4b1940bc69524163b669asd361842db", | ||
# "test" => true | ||
# { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you add anything or modify anything or just adjust the syntax? If it is the former, could you please point out which one you added or modified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all that changed is 1. styling so it's more readable imo, and 2. fields for v3 were changed according to the confluence page
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields that were changed:
- servicelevel_[attr] go into a servicelevel dict
- delete trackable
- delete insurance fields (this info is in the shipment)
- remove delivery_attempts, outbound_endpoint and inbound_endpoint
|
||
```ruby | ||
ap @shipment.rates_list.first | ||
ap @shipment.rates.first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we change the key from rates_list to rates in the response?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea
# "rates_url" => "https://api.goshippo.com/v1/shipments/a336daf87a8e442992a68daa6622758f/rates/", | ||
# "messages" => [ ] # ommitted for brevity, | ||
# "rates_list" => [ ] # ommitted for brevity. | ||
# "carrier_accounts" => [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as my another comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah just the spacing seemed strange to me, and here's what changed apart from that:
- address fields are expanded instead of being ids
- submission_date --> shipment_date
- return_of --> is_return
- insurance and references inside extra
- delete rates_url
- rates_list --> rates
README.md
Outdated
address_from: { | ||
object_purpose: 'PURCHASE', | ||
is_complete: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to make sure. No more object_purpose
in the payload, huh?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right but also refresh to the last commit -- no is_complete, either.
README.md
Outdated
# :created => 2016-07-06 20:44:47 UTC, | ||
# :updated => 2016-07-06 20:44:47 UTC, | ||
# :owner => "valued_customer@gmail.com", | ||
# :state => #<Shippo::API::Category::State:0x007fd88be8aa38 @name=:state, @value=:valid>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object_state and object_purpose should be removed from shipment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -94,66 +90,62 @@ params = { object_purpose: 'PURCHASE', | |||
Let's take a quick look at what the `Shipment` object looks like: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should remove @shipment.state from here, 5 lines up ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@@ -78,7 +74,7 @@ def mk_opts(property) | |||
|
|||
# list of allowed properties, of a given type. | |||
PROPS_ID = %i(id).freeze | |||
PROPS_CATEG = %i(state purpose source status results).freeze | |||
PROPS_CATEG = %i(state status results).freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per Guozhen's notes: object_purpose and object_source are removed everywhere, object_state is removed from address, shipment and rates
README.md
Outdated
# "content" => "", | ||
# "provider" => "FEDEX" | ||
# }, | ||
# "is_return" => nil, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're looking to have is_return have a default False value (schema migration pending) - so it shouldn't ever end up being null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
… into v3-updates
it 'should include Shippo-API-Version in header if one is specified' do | ||
expect(api_request.headers[:'Shippo-API-Version']).to eql("2016-10-25") | ||
expect(api_request.headers[:'Shippo-API-Version']).to eql("2017-03-29") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the test should always use v3?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one does to test the headers (see line 18 above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got you.
@@ -213,18 +201,15 @@ Finally, here is how we access the rest of the `object_` fields: | |||
# ⤷ valued_customer@gmail.com | |||
``` | |||
|
|||
Here is the fully construted `ApiObject` instance, attached to our `@shipment`: | |||
Here is the fully constructed `ApiObject` instance, attached to our `@shipment`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. lolol
README.md
Outdated
# "messages" => [ ] # ommitted for brevity, | ||
# "rates_list" => [ ] # ommitted for brevity. | ||
# "carrier_accounts" => [], | ||
# "address_from" => [ ... ], # omitted for brevity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure to omit the addresses? Maybe show one of them at least?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in v3 they should be expanded fields and not object ids (which is why I removed them and put ...)
if you think there should be an example instead, I can put it in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think it would be better. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over looks good. Just a couple small comments.
Also, one last thing, you want to update the version of the gem too. |
Also, it might be out of scope your task, but we should update readme for v3 or at least mention the response are for v3? Did I miss that? |
Just one comment on expanding parcel, but I am gonna approve now. Thanks for making the changes. :) |
As according to V3 cleanup page; endpoint modification should not be done in the wrapper.