Class: OmniAuth::Strategies::WalletOne
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::WalletOne
- Defined in:
- lib/omniauth/strategies/walletone.rb
Instance Method Summary collapse
- #credentials ⇒ Object
- #raw_info ⇒ Object
- #set_json_format ⇒ Object
- #set_xml_format ⇒ Object
- #setup_phase ⇒ Object
Instance Method Details
#credentials ⇒ Object
53 54 55 56 57 |
# File 'lib/omniauth/strategies/walletone.rb', line 53 def credentials creds = super creds['expires'] = raw_info['ExpireDate'] creds end |
#raw_info ⇒ Object
59 60 61 |
# File 'lib/omniauth/strategies/walletone.rb', line 59 def raw_info @raw_info ||= access_token.get('/OpenApi/sessions/current', headers: [:headers], parse: [:format]).parsed end |
#set_json_format ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/omniauth/strategies/walletone.rb', line 24 def set_json_format [:headers] = { 'Accept' => 'application/vnd.wallet.openapi.v1+json', 'Content-Type' => 'application/vnd.wallet.openapi.v1+json' } [:format] = :json end |
#set_xml_format ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/omniauth/strategies/walletone.rb', line 32 def set_xml_format [:headers] = { 'Accept' => 'application/vnd.wallet.openapi.v1+xml', 'Content-Type' => 'application/vnd.wallet.openapi.v1+xml' } [:format] = :xml end |
#setup_phase ⇒ Object
19 20 21 22 |
# File 'lib/omniauth/strategies/walletone.rb', line 19 def setup_phase super [:format].try(:to_sym) == :xml ? set_xml_format : set_json_format end |