Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created June 3, 2012 16:00
Show Gist options
  • Save coderforhire/2863990 to your computer and use it in GitHub Desktop.
Save coderforhire/2863990 to your computer and use it in GitHub Desktop.
require 'omniauth-oauth2'
require 'stripe'
module OmniAuth
module Strategies
class StripePlatform < OmniAuth::Strategies::OAuth2
DEFAULT_SCOPE = 'read_write'
option :name, "stripeplatform"
option :client_options, {
:site => 'https://manage.stripe.com',
:authorize_url => '/oauth/authorize',
:token_url => '/oauth/token'
}
option :token_params, {
:parse => :query
}
option :access_token_options, {
:header_format => "Authorization: Bearer #{:client_secret}",
:param_name => 'access_token'
}
uid{ raw_info['id'] }
info do
{
:id => raw_info['id']
}
end
extra do
{
'raw_info' => raw_info
}
end
def raw_info
end
end
end
end
OmniAuth.config.add_camelization 'stripeplatform', 'StripePlatform'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment