wepay-rails 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.8
1
+ 0.1.9
@@ -25,6 +25,24 @@ module WepayRails
25
25
  def gateway
26
26
  @gateway ||= Gateway.new
27
27
  end
28
+
29
+ def wepay_auth_code=(auth_code)
30
+ @wepay_auth_code = auth_code
31
+ end
32
+
33
+ def wepay_auth_code
34
+ @wepay_auth_code
35
+ end
36
+
37
+ def wepay_auth_header
38
+ {'Authorization' => "Bearer: #{wepay_auth_code}"}
39
+ end
40
+
41
+ def wepay_user
42
+ response = get "/v2/user", {:headers => wepay_auth_header}
43
+ puts response.inspect
44
+ JSON.parse(response)
45
+ end
28
46
  end
29
47
  end
30
48
  end
@@ -1,13 +1,21 @@
1
1
  module WepayRails
2
2
  module Helpers
3
3
  module ModelHelpers
4
+
5
+ # Create a column on one of your models where the wepay authorization code
6
+ # will be stored to be used for future transactions. Example:
7
+
8
+ # add_column :users, :wepay_auth_code, :string
9
+
10
+ # Then in your model, let's say the User model, you tell wepay-rails what the column name is:
11
+ #
12
+ # class User < ActiveRecord::Base
13
+ # wepayable :wepay_auth_code
14
+ # end
4
15
  def wepayable(*args)
5
16
  @params = args.last if args.last.is_a?(Hash)
6
17
  @column = args.first.to_s
7
18
 
8
- puts "*"*50
9
- puts @column
10
-
11
19
  define_method "has_#{@column}?" do
12
20
  "#{@column}.present?"
13
21
  end
data/wepay-rails.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wepay-rails}
8
- s.version = "0.1.8"
8
+ s.version = "0.1.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam Medeiros"]
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: 0.1.8
4
+ version: 0.1.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty
17
- requirement: &2151873780 !ruby/object:Gem::Requirement
17
+ requirement: &2151871020 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2151873780
25
+ version_requirements: *2151871020
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: shoulda
28
- requirement: &2151872380 !ruby/object:Gem::Requirement
28
+ requirement: &2151868900 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2151872380
36
+ version_requirements: *2151868900
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: bundler
39
- requirement: &2151870040 !ruby/object:Gem::Requirement
39
+ requirement: &2151865920 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.0.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2151870040
47
+ version_requirements: *2151865920
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: jeweler
50
- requirement: &2151867600 !ruby/object:Gem::Requirement
50
+ requirement: &2151864820 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: 1.6.4
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *2151867600
58
+ version_requirements: *2151864820
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rcov
61
- requirement: &2151865920 !ruby/object:Gem::Requirement
61
+ requirement: &2151863380 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,7 +66,7 @@ dependencies:
66
66
  version: '0'
67
67
  type: :development
68
68
  prerelease: false
69
- version_requirements: *2151865920
69
+ version_requirements: *2151863380
70
70
  description: Rails gem that interfaces with the WePay API
71
71
  email: adammede@gmail.com
72
72
  executables: []
@@ -106,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
106
106
  version: '0'
107
107
  segments:
108
108
  - 0
109
- hash: 3553672288628938028
109
+ hash: -213842945120779990
110
110
  required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  none: false
112
112
  requirements: