Class: UnivapayClientSdk::DirectDebitBankAccount

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/univapay_client_sdk/models/direct_debit_bank_account.rb

Overview

A consumer bank account registered for direct debit.

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(id: SKIP, legacy_store_id: SKIP, merchant_id: SKIP, user_number: SKIP, bank_code: SKIP, bank_name: SKIP, branch_code: SKIP, bank_account_type: SKIP, bank_account_name: SKIP, bank_account_number: SKIP, registration_origin: SKIP, status: SKIP, created_on: SKIP, updated_on: SKIP, additional_properties: nil) ⇒ DirectDebitBankAccount

Returns a new instance of DirectDebitBankAccount.



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

def initialize(id: SKIP, legacy_store_id: SKIP, merchant_id: SKIP,
               user_number: SKIP, bank_code: SKIP, bank_name: SKIP,
               branch_code: SKIP, bank_account_type: SKIP,
               bank_account_name: SKIP, bank_account_number: SKIP,
               registration_origin: SKIP, status: SKIP, created_on: SKIP,
               updated_on: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @legacy_store_id = legacy_store_id unless legacy_store_id == SKIP
  @merchant_id = merchant_id unless merchant_id == SKIP
  @user_number = user_number unless user_number == SKIP
  @bank_code = bank_code unless bank_code == SKIP
  @bank_name = bank_name unless bank_name == SKIP
  @branch_code = branch_code unless branch_code == SKIP
  @bank_account_type =  unless  == SKIP
  @bank_account_name =  unless  == SKIP
  @bank_account_number =  unless  == SKIP
  @registration_origin = registration_origin unless registration_origin == SKIP
  @status = status unless status == SKIP
  @created_on = created_on unless created_on == SKIP
  @updated_on = updated_on unless updated_on == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#bank_account_nameString

Account holder name (口座名義), in half-width katakana. Full-width characters are rejected by the bank.

Returns:

  • (String)


50
51
52
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 50

def 
  @bank_account_name
end

#bank_account_numberString

Seven-digit account number (口座番号).

Returns:

  • (String)


54
55
56
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 54

def 
  @bank_account_number
end

#bank_account_typeDirectDebitBankAccountType

Deposit account type (預金種類) — regular (普通), current (当座), savings (貯蓄) or others (その他).



45
46
47
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 45

def 
  @bank_account_type
end

#bank_codeString

Four-digit code identifying the consumer's bank (銀行コード).

Returns:

  • (String)


32
33
34
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 32

def bank_code
  @bank_code
end

#bank_nameString

Bank name in half-width katakana (銀行名).

Returns:

  • (String)


36
37
38
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 36

def bank_name
  @bank_name
end

#branch_codeString

Three-digit code identifying the bank branch (支店コード).

Returns:

  • (String)


40
41
42
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 40

def branch_code
  @branch_code
end

#created_onDateTime

Timestamp when the resource was created.

Returns:

  • (DateTime)


69
70
71
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 69

def created_on
  @created_on
end

#idString

Unique identifier of a direct debit bank account (銀行口座ID).

Returns:

  • (String)


15
16
17
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 15

def id
  @id
end

#legacy_store_idString

Identifier of the merchant in the legacy direct debit system.

Returns:

  • (String)


19
20
21
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 19

def legacy_store_id
  @legacy_store_id
end

#merchant_idUUID | String

The merchant that owns this bank account.

Returns:

  • (UUID | String)


23
24
25
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 23

def merchant_id
  @merchant_id
end

#registration_originDirectDebitRegistrationOrigin

Where the bank account was registered from — merchant_console for the merchant dashboard, anywhere otherwise.



59
60
61
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 59

def registration_origin
  @registration_origin
end

#statusDirectDebitBankAccountStatus

Bank account state (有効・無効・登録失敗). Only an active account can have transfers registered against it. registration_failed means the bank rejected the account details.



65
66
67
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 65

def status
  @status
end

#updated_onDateTime

Timestamp when the resource was last updated.

Returns:

  • (DateTime)


73
74
75
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 73

def updated_on
  @updated_on
end

#user_numberString

The merchant's own membership number for the consumer (会員番号). Alphanumeric.

Returns:

  • (String)


28
29
30
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 28

def user_number
  @user_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 147

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  legacy_store_id =
    hash.key?('legacy_store_id') ? hash['legacy_store_id'] : SKIP
  merchant_id = hash.key?('merchant_id') ? hash['merchant_id'] : SKIP
  user_number = hash.key?('user_number') ? hash['user_number'] : SKIP
  bank_code = hash.key?('bank_code') ? hash['bank_code'] : SKIP
  bank_name = hash.key?('bank_name') ? hash['bank_name'] : SKIP
  branch_code = hash.key?('branch_code') ? hash['branch_code'] : SKIP
   =
    hash.key?('bank_account_type') ? hash['bank_account_type'] : SKIP
   =
    hash.key?('bank_account_name') ? hash['bank_account_name'] : SKIP
   =
    hash.key?('bank_account_number') ? hash['bank_account_number'] : SKIP
  registration_origin =
    hash.key?('registration_origin') ? hash['registration_origin'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  created_on = if hash.key?('created_on')
                 (DateTimeHelper.from_rfc3339(hash['created_on']) if hash['created_on'])
               else
                 SKIP
               end
  updated_on = if hash.key?('updated_on')
                 (DateTimeHelper.from_rfc3339(hash['updated_on']) if hash['updated_on'])
               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.
  DirectDebitBankAccount.new(id: id,
                             legacy_store_id: legacy_store_id,
                             merchant_id: merchant_id,
                             user_number: user_number,
                             bank_code: bank_code,
                             bank_name: bank_name,
                             branch_code: branch_code,
                             bank_account_type: ,
                             bank_account_name: ,
                             bank_account_number: ,
                             registration_origin: registration_origin,
                             status: status,
                             created_on: created_on,
                             updated_on: updated_on,
                             additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 76

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['legacy_store_id'] = 'legacy_store_id'
  @_hash['merchant_id'] = 'merchant_id'
  @_hash['user_number'] = 'user_number'
  @_hash['bank_code'] = 'bank_code'
  @_hash['bank_name'] = 'bank_name'
  @_hash['branch_code'] = 'branch_code'
  @_hash['bank_account_type'] = 'bank_account_type'
  @_hash['bank_account_name'] = 'bank_account_name'
  @_hash['bank_account_number'] = 'bank_account_number'
  @_hash['registration_origin'] = 'registration_origin'
  @_hash['status'] = 'status'
  @_hash['created_on'] = 'created_on'
  @_hash['updated_on'] = 'updated_on'
  @_hash
end

.nullablesObject

An array for nullable fields



116
117
118
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 116

def self.nullables
  []
end

.optionalsObject

An array for optional fields



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 96

def self.optionals
  %w[
    id
    legacy_store_id
    merchant_id
    user_number
    bank_code
    bank_name
    branch_code
    bank_account_type
    bank_account_name
    bank_account_number
    registration_origin
    status
    created_on
    updated_on
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



225
226
227
228
229
230
231
232
233
234
235
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 225

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, legacy_store_id: #{@legacy_store_id.inspect},"\
  " merchant_id: #{@merchant_id.inspect}, user_number: #{@user_number.inspect}, bank_code:"\
  " #{@bank_code.inspect}, bank_name: #{@bank_name.inspect}, branch_code:"\
  " #{@branch_code.inspect}, bank_account_type: #{@bank_account_type.inspect},"\
  " bank_account_name: #{@bank_account_name.inspect}, bank_account_number:"\
  " #{@bank_account_number.inspect}, registration_origin: #{@registration_origin.inspect},"\
  " status: #{@status.inspect}, created_on: #{@created_on.inspect}, updated_on:"\
  " #{@updated_on.inspect}, additional_properties: #{@additional_properties}>"
end

#to_custom_created_onObject



204
205
206
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 204

def to_custom_created_on
  DateTimeHelper.to_rfc3339(created_on)
end

#to_custom_updated_onObject



208
209
210
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 208

def to_custom_updated_on
  DateTimeHelper.to_rfc3339(updated_on)
end

#to_sObject

Provides a human-readable string representation of the object.



213
214
215
216
217
218
219
220
221
222
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account.rb', line 213

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, legacy_store_id: #{@legacy_store_id}, merchant_id:"\
  " #{@merchant_id}, user_number: #{@user_number}, bank_code: #{@bank_code}, bank_name:"\
  " #{@bank_name}, branch_code: #{@branch_code}, bank_account_type: #{@bank_account_type},"\
  " bank_account_name: #{@bank_account_name}, bank_account_number: #{@bank_account_number},"\
  " registration_origin: #{@registration_origin}, status: #{@status}, created_on:"\
  " #{@created_on}, updated_on: #{@updated_on}, additional_properties:"\
  " #{@additional_properties}>"
end