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 rate call for Shipments #83

Merged
merged 1 commit into from
Sep 6, 2019

Conversation

mtking2
Copy link
Contributor

@mtking2 mtking2 commented Apr 4, 2018

Calling Shippo::Shipment.rates('<shipment_object_id>') would result in the following error:

Shippo::Exceptions::ConnectionError: Shippo::Exceptions::ConnectionError (Could not connect to the Shippo API, via URL
https://api.goshippo.com/shipments/rates/<shipment_object_id>/.
Please check your Internet connection, try again, if the problem
persists please contact Shippo Customer Support.
Error Description:
RestClient::NotFound ⇨ 404 Not Found)

This would just normally mean there are no rates for that shipment.

However,

https://api.goshippo.com/shipments/rates/<shipment_object_id>/

is not the correct endpoint.

This PR adds a param for the shipment object ID and interpolates it into the url, resulting in the endpoint with correct params: https://api.goshippo.com/shipments/<shipment_object_id>/rates

With these changes it can be called without error like so:

Shippo::Shipment.rates('<shipment_object_id>') or
Shippo::Shipment.rates('<shipment_object_id>', '<currency_code>')

@mykewould mykewould merged commit 28bf224 into goshippo:master Sep 6, 2019
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

Successfully merging this pull request may close these issues.

2 participants