rails-internet-marke 0.0.3 → 0.0.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/client.rb +3 -3
  3. data/lib/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f6a896a9ca7a2b3fda450a450428abd1124bf0c17db3dc9d2404069684ada2c
4
- data.tar.gz: 196755ce0a78e2a8b0194c99a6f40bdf5eebcdfb004fc388a0c4d852ba1d6b76
3
+ metadata.gz: 49ed1918a4f9f7a249a9a0d8220523f01ccca9eb2fb99ebc5f4adec8d608aef0
4
+ data.tar.gz: a4f804fccb541160c83208fa89a9a32e109fbacc462bce3da7ff5fcf0f5ae576
5
5
  SHA512:
6
- metadata.gz: 9b3c216f8027add5ad1ceca898dea7ca9d8122a0756c188f6263cb1d16326f2d0e4abe01a9cd0afde5a5c5c6704eef1e4f89dc1c762065b309d92f0228901c9c
7
- data.tar.gz: c6b80727bdad19e98336d751482f3f129604d96bf62c0dce96369fa26746a2fa105f25b9c19a76be9facadec075305e075084cdbf6d6deedb347a9a17d81fb8a
6
+ metadata.gz: ecd8b23a3a330c5f01d799634ebf28ef2af6fb5128ef2ed834749c559f34f0980262ebfd5ff01d6b17aabc012c6661f4556523eed06902b73898b13938081223
7
+ data.tar.gz: 4accadfdc295fd096d33b9218d9ef68a8799a2e22b6a9c99394312750a36d7eb10c9fffa3b4aa5a0ebc881c8a41eca7e3f9ef554db3dc31123c5d9b07403e9c5
data/lib/client.rb CHANGED
@@ -4,7 +4,7 @@ module InternetMarke
4
4
  mattr_accessor :client_id, :client_secret, :username, :password
5
5
 
6
6
  @@auth_type = "client_credentials"
7
- @@api_version = "v1.1.14"
7
+ @@api_version = ["v1.1.14", "v1.1.16"]
8
8
 
9
9
  @@auth_url = "https://api-eu.dhl.com/post/de/shipping/im/v1/user"
10
10
  @@api_url = "https://api-eu.dhl.com/post/de/shipping/im/v1/"
@@ -22,7 +22,7 @@ module InternetMarke
22
22
  @password = password
23
23
 
24
24
  self.check_api_version
25
- if @apiVersion == @@api_version
25
+ if @@api_version.include?(@apiVersion)
26
26
  @authToken = self.generate_auth_token
27
27
  else
28
28
  raise "selected api version #{@apiVersion} is not supported"
@@ -42,7 +42,7 @@ module InternetMarke
42
42
  @request = http.request(request)
43
43
  @response = JSON.parse @request.read_body
44
44
 
45
- @apiVersion = @response["amp"]["version"]
45
+ @apiVersion = @response["amp"]["version"].present? ? @response["amp"]["version"] : "undefined"
46
46
  end
47
47
 
48
48
  def generate_auth_token
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module InternetMarke
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-internet-marke
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - cmetzner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-19 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Gem for use Deutsche Post InternetMarke Api in Ruby. Put money on your
14
14
  wallet and buy products of Deutsche Post InternetMarke