dhl_ecommerce_api 0.1.7 → 0.1.8

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: 1611a50fc49c9a322a7949f3080512e79d727d34d99ca75f4d6370f8bbdeef15
4
- data.tar.gz: 7dcf5b35eac8835be58e2baa8a6f93ee8c901c7ca94e3427156442ca8db758f1
3
+ metadata.gz: 2c631b27d8fbe5337fb63e73caf9a577ab9be717d56f72b0d726d004439e954a
4
+ data.tar.gz: 5fd628b9b8339e5f0baeb0e36f2f59f97ee72b110e7dc7a94100b7fac18c3287
5
5
  SHA512:
6
- metadata.gz: 6119191eddd500affe3c2a7a5cc724082fa93e003f34c89649b26169f36380775cea1c270be92994a5709d24d42c3c00919e00f3f13c30c2cdd4f8cca1f8293c
7
- data.tar.gz: da6911749451b9951d1c8b07aa0cd44f05a1a6dd2290fbe9904202c45d408ce502dff9a6756e7712838c2d68dce70344aa7e485cb8a10a83c91057e6f78450a9
6
+ metadata.gz: 22ab3ba491f789331432b8466a74679188537236682fb16c864712539a4f5e046f149ae52974751b76919859f49e6cbfb8c720a3a060b825026b00ef23ad6c3a
7
+ data.tar.gz: df9c0a8d9d63bb8570f30d296ca24e0602f6500c18bfe68dd6a888ee0dc3c04accdf7b3a209411c1bff3a490deca73432804aab98506e73069659129e5e81cf8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dhl_ecommerce_api (0.1.6)
4
+ dhl_ecommerce_api (0.1.7)
5
5
  activeresource (>= 4.1.0, < 6.0.0)
6
6
 
7
7
  GEM
@@ -18,7 +18,6 @@ module DHLEcommerceAPI
18
18
  end
19
19
 
20
20
  def status_slug
21
- binding.pry
22
21
  STATUS_CODES[status.to_sym]
23
22
  end
24
23
  end
@@ -1,5 +1,6 @@
1
1
  module DHLEcommerceAPI
2
2
  # Component item
3
3
  class Shipment::ShipmentItem::ConsigneeAddress < Base
4
+ self.element_name = ""
4
5
  end
5
6
  end
@@ -1,6 +1,8 @@
1
1
  module DHLEcommerceAPI
2
2
  # Component item
3
3
  class Shipment::ShipmentItem < Base
4
+ self.element_name = ""
5
+
4
6
  # add some validations?
5
7
  DEFAULT_ATTRIBUTES = {
6
8
  shipment_id: nil,
@@ -0,0 +1,52 @@
1
+ module DHLEcommerceAPI
2
+ class ShipmentWithDropoff < Shipment
3
+ # This creates a Shipment ONLY.
4
+ # DHL will expect the item to be dropped off at one of their locations.
5
+ # Used in conjunction with the Pickup class.
6
+
7
+ self.element_name = ""
8
+
9
+ DEFAULT_ATTRIBUTES = {
10
+ handover_method: 1,
11
+ shipment_items: []
12
+ }
13
+ end
14
+ end
15
+
16
+ =begin
17
+ shipment_with_dropoff_params = {
18
+ "shipment_items" => [
19
+ {
20
+ "consignee_address" => {
21
+ "company_name" => "Test",
22
+ "name" => "Test1",
23
+ "address1" => "NO 3 JALAN PPU 1",
24
+ "address2" => "TAMAN PERINDUSTRIAN PUCHONG UTAMA",
25
+ "address3" => nil,
26
+ "city" => "PUCHONG",
27
+ "state" => "SELANGOR",
28
+ "district" => nil,
29
+ "country" => "MY",
30
+ "post_code" => "57000",
31
+ "phone" => "0123456798",
32
+ "email" => nil
33
+ },
34
+ "shipment_id" => "MYPTC000103",
35
+ "package_desc" => "Bread Materials",
36
+ "total_weight" => 2000,
37
+ "total_weight_uom" => "G",
38
+ "dimension_uom" => "CM",
39
+ "height" => nil,
40
+ "length" => nil,
41
+ "width" => nil,
42
+ "product_code" => "PDO",
43
+ "cod_value" => nil,
44
+ "insurance_value" => nil,
45
+ "total_value" => 300,
46
+ "currency" => "MYR",
47
+ "remarks" => nil,
48
+ "is_routing_info_required" => "Y"
49
+ }
50
+ ],
51
+ }
52
+ =end
@@ -0,0 +1,93 @@
1
+ module DHLEcommerceAPI
2
+ class ShipmentWithPickup < Shipment
3
+ # This is a coupled shipment + pickup request.
4
+
5
+ self.element_name = ""
6
+
7
+ DEFAULT_ATTRIBUTES = {
8
+ handover_method: 2,
9
+ pickup_date_time: nil,
10
+ pickup_address: {
11
+ company_name: "",
12
+ name: "",
13
+ address1: "",
14
+ address2: nil,
15
+ address3: nil,
16
+ city: "",
17
+ state: "",
18
+ post_code: "",
19
+ country: "MY",
20
+ phone: "",
21
+ email: nil
22
+ },
23
+ shipment_items: []
24
+ }
25
+ end
26
+ end
27
+
28
+ =begin
29
+ params = {
30
+ "handoverMethod": 2,
31
+ "pickupDateTime": DateTime.now.to_s,
32
+ "pickupAddress": {
33
+ "companyName": "Pickup From Company",
34
+ "name": "Pickup From Name",
35
+ "address1": "Holistic Pharmacy PostCo, 55, Jalan Landak",
36
+ "address2": "",
37
+ "address3": "",
38
+ "city": " Kuala Lumpur",
39
+ "state": " Kuala Lumpur",
40
+ "postCode": "55100",
41
+ "country": "MY",
42
+ "phone": "0169822645",
43
+ "email": "erwhey@postco.co"
44
+ },
45
+ "shipmentItems": [
46
+ {
47
+ "shipmentID": "MYPTC0087",
48
+ "packageDesc": "Laptop Sleeve",
49
+ "totalWeight": 500,
50
+ "totalWeightUOM": "G",
51
+ "dimensionUOM": "CM",
52
+ "height": nil,
53
+ "length": nil,
54
+ "width": nil,
55
+ "productCode": "PDO",
56
+ "codValue": nil,
57
+ "insuranceValue": nil,
58
+ "totalValue": 300,
59
+ "currency": "MYR",
60
+ "remarks": nil,
61
+ "isRoutingInfoRequired": "Y",
62
+ "returnMode": 3,
63
+ "returnAddress": {
64
+ "companyName": "Pickup From Company",
65
+ "name": "Pickup From Name",
66
+ "address1": "Holistic Pharmacy PostCo, 55, Jalan Landak",
67
+ "address2": "",
68
+ "address3": "",
69
+ "city": " Kuala Lumpur",
70
+ "state": " Kuala Lumpur",
71
+ "postCode": "55100",
72
+ "country": "MY",
73
+ "phone": "0169822645",
74
+ "email": "erwhey@postco.co"
75
+ },
76
+ "consigneeAddress": {
77
+ "companyName": "Sleeve Company",
78
+ "name": "Sleeve Sdn Bhd",
79
+ "address1": "No. 3, Jalan Bangsar, Kampung Haji Abdullah Hukum",
80
+ "address2": nil,
81
+ "address3": nil,
82
+ "city": "Kuala Lumpur",
83
+ "state": "Kuala Lumpur",
84
+ "district": nil,
85
+ "country": "MY",
86
+ "postCode": "59200",
87
+ "phone": "0169822645",
88
+ "email": nil
89
+ }
90
+ },
91
+ ]
92
+ }.deep_transform_keys!{ |key| key.to_s.underscore }
93
+ =end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DHLEcommerceAPI
4
- VERSION = "0.1.7"
4
+ VERSION = "0.1.8"
5
5
  end
@@ -12,8 +12,9 @@ module DHLEcommerceAPI
12
12
  require "dhl_ecommerce_api/resources/authentication"
13
13
 
14
14
  require "dhl_ecommerce_api/resources/shipment"
15
- require "dhl_ecommerce_api/resources/shipment/pickup"
16
- require "dhl_ecommerce_api/resources/shipment/dropoff"
15
+ require "dhl_ecommerce_api/resources/shipment_with_pickup"
16
+ require "dhl_ecommerce_api/resources/shipment_with_dropoff"
17
+
17
18
  require "dhl_ecommerce_api/resources/shipment/shipment_item"
18
19
  require "dhl_ecommerce_api/resources/shipment/shipment_item/consignee_address"
19
20
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhl_ecommerce_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Er Whey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-14 00:00:00.000000000 Z
11
+ date: 2022-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activeresource
@@ -142,10 +142,10 @@ files:
142
142
  - lib/dhl_ecommerce_api/resources/pickup.rb
143
143
  - lib/dhl_ecommerce_api/resources/pickup/handover_item.rb
144
144
  - lib/dhl_ecommerce_api/resources/shipment.rb
145
- - lib/dhl_ecommerce_api/resources/shipment/dropoff.rb
146
- - lib/dhl_ecommerce_api/resources/shipment/pickup.rb
147
145
  - lib/dhl_ecommerce_api/resources/shipment/shipment_item.rb
148
146
  - lib/dhl_ecommerce_api/resources/shipment/shipment_item/consignee_address.rb
147
+ - lib/dhl_ecommerce_api/resources/shipment_with_dropoff.rb
148
+ - lib/dhl_ecommerce_api/resources/shipment_with_pickup.rb
149
149
  - lib/dhl_ecommerce_api/resources/tracking.rb
150
150
  - lib/dhl_ecommerce_api/version.rb
151
151
  - sig/dhl_ecommerce_api.rbs
@@ -1,50 +0,0 @@
1
- module DHLEcommerceAPI
2
- class Shipment::Dropoff < Shipment
3
- # This creates a Shipment ONLY.
4
- # DHL will expect the item to be dropped off at one of their locations.
5
- # Used in conjunction with the Pickup class.
6
-
7
- self.element_name = ""
8
-
9
- DEFAULT_ATTRIBUTES = {
10
- handover_method: 1,
11
- shipment_items: []
12
- }
13
- end
14
- end
15
-
16
- # shipment_with_dropoff_params = {
17
- # "shipment_items" => [
18
- # {
19
- # "consignee_address" => {
20
- # "company_name" => "Test",
21
- # "name" => "Test1",
22
- # "address1" => "NO 3 JALAN PPU 1",
23
- # "address2" => "TAMAN PERINDUSTRIAN PUCHONG UTAMA",
24
- # "address3" => nil,
25
- # "city" => "PUCHONG",
26
- # "state" => "SELANGOR",
27
- # "district" => nil,
28
- # "country" => "MY",
29
- # "post_code" => "57000",
30
- # "phone" => "0123456798",
31
- # "email" => nil
32
- # },
33
- # "shipment_id" => "MYPTC000103",
34
- # "package_desc" => "Bread Materials",
35
- # "total_weight" => 2000,
36
- # "total_weight_uom" => "G",
37
- # "dimension_uom" => "CM",
38
- # "height" => nil,
39
- # "length" => nil,
40
- # "width" => nil,
41
- # "product_code" => "PDO",
42
- # "cod_value" => nil,
43
- # "insurance_value" => nil,
44
- # "total_value" => 300,
45
- # "currency" => "MYR",
46
- # "remarks" => nil,
47
- # "is_routing_info_required" => "Y"
48
- # }
49
- # ],
50
- # }
@@ -1,77 +0,0 @@
1
- module DHLEcommerceAPI
2
- class Shipment::Pickup < Shipment
3
- # This is a coupled shipment + pickup request.
4
-
5
- self.element_name = ""
6
-
7
- DEFAULT_ATTRIBUTES = {
8
- handover_method: 2,
9
- pickup_date_time: nil,
10
- pickup_address: {
11
- company_name: "",
12
- name: "",
13
- address1: "",
14
- address2: nil,
15
- address3: nil,
16
- city: "",
17
- state: "",
18
- post_code: "",
19
- country: "MY",
20
- phone: "",
21
- email: nil
22
- },
23
- shipment_items: []
24
- }
25
- end
26
- end
27
-
28
- # shipment_with_pickup_params = {
29
- # "handoverMethod": 2,
30
- # "pickupDateTime": DateTime.now.to_s,
31
- # "pickupAddress": {
32
- # "companyName": "Pickup From Company",
33
- # "name": "Pickup From Name",
34
- # "address1": "Holistic Pharmacy PostCo, 55, Jalan Landak",
35
- # "address2": "",
36
- # "address3": "",
37
- # "city": " Kuala Lumpur",
38
- # "state": " Kuala Lumpur",
39
- # "postCode": "55100",
40
- # "country": "MY",
41
- # "phone": "0169822645",
42
- # "email": "erwhey@postco.co"
43
- # },
44
- # "shipmentItems": [
45
- # {
46
- # "shipmentID": "MYPTC0087",
47
- # "packageDesc": "Laptop Sleeve",
48
- # "totalWeight": 500,
49
- # "totalWeightUOM": "G",
50
- # "dimensionUOM": "CM",
51
- # "height": nil,
52
- # "length": nil,
53
- # "width": nil,
54
- # "productCode": "PDO",
55
- # "codValue": nil,
56
- # "insuranceValue": nil,
57
- # "totalValue": 300,
58
- # "currency": "MYR",
59
- # "remarks": nil,
60
- # "isRoutingInfoRequired": "Y",
61
- # "consigneeAddress": {
62
- # "companyName": "Sleeve Company",
63
- # "name": "Sleeve Sdn Bhd",
64
- # "address1": "No. 3, Jalan Bangsar, Kampung Haji Abdullah Hukum",
65
- # "address2": nil,
66
- # "address3": nil,
67
- # "city": "Kuala Lumpur",
68
- # "state": "Kuala Lumpur",
69
- # "district": nil,
70
- # "country": "MY",
71
- # "postCode": "59200",
72
- # "phone": "0169822645",
73
- # "email": nil
74
- # }
75
- # },
76
- # ]
77
- # }