Class: ThePlaidApi::NumbersAch

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

Overview

Identifying information for transferring money to or from a US account via ACH or wire transfer.

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(account_id:, account:, routing:, wire_routing:, is_tokenized_account_number: SKIP, can_transfer_in: SKIP, can_transfer_out: SKIP, additional_properties: nil) ⇒ NumbersAch

Returns a new instance of NumbersAch.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 88

def initialize(account_id:, account:, routing:, wire_routing:,
               is_tokenized_account_number: SKIP, can_transfer_in: SKIP,
               can_transfer_out: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_id = 
  @account = 
  unless  == SKIP
    @is_tokenized_account_number =
      
  end
  @routing = routing
  @wire_routing = wire_routing
  @can_transfer_in = can_transfer_in unless can_transfer_in == SKIP
  @can_transfer_out = can_transfer_out unless can_transfer_out == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountString

The ACH account number for the account. At certain institutions, including Chase, PNC, and (coming May 2025) US Bank, you will receive “tokenized” routing and account numbers, which are not the user’s actual account and routing numbers. For important details on how this may impact your integration and on how to avoid fraud, user confusion, and ACH returns, see [Tokenized account numbers](plaid.com/docs/auth/#tokenized-account-numbers).

Returns:

  • (String)


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

def 
  @account
end

#account_idString

The Plaid account ID associated with the account numbers

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 15

def 
  @account_id
end

#can_transfer_inTrueClass | FalseClass

Whether the account supports ACH transfers into the account

Returns:

  • (TrueClass | FalseClass)


51
52
53
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 51

def can_transfer_in
  @can_transfer_in
end

#can_transfer_outTrueClass | FalseClass

Whether the account supports ACH transfers out of the account

Returns:

  • (TrueClass | FalseClass)


55
56
57
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 55

def can_transfer_out
  @can_transfer_out
end

#is_tokenized_account_numberTrueClass | FalseClass

Indicates whether the account number is tokenized by the institution. For important details on how tokenized account numbers may impact your integration, see [Tokenized account numbers](plaid.com/docs/auth/#tokenized-account-numbers).

Returns:

  • (TrueClass | FalseClass)


32
33
34
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 32

def 
  @is_tokenized_account_number
end

#routingString

The ACH routing number for the account. This may be a tokenized routing number. For more information, see [Tokenized account numbers](plaid.com/docs/auth/#tokenized-account-numbers).

Returns:

  • (String)


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

def routing
  @routing
end

#wire_routingString

The wire transfer routing number for the account. This field is only populated if the institution is known to use a separate wire transfer routing number. Many institutions do not have a separate wire routing number and use the ACH routing number for wires instead. It is recommended to have the end user manually confirm their wire routing number before sending any wires to their account, especially if this field is ‘null`.

Returns:

  • (String)


47
48
49
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 47

def wire_routing
  @wire_routing
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 108

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('account_id') ? hash['account_id'] : nil
   = hash.key?('account') ? hash['account'] : nil
  routing = hash.key?('routing') ? hash['routing'] : nil
  wire_routing = hash.key?('wire_routing') ? hash['wire_routing'] : nil
   =
    hash.key?('is_tokenized_account_number') ? hash['is_tokenized_account_number'] : SKIP
  can_transfer_in =
    hash.key?('can_transfer_in') ? hash['can_transfer_in'] : SKIP
  can_transfer_out =
    hash.key?('can_transfer_out') ? hash['can_transfer_out'] : 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.
  NumbersAch.new(account_id: ,
                 account: ,
                 routing: routing,
                 wire_routing: wire_routing,
                 is_tokenized_account_number: ,
                 can_transfer_in: can_transfer_in,
                 can_transfer_out: can_transfer_out,
                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



58
59
60
61
62
63
64
65
66
67
68
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 58

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_id'] = 'account_id'
  @_hash['account'] = 'account'
  @_hash['is_tokenized_account_number'] = 'is_tokenized_account_number'
  @_hash['routing'] = 'routing'
  @_hash['wire_routing'] = 'wire_routing'
  @_hash['can_transfer_in'] = 'can_transfer_in'
  @_hash['can_transfer_out'] = 'can_transfer_out'
  @_hash
end

.nullablesObject

An array for nullable fields



80
81
82
83
84
85
86
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 80

def self.nullables
  %w[
    wire_routing
    can_transfer_in
    can_transfer_out
  ]
end

.optionalsObject

An array for optional fields



71
72
73
74
75
76
77
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 71

def self.optionals
  %w[
    is_tokenized_account_number
    can_transfer_in
    can_transfer_out
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



151
152
153
154
155
156
157
158
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 151

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id.inspect}, account: #{@account.inspect},"\
  " is_tokenized_account_number: #{@is_tokenized_account_number.inspect}, routing:"\
  " #{@routing.inspect}, wire_routing: #{@wire_routing.inspect}, can_transfer_in:"\
  " #{@can_transfer_in.inspect}, can_transfer_out: #{@can_transfer_out.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



142
143
144
145
146
147
148
# File 'lib/the_plaid_api/models/numbers_ach.rb', line 142

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_id: #{@account_id}, account: #{@account},"\
  " is_tokenized_account_number: #{@is_tokenized_account_number}, routing: #{@routing},"\
  " wire_routing: #{@wire_routing}, can_transfer_in: #{@can_transfer_in}, can_transfer_out:"\
  " #{@can_transfer_out}, additional_properties: #{@additional_properties}>"
end