Class: ThePlaidApi::TransferFailure
- Defined in:
- lib/the_plaid_api/models/transfer_failure.rb
Overview
The failure reason if the event type for a transfer is ‘“failed”` or `“returned”`. Null value otherwise.
Instance Attribute Summary collapse
-
#ach_return_code ⇒ String
The ACH return code, e.g.
-
#description ⇒ String
A human-readable description of the reason for the failure or reversal.
-
#failure_code ⇒ String
The failure code, e.g.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(failure_code: SKIP, ach_return_code: SKIP, description: SKIP, additional_properties: nil) ⇒ TransferFailure
constructor
A new instance of TransferFailure.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(failure_code: SKIP, ach_return_code: SKIP, description: SKIP, additional_properties: nil) ⇒ TransferFailure
Returns a new instance of TransferFailure.
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 59 def initialize(failure_code: SKIP, ach_return_code: SKIP, description: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @failure_code = failure_code unless failure_code == SKIP @ach_return_code = ach_return_code unless ach_return_code == SKIP @description = description unless description == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#ach_return_code ⇒ String
The ACH return code, e.g. ‘R01`. A return code will be provided if and only if the transfer status is `returned`. For a full listing of ACH return codes, see [Transfer errors](plaid.com/docs/errors/transfer/#ach-return-codes).
27 28 29 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 27 def ach_return_code @ach_return_code end |
#description ⇒ String
A human-readable description of the reason for the failure or reversal.
31 32 33 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 31 def description @description end |
#failure_code ⇒ String
The failure code, e.g. ‘R01`. A failure code will be provided if and only if the transfer status is `returned`. See [ACH return codes](plaid.com/docs/errors/transfer/#ach-return-codes) for a full listing of ACH return codes and [RTP/RfP error codes](plaid.com/docs/errors/transfer/#rtprfp-error-codes) for RTP error codes.
20 21 22 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 20 def failure_code @failure_code end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 71 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. failure_code = hash.key?('failure_code') ? hash['failure_code'] : SKIP ach_return_code = hash.key?('ach_return_code') ? hash['ach_return_code'] : SKIP description = hash.key?('description') ? hash['description'] : 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. TransferFailure.new(failure_code: failure_code, ach_return_code: ach_return_code, description: description, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['failure_code'] = 'failure_code' @_hash['ach_return_code'] = 'ach_return_code' @_hash['description'] = 'description' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 55 56 57 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 52 def self.nullables %w[ failure_code ach_return_code ] end |
.optionals ⇒ Object
An array for optional fields
43 44 45 46 47 48 49 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 43 def self.optionals %w[ failure_code ach_return_code description ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
102 103 104 105 106 107 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 102 def inspect class_name = self.class.name.split('::').last "<#{class_name} failure_code: #{@failure_code.inspect}, ach_return_code:"\ " #{@ach_return_code.inspect}, description: #{@description.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
95 96 97 98 99 |
# File 'lib/the_plaid_api/models/transfer_failure.rb', line 95 def to_s class_name = self.class.name.split('::').last "<#{class_name} failure_code: #{@failure_code}, ach_return_code: #{@ach_return_code},"\ " description: #{@description}, additional_properties: #{@additional_properties}>" end |