dhl_ecommerce_api 0.1.3 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a2f1d2a269383e70ae8d3e1790d26a84cf75914195f112d1228030f18f46304
4
- data.tar.gz: c7c5739d014fb7f1785b1d2da4531c50891e5c634a0adbe376978adab3850ec3
3
+ metadata.gz: 3c46dd0f19e8135cece977f02bf78ea9f93e9d174977f5f70588001c76f81973
4
+ data.tar.gz: eb69521ee70c73cf460cacb743fc2e31cb9e957e5acc94d81af9c016b20781ba
5
5
  SHA512:
6
- metadata.gz: a7888364e05e7bd7eec4f778cbcb241451643907c93e73d3f6cca7d57803d2528611567612fa8b3515069eef889332d041704e0084b51b05dcdeaddd7db6e7bf
7
- data.tar.gz: 0de0dd3a612306fda95c9892ceece8b08fcc37ba2720f984c7905a71cbc01cb65702ba897cecb25dbad6f416760ee0a5622662d6431b66cc2653580371064ff7
6
+ metadata.gz: 9f3828dfd64123a9992d4b89b1cc3494dfefaf8792e885bae497a881d44981a4aa1f3343b7f3a66c48f6d4f45fba429e37c19304e7e8c82c30abab510ad480e8
7
+ data.tar.gz: 52f6fa06f6ae6b416b05ec1daebb2d6a1ed3219e33089c8a48dc32bc54083f5b17ba337bfc18206b3c0b501fd898a5e89dda92b985c152ff881c41675fa67b03
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dhl_ecommerce_api (0.1.1)
4
+ dhl_ecommerce_api (0.1.4)
5
5
  activeresource (>= 4.1.0, < 6.0.0)
6
6
 
7
7
  GEM
@@ -22,58 +22,56 @@ module DHLEcommerceAPI
22
22
  },
23
23
  shipment_items: []
24
24
  }
25
-
26
- validates_presence_of :pickup_date_time
27
25
  end
28
26
  end
29
27
 
30
- # shipment_with_pickup_params = {
31
- # "handoverMethod": 2,
32
- # "pickupDateTime": DateTime.now.to_s,
33
- # "pickupAddress": {
34
- # "companyName": "Pickup From Company",
35
- # "name": "Pickup From Name",
36
- # "address1": "Holistic Pharmacy PostCo, 55, Jalan Landak",
37
- # "address2": "",
38
- # "address3": "",
39
- # "city": " Kuala Lumpur",
40
- # "state": " Kuala Lumpur",
41
- # "postCode": "55100",
42
- # "country": "MY",
43
- # "phone": "0169822645",
44
- # "email": "erwhey@postco.co"
45
- # },
46
- # "shipmentItems": [
47
- # {
48
- # "shipmentID": "MYPTC0087",
49
- # "packageDesc": "Laptop Sleeve",
50
- # "totalWeight": 500,
51
- # "totalWeightUOM": "G",
52
- # "dimensionUOM": "CM",
53
- # "height": nil,
54
- # "length": nil,
55
- # "width": nil,
56
- # "productCode": "PDO",
57
- # "codValue": nil,
58
- # "insuranceValue": nil,
59
- # "totalValue": 300,
60
- # "currency": "MYR",
61
- # "remarks": nil,
62
- # "isRoutingInfoRequired": "Y",
63
- # "consigneeAddress": {
64
- # "companyName": "Sleeve Company",
65
- # "name": "Sleeve Sdn Bhd",
66
- # "address1": "No. 3, Jalan Bangsar, Kampung Haji Abdullah Hukum",
67
- # "address2": nil,
68
- # "address3": nil,
69
- # "city": "Kuala Lumpur",
70
- # "state": "Kuala Lumpur",
71
- # "district": nil,
72
- # "country": "MY",
73
- # "postCode": "59200",
74
- # "phone": "0169822645",
75
- # "email": nil
76
- # }
77
- # },
78
- # ]
79
- # }
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
+ }
@@ -1,46 +1,52 @@
1
- module DHLEcommerceAPI
2
- # Component item
3
- class Shipment::ShipmentItem < Base
4
- # add some validations?
5
- DEFAULT_ATTRIBUTES = {
6
- shipment_id: nil,
7
- package_desc: "",
8
- total_weight: nil,
9
- total_weight_uom: "G",
10
- dimension_uom: "CM",
11
- height: nil,
12
- length: nil,
13
- width: nil,
14
- product_code: "PDO",
15
- cod_value: nil,
16
- insurance_value: nil,
17
- total_value: 300,
18
- currency: "MYR",
19
- remarks: nil,
20
- is_routing_info_required: "Y",
21
- consignee_address: {
22
- company_name: "",
23
- name: "",
24
- address1: "",
25
- address2: nil,
26
- address3: nil,
27
- city: "",
28
- state: "",
29
- district: nil,
30
- country: "MY",
31
- post_code: "",
32
- phone: "",
33
- email: nil
34
- }
35
- }
1
+ # module DHLEcommerceAPI
2
+ # # Component item
3
+ # class Shipment::ShipmentItem < Base
4
+ # # add some validations?
5
+ # DEFAULT_ATTRIBUTES = {
6
+ # shipment_id: nil,
7
+ # package_desc: "",
8
+ # total_weight: nil,
9
+ # total_weight_uom: "G",
10
+ # dimension_uom: "CM",
11
+ # height: nil,
12
+ # length: nil,
13
+ # width: nil,
14
+ # product_code: "PDO",
15
+ # cod_value: nil,
16
+ # insurance_value: nil,
17
+ # total_value: 300,
18
+ # currency: "MYR",
19
+ # remarks: nil,
20
+ # is_routing_info_required: "Y",
21
+ # consignee_address: {
22
+ # company_name: "",
23
+ # name: "",
24
+ # address1: "",
25
+ # address2: nil,
26
+ # address3: nil,
27
+ # city: "",
28
+ # state: "",
29
+ # district: nil,
30
+ # country: "MY",
31
+ # post_code: "",
32
+ # phone: "",
33
+ # email: nil
34
+ # }
35
+ # }
36
36
 
37
- def initialize(attributes = {}, persisted = false)
38
- status = attributes["response_status"]
39
- if status.present? && status["code"] != "200"
40
- error_messages = status["message_details"].map{|err| err["message_detail"]}
41
- handle_errors(status["code"], error_messages)
42
- end
43
- super
44
- end
45
- end
46
- end
37
+ # def initialize(attributes = {}, persisted = false)
38
+ # status = attributes["response_status"]
39
+ # if status.present? && status["code"] != "200"
40
+ # error_messages = status["message_details"].map{|err| err["message_detail"]}
41
+ # handle_errors(status["code"], error_messages)
42
+ # end
43
+ # super
44
+ # end
45
+
46
+ # def to_json(options = {})
47
+ # attributes.as_json
48
+ # .deep_transform_keys { |k| k.to_s.camelize(:lower) }
49
+ # .to_json(include_root_in_json ? { root: self.class.element_name }.merge(options) : options)
50
+ # end
51
+ # end
52
+ # end
@@ -6,8 +6,6 @@ module DHLEcommerceAPI
6
6
  self.prefix = "/rest/v3/Shipment"
7
7
  self.element_name = ""
8
8
 
9
- has_many :shipment_items, class_name: "DHLEcommerceAPI::Shipment::ShipmentItem"
10
-
11
9
  validates_presence_of :handover_method
12
10
 
13
11
  def create
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DHLEcommerceAPI
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.6"
5
5
  end
@@ -14,7 +14,7 @@ module DHLEcommerceAPI
14
14
  require "dhl_ecommerce_api/resources/shipment"
15
15
  require "dhl_ecommerce_api/resources/shipment/pickup"
16
16
  require "dhl_ecommerce_api/resources/shipment/dropoff"
17
- require "dhl_ecommerce_api/resources/shipment/shipment_item"
17
+ # require "dhl_ecommerce_api/resources/shipment/shipment_item"
18
18
 
19
19
  require "dhl_ecommerce_api/resources/pickup"
20
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhl_ecommerce_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Er Whey