Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add USPS tracking capabilities #44

wants to merge 18 commits into


None yet
6 participants

Accessed in same manner as UPS and FedEx tracking:

usps = USPS.new(:login => 'USPSlogin')
tracking_info = usps.find_tracking_info('9102901000462189604217')  

tracking_info.shipment_events.each do |event|
  puts "#{event.name} at #{event.location.city}, #{event.location.state} on #{event.time}. #{event.message}"

mperham commented May 22, 2012

Yes please!


jbrowning commented Jun 15, 2012

Yes please from me as well!

Sorry to bug you @csaunders - do you feel this is ready to pull in, or is there more you would like to see in it?


csaunders commented Jun 18, 2012

I need to go over the code a bit more thoroughly and ensure that it doesn't break any expectations. I'll try to go through it in more details soon.

If you could verify that it at least works on ruby 1.8.7 and 1.9.3 that's a start.

There we go. I hadn't tested with 1.8.7 (apologies). Found a unit test failure due to difference in default date-as-a-string formatting.

Now all unit tests and the USPS remote tests pass with 1.8.7p358 and 1.9.3p194.


csaunders commented Jul 5, 2012


Thanks :)

@csaunders csaunders closed this Jul 5, 2012

@csaunders csaunders reopened this Jul 5, 2012


csaunders commented Jul 5, 2012

Disregard that, something came up. I'll have to look through it.


csaunders commented Jul 5, 2012

Could you try rebasing off of the current master? It seems like somethings changed that's causing all of your tests to fail. Then there's a time cop issue with @odorcicd is looking into.

NoMethodError: undefined method `parameterize' for nil:NilClass
    /Users/csaunders/development/ruby/active_shipping/lib/active_shipping/shipping/tracking_response.rb:16:in `initialize'
    /Users/csaunders/development/ruby/active_shipping/lib/active_shipping/shipping/carriers/usps.rb:480:in `new'
    /Users/csaunders/development/ruby/active_shipping/lib/active_shipping/shipping/carriers/usps.rb:480:in `parse_tracking_response'
    /Users/csaunders/development/ruby/active_shipping/lib/active_shipping/shipping/carriers/usps.rb:122:in `find_tracking_info'
    /Users/csaunders/development/ruby/active_shipping/test/unit/carriers/usps_test.rb:34:in `test_find_tracking_info_should_parse_response_into_correct_number_of_shipment_events'
    /Users/csaunders/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/mocha-0.10.5/lib/mocha/integration/mini_test/version_230_to_262.rb:28:in `run'

Will do.

All unit tests and all USPS remote tests passing now.

(do all remote tests currently pass for you @csaunders ? I have failures on all NZPost, some Shipwire)


csaunders commented Jul 6, 2012

Yeah, I got those off of master too. There's a good chance it has something to do with our test data.

ayb commented Nov 21, 2012

Has this integration been completed yet? I'm trying to test it in console now but looks like USPS does not respond to the method "find_tracking_info"..

No I don't believe it has. You can see my fork of active_shipping here: https://github.com/Capncavedan/active_shipping - it has the USPS tracking features.


csaunders commented May 6, 2013

I'm trying to rebase this into master, but it's actually not rebasing cleanly.

It looks like all the merges make this a pain to nicely merge into master. I think this can easily be managed by cherry picking all the commits, though I'm not entirely sure.

If you'd mind cherry picking and then turning that into a single commit, it would be awesome.


@csaunders Sorry, been swamped with some other things. I will get to this in the next week or so.

+1 for this.


csaunders commented Jul 11, 2013

@Capncavedan don't worry about it. Just took care of it. I'll be merging in a rebased and slightly cleaned up version soon.

@csaunders csaunders closed this Jul 11, 2013


csaunders commented Jul 11, 2013

Code was merged via a2b378a

Thanks, @csaunders - sorry I didn't get to it.


csaunders commented Jul 12, 2013

No probs. Useless +1'ing gets on my nerves a bit :P

On 12 July 2013 09:03, Dan Buettner notifications@github.com wrote:

Thanks, @csaunders https://github.com/csaunders - sorry I didn't get to

Reply to this email directly or view it on GitHubhttps://github.com/Shopify/active_shipping/pull/44#issuecomment-20874991

Chris // API & Integrations Developer @ Shopify

@kknd113 kknd113 pushed a commit to dotandbo/active_shipping that referenced this pull request May 12, 2015

@jumph4x jumph4x Merge pull request #44 from hooktstudios/cache-fixes-3
Cache fixes 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment