Class: Plaid::DepositSwitchApi

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

Overview

DepositSwitchApi

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

#deposit_switch_alt_create(body) ⇒ ApiResponse

This endpoint provides an alternative to ‘/deposit_switch/create` for customers who have not yet fully integrated with Plaid Exchange. Like `/deposit_switch/create`, it creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/plaid/apis/deposit_switch_api.rb', line 41

def deposit_switch_alt_create(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/deposit_switch/alt/create',
                                 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(DepositSwitchAltCreateResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end

#deposit_switch_create(body) ⇒ ApiResponse

This endpoint creates a deposit switch entity that will be persisted throughout the lifecycle of the switch. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/plaid/apis/deposit_switch_api.rb', line 64

def deposit_switch_create(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/deposit_switch/create',
                                 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(DepositSwitchCreateResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end

#deposit_switch_get(body) ⇒ ApiResponse

This endpoint returns information related to how the user has configured their payroll allocation and the state of the switch. You can use this information to build logic related to the user’s direct deposit allocation preferences. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



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

def deposit_switch_get(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/deposit_switch/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(DepositSwitchGetResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end

#deposit_switch_token_create(body) ⇒ ApiResponse

In order for the end user to take action, you will need to create a public token representing the deposit switch. This token is used to initialize Link. It can be used one time and expires after 30 minutes. type description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/plaid/apis/deposit_switch_api.rb', line 88

def deposit_switch_token_create(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/deposit_switch/token/create',
                                 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(DepositSwitchTokenCreateResponse.method(:from_hash))
                .is_api_response(true))
    .execute
end