Ok, I dug a little deeper and found some interesting findings. Btw, I
appreciate you taking up this library, I'm sure it will end up being
the defacto rails shipping gem once the kinks get worked out.
1. If a service type is specified, the code breaks.
2. If a service type is specified with reworked code, some address
validation errors are thrown(which is I why I was initially confused
as to why it wasn't happening). This doesn't happen if specific
service type is not provided.
3. Because of FedEx's limitations(#2), I'm going to locally tack on
address validation to shippinglogic. If I find that Address Validation
is either too much or otherwise not usable, I might make two calls to
FedEx, the first "fake" request to generate errors, and assuming there
are none, the second request being the standard request(ewww!)
1. Service Type Breaks code.
Unfortunately, the current code breaks if you specify a service type
(:service_type=>"FEDEX_GROUND"). The parse code assumes
rate_reply_details to be an array. If a service type is specified, it
actually returns a hash. Quick and dirty fix is below, where
get_rate_info calls your current parsing code.
if (response[:rate_reply_details].is_a?(Array))
response[:rate_reply_details].collect do |details|
get_rate_info(details)
end
else
return [].push(get_rate_info(response[:rate_reply_details]))
end
end
2. Specifying a service type gets FedEx to return simple address
validation errors, Example:
{:highest_severity=>"ERROR", :notifications=>
{:code=>"836", :source=>"crs", :message=>"Destination Postal-State
Mismatch.", :localized_message=>"Destination Postal-State
Mismatch.", :severity=>"ERROR"}, :"xmlns:xsi"=>"
http://www.w3.org/2001/
XMLSchema-instance", :version=>
{:minor=>"0", :service_id=>"crs", :intermediate=>"0", :major=>"6"}, :"xmlns:v6"=>"http://
fedex.com/ws/rate/v6"}
3. If you have any interest in adding address validation to shipping
logic, I can get shoot you over some code, if anything it will
probably help you save some keystrokes.