intersoft_api 0.1.1 → 0.1.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44e0a3b40d47c81db77597eb0195eeb78a3597fbc11563b9147bb0bdf6d255c4
|
4
|
+
data.tar.gz: 1f30f1c3026addcb2ec1e0345ecef624edb3a55e4ec457e4efbe76d783e1e72f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 99a7161e1c6903aa95aa75484f02ffffe67f2d2648edbd129f930e20c1783deed551bfc19f067a2cf710274a2070caa6e9bc350e587e665883acfa108c27ecb9
|
7
|
+
data.tar.gz: 1f708a1218dfc79640078c5d34d9a31d9d1b7b5710a1f102ce1d7d968cf03a16e0d0f4e739aeeb623e074c4eb5f4741d5482d5e5d844b08354f3482160dc4011
|
data/lib/intersoft_api/client.rb
CHANGED
@@ -13,11 +13,11 @@ module IntersoftAPI
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def post_request(url, body:, headers: {})
|
16
|
-
handle_response client.connection.post(url, body, headers)
|
16
|
+
handle_response client.connection.post(url, parse_body(body), headers)
|
17
17
|
end
|
18
18
|
|
19
19
|
def put_request(url, body:, headers: {})
|
20
|
-
handle_response client.connection.put(url, body, headers)
|
20
|
+
handle_response client.connection.put(url, parse_body(body), headers)
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
@@ -25,5 +25,9 @@ module IntersoftAPI
|
|
25
25
|
def handle_response(response)
|
26
26
|
client.handle_response(response)
|
27
27
|
end
|
28
|
+
|
29
|
+
def parse_body(params)
|
30
|
+
params.deep_transform_keys { |key| key.to_s.camelcase }
|
31
|
+
end
|
28
32
|
end
|
29
33
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
module IntersoftAPI
|
4
2
|
class ShipmentResource < Resource
|
5
3
|
def create(attributes)
|
@@ -9,5 +7,14 @@ module IntersoftAPI
|
|
9
7
|
def generate_label_qr_code(shipment_id)
|
10
8
|
Shipment.new(get_request("shipments/printMyLabelQRCode/rm/#{shipment_id}").body)
|
11
9
|
end
|
10
|
+
|
11
|
+
def all(shipping_location_id, options = {})
|
12
|
+
url = "shipments/#{shipping_location_id}"
|
13
|
+
options = options.slice(:shipping_account_id, :carrier_code, :status, :destination_country_code, :date_from, :date_to, :page_size, :page_number)
|
14
|
+
options = options.transform_keys { |key| key.to_s.camelize(:lower) }
|
15
|
+
url += "?#{options.to_query}" if options.any?
|
16
|
+
|
17
|
+
Shipment.new(get_request(url).body)
|
18
|
+
end
|
12
19
|
end
|
13
20
|
end
|
@@ -6,8 +6,8 @@ module IntersoftAPI
|
|
6
6
|
ShippingAccount.new(post_request("shippingAccounts/rm", body: attributes).body)
|
7
7
|
end
|
8
8
|
|
9
|
-
def find(
|
10
|
-
ShippingAccount.new(get_request("shippingAccounts/rm/#{
|
9
|
+
def find(shipping_account_id)
|
10
|
+
ShippingAccount.new(get_request("shippingAccounts/rm/#{shipping_account_id}").body)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: intersoft_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Farm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -112,7 +112,7 @@ licenses:
|
|
112
112
|
- MIT
|
113
113
|
metadata:
|
114
114
|
homepage_uri: https://github.com/PostCo/intersoft_api
|
115
|
-
source_code_uri: https://github.com/PostCo/intersoft_api
|
115
|
+
source_code_uri: https://github.com/PostCo/intersoft_api
|
116
116
|
changelog_uri: https://github.com/PostCo/intersoft_api/releases
|
117
117
|
post_install_message:
|
118
118
|
rdoc_options: []
|