Class: Unit::Resource::StatementResource
- Inherits:
-
BaseResource
- Object
- BaseResource
- Unit::Resource::StatementResource
- Defined in:
- lib/unit/api_resources/statement_resource.rb
Class Method Summary collapse
-
.get_bank_verification(request) ⇒ UnitResponse, UnitError
Get bank verification by calling Unit’s API.
-
.get_html_by_id(request) ⇒ UnitResponse, UnitError
Get a html statement by id by calling Unit’s API.
-
.get_pdf_by_id(request) ⇒ UnitResponse, UnitError
Get a pdf statement by id by calling Unit’s API.
-
.list(params = nil) ⇒ UnitResponse, UnitError
Get statements by calling Unit’s API.
Methods inherited from BaseResource
file_response_handler, response_handler
Class Method Details
.get_bank_verification(request) ⇒ UnitResponse, UnitError
Get bank verification by calling Unit’s API
39 40 41 42 |
# File 'lib/unit/api_resources/statement_resource.rb', line 39 def get_bank_verification(request) response = HttpHelper.get("#{api_url}/statements/#{request.account_id}/bank/pdf", params: request&.to_hash, headers: headers) file_response_handler(response) end |
.get_html_by_id(request) ⇒ UnitResponse, UnitError
Get a html statement by id by calling Unit’s API
23 24 25 26 |
# File 'lib/unit/api_resources/statement_resource.rb', line 23 def get_html_by_id(request) response = HttpHelper.get("#{api_url}/statements/#{request.statement_id}/html", params: request.to_hash, headers: headers) file_response_handler(response) end |
.get_pdf_by_id(request) ⇒ UnitResponse, UnitError
Get a pdf statement by id by calling Unit’s API
31 32 33 34 |
# File 'lib/unit/api_resources/statement_resource.rb', line 31 def get_pdf_by_id(request) response = HttpHelper.get("#{api_url}/statements/#{request.statement_id}/pdf", params: request.to_hash, headers: headers) file_response_handler(response) end |
.list(params = nil) ⇒ UnitResponse, UnitError
Get statements by calling Unit’s API
15 16 17 18 |
# File 'lib/unit/api_resources/statement_resource.rb', line 15 def list(params = nil) response = HttpHelper.get("#{api_url}/statements", params: params&.to_hash, headers: headers) response_handler(response) end |