przelewy24 0.1.5 → 0.1.6

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.
@@ -9,10 +9,12 @@ module Przelewy24
9
9
  end
10
10
 
11
11
  def register_transfer(transaction)
12
- client.call(:register_transfer, message: {
12
+ response = client.call(:register_transfer, message: {
13
13
  'authorizeIn' => authorization_object,
14
14
  'o_transactionIn' => transaction
15
15
  })
16
+
17
+ Response.new(response.body[:register_transfer_response][:return])
16
18
  end
17
19
 
18
20
  private
@@ -0,0 +1,18 @@
1
+ module Przelewy24
2
+ module Ekspres
3
+ class Response
4
+ def initialize(savon_response)
5
+ @result = savon_response[:result]
6
+ @error = savon_response[:error]
7
+ end
8
+
9
+ def success?
10
+ @error[:error_code] == '0'
11
+ end
12
+
13
+ def result
14
+ @result
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module Przelewy24
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: przelewy24
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-06-12 00:00:00.000000000 Z
12
+ date: 2015-06-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -79,6 +79,7 @@ files:
79
79
  - lib/przelewy24.rb
80
80
  - lib/przelewy24/client.rb
81
81
  - lib/przelewy24/ekspres/client.rb
82
+ - lib/przelewy24/ekspres/response.rb
82
83
  - lib/przelewy24/invalid_gateway_url.rb
83
84
  - lib/przelewy24/response.rb
84
85
  - lib/przelewy24/transaction.rb