Skip to content

Commit

Permalink
Remove multiple shipment support (as not provided by DHL api) fixes w…
Browse files Browse the repository at this point in the history
  • Loading branch information
playmakers committed Mar 14, 2015
1 parent 1d01c7d commit 97ba9bd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/dhl-intraship/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ def initialize(config, options = {})
@client.http.auth.basic(config[:api_user], config[:api_pwd])
end

def createShipmentDD(shipments)
def createShipmentDD(shipment)
begin
shipments = [shipments] unless shipments.respond_to?('each')

# For some reason the class instance variables are not accessible inside of the request block
ekp = @ekp
partner_id = @partner_id
Expand All @@ -64,10 +62,8 @@ def createShipmentDD(shipments)
add_version_information(xml)
xml.ShipmentOrder do |xml|
xml.SequenceNumber('1')
shipments.each do |shipment|
shipment.append_to_xml(ekp, partner_id, xml)
xml.LabelResponseType('XML') if returnXML
end
shipment.append_to_xml(ekp, partner_id, xml)
xml.LabelResponseType('XML') if returnXML
end
end
end
Expand Down

0 comments on commit 97ba9bd

Please sign in to comment.