Class: NewStoreApi::FiscalProvidersController

Inherits:
BaseController show all
Defined in:
lib/new_store_api/controllers/fiscal_providers_controller.rb

Overview

FiscalProvidersController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent

Constructor Details

This class inherits a constructor from NewStoreApi::BaseController

Instance Method Details

#list_fiscal_countriesFiscalCountriesDto

Get supported fiscal countries list.

Returns:



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/new_store_api/controllers/fiscal_providers_controller.rb', line 11

def list_fiscal_countries
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/providers/fiscal-countries',
                                 Server::API)
               .header_param(new_parameter('application/json', key: 'accept')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(FiscalCountriesDto.method(:from_hash)))
    .execute
end