rails-internet-marke 0.0.3 → 0.0.5
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/lib/client.rb +3 -3
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ac3b3726b4cdbe6f7dbe46cdb8c8100a7af87bf4687ab115a083d0868f1cb75
|
4
|
+
data.tar.gz: 5f6ff8f04f2649f1f6421da8c96d47eecec97dadc0b4da59d2817841b61aa669
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27d22f83fcd9de84e23ff053175fc32428e2bb880aa1d907c10ce0d29ea7c89df0b5ca82a51bb9127b5afc2df316040342a394166fc6ad86829a427e5689221e
|
7
|
+
data.tar.gz: f948ce0901163bdc39a694da8b9056645f975e159334c9ef8bd4ca6e0de1c6ac0a55bd8fe6146522491b79c85fb30c241e86e05e92657cb1df035dc5aa374dcc
|
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", "v1.1.18"]
|
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
|
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
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.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- cmetzner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-09 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
|
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
|
-
rubygems_version: 3.
|
43
|
+
rubygems_version: 3.5.22
|
44
44
|
signing_key:
|
45
45
|
specification_version: 4
|
46
46
|
summary: Ruby Client for Deutsche Post InternetMarke Api
|