dhl-ecommerce 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dhl/ecommerce/label.rb +8 -4
- data/lib/dhl/ecommerce/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c80ada9d43813b68d5933fcdae0a32cf8701238
|
4
|
+
data.tar.gz: e0b3836a3f237e216382cfbad3abe3a12146251f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fe6a0fa778d63f15cd814d3963490195b6c2e9c2cfba6fb4166e373193a1d3daa184e637fa9f1d6e4912fe0b503f48c7a86e5cdb237f13c298a7b5b583c19d8
|
7
|
+
data.tar.gz: c6393588707563f98c135a4c1a59bdf683cd330ef2e17bbaf9a5603b699b764e25cd5ff9d5b194b7cfccbdfc4a3fbe69e10762360c6516c82e3b6ad28e5f599c
|
data/lib/dhl/ecommerce/label.rb
CHANGED
@@ -2,7 +2,7 @@ module DHL
|
|
2
2
|
module Ecommerce
|
3
3
|
class Label < Base
|
4
4
|
attr_accessor :customer_confirmation_number, :service_endorsement, :reference, :batch, :mail_type, :facility, :expected_ship_date, :weight, :consignee_address, :return_address, :service
|
5
|
-
attr_reader :id, :location_id, :product_id, :events, :service_type, :
|
5
|
+
attr_reader :id, :location_id, :product_id, :events, :service_type, :impb
|
6
6
|
|
7
7
|
FACILITIES = {
|
8
8
|
auburn: "USSEA1",
|
@@ -75,6 +75,10 @@ module DHL
|
|
75
75
|
@product_id = product.id
|
76
76
|
end
|
77
77
|
|
78
|
+
def file
|
79
|
+
@base64_decoded_file ||= StringIO.new(Base64.decode64(@file))
|
80
|
+
end
|
81
|
+
|
78
82
|
def self.create(attributes)
|
79
83
|
array = attributes.is_a? Array
|
80
84
|
attributes = [attributes] unless array
|
@@ -142,7 +146,7 @@ module DHL
|
|
142
146
|
|
143
147
|
xml.PackageRef do
|
144
148
|
xml.PrintFlag customer_confirmation_number.present?
|
145
|
-
|
149
|
+
xml.LabelText customer_confirmation_number
|
146
150
|
end
|
147
151
|
|
148
152
|
xml.ConsigneeAddress do
|
@@ -232,9 +236,9 @@ module DHL
|
|
232
236
|
|
233
237
|
case DHL::Ecommerce.label_format
|
234
238
|
when :png, :image
|
235
|
-
label.instance_variable_set :@file,
|
239
|
+
label.instance_variable_set :@file, label_response[:label_image] if label_response[:label_image]
|
236
240
|
when :zpl
|
237
|
-
label.instance_variable_set :@file,
|
241
|
+
label.instance_variable_set :@file, label_response[:label_zpl] if label_response[:label_zpl]
|
238
242
|
end
|
239
243
|
|
240
244
|
if label_response[:label_detail]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dhl-ecommerce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Francois Deschenes
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|