Class: ThePlaidApi::SignalEvaluateRequest

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/signal_evaluate_request.rb

Overview

SignalEvaluateRequest defines the request schema for ‘/signal/evaluate`

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(access_token:, account_id:, client_transaction_id:, amount:, client_id: SKIP, secret: SKIP, user_present: SKIP, client_user_id: SKIP, is_recurring: SKIP, default_payment_method: SKIP, user: SKIP, device: SKIP, risk_profile_key: SKIP, ruleset_key: SKIP, additional_properties: nil) ⇒ SignalEvaluateRequest

Returns a new instance of SignalEvaluateRequest.



166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 166

def initialize(access_token:, account_id:, client_transaction_id:, amount:,
               client_id: SKIP, secret: SKIP, user_present: SKIP,
               client_user_id: SKIP, is_recurring: SKIP,
               default_payment_method: SKIP, user: SKIP, device: SKIP,
               risk_profile_key: SKIP, ruleset_key: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @client_id = client_id unless client_id == SKIP
  @secret = secret unless secret == SKIP
  @access_token = access_token
  @account_id = 
  @client_transaction_id = client_transaction_id
  @amount = amount
  @user_present = user_present unless user_present == SKIP
  @client_user_id = client_user_id unless client_user_id == SKIP
  @is_recurring = is_recurring unless is_recurring == SKIP
  @default_payment_method = default_payment_method unless default_payment_method == SKIP
  @user = user unless user == SKIP
  @device = device unless device == SKIP
  @risk_profile_key = risk_profile_key unless risk_profile_key == SKIP
  @ruleset_key = ruleset_key unless ruleset_key == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#access_tokenString

The access token associated with the Item data is being requested for.

Returns:

  • (String)


25
26
27
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 25

def access_token
  @access_token
end

#account_idString

The Plaid ‘account_id` of the account that is the funding source for the proposed transaction. The `account_id` is returned in the `/accounts/get` endpoint as well as the [`onSuccess`](plaid.com/docs/link/ios/#link-ios-onsuccess-linkSucc ess-metadata-accounts-id) callback metadata. This will return an [`INVALID_ACCOUNT_ID`](plaid.com/docs/errors/invalid-input/#invali d_account_id) error if the account has been removed at the bank or if the `account_id` is no longer valid.

Returns:

  • (String)


37
38
39
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 37

def 
  @account_id
end

#amountFloat

The transaction amount, in USD (e.g. ‘102.05`)

Returns:

  • (Float)


48
49
50
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 48

def amount
  @amount
end

#client_idString

Your Plaid API ‘client_id`. The `client_id` is required and may be provided either in the `PLAID-CLIENT-ID` header or as part of a request body.

Returns:

  • (String)


16
17
18
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 16

def client_id
  @client_id
end

#client_transaction_idString

The unique ID that you would like to use to refer to this evaluation attempt - for example, a payment attempt ID. You will use this later to debug this evaluation, and/or report an ACH return, etc. The max length for this field is 36 characters.

Returns:

  • (String)


44
45
46
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 44

def client_transaction_id
  @client_transaction_id
end

#client_user_idString

A unique ID that identifies the end user in your system. This ID is used to correlate requests by a user with multiple Items. Personally identifiable information, such as an email address or phone number, should not be used in the ‘client_user_id`.

Returns:

  • (String)


65
66
67
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 65

def client_user_id
  @client_user_id
end

#default_payment_methodString

The default ACH payment method to complete the transaction. When using a Balance-only ruleset, this field is ignored. ‘SAME_DAY_ACH`: Same Day ACH by Nacha. The debit transaction is processed and settled on the same day. `STANDARD_ACH`: Standard ACH by Nacha. `MULTIPLE_PAYMENT_METHODS`: If there is no default debit rail or there are multiple payment methods. Possible values: `SAME_DAY_ACH`, `STANDARD_ACH`, `MULTIPLE_PAYMENT_METHODS`

Returns:

  • (String)


83
84
85
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 83

def default_payment_method
  @default_payment_method
end

#deviceSignalEvaluateDevice

Details about the end user’s device. These fields are optional, but strongly recommended to increase the accuracy of results when using Signal Transaction Scores. When using a Balance-only Ruleset, these fields are ignored if the Signal Addendum has been signed; if it has not been signed, using these fields will result in an error.



100
101
102
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 100

def device
  @device
end

#is_recurringTrueClass | FalseClass

Use ‘true` if the ACH transaction is a part of recurring schedule (for example, a monthly repayment); `false` otherwise. When using a Balance-only ruleset, this field is ignored.

Returns:

  • (TrueClass | FalseClass)


71
72
73
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 71

def is_recurring
  @is_recurring
end

#risk_profile_keyString

Specifying ‘risk_profile_key` is deprecated. Please provide `ruleset` instead.

Returns:

  • (String)


105
106
107
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 105

def risk_profile_key
  @risk_profile_key
end

#ruleset_keyString

The key of the ruleset to use for evaluating this transaction. You can create a ruleset using the Plaid Dashboard, under [Signal->Rules](dashboard.plaid.com/signal/risk-profiles). If not provided, for all new customers as of October 15, 2025, the ‘default` ruleset will be used. For existing Signal Transaction Scores customers as of October 15, 2025, by default, no ruleset will be used if the `ruleset_key` is not provided. For more information, or to opt out of using rulesets, see [Signal Rules](plaid.com/docs/signal/signal-rules/).

Returns:

  • (String)


117
118
119
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 117

def ruleset_key
  @ruleset_key
end

#secretString

Your Plaid API ‘secret`. The `secret` is required and may be provided either in the `PLAID-SECRET` header or as part of a request body.

Returns:

  • (String)


21
22
23
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 21

def secret
  @secret
end

#userSignalUser

Details about the end user initiating the transaction (i.e., the account holder). These fields are optional, but strongly recommended to increase the accuracy of results when using Signal Transaction Scores. When using a Balance-only ruleset, if the Signal Addendum has been signed, these fields are ignored; if the Addendum has not been signed, using these fields will result in an error.

Returns:



92
93
94
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 92

def user
  @user
end

#user_presentTrueClass | FalseClass

‘true` if the end user is present while initiating the ACH transfer and the endpoint is being called; `false` otherwise (for example, when the ACH transfer is scheduled and the end user is not present, or you call this endpoint after the ACH transfer but before submitting the Nacha file for ACH processing). When using a Balance-only ruleset, this field is ignored. This field is not currently used as part of Signal Transaction Score evaluations, but may be used in the future.

Returns:

  • (TrueClass | FalseClass)


58
59
60
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 58

def user_present
  @user_present
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 193

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  access_token = hash.key?('access_token') ? hash['access_token'] : nil
   = hash.key?('account_id') ? hash['account_id'] : nil
  client_transaction_id =
    hash.key?('client_transaction_id') ? hash['client_transaction_id'] : nil
  amount = hash.key?('amount') ? hash['amount'] : nil
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  user_present = hash.key?('user_present') ? hash['user_present'] : SKIP
  client_user_id =
    hash.key?('client_user_id') ? hash['client_user_id'] : SKIP
  is_recurring = hash.key?('is_recurring') ? hash['is_recurring'] : SKIP
  default_payment_method =
    hash.key?('default_payment_method') ? hash['default_payment_method'] : SKIP
  user = SignalUser.from_hash(hash['user']) if hash['user']
  device = SignalEvaluateDevice.from_hash(hash['device']) if hash['device']
  risk_profile_key =
    hash.key?('risk_profile_key') ? hash['risk_profile_key'] : SKIP
  ruleset_key = hash.key?('ruleset_key') ? hash['ruleset_key'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  SignalEvaluateRequest.new(access_token: access_token,
                            account_id: ,
                            client_transaction_id: client_transaction_id,
                            amount: amount,
                            client_id: client_id,
                            secret: secret,
                            user_present: user_present,
                            client_user_id: client_user_id,
                            is_recurring: is_recurring,
                            default_payment_method: default_payment_method,
                            user: user,
                            device: device,
                            risk_profile_key: risk_profile_key,
                            ruleset_key: ruleset_key,
                            additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 120

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['access_token'] = 'access_token'
  @_hash['account_id'] = 'account_id'
  @_hash['client_transaction_id'] = 'client_transaction_id'
  @_hash['amount'] = 'amount'
  @_hash['user_present'] = 'user_present'
  @_hash['client_user_id'] = 'client_user_id'
  @_hash['is_recurring'] = 'is_recurring'
  @_hash['default_payment_method'] = 'default_payment_method'
  @_hash['user'] = 'user'
  @_hash['device'] = 'device'
  @_hash['risk_profile_key'] = 'risk_profile_key'
  @_hash['ruleset_key'] = 'ruleset_key'
  @_hash
end

.nullablesObject

An array for nullable fields



156
157
158
159
160
161
162
163
164
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 156

def self.nullables
  %w[
    user_present
    is_recurring
    default_payment_method
    risk_profile_key
    ruleset_key
  ]
end

.optionalsObject

An array for optional fields



140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 140

def self.optionals
  %w[
    client_id
    secret
    user_present
    client_user_id
    is_recurring
    default_payment_method
    user
    device
    risk_profile_key
    ruleset_key
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



254
255
256
257
258
259
260
261
262
263
264
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 254

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect}, access_token:"\
  " #{@access_token.inspect}, account_id: #{@account_id.inspect}, client_transaction_id:"\
  " #{@client_transaction_id.inspect}, amount: #{@amount.inspect}, user_present:"\
  " #{@user_present.inspect}, client_user_id: #{@client_user_id.inspect}, is_recurring:"\
  " #{@is_recurring.inspect}, default_payment_method: #{@default_payment_method.inspect},"\
  " user: #{@user.inspect}, device: #{@device.inspect}, risk_profile_key:"\
  " #{@risk_profile_key.inspect}, ruleset_key: #{@ruleset_key.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



242
243
244
245
246
247
248
249
250
251
# File 'lib/the_plaid_api/models/signal_evaluate_request.rb', line 242

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, access_token:"\
  " #{@access_token}, account_id: #{@account_id}, client_transaction_id:"\
  " #{@client_transaction_id}, amount: #{@amount}, user_present: #{@user_present},"\
  " client_user_id: #{@client_user_id}, is_recurring: #{@is_recurring},"\
  " default_payment_method: #{@default_payment_method}, user: #{@user}, device: #{@device},"\
  " risk_profile_key: #{@risk_profile_key}, ruleset_key: #{@ruleset_key},"\
  " additional_properties: #{@additional_properties}>"
end