Class: Plaid::InstitutionsApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/plaid/apis/institutions_api.rb

Overview

InstitutionsApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

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

Constructor Details

This class inherits a constructor from Plaid::BaseApi

Instance Method Details

#institutions_get(body) ⇒ ApiResponse

Returns a JSON response containing details on all financial institutions currently supported by Plaid. Because Plaid supports thousands of institutions, results are paginated. If there is no overlap between an institution’s enabled products and a client’s enabled products, then the institution will be filtered out from the response. As a result, the number of institutions returned may not match the count specified in the call. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/plaid/apis/institutions_api.rb', line 45

def institutions_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/institutions/get',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('PLAID-CLIENT-ID', 'PLAID-SECRET', 'Plaid-Version')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InstitutionsGetResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#institutions_get_by_id(body) ⇒ ApiResponse

Returns a JSON response containing details on a specified financial institution currently supported by Plaid. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/plaid/apis/institutions_api.rb', line 14

def institutions_get_by_id(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/institutions/get_by_id',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('PLAID-CLIENT-ID', 'PLAID-SECRET', 'Plaid-Version')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InstitutionsGetByIdResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end

#institutions_search(body) ⇒ ApiResponse

Returns a JSON response containing details for institutions that match the query parameters, up to a maximum of ten institutions per query. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/plaid/apis/institutions_api.rb', line 71

def institutions_search(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/institutions/search',
                                 Server::DEFAULT)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(And.new('PLAID-CLIENT-ID', 'PLAID-SECRET', 'Plaid-Version')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(InstitutionsSearchResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response',
                             ErrorErrorException))
    .execute
end