dhl_ecommerce_api 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 894fe3942cd1b2e5e908d8e0a4a644e47ad32339d35947b9e320663fab0e8332
|
4
|
+
data.tar.gz: 48c07a18b59aad9a537b1b7e54395e8dda48c70cf547eec800a28577db0e5774
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edeaad255cdebe539487991812a8a3017f94a1f5300e2a2a939016387b6e360fc17e5c3f47baa1e7f9edc9dbe453d0a7b0f58d2fe766bae5fe3372cf521e900a
|
7
|
+
data.tar.gz: 44f21615352723faff79ec7cfe2adfdd31fc6f11fc7e12f9381f1f88cfcfdaa229ff3d477f15e0d044eafcaab18838d727bbc2e484a06a4a5b0d4dd3e510c6a4
|
@@ -42,13 +42,12 @@ module DHLEcommerceAPI
|
|
42
42
|
# Since request_data isnt the same as object attributes.
|
43
43
|
# We have to write our own method to format the request data
|
44
44
|
def formatted_request_data(request_data)
|
45
|
-
request_data.as_json
|
46
|
-
.deep_transform_keys {|key| custom_key_format(key)}.to_json
|
45
|
+
request_data.as_json.deep_transform_keys {|key| custom_key_format(key)}
|
47
46
|
end
|
48
47
|
|
49
48
|
# custom keys that arent following lowerCamel convention
|
50
49
|
def custom_key_format(key)
|
51
|
-
case key
|
50
|
+
case key.to_s
|
52
51
|
when "shipment_id"
|
53
52
|
"shipmentID"
|
54
53
|
when "total_weight_uom"
|
@@ -10,8 +10,8 @@ module DHLEcommerceAPI
|
|
10
10
|
|
11
11
|
def create
|
12
12
|
run_callbacks :create do
|
13
|
-
data = formatted_request_data(manifest_request)
|
14
|
-
connection.post(collection_path, data, self.class.headers).tap do |response|
|
13
|
+
data = formatted_request_data(manifest_request).deep_transform_keys{|key| custom_key_format(key)}
|
14
|
+
connection.post(collection_path, data.to_json, self.class.headers).tap do |response|
|
15
15
|
load_attributes_from_response(response)
|
16
16
|
end
|
17
17
|
end
|