Class: Plaid::NumbersAch

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/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:, additional_properties: nil) ⇒ NumbersAch

Returns a new instance of NumbersAch.



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/plaid/models/numbers_ach.rb', line 61

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

  @account_id = 
  @account = 
  @routing = routing
  @wire_routing = wire_routing
  @additional_properties = additional_properties
end

Instance Attribute Details

#accountString

The ACH account number for the account. Note that when using OAuth with Chase Bank (‘ins_56`), Chase will issue “tokenized” routing and account numbers, which are not the user’s actual account and routing numbers. These tokenized numbers should work identically to normal account and routing numbers. The digits returned in the mask field will continue to reflect the actual account number, rather than the tokenized account number. If a user revokes their permissions to your app, the tokenized numbers will continue to work for ACH deposits, but not withdrawals.

Returns:

  • (String)


27
28
29
# File 'lib/plaid/models/numbers_ach.rb', line 27

def 
  @account
end

#account_idString

The Plaid account ID associated with the account numbers

Returns:

  • (String)


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

def 
  @account_id
end

#routingString

The ACH routing number for the account. If the institution is ‘ins_56`, this may be a tokenized routing number. For more information, see the description of the `account` field.

Returns:

  • (String)


33
34
35
# File 'lib/plaid/models/numbers_ach.rb', line 33

def routing
  @routing
end

#wire_routingString

The wire transfer routing number for the account, if available

Returns:

  • (String)


37
38
39
# File 'lib/plaid/models/numbers_ach.rb', line 37

def wire_routing
  @wire_routing
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/plaid/models/numbers_ach.rb', line 74

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

  # 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,
                 additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



40
41
42
43
44
45
46
47
# File 'lib/plaid/models/numbers_ach.rb', line 40

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

.nullablesObject

An array for nullable fields



55
56
57
58
59
# File 'lib/plaid/models/numbers_ach.rb', line 55

def self.nullables
  %w[
    wire_routing
  ]
end

.optionalsObject

An array for optional fields



50
51
52
# File 'lib/plaid/models/numbers_ach.rb', line 50

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



106
107
108
109
110
111
# File 'lib/plaid/models/numbers_ach.rb', line 106

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

#to_sObject

Provides a human-readable string representation of the object.



99
100
101
102
103
# File 'lib/plaid/models/numbers_ach.rb', line 99

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