Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

Add AustraliaPost Carrier #363

Merged
merged 2 commits into from
Jun 2, 2016
Merged

Conversation

arkes
Copy link
Contributor

@arkes arkes commented May 5, 2016

Support currently:

  • Parcel service for domestic and international
  • Parcel calculate for domestic and international

@arkes arkes force-pushed the australia_post branch from 81c9024 to 866fa13 Compare May 5, 2016 02:23
@arkes arkes force-pushed the australia_post branch from 866fa13 to 77a0d67 Compare May 5, 2016 23:15
@kmcphillips
Copy link
Member

Hey @arkes! Sorry for the delayed response.

This looks super great. Thanks for your contribution.

@jonathankwok when you have a minute, can I get a second set of 👀 ?

rescue ActiveUtils::ResponseError, ActiveShipping::ResponseError => e
data = JSON.parse(e.response.body)

RateResponse.new(false, data['error']['errorMessage'], data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an assumption here that a parsed error body will always have a error: key. This can raise a nil error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jonathankwok
Copy link
Contributor

This is very clean, well-done, and thorough! 👏

- Add URI
- fix parse body with error message
endpoint = domestic_destination? ? @endpoints[:domestic] : @endpoints[:international]
params = domestic_destination? ? domestic_params : international_params

URI::HTTPS.build(host: HOST, path: endpoint, query: params.to_query).to_s
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Way better.

@kmcphillips
Copy link
Member

Nice. Happy with it @arkes? Good to merge?

@arkes
Copy link
Contributor Author

arkes commented Jun 1, 2016

Hey @kmcphillips, yes all good thanks!

@kmcphillips kmcphillips merged commit ca7c77b into Shopify:master Jun 2, 2016
@kmcphillips
Copy link
Member

Released in 1.7.3

maartenvg pushed a commit that referenced this pull request Nov 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants