oa-webmoney 0.0.0 → 0.0.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.0
1
+ 0.0.1
@@ -40,8 +40,11 @@ module OmniAuth
40
40
  # 12
41
41
  :user_blocked => "The user is temporarily blocked. Probably made the selection Ticket",
42
42
  # 201
43
- :ip_differs => "Ip address in the request differs from the address, which was an authorized user"
43
+ :ip_differs => "Ip address in the request differs from the address, which was an authorized user",
44
+
45
+ :canceled => "Authorization was canceled by user"
44
46
  }
47
+ attr_reader :credentials, :mode, :wm_instance
45
48
 
46
49
  def initialize(app, opts = {})
47
50
  @credentials = opts[:credentials]
@@ -61,7 +64,11 @@ module OmniAuth
61
64
  end
62
65
 
63
66
  def callback_phase
64
- wminfo =
67
+ if request.params["WmLogin_KeeperRetStr"] == "Canceled"
68
+ return fail!(:canceled, ERROR_MESSAGES[:canceled])
69
+ end
70
+
71
+ @wminfo =
65
72
  { :WmLogin_Ticket => request.params["WmLogin_Ticket"],
66
73
  :WmLogin_UrlID => request.params["WmLogin_UrlID"],
67
74
  :WmLogin_Expire => request.params["WmLogin_Expires"],
@@ -72,9 +79,9 @@ module OmniAuth
72
79
  :WmLogin_UserAddress => request.params["WmLogin_UserAddress"] }
73
80
 
74
81
  # work around for local development
75
- ip_to_check = %w(development test).include?(mode) ? wminfo[:WmLogin_UserAddress] : request.ip
82
+ ip_to_check = %w(development test).include?(mode) ? @wminfo[:WmLogin_UserAddress] : request.ip
76
83
 
77
- check_req_params = wminfo.merge({:remote_ip => ip_to_check})
84
+ check_req_params = @wminfo.merge({:remote_ip => ip_to_check})
78
85
 
79
86
  begin
80
87
  response = wm_instance.request(:login, check_req_params)[:retval]
data/oa-webmoney.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{oa-webmoney}
8
- s.version = "0.0.0"
8
+ s.version = "0.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Anton"]
12
- s.date = %q{2011-02-18}
12
+ s.date = %q{2011-02-21}
13
13
  s.description = %q{Webmoney}
14
14
  s.email = %q{eagle.anton@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 0
9
- version: 0.0.0
8
+ - 1
9
+ version: 0.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Anton
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-18 00:00:00 +03:00
17
+ date: 2011-02-21 00:00:00 +03:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -146,7 +146,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
146
146
  requirements:
147
147
  - - ">="
148
148
  - !ruby/object:Gem::Version
149
- hash: -871235757
149
+ hash: -329919267
150
150
  segments:
151
151
  - 0
152
152
  version: "0"