Class: SolidusTiny::Account
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- SolidusTiny::Account
- Defined in:
- app/models/solidus_tiny/account.rb
Instance Method Summary collapse
Instance Method Details
#authorization_url ⇒ Object
18 19 20 |
# File 'app/models/solidus_tiny/account.rb', line 18 def "https://accounts.tiny.com.br/realms/tiny/protocol/openid-connect/auth?client_id=#{client_id}&redirect_uri=#{redirect_url}&response_type=code&state=#{state}" end |
#authorize(code:) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/models/solidus_tiny/account.rb', line 8 def (code:) client = ::SolidusTiny::TinyClient.for_account(self) client.(code: code, redirect_url: redirect_url) update( refresh_token: client.get_refresh_token, access_token: client.access_token, token_expires_in: client.token_expires_at ) end |