rack-webmoney 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -14,7 +14,7 @@ application.rb
14
14
 
15
15
  ...
16
16
  config.middleware.insert_before(Warden::Manager, Rack::Webmoney,
17
- :credentials => {:site_rid => 'your_site_rid', :site_holder_wmid => 'your_site_holder_wmid'},
17
+ :credentials => {:app_rids => { 'example.com' => 'your_site_rid' }, :site_holder_wmid => 'your_site_holder_wmid'},
18
18
  :mode => Rails.env)
19
19
  ...
20
20
 
@@ -32,7 +32,7 @@ application.rb
32
32
  end
33
33
  }
34
34
 
35
- use Rack::Webmoney, :credentials => {:site_rid => 'your_site_rid', :site_holder_wmid => 'your_site_holder_wmid'}, :mode => "development_OR_test_FOR_TESTING"
35
+ use Rack::Webmoney, :credentials => {:app_rids => { 'example.com' => 'your_site_rid' }, :site_holder_wmid => 'your_site_holder_wmid'}, :mode => "development_OR_test_FOR_TESTING"
36
36
  run MyApp
37
37
 
38
38
  === Sinatra Example
@@ -41,7 +41,7 @@ application.rb
41
41
  use Rack::Session::Cookie
42
42
 
43
43
  require 'rack/webmoney'
44
- use Rack::Webmoney, :credentials => {:site_rid => 'your_site_rid', :site_holder_wmid => 'your_site_holder_wmid'}, :mode => "development_OR_test_FOR_TESTING"
44
+ use Rack::Webmoney, :credentials => {:app_rids => { 'example.com' => 'your_site_rid' }, :site_holder_wmid => 'your_site_holder_wmid'}, :mode => "development_OR_test_FOR_TESTING"
45
45
 
46
46
  get '/login' do
47
47
  erb :login
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
data/lib/rack/webmoney.rb CHANGED
@@ -173,7 +173,7 @@ module Rack #:nodoc:
173
173
 
174
174
  raise RuntimeError, "Rack::Webmoney requires a session" unless session
175
175
 
176
- redirect_to "https://login.wmtransfer.com/GateKeeper.aspx?RID=#{credentials[:site_rid]}"
176
+ redirect_to "https://login.wmtransfer.com/GateKeeper.aspx?RID=#{credentials[:app_rids][req.host]}"
177
177
  end
178
178
 
179
179
  def complete_authentication(env)
@@ -212,7 +212,7 @@ module Rack #:nodoc:
212
212
  soap.namespace = "https://login.wmtransfer.com/ws/Security.asmx?WSDL"
213
213
  soap.body = check_req_params
214
214
  end.to_hash['authorizeResult'].to_i
215
- rescue Exception => msg
215
+ rescue Errno::ECONNRESET, Errno::ECONNREFUSED, Timeout::Error
216
216
  response = -2
217
217
  end
218
218
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-webmoney}
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Anton Orel", "Alexander Orel"]
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 3
9
- version: 0.0.3
8
+ - 4
9
+ version: 0.0.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Anton Orel