Class: Plaid::NumbersAchNullable

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/plaid/models/numbers_ach_nullable.rb

Overview

NumbersAchNullable Model.

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) ⇒ NumbersAchNullable

Returns a new instance of NumbersAchNullable.



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

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)


26
27
28
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 26

def 
  @account
end

#account_idString

The Plaid account ID associated with the account numbers

Returns:

  • (String)


14
15
16
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 14

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)


32
33
34
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 32

def routing
  @routing
end

#wire_routingString

The wire transfer routing number for the account, if available

Returns:

  • (String)


36
37
38
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 36

def wire_routing
  @wire_routing
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

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



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

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



54
55
56
57
58
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 54

def self.nullables
  %w[
    wire_routing
  ]
end

.optionalsObject

An array for optional fields



49
50
51
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 49

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



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

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.



98
99
100
101
102
# File 'lib/plaid/models/numbers_ach_nullable.rb', line 98

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