mpi_client 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -21,13 +21,16 @@ module MPIClient
21
21
 
22
22
  def parse
23
23
  doc = Nokogiri::XML.parse(response_source)
24
-
25
- if error = doc.xpath("//Error").first
24
+ case
25
+ when error = doc.xpath("//Error").first
26
26
  @error_code = error[:code]
27
27
  @error_message = error.text
28
28
  @errors = errors_to_hash
29
+ when (transaction = doc.xpath("//Transaction/*")) && transaction.any?
30
+ set_account_attributes transaction
29
31
  else
30
- set_account_attributes doc.xpath("//Transaction/*")
32
+ @error_message = 'Unknown response was received from MPI'
33
+ @errors = errors_to_hash
31
34
  end
32
35
  end
33
36
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mpi_client
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dmitry Plashchynski
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-11-16 00:00:00 +02:00
19
+ date: 2010-11-19 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency