Class: ThePlaidApi::ProcessorSignalEvaluateRequest

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

Overview

ProcessorSignalEvaluateRequest defines the request schema for ‘/processor/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(processor_token:, 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, ruleset_key: SKIP, additional_properties: nil) ⇒ ProcessorSignalEvaluateRequest

Returns a new instance of ProcessorSignalEvaluateRequest.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 143

def initialize(processor_token:, 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,
               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
  @processor_token = processor_token
  @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
  @ruleset_key = ruleset_key unless ruleset_key == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amountFloat

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

Returns:

  • (Float)


38
39
40
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 38

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)


17
18
19
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 17

def client_id
  @client_id
end

#client_transaction_idString

The unique ID that you would like to use to refer to this transaction. For your convenience mapping your internal data, you could use your internal ID/identifier for this transaction. The max length for this field is 36 characters.

Returns:

  • (String)


34
35
36
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 34

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)


53
54
55
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 53

def client_user_id
  @client_user_id
end

#default_payment_methodString

The default ACH or non-ACH payment method to complete the transaction. ‘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)


69
70
71
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 69

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.



86
87
88
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 86

def device
  @device
end

#is_recurringTrueClass | FalseClass

true if the ACH transaction is a recurring transaction; false otherwise

Returns:

  • (TrueClass | FalseClass)


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

def is_recurring
  @is_recurring
end

#processor_tokenString

The processor token obtained from the Plaid integration partner. Processor tokens are in the format: ‘processor-<environment>-<identifier>`

Returns:

  • (String)


27
28
29
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 27

def processor_token
  @processor_token
end

#ruleset_keyString

The key of the ruleset to use for this transaction. You can configure a ruleset using the Plaid Dashboard, under [Signal->Rules](dashboard.plaid.com/signal/risk-profiles). If not provided, for customers who began using Signal Transaction Scores before October 15, 2025, by default, no ruleset will be used; for customers who began using Signal Transaction Scores after that date, or for Balance customers, the ‘default` ruleset will be used. For more details, or to opt out of using a ruleset, see [Signal Rules](plaid.com/docs/signal/signal-rules/).

Returns:

  • (String)


98
99
100
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 98

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)


22
23
24
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 22

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:



78
79
80
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 78

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).

Returns:

  • (TrueClass | FalseClass)


46
47
48
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 46

def user_present
  @user_present
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 167

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  processor_token =
    hash.key?('processor_token') ? hash['processor_token'] : 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']
  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.
  ProcessorSignalEvaluateRequest.new(processor_token: processor_token,
                                     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,
                                     ruleset_key: ruleset_key,
                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 101

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['processor_token'] = 'processor_token'
  @_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['ruleset_key'] = 'ruleset_key'
  @_hash
end

.nullablesObject

An array for nullable fields



134
135
136
137
138
139
140
141
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 134

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

.optionalsObject

An array for optional fields



119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 119

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

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



223
224
225
226
227
228
229
230
231
232
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 223

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect},"\
  " processor_token: #{@processor_token.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}, ruleset_key: #{@ruleset_key.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



212
213
214
215
216
217
218
219
220
# File 'lib/the_plaid_api/models/processor_signal_evaluate_request.rb', line 212

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, processor_token:"\
  " #{@processor_token}, 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}, ruleset_key: #{@ruleset_key}, additional_properties:"\
  " #{@additional_properties}>"
end