README.md in omniauth-stripe-connect-2.2.0 vs README.md in omniauth-stripe-connect-2.3.0
- old
+ new
@@ -33,16 +33,37 @@
end
```
Your `STRIPE_CONNECT_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.
+Edit your routes.rb file to have:
+`devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" }`
+
+And create a file called `omniauth_callbacks_controller.rb` which should have this inside:
+```ruby
+class OmniauthCallbacksController < Devise::OmniauthCallbacksController
+
+ def stripe_connect
+ # Delete the code inside of this method and write your own.
+ # The code below is to show you where to access the data.
+ raise request.env["omniauth.auth"].to_yaml
+ end
+end
+```
+
+Make sure to go to Stripe's Account Settings > Applications and set your Redirect URL to:
+`http://localhost:3003/users/auth/stripe_connect/callback`
+
+The Webhook URL will be something similar:
+`http://www.yourdomain.com/users/auth/stripe_connect/callback`
+
Then you can hit `/auth/stripe_connect`
If you hit `/auth/stripe_connect` with any query params, they will be passed along to Stripe. Read [Stripe's OAuth Reference](https://stripe.com/docs/connect/reference) for more information.
### Ruby on Rails apps with Devise
-After setting up Devise to use OmniAuth, you only need to add the following line of code to handle the OAuth2 part of Stripe Connect.
+After setting up Devise to use OmniAuth, you only need to add the following line of code to handle the OAuth2 part of Stripe Connect. Since this Devise initializer code takes care of OmniAuth, do not use a separate OmniAuth initializer.
```ruby
# Put this in config/initializers/devise.rb with the rest of your Devise configuration
config.omniauth :stripe_connect,
ENV['STRIPE_CONNECT_CLIENT_ID'],