janio_api 0.3.3 → 0.3.4
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/janio_api/resources/order.rb +3 -3
- data/lib/janio_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ec588d4ddedcb71c4d1038732fe2db5864cacc915b2d4f0e257feedafd5916d7
|
|
4
|
+
data.tar.gz: ccb59b3ec045bcd86029fbd301e909a2919a94c000f1e098f780a9e99ccf53f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 868e7843a0cfdfa019f48fc2eaf0df991e2aeb0369e012aa2cb2407c53cc3865b1fc5f83f6fae8ac6b42e00ee945edf8014be90b00a5ada8f41adc9740549857
|
|
7
|
+
data.tar.gz: d946eca197b5186140ba4741cd90cbdbd15b44b66da94d2ceb54edf4be9d7a5a2013551a8d476d3f5cd55e1db87e572781e19bbb443ac37e44eb672dd23d3fe9
|
data/Gemfile.lock
CHANGED
|
@@ -220,16 +220,16 @@ module JanioAPI
|
|
|
220
220
|
def reformat_before_save(blocking)
|
|
221
221
|
attributes = @attributes.dup
|
|
222
222
|
@attributes.clear
|
|
223
|
-
@attributes[:secret_key] = retrieve_api_token
|
|
223
|
+
@attributes[:secret_key] = retrieve_api_token(attributes[:pickup_country])
|
|
224
224
|
# set blocking until label generated
|
|
225
225
|
@attributes[:blocking] = blocking
|
|
226
226
|
# reformat attributes
|
|
227
227
|
@attributes[:orders] = [attributes]
|
|
228
228
|
end
|
|
229
229
|
|
|
230
|
-
def retrieve_api_token
|
|
230
|
+
def retrieve_api_token(country)
|
|
231
231
|
if JanioAPI.config.api_tokens
|
|
232
|
-
country_code_sym = ISO3166::Country.find_country_by_name(
|
|
232
|
+
country_code_sym = ISO3166::Country.find_country_by_name(country)&.alpha2&.to_sym
|
|
233
233
|
JanioAPI.config.api_tokens[country_code_sym]
|
|
234
234
|
elsif JanioAPI.config.api_token
|
|
235
235
|
JanioAPI.config.api_token
|
data/lib/janio_api/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: janio_api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andy Chong
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-05-
|
|
11
|
+
date: 2020-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activeresource
|