dhl_express_global 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 25e0e751ae94b63b522255dbf5845e0fd29cf0da
4
- data.tar.gz: 547a4abace99495614dfbfbdb37535975949eefb
3
+ metadata.gz: eea696599b00a4356be675fe6417b11a3c12550c
4
+ data.tar.gz: 6f9f47739786bf125658737364eabc26845bc4a5
5
5
  SHA512:
6
- metadata.gz: 8ca2bcad9315a1ec247841d40c2a2648199186fde8de11742e0627a4fd81ace783cebd20b408249bf3fc22c760537a0a01427f6120ec4f8c42608e3973b4ba44
7
- data.tar.gz: c89c3c5df237c6d5235d922b880f43c0e3c74139048c48a604efe9ce0319ffe872e23dd8eb514d7eceb863f2232936cf247dc182a864558200ebba03c1b59800
6
+ metadata.gz: 29de7e71dd333a56b62f43a709a312a4a5d6cad95c0d317593493fd5b56a1ef940ef6b84bd2bedf40b3d4058da750f117458d57ea5c0b4789a4a148a4e0b621b
7
+ data.tar.gz: f7486d4310fcacb83c8fa51e50c19e0911316637f369010c868bcc3b5b9f44c97c3fe913a6959c44c9dbc25264aba64adfb0274c5ed4f7a90548946d3832af20
@@ -15,10 +15,10 @@ module DhlExpressGlobal
15
15
  default_options.update(verify: false)
16
16
 
17
17
  # DHL Express Global Test URL
18
- TEST_URL = 'https://wsb.dhl.com:443/sndpt/expressRateBook?WSDL'
18
+ TEST_URL = 'https://wsbexpress.dhl.com:443/sndpt/'
19
19
 
20
20
  # DHL Express Global Production URL
21
- PRODUCTION_URL = ''
21
+ PRODUCTION_URL = 'https://wsbexpress.dhl.com:443/gbl/'
22
22
 
23
23
  # SERVICE_CODES = []
24
24
 
@@ -40,7 +40,16 @@ module DhlExpressGlobal
40
40
  end
41
41
 
42
42
  def api_url
43
- @credentials.mode == 'production' ? PRODUCTION_URL : TEST_URL
43
+ if @credentials.mode == 'production'
44
+ "#{PRODUCTION_URL}#{api_action}"
45
+ else
46
+ "#{TEST_URL}#{api_action}?WSDL"
47
+ end
48
+ end
49
+
50
+ def api_action
51
+ # default action, overwrite in subclass
52
+ "expressRateBook"
44
53
  end
45
54
 
46
55
  def build_xml
@@ -21,7 +21,6 @@ module DhlExpressGlobal
21
21
  end
22
22
 
23
23
  def process_request
24
- api_response = self.class.post api_url, :body => build_xml, :headers => headers
25
24
  puts api_response if @debug
26
25
  response = parse_response(api_response)
27
26
  if success?(response)
@@ -31,6 +30,14 @@ module DhlExpressGlobal
31
30
  end
32
31
  end
33
32
 
33
+ def api_response
34
+ @response ||= self.class.post(URI(api_url),
35
+ body: build_xml,
36
+ headers: headers,
37
+ verify: true
38
+ )
39
+ end
40
+
34
41
  private
35
42
 
36
43
  def build_xml
@@ -1,3 +1,3 @@
1
1
  module DhlExpressGlobal
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dhl_express_global
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - JONBRWN
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-08 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.0.6
233
+ rubygems_version: 2.4.8
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Ruby wrapper for the DHL Express Global API