lib/active_shipping/carriers/fedex.rb in active_shipping-1.4.0 vs lib/active_shipping/carriers/fedex.rb in active_shipping-1.4.1
- old
+ new
@@ -169,12 +169,10 @@
raise Error, "Multiple packages are not supported yet." if packages.length > 1
request = build_shipment_request(origin, destination, packages, options)
logger.debug(request) if logger
- logger.debug(confirm_response) if logger
-
response = commit(save_request(request), (options[:test] || false))
parse_ship_response(response)
end
def maximum_address_field_length
@@ -583,10 +581,14 @@
status_detail = tracking_details.at('StatusDetail')
if status_detail.nil?
raise ActiveShipping::Error, "Tracking response does not contain status information"
end
- status_code = status_detail.at('Code').text
+ status_code = status_detail.at('Code').try(:text)
+ if status_code.nil?
+ raise ActiveShipping::Error, "Tracking response does not contain status code"
+ end
+
status_description = (status_detail.at('AncillaryDetails/ReasonDescription') || status_detail.at('Description')).text
status = TRACKING_STATUS_CODES[status_code]
if status_code == 'DL' && tracking_details.at('AvailableImages').try(:text) == 'SIGNATURE_PROOF_OF_DELIVERY'
delivery_signature = tracking_details.at('DeliverySignatureName').text