paylane 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDQ0NWIxMmQwZmRjMDg5ZjE5ZjhkNzQ0MWFjOWI5OWNjZmI1ZTQ2MA==
5
+ data.tar.gz: !binary |-
6
+ MGU2MTFiMzJhOGVhMzhiZmMzZmQ2NWI4ODA2OTE3OTljZjhhYTA2ZA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NzY5MTRkNTgzMDBlZTAwNWY0N2YyZWYxNjNhMTEzODFmN2Y2YzgxNmMxZmIz
10
+ MDBlNTQwODM0Yjg2ZjRlYWU3MGQ5MWVkZGRkMWJiNTU1YTU1Nzk0MTJjYTBk
11
+ ODgxZmJkNDJmM2FlMzQ0MzA0NWFlYzY0NDIyNGJmMTQ5ZmYxYzk=
12
+ data.tar.gz: !binary |-
13
+ ZGY2MWNjMDkyZjBiMjgwZjI2MjkzZDQyYmE0MGJkNGIzMzI4ZjM4M2QwOWEz
14
+ ZGUyODdkYjI4YzM5OTJkNzE4MjZkMWZjMmMyNDExNzJjNmMyZTkyODIyYTg2
15
+ ZTYzODVkNWFjMDNhZWM2NTNjNGE5NjNjNjEzZTVlMmVkZGUyOGE=
@@ -8,45 +8,31 @@ module PayLane
8
8
  end
9
9
 
10
10
  def multi_sale(params)
11
- PayLane::Response.new do
12
- request(:multiSale, params, 'multi_sale_params')[:multi_sale_response][:response]
13
- end
11
+ request(:multiSale, params, 'multi_sale_params')[:multi_sale_response][:response]
14
12
  end
15
13
 
16
14
  def capture_sale(params)
17
- PayLane::Response.new do
18
- request(:captureSale, params)[:capture_sale_response][:response]
19
- end
15
+ request(:captureSale, params)[:capture_sale_response][:response]
20
16
  end
21
17
 
22
18
  def close_sale_authorization(params)
23
- PayLane::Response.new do
24
- request(:closeSaleAuthorization, params)[:close_sale_authorization_response][:response]
25
- end
19
+ request(:closeSaleAuthorization, params)[:close_sale_authorization_response][:response]
26
20
  end
27
21
 
28
22
  def refund(params)
29
- PayLane::Response.new do
30
- request(:refund, params)[:refund_response][:response]
31
- end
23
+ request(:refund, params)[:refund_response][:response]
32
24
  end
33
25
 
34
26
  def resale(params)
35
- PayLane::Response.new do
36
- request(:resale, params)[:resale_response][:response]
37
- end
27
+ request(:resale, params)[:resale_response][:response]
38
28
  end
39
29
 
40
30
  def get_sale_result(params)
41
- PayLane::Response.new do
42
- request(:getSaleResult, params)[:get_sale_result_response][:response]
43
- end
31
+ request(:getSaleResult, params)[:get_sale_result_response][:response]
44
32
  end
45
33
 
46
34
  def check_sales(params)
47
- PayLane::Response.new do
48
- request(:checkSales, params, 'check_sales_params')[:check_sales_response][:check_sales_response]
49
- end
35
+ request(:checkSales, params, 'check_sales_params')[:check_sales_response][:check_sales_response]
50
36
  end
51
37
 
52
38
  private
@@ -55,7 +41,7 @@ module PayLane
55
41
  begin
56
42
  body = params_prefix ? {params_prefix => params} : params
57
43
  soap_response = @client.request(method) { soap.body = body }
58
- soap_response.to_hash
44
+ PayLane::Response.new(soap_response.to_hash)
59
45
  rescue Savon::Error => e
60
46
  err = PayLane::ConnectionError.new(e)
61
47
  PayLane.logger.error("[PayLane][Savon] #{err.to_hash}")
@@ -1,7 +1,7 @@
1
1
  module PayLane
2
2
  class Response < Hash
3
- def initialize
4
- @response = yield
3
+ def initialize(response)
4
+ @response = response
5
5
  end
6
6
 
7
7
  def [](key)
@@ -1,3 +1,3 @@
1
1
  module PayLane
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
@@ -15,10 +15,8 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = PayLane::VERSION
17
17
 
18
- gem.add_dependency "savon"
18
+ gem.add_dependency "savon", "1.2.0"
19
19
  gem.add_development_dependency "rake"
20
20
  gem.add_development_dependency "rspec"
21
21
  gem.add_development_dependency "fakeweb"
22
-
23
- gem.post_install_message = "**It's strongly recommended to NOT install current version - development in progress**"
24
22
  end
@@ -187,19 +187,5 @@ describe PayLane::API do
187
187
  sales.should include({id_sale: "2772323", status: "PERFORMED", is_refund: false, is_chargeback: false, is_reversal: false})
188
188
  end
189
189
  end
190
-
191
- describe 'handle savon error' do
192
- let(:savon_http_error) {
193
- Savon::HTTP::Error.new(double(error?: true, code: 404, body: 'Not Found'))
194
- }
195
-
196
- it 'logs and raise PayLane::ConnectionError' do
197
- connection.stub(:request).and_raise(savon_http_error)
198
- PayLane.logger.should_receive(:error).with("[PayLane][Savon] HTTP error (404): Not Found")
199
- expect {
200
- api.multi_sale({})
201
- }.to raise_error(PayLane::ConnectionError)
202
- end
203
- end
204
190
  end
205
191
 
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe PayLane::Response do
4
4
  context 'has :ok and :data hashes' do
5
5
  let(:response) do
6
- PayLane::Response.new { {ok: {sale_id: 1}, data: {fraud_score: 1.0}} }
6
+ PayLane::Response.new({ok: {sale_id: 1}, data: {fraud_score: 1.0}})
7
7
  end
8
8
 
9
9
  it "returns true on #has_ok?" do
@@ -25,7 +25,7 @@ describe PayLane::Response do
25
25
 
26
26
  context 'has :error hash' do
27
27
  let(:response) do
28
- PayLane::Response.new { {error: {error_description: 'Something went wrong'}} }
28
+ PayLane::Response.new({error: {error_description: 'Something went wrong'}})
29
29
  end
30
30
 
31
31
  it "returns false on #has_ok?" do
metadata CHANGED
@@ -1,36 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paylane
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
4
+ version: 1.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Bartlomiej Kozal
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-09-04 00:00:00.000000000 Z
11
+ date: 2013-03-25 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: savon
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: 1.2.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: '0'
26
+ version: 1.2.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: fakeweb
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -108,28 +99,26 @@ files:
108
99
  - spec/spec_helper.rb
109
100
  homepage: ''
110
101
  licenses: []
111
- post_install_message: ! '**It''s strongly recommended to NOT install current version
112
- - development in progress**'
102
+ metadata: {}
103
+ post_install_message:
113
104
  rdoc_options: []
114
105
  require_paths:
115
106
  - lib
116
107
  required_ruby_version: !ruby/object:Gem::Requirement
117
- none: false
118
108
  requirements:
119
109
  - - ! '>='
120
110
  - !ruby/object:Gem::Version
121
111
  version: '0'
122
112
  required_rubygems_version: !ruby/object:Gem::Requirement
123
- none: false
124
113
  requirements:
125
114
  - - ! '>='
126
115
  - !ruby/object:Gem::Version
127
116
  version: '0'
128
117
  requirements: []
129
118
  rubyforge_project:
130
- rubygems_version: 1.8.23
119
+ rubygems_version: 2.0.3
131
120
  signing_key:
132
- specification_version: 3
121
+ specification_version: 4
133
122
  summary: Ruby client for PayLane service.
134
123
  test_files:
135
124
  - spec/helpers.rb