Class: Belvo::WidgetToken

Inherits:
Resource show all
Defined in:
lib/belvo/resources.rb

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

#endpoint

Instance Method Summary collapse

Methods inherited from Resource

#clean, #delete, #detail, #list, #resume

Constructor Details

#initialize(session) ⇒ WidgetToken

Returns a new instance of WidgetToken.



391
392
393
394
# File 'lib/belvo/resources.rb', line 391

def initialize(session)
  super(session)
  @endpoint = 'token/'
end

Instance Method Details

#createObject



396
397
398
399
400
401
402
403
# File 'lib/belvo/resources.rb', line 396

def create
  body = {
    id: @session.key_id,
    password: @session.key_password,
    scopes: 'read_institutions,write_links,read_links,delete_links'
  }
  @session.post(@endpoint, body)
end