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.
611 612 613 614 |
# File 'lib/belvo/resources.rb', line 611 def initialize(session) super(session) @endpoint = 'api/token/' end |
Instance Method Details
#create(options: nil) ⇒ Object
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 |
# File 'lib/belvo/resources.rb', line 616 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,read_links', link_id: link_id, widget: }.merge() body = clean body: body @session.post(@endpoint, body) end |