Class: Plaid::SignalApi

Inherits:
BaseApi show all
Defined in:
lib/plaid/apis/signal_api.rb

Overview

SignalApi

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

#signal_decision_report(body) ⇒ ApiResponse

After calling ‘/signal/evaluate`, call `/signal/decision/report` to report whether the transaction was initiated. This endpoint will return an `INVALID_REQUEST` error if called a second time with a different value for `initiated`. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/plaid/apis/signal_api.rb', line 48

def signal_decision_report(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/signal/decision/report',
                                 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(SignalDecisionReportResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response.',
                             ErrorErrorException))
    .execute
end

#signal_evaluate(body) ⇒ ApiResponse

Use ‘/signal/evaluate` to evaluate a planned ACH transaction to get a return risk assessment (such as a risk score and risk tier) and additional risk signals. In order to obtain a valid score for an ACH transaction, Plaid must have an access token for the account, and the Item must be healthy (receiving product updates) or have recently been in a healthy state. If the transaction does not meet eligibility requirements, an error will be returned corresponding to the underlying cause. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/plaid/apis/signal_api.rb', line 20

def signal_evaluate(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/signal/evaluate',
                                 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(SignalEvaluateResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response.',
                             ErrorErrorException))
    .execute
end

#signal_return_report(body) ⇒ ApiResponse

Call the ‘/signal/return/report` endpoint to report a returned transaction that was previously sent to the `/signal/evaluate` endpoint. Your feedback will be used by the model to incorporate the latest risk trend in your portfolio. description here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/plaid/apis/signal_api.rb', line 76

def signal_return_report(body)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/signal/return/report',
                                 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(SignalReturnReportResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('default',
                             'Error response.',
                             ErrorErrorException))
    .execute
end