class PayPal::SDK::Core::OpenIDConnect::DataTypes::Tokeninfo
Constants
- PATH
Public Class Methods
create_from_refresh_token(options, http_header = {})
click to toggle source
# File lib/paypal-sdk/core/openid_connect.rb, line 67 def create_from_refresh_token(options, http_header = {}) options = { :refresh_token => options } if options.is_a? String options = options.merge( :grant_type => "refresh_token" ) Tokeninfo.new(api.post(PATH, with_credentials(options), http_header)) end
Also aliased as: refresh
load_members()
click to toggle source
# File lib/paypal-sdk/core/openid_connect/data_types.rb, line 47 def self.load_members object_of :scope, String object_of :access_token, String object_of :refresh_token, String object_of :token_type, String object_of :id_token, String object_of :expires_in, Integer end
with_credentials(options = {})
click to toggle source
# File lib/paypal-sdk/core/openid_connect.rb, line 74 def with_credentials(options = {}) options = options.dup [ :client_id, :client_secret ].each do |key| options[key] = self.send(key) unless options[key] or options[key.to_s] end options end
Public Instance Methods
logout_url(options = {})
click to toggle source
# File lib/paypal-sdk/core/openid_connect.rb, line 97 def logout_url(options = {}) OpenIDConnect.logout_url({ :id_token => self.id_token }.merge(options)) end
refresh(options = {})
click to toggle source
# File lib/paypal-sdk/core/openid_connect.rb, line 87 def refresh(options = {}) tokeninfo = self.class.refresh({ :refresh_token => self.refresh_token}.merge(options)) self.merge!(tokeninfo.to_hash) end
userinfo(options = {})
click to toggle source
# File lib/paypal-sdk/core/openid_connect.rb, line 93 def userinfo(options = {}) Userinfo.get({ :access_token => self.access_token }.merge(options)) end