Class: ThePlaidApi::SignalDecisionReportRequest

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

Overview

SignalDecisionReportRequest defines the request schema for ‘/signal/decision/report`

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(client_transaction_id:, initiated:, client_id: SKIP, secret: SKIP, days_funds_on_hold: SKIP, decision_outcome: SKIP, payment_method: SKIP, amount_instantly_available: SKIP, submitted_at: SKIP, additional_properties: nil) ⇒ SignalDecisionReportRequest

Returns a new instance of SignalDecisionReportRequest.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 122

def initialize(client_transaction_id:, initiated:, client_id: SKIP,
               secret: SKIP, days_funds_on_hold: SKIP,
               decision_outcome: SKIP, payment_method: SKIP,
               amount_instantly_available: SKIP, submitted_at: 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
  @client_transaction_id = client_transaction_id
  @initiated = initiated
  @days_funds_on_hold = days_funds_on_hold unless days_funds_on_hold == SKIP
  @decision_outcome = decision_outcome unless decision_outcome == SKIP
  @payment_method = payment_method unless payment_method == SKIP
  unless amount_instantly_available == SKIP
    @amount_instantly_available =
      amount_instantly_available
  end
  @submitted_at =  unless  == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#amount_instantly_availableFloat

The amount (in USD) made available to your customers instantly following the debit transaction. It could be a partial amount of the requested transaction (example: 102.05).

Returns:

  • (Float)


76
77
78
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 76

def amount_instantly_available
  @amount_instantly_available
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)


18
19
20
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 18

def client_id
  @client_id
end

#client_transaction_idString

Must be the same as the ‘client_transaction_id` supplied when calling `/signal/evaluate`

Returns:

  • (String)


28
29
30
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 28

def client_transaction_id
  @client_transaction_id
end

#days_funds_on_holdInteger

The actual number of days (hold time) since the ACH debit transaction that you wait before making funds available to your customers. The holding time could affect the ACH return rate. For example, use 0 if you make funds available to your customers instantly or the same day following the debit transaction, or 1 if you make funds available the next day following the debit initialization.

Returns:

  • (Integer)


45
46
47
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 45

def days_funds_on_hold
  @days_funds_on_hold
end

#decision_outcomeSignalDecisionOutcome

The payment decision from the risk assessment. ‘APPROVE`: approve the transaction without requiring further actions from your customers. For example, use this field if you are placing a standard hold for all the approved transactions before making funds available to your customers. You should also use this field if you decide to accelerate the fund availability for your customers. `REVIEW`: the transaction requires manual review `REJECT`: reject the transaction `TAKE_OTHER_RISK_MEASURES`: for example, placing a longer hold on funds than those approved transactions or introducing customer frictions such as step-up verification/authentication `NOT_EVALUATED`: if only logging the results without using them



60
61
62
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 60

def decision_outcome
  @decision_outcome
end

#initiatedTrueClass | FalseClass

‘true` if the ACH transaction was initiated, `false` otherwise. This field must be returned as a boolean. If formatted incorrectly, this will result in an [`INVALID_FIELD`](plaid.com/docs/errors/invalid-request/#invalid_f ield) error.

Returns:

  • (TrueClass | FalseClass)


36
37
38
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 36

def initiated
  @initiated
end

#payment_methodSignalPaymentMethod

The payment method to complete the transaction after the risk assessment. It may be different from the default payment method. ‘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.

Returns:



70
71
72
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 70

def payment_method
  @payment_method
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)


23
24
25
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 23

def secret
  @secret
end

#submitted_atDateTime

The date the ACH debit was submitted to the bank for processing (in ISO 8601 format: ‘YYYY-MM-DDTHH:mm:ssZ`). This field should correspond to the attempt initiated after the `/signal/schedule` call.

Returns:

  • (DateTime)


82
83
84
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 82

def 
  @submitted_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 146

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  client_transaction_id =
    hash.key?('client_transaction_id') ? hash['client_transaction_id'] : nil
  initiated = hash.key?('initiated') ? hash['initiated'] : nil
  client_id = hash.key?('client_id') ? hash['client_id'] : SKIP
  secret = hash.key?('secret') ? hash['secret'] : SKIP
  days_funds_on_hold =
    hash.key?('days_funds_on_hold') ? hash['days_funds_on_hold'] : SKIP
  decision_outcome =
    hash.key?('decision_outcome') ? hash['decision_outcome'] : SKIP
  payment_method =
    hash.key?('payment_method') ? hash['payment_method'] : SKIP
  amount_instantly_available =
    hash.key?('amount_instantly_available') ? hash['amount_instantly_available'] : SKIP
   = if hash.key?('submitted_at')
                   (DateTimeHelper.from_rfc3339(hash['submitted_at']) if hash['submitted_at'])
                 else
                   SKIP
                 end

  # 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.
  SignalDecisionReportRequest.new(client_transaction_id: client_transaction_id,
                                  initiated: initiated,
                                  client_id: client_id,
                                  secret: secret,
                                  days_funds_on_hold: days_funds_on_hold,
                                  decision_outcome: decision_outcome,
                                  payment_method: payment_method,
                                  amount_instantly_available: amount_instantly_available,
                                  submitted_at: ,
                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 85

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['client_id'] = 'client_id'
  @_hash['secret'] = 'secret'
  @_hash['client_transaction_id'] = 'client_transaction_id'
  @_hash['initiated'] = 'initiated'
  @_hash['days_funds_on_hold'] = 'days_funds_on_hold'
  @_hash['decision_outcome'] = 'decision_outcome'
  @_hash['payment_method'] = 'payment_method'
  @_hash['amount_instantly_available'] = 'amount_instantly_available'
  @_hash['submitted_at'] = 'submitted_at'
  @_hash
end

.nullablesObject

An array for nullable fields



113
114
115
116
117
118
119
120
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 113

def self.nullables
  %w[
    days_funds_on_hold
    decision_outcome
    payment_method
    amount_instantly_available
  ]
end

.optionalsObject

An array for optional fields



100
101
102
103
104
105
106
107
108
109
110
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 100

def self.optionals
  %w[
    client_id
    secret
    days_funds_on_hold
    decision_outcome
    payment_method
    amount_instantly_available
    submitted_at
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



204
205
206
207
208
209
210
211
212
213
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 204

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id.inspect}, secret: #{@secret.inspect},"\
  " client_transaction_id: #{@client_transaction_id.inspect}, initiated:"\
  " #{@initiated.inspect}, days_funds_on_hold: #{@days_funds_on_hold.inspect},"\
  " decision_outcome: #{@decision_outcome.inspect}, payment_method:"\
  " #{@payment_method.inspect}, amount_instantly_available:"\
  " #{@amount_instantly_available.inspect}, submitted_at: #{@submitted_at.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_custom_submitted_atObject



189
190
191
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 189

def 
  DateTimeHelper.to_rfc3339()
end

#to_sObject

Provides a human-readable string representation of the object.



194
195
196
197
198
199
200
201
# File 'lib/the_plaid_api/models/signal_decision_report_request.rb', line 194

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} client_id: #{@client_id}, secret: #{@secret}, client_transaction_id:"\
  " #{@client_transaction_id}, initiated: #{@initiated}, days_funds_on_hold:"\
  " #{@days_funds_on_hold}, decision_outcome: #{@decision_outcome}, payment_method:"\
  " #{@payment_method}, amount_instantly_available: #{@amount_instantly_available},"\
  " submitted_at: #{@submitted_at}, additional_properties: #{@additional_properties}>"
end