wepay-rails 2.2.5 → 2.2.9

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/README.rdoc CHANGED
@@ -9,6 +9,7 @@ Wepay-Rails allows your rails app to accept payments with Wepay (http://www.wepa
9
9
  * Built in API tools to allow you to make all wepay-api calls easily
10
10
  * Built in ability to send your customers to wepay to make payments and handles their trip back for you
11
11
  * Saves the current state of every checkout
12
+ * Authorize many users to accept payments dynamically (see Wiki)
12
13
  * Configurable
13
14
 
14
15
  = Installation
@@ -110,6 +111,7 @@ wepay to get the checkout info - whatever you want to do (See the wiki for more
110
111
  * lucisferre (Chris Nicola) https://github.com/lucisferre
111
112
  * mindeavor (Gilbert) https://github.com/mindeavor
112
113
  * ustorf (Bernd Ustorf) https://github.com/ustorf
114
+ * dragonstarwebdesign (Steve Aquino) https://github.com/dragonstarwebdesign
113
115
 
114
116
 
115
117
  == Contributing to wepay-rails
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.5
1
+ 2.2.9
@@ -3,16 +3,17 @@ class Wepay::AuthorizeController < Wepay::ApplicationController
3
3
  def index
4
4
  wepay_gateway = WepayRails::Payments::Gateway.new
5
5
 
6
+ # For security purposes, stop people from hitting this page and resetting the access_token.
7
+ if wepay_gateway.configuration[:access_token].present?
8
+ render :text => "You have already specified an access token in wepay.yml. If you wish to change it, please delete the current one and try again."
9
+ return
10
+ end
11
+
6
12
  if params[:code].present?
7
13
  access_token = wepay_gateway.get_access_token(params[:code], redirect_uri)
8
- render :text => "Copy this access token, #{access_token} to the access_token directive in your wepay.yml"
14
+ render :text => "Copy this access token, #{access_token} to the access_token directive in your wepay.yml and restart your app."
9
15
  else
10
- # For security purposes, stop people from hitting this page and resetting the access_token.
11
- if wepay_gateway.configuration[:access_token].present?
12
- render :text => "You have already specified an access token in wepay.yml. If you wish to change it, please delete the current one and try again."
13
- else
14
- redirect_to wepay_gateway.auth_code_url redirect_uri
15
- end
16
+ redirect_to wepay_gateway.auth_code_url redirect_uri
16
17
  end
17
18
  end
18
19
 
@@ -20,4 +21,4 @@ class Wepay::AuthorizeController < Wepay::ApplicationController
20
21
  def redirect_uri
21
22
  "#{WepayRails::Configuration.settings[:root_callback_uri]}/wepay/authorize"
22
23
  end
23
- end
24
+ end
data/lib/wepay-rails.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'active_record'
2
2
  require 'helpers/controller_helpers'
3
+ require 'api/account_methods'
3
4
  require 'api/checkout_methods'
4
5
  require 'httparty'
5
6
  module WepayRails
@@ -41,6 +42,7 @@ module WepayRails
41
42
  base_uri @base_uri
42
43
 
43
44
  attr_accessor :access_token
45
+ attr_accessor :account_id
44
46
 
45
47
  # Pass in the wepay access token that we got after the oauth handshake
46
48
  # and use it for ongoing comunique with Wepay.
@@ -76,6 +78,7 @@ module WepayRails
76
78
 
77
79
  raise WepayRails::Exceptions::AccessTokenError.new("A problem occurred trying to get the access token: #{json.inspect}") unless json.has_key?("access_token")
78
80
 
81
+ @account_id = json["user_id"]
79
82
  @access_token = json["access_token"]
80
83
  end
81
84
 
@@ -110,6 +113,7 @@ module WepayRails
110
113
  JSON.parse(response.body)
111
114
  end
112
115
 
116
+ include WepayRails::Api::AccountMethods
113
117
  include WepayRails::Api::CheckoutMethods
114
118
  end
115
119
 
data/wepay-rails.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wepay-rails}
8
- s.version = "2.2.5"
8
+ s.version = "2.2.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Adam Medeiros}]
12
- s.date = %q{2012-04-01}
11
+ s.authors = ["Adam Medeiros"]
12
+ s.date = %q{2012-05-28}
13
13
  s.description = %q{Rails gem that interfaces with the WePay API}
14
14
  s.email = %q{adammede@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -44,9 +44,9 @@ Gem::Specification.new do |s|
44
44
  "wepay-rails.gemspec"
45
45
  ]
46
46
  s.homepage = %q{http://github.com/adamthedeveloper/wepay-rails}
47
- s.licenses = [%q{MIT}]
48
- s.require_paths = [%q{lib}]
49
- s.rubygems_version = %q{1.8.6}
47
+ s.licenses = ["MIT"]
48
+ s.require_paths = ["lib"]
49
+ s.rubygems_version = %q{1.6.2}
50
50
  s.summary = %q{Rails gem that interfaces with the WePay API}
51
51
 
52
52
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wepay-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-01 00:00:00.000000000Z
12
+ date: 2012-05-28 00:00:00.000000000 -07:00
13
+ default_executable:
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: httparty
16
- requirement: &17209040 !ruby/object:Gem::Requirement
17
+ requirement: &2161037600 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ! '>='
@@ -21,10 +22,10 @@ dependencies:
21
22
  version: '0'
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *17209040
25
+ version_requirements: *2161037600
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: shoulda
27
- requirement: &17205100 !ruby/object:Gem::Requirement
28
+ requirement: &2161036220 !ruby/object:Gem::Requirement
28
29
  none: false
29
30
  requirements:
30
31
  - - ! '>='
@@ -32,10 +33,10 @@ dependencies:
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *17205100
36
+ version_requirements: *2161036220
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: bundler
38
- requirement: &17180660 !ruby/object:Gem::Requirement
39
+ requirement: &2161034580 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
41
42
  - - ~>
@@ -43,10 +44,10 @@ dependencies:
43
44
  version: 1.0.0
44
45
  type: :development
45
46
  prerelease: false
46
- version_requirements: *17180660
47
+ version_requirements: *2161034580
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: jeweler
49
- requirement: &17178880 !ruby/object:Gem::Requirement
50
+ requirement: &2161032980 !ruby/object:Gem::Requirement
50
51
  none: false
51
52
  requirements:
52
53
  - - ~>
@@ -54,10 +55,10 @@ dependencies:
54
55
  version: 1.6.4
55
56
  type: :development
56
57
  prerelease: false
57
- version_requirements: *17178880
58
+ version_requirements: *2161032980
58
59
  - !ruby/object:Gem::Dependency
59
60
  name: rcov
60
- requirement: &17177720 !ruby/object:Gem::Requirement
61
+ requirement: &2161032060 !ruby/object:Gem::Requirement
61
62
  none: false
62
63
  requirements:
63
64
  - - ! '>='
@@ -65,7 +66,7 @@ dependencies:
65
66
  version: '0'
66
67
  type: :development
67
68
  prerelease: false
68
- version_requirements: *17177720
69
+ version_requirements: *2161032060
69
70
  description: Rails gem that interfaces with the WePay API
70
71
  email: adammede@gmail.com
71
72
  executables: []
@@ -99,6 +100,7 @@ files:
99
100
  - test/helper.rb
100
101
  - test/test_wepay-rails.rb
101
102
  - wepay-rails.gemspec
103
+ has_rdoc: true
102
104
  homepage: http://github.com/adamthedeveloper/wepay-rails
103
105
  licenses:
104
106
  - MIT
@@ -114,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
116
  version: '0'
115
117
  segments:
116
118
  - 0
117
- hash: 3961718149411940929
119
+ hash: -4350296257976175224
118
120
  required_rubygems_version: !ruby/object:Gem::Requirement
119
121
  none: false
120
122
  requirements:
@@ -123,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
125
  version: '0'
124
126
  requirements: []
125
127
  rubyforge_project:
126
- rubygems_version: 1.8.6
128
+ rubygems_version: 1.6.2
127
129
  signing_key:
128
130
  specification_version: 3
129
131
  summary: Rails gem that interfaces with the WePay API