Add USPS tracking capabilities #44

Closed
wants to merge 18 commits into
from

Conversation

Projects
None yet
6 participants
@Capncavedan

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}"
end
@mperham

This comment has been minimized.

Show comment Hide comment
@mperham

mperham May 22, 2012

Yes please!

mperham commented May 22, 2012

Yes please!

@jbrowning

This comment has been minimized.

Show comment Hide comment
@jbrowning

jbrowning Jun 15, 2012

Contributor

Yes please from me as well!

Contributor

jbrowning commented Jun 15, 2012

Yes please from me as well!

@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan Jun 18, 2012

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?

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

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jun 18, 2012

Contributor

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.

Contributor

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.

@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan Jun 18, 2012

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.

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

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 5, 2012

Contributor

Merged.

Thanks :)

Contributor

csaunders commented Jul 5, 2012

Merged.

Thanks :)

@csaunders csaunders closed this Jul 5, 2012

@csaunders csaunders reopened this Jul 5, 2012

@csaunders

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 5, 2012

Contributor

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

Contributor

csaunders commented Jul 5, 2012

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

@csaunders

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 5, 2012

Contributor

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.

test_find_tracking_info_should_parse_response_into_correct_number_of_shipment_events(USPSTest):
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'
Contributor

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.

test_find_tracking_info_should_parse_response_into_correct_number_of_shipment_events(USPSTest):
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'
@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan Jul 5, 2012

Will do.

Will do.

@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan Jul 6, 2012

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)

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

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 6, 2012

Contributor

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

Contributor

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

This comment has been minimized.

Show comment Hide comment
@ayb

ayb 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"..

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"..

@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan Nov 21, 2012

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.

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

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders May 6, 2013

Contributor

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.

Thanks

Contributor

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.

Thanks

@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan May 11, 2013

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

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

@MrGossett

This comment has been minimized.

Show comment Hide comment
@MrGossett

MrGossett Jul 2, 2013

+1 for this.

+1 for this.

@csaunders

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 11, 2013

Contributor

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

Contributor

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

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 11, 2013

Contributor

Code was merged via a2b378a

Contributor

csaunders commented Jul 11, 2013

Code was merged via a2b378a

@Capncavedan

This comment has been minimized.

Show comment Hide comment
@Capncavedan

Capncavedan Jul 12, 2013

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

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

@csaunders

This comment has been minimized.

Show comment Hide comment
@csaunders

csaunders Jul 12, 2013

Contributor

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
it.


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

Chris // API & Integrations Developer @ Shopify

Contributor

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
it.


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 pushed a commit to dotandbo/active_shipping that referenced this pull request May 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment