Skip to content

Commit

Permalink
return nil if no order is found
Browse files Browse the repository at this point in the history
  • Loading branch information
jzw committed Sep 19, 2012
1 parent b7e62b0 commit 19549cc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/powa_api/order_service.rb
Expand Up @@ -29,6 +29,7 @@ def self.get_order_details(order_number)

client = Savon.client wsdl

begin
response = client.request :get_order_details do
soap.xml do |xml|
xml.soapenv(:Envelope, namespaces) do |xml|
Expand All @@ -43,6 +44,10 @@ def self.get_order_details(order_number)
end
end
end
rescue Savon::SOAP::Fault => e
return nil if e.message.include?("Order not found")
raise e.message
end

response.to_array(:get_order_details_response).first

Expand Down

0 comments on commit 19549cc

Please sign in to comment.