Class: Belvo::WidgetToken
Overview
A WidgetToken is a limited scope with short time to live token, that contains access and refresh keys to allow you embedding Belvo’s Connect Widget into your app.
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
- #create(options: nil) ⇒ Object
-
#initialize(session) ⇒ WidgetToken
constructor
A new instance of WidgetToken.
Methods inherited from Resource
#clean, #delete, #detail, #list, #resume
Constructor Details
#initialize(session) ⇒ WidgetToken
Returns a new instance of WidgetToken.
604 605 606 607 |
# File 'lib/belvo/resources.rb', line 604 def initialize(session) super(session) @endpoint = 'api/token/' end |
Instance Method Details
#create(options: nil) ⇒ Object
609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 |
# File 'lib/belvo/resources.rb', line 609 def create(options: nil) = WidgetTokenOptions.from() link_id = .link = . .delete('link') .delete('widget') body = { id: @session.key_id, password: @session.key_password, scopes: 'read_institutions,write_links', link_id: link_id, widget: }.merge() body = clean body: body @session.post(@endpoint, body) end |