-
Notifications
You must be signed in to change notification settings - Fork 26
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
find_by_package_id not recognizing FedEx #6
Comments
I'm having this issue as well. My working theory that it's because I don't have FedEx credentials in my config like I do for UPS and USPS. Can anyone else confirm this? Hopefully I'm wrong and this is just some bug in the gem. I'd like to be able to see whether a number is a FedEx number without a dev account with them. |
Yes, you need to have the FedEx credentials. |
I have valid credentials and I see the same behavior.
but |
'605578645398' =~ /^[0-9]{15}$/ # => nil The reason is obviously because the regex specifies the tracking number has to be 15 digits long. We can solve that issue by adding some additional regex matchers to the FedEx service. What are the errors that you're getting? |
It looks like the xml schema may have changed since it was last tested.
|
Yeah, I just checked on the FedEx development resources website. They're in v9, and this gem uses v8. I'll update the WSDL and run the tests to see what's changed. |
I pulled in the latest WSDL from FedEx, and updated the XML fixtures and was able to reproduce the error you're getting. I may not have time to work on this for a while. If you'd like, I can push what I've done so far into a bug-fix branch so you can take a look and see if you can fix it yourself. It's just a matter of updating the FedEx parser to get it to work with v9 of the API. |
Here's what I did back then to get it matching for FedEx: My error was related to it only matching 15 characters. The fix matches 12 and 15 characters. |
Thanks, @superjustin. I'll add that expression to the service. @annaswims, I'm going to commit the matchers so I can close this issue, and create a new one (issue #11) for updating to the latest FedEx API version. |
Trackerific::Services.find_by_package_id("123456789012")
=> []
USPS and UPS appear to be working fine:
irb(main):006:0> Trackerific::Services.find_by_package_id("1Z12345E0291980793")
=> [Trackerific::Services::UPS]
irb(main):007:0> Trackerific::Services.find_by_package_id("EJ958083578US")
=> [Trackerific::Services::USPS]
The text was updated successfully, but these errors were encountered: