Skip to content

Instantly share code, notes, and snippets.

@coderforhire
Created May 31, 2012 00:45
Show Gist options
  • Save coderforhire/2839918 to your computer and use it in GitHub Desktop.
Save coderforhire/2839918 to your computer and use it in GitHub Desktop.
require 'multi_json'
module OmniAuth
module Strategies
class Stripedotcom < OAuth2
def initialize(app, client_id = nil, client_secret = nil, options = {}, &block )
client_options = {
:site => " https://manage.stripe.com/oauth/authorize",
:authorize_path => "/oauth/authorize",
:access_token_path => "/oauth/token"
}
super(app, :stripedotcom, client_id, client_secret, client_options, &block)
end
end
end
end
def request_phase
options[:response_type] ||= 'code'
super
end
def callback_phase
options[:grant_type] ||= 'authorization_code'
super
end
def auth_hash
OmniAuth::Utils.deep_merge(super, {
'instance_url' => @access_token['instance_url']
})
end
~
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment