Skip to content

Commit 96eef94

Browse files
committed
DHL apparently only supports creating 1 label at a time.
1 parent c9dccf0 commit 96eef94

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

lib/dhl/ecommerce/label.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ def self.create_in_batches(attributes)
202202
url = "https://api.dhlglobalmail.com/v1/#{self.resource_name.downcase}/US/#{location_id}/zpl"
203203
end
204204

205-
location_attributes.each_slice(500).collect do |slice|
205+
# DHL e-Commerce's documentation says they support creating 500 labels
206+
# at once but as it turns out, they don't.
207+
location_attributes.each_slice(1).collect do |slice|
206208
labels = slice.map do |slice_attributes|
207209
new slice_attributes
208210
end

lib/dhl/ecommerce/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module DHL
22
module Ecommerce
3-
VERSION = "1.0"
3+
VERSION = "1.0.1"
44
end
55
end

0 commit comments

Comments
 (0)