omniauth-stripe-platform 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +24 -21
- data/lib/omniauth-stripe-platform/version.rb +1 -1
- data/lib/omniauth/strategies/stripe_platform.rb +0 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -29,14 +29,25 @@ Here's a quick example, adding the middleware to a Rails app in
|
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
32
|
-
provider :stripe_platform, ENV['
|
32
|
+
provider :stripe_platform, ENV['STRIPE_PLATFORM_CLIENT_ID'], ENV['STRIPE_SECRET']
|
33
33
|
end
|
34
34
|
```
|
35
35
|
|
36
|
-
Your `
|
36
|
+
Your `STRIPE_PLATFORM_CLIENT_ID` is application-specific and your `STRIPE_SECRET` is account-specific and may also be known as your Stripe API key or Stripe Private key.
|
37
37
|
|
38
38
|
Then you can hit `/auth/stripe_platform`
|
39
39
|
|
40
|
+
### Ruby on Rails apps with Devise
|
41
|
+
|
42
|
+
After setting up Devise to use OmniAuth, you only need to add the following line of code to handle the OAuth2 part of Stripe Platform.
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
# Put this in config/initializers/devise.rb with the rest of your Devise configuration
|
46
|
+
config.omniauth :stripe_platform, ENV['STRIPE_PLATFORM_CLIENT_ID'], ENV['STRIPE_SECRET_KEY'], {:scope => 'read_write'} # or :scope => 'read_only'
|
47
|
+
```
|
48
|
+
|
49
|
+
Now your done!
|
50
|
+
|
40
51
|
## Auth Hash
|
41
52
|
|
42
53
|
Here is an example of the Auth Hash you get back from calling `request.env['omniauth.auth']`:
|
@@ -45,30 +56,22 @@ Here is an example of the Auth Hash you get back from calling `request.env['omni
|
|
45
56
|
{
|
46
57
|
"provider"=>"stripe_platform",
|
47
58
|
"uid"=>"<STRIPE_USER_ID>",
|
48
|
-
"info"=>
|
49
|
-
|
50
|
-
"scope"=>"read_only", # or "read_write"
|
59
|
+
"info"=> {
|
60
|
+
"scope"=>"read_write", # or "read_only"
|
51
61
|
"livemode"=>false,
|
52
|
-
"
|
53
|
-
"expires_in"=>nil,
|
54
|
-
"stripe_publishable_key"=>"<STRIPE_PUBLISHABLE_KEY>"
|
62
|
+
"stripe_publishable_key"=>"<STRIPE_PUBLISHABLE_KEY>",
|
55
63
|
},
|
56
|
-
"credentials"=>
|
57
|
-
|
58
|
-
"
|
59
|
-
"refresh_token"=>"REFRESH_TOKEN",
|
60
|
-
"expires_at"=>1341608127,
|
61
|
-
"expires"=>true
|
64
|
+
"credentials"=> {
|
65
|
+
"token"=>"<STRIPE_ACCESS_TOKEN>",
|
66
|
+
"expires"=>false
|
62
67
|
},
|
63
|
-
"extra"=>
|
64
|
-
|
65
|
-
"raw_info"=>
|
66
|
-
{
|
67
|
-
"scope"=>"read_only",
|
68
|
-
"livemode"=>false,
|
68
|
+
"extra"=> {
|
69
|
+
"raw_info"=> {
|
69
70
|
"token_type"=>"bearer",
|
70
71
|
"stripe_user_id"=>"<STRIPE_USER_ID>",
|
71
|
-
"
|
72
|
+
"scope"=>"read_only",
|
73
|
+
"stripe_publishable_key"=>"<STRIPE_PUBLISHABLE_KEY>",
|
74
|
+
"livemode"=>false
|
72
75
|
}
|
73
76
|
}
|
74
77
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-stripe-platform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash:
|
77
|
+
hash: 1659175714907904771
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
segments:
|
85
85
|
- 0
|
86
|
-
hash:
|
86
|
+
hash: 1659175714907904771
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
89
|
rubygems_version: 1.8.24
|