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

Does USPS require a password? #8

Open
zackshapiro opened this issue Nov 7, 2013 · 12 comments · May be fixed by #9
Open

Does USPS require a password? #8

zackshapiro opened this issue Nov 7, 2013 · 12 comments · May be fixed by #9

Comments

@zackshapiro
Copy link

I just signed up for their dev account and they gave me both a user_id and a password.

Looks like in the docs the gem doesn't require a pass but running Trackerific::Services.find_by_package_id(params[:tracking_number]) is returning nil

Any ideas?

** Resolved **
I tried to bump to version 0.7.5 but it looks like it's conflicting with Nokogiri and needs a version less than 1.6.0. Is that correct? Upon further investigation, and trying to use @superjustin's version, this seems to be a main problem as well. Using Rails 4 and Ruby 2, I have to use a version of Nokogiri less than 1.6 to run Trackerific 0.7.5

This last part seemed to be a Mavericks problem. I had to do this: http://jasdeep.ca/2013/10/installing-nokogiri-fails-os-x-mavericks/ to update my command line tools for the new version of OS X, then install Nokogiri 1.5.10, then it let me install Trackerific 0.7.5

@travishaynes
Copy link
Owner

No, according to the USPS docs it does not require a password: https://www.usps.com/business/web-tools-apis/Development-Guide-v3-1d.htm

Are you in production mode, or using a test ID?

@zackshapiro
Copy link
Author

I called USPS and they turned my key into a production key, so should be in
prod mode

On Thu, Nov 7, 2013 at 12:42 PM, Travis Haynes [email protected]:

No, according to the USPS docs it does not require a password:
https://www.usps.com/business/web-tools-apis/Development-Guide-v3-1d.htm

Are you in production mode, or using a test ID?


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-28004394
.

@travishaynes
Copy link
Owner

Could you please provide an example of the code you're using, and if possible the tracking ID?

@travishaynes
Copy link
Owner

Sorry, I mean a more complete example than the one you already provided.

Also, did you try accessing the USPS service directly? Example:

usps = Trackerific::Services::USPS.new(user_id: "your user id")
results = usps.track("tracking id")

@zackshapiro
Copy link
Author

Validating my ID works that way. I have config.usps set up in my initializers/trackerific.rb file, but that doesn't seem to be communicating back to the gem?

Then I run package = usps.track("9405510200828946707045") and it gives
me:

ArgumentError: invalid date
 from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/trackerific-0.7.1/lib/trackerific/services/usps.rb:110:in
`parse'
from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/trackerific-0.7.1/lib/trackerific/services/usps.rb:110:in
`date_of_event'
 from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/trackerific-0.7.1/lib/trackerific/services/usps.rb:53:in
`block in track'
from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/trackerific-0.7.1/lib/trackerific/services/usps.rb:51:in
`each'
 from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/trackerific-0.7.1/lib/trackerific/services/usps.rb:51:in
`track'
from (irb):3
 from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/railties-4.0.0/lib/rails/commands/console.rb:90:in
`start'
from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/railties-4.0.0/lib/rails/commands/console.rb:9:in
`start'
 from /Users/zackshapiro/.rvm/gems/ruby-2.0.0-p247@luna/gems/railties-4.0.0/lib/rails/commands.rb:64:in
`<top (required)>'
from bin/rails:4:in `require'
 from bin/rails:4:in `<main>'

On Thu, Nov 7, 2013 at 12:56 PM, Travis Haynes [email protected]:

Sorry, I mean a more complete example than the one you already provided.

Also, did you try accessing the USPS service directly? Example:

usps = Trackerific::Services::USPS.new(user_id: "your user id")results = usps.track("tracking id")


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-28005594
.

@zackshapiro
Copy link
Author

Hey @travishaynes, just wanted to follow up on this thread

@travishaynes
Copy link
Owner

I will be able to look into this on Tuesday. I'll be busy with something else until then.

@zackshapiro
Copy link
Author

Thanks so much. I'll build a scraper until then

On Sat, Nov 9, 2013 at 11:27 AM, Travis Haynes [email protected]:

I will be able to look into this on Tuesday. I'll be busy with something
else until then.


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-28134788
.

@zackshapiro
Copy link
Author

An update on this:

I think I've gotten as far as I can. I got Trackerific installed on the most recent version.

The gem is correctly getting that it's a USPS package and accepting my dev credentials in config.

When I run klass = Trackerific::Services.find_by_package_id("9405510200828946707045").first and then klass.track("9405510200828946707045"), I get back the same error as before: ArgumentError Exception: invalid date

Here is a link to the USPS tracking info on the web, if that helps: https://tools.usps.com/go/TrackConfirmAction.action?tRef=fullpage&tLc=1&tLabels=9405510200828946707045

@zackshapiro
Copy link
Author

Hey @travishaynes, want to jam on this together today?

@zackshapiro
Copy link
Author

Any updates on the date stuff with USPS?

@zackshapiro
Copy link
Author

@travishaynes I'm gonna dive in and fix this bug unless you've already done it. Continuing to get it with a package that is en route as well as with a package that has been delivered.

@zackshapiro zackshapiro linked a pull request Nov 23, 2013 that will close this issue
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 a pull request may close this issue.

2 participants