Class: UnivapayClientSdk::DirectDebitBankTransfer

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

Overview

A single scheduled pull of funds from a registered bank account. The bank account details are copied onto the transfer at registration time, so later edits to the account do not change past transfers.

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, bank_account_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, amount: SKIP, debit_date: SKIP, calculated_debit_date: SKIP, lock: SKIP, status: SKIP, error: SKIP, created_on: SKIP, updated_on: SKIP, additional_properties: nil) ⇒ DirectDebitBankTransfer

Returns a new instance of DirectDebitBankTransfer.



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
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 157

def initialize(id: SKIP, legacy_store_id: SKIP, merchant_id: SKIP,
               bank_account_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,
               amount: SKIP, debit_date: SKIP, calculated_debit_date: SKIP,
               lock: SKIP, status: SKIP, error: 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
  @bank_account_id =  unless  == 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
  @amount = amount unless amount == SKIP
  @debit_date = debit_date unless debit_date == SKIP
  @calculated_debit_date = calculated_debit_date unless calculated_debit_date == SKIP
  @lock = lock unless lock == SKIP
  @status = status unless status == SKIP
  @error = error unless error == 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

#amountInteger

Transfer amount in JPY. Must be a positive, non-zero whole number.

Returns:

  • (Integer)


64
65
66
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 64

def amount
  @amount
end

#bank_account_idString

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

Returns:

  • (String)


29
30
31
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 29

def 
  @bank_account_id
end

#bank_account_nameString

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

Returns:

  • (String)


56
57
58
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 56

def 
  @bank_account_name
end

#bank_account_numberString

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

Returns:

  • (String)


60
61
62
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 60

def 
  @bank_account_number
end

#bank_account_typeDirectDebitBankAccountType

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



51
52
53
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 51

def 
  @bank_account_type
end

#bank_codeString

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

Returns:

  • (String)


38
39
40
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 38

def bank_code
  @bank_code
end

#bank_nameString

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

Returns:

  • (String)


42
43
44
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 42

def bank_name
  @bank_name
end

#branch_codeString

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

Returns:

  • (String)


46
47
48
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 46

def branch_code
  @branch_code
end

#calculated_debit_dateDate

The actual business day on which funds are pulled (計算された振替日), derived from the debit cycle.

Returns:

  • (Date)


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

def calculated_debit_date
  @calculated_debit_date
end

#created_onDateTime

Timestamp when the resource was created.

Returns:

  • (DateTime)


94
95
96
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 94

def created_on
  @created_on
end

#debit_dateDirectDebitDebitDate

Monthly debit cycle — funds are pulled on either the 14th or the 27th.



68
69
70
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 68

def debit_date
  @debit_date
end

#errorDirectDebitBankTransferError

Failure reason, or null while the transfer is awaiting a result or has succeeded.



90
91
92
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 90

def error
  @error
end

#idString

Unique identifier of a direct debit bank transfer (振替ID).

Returns:

  • (String)


17
18
19
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 17

def id
  @id
end

#legacy_store_idString

Identifier of the merchant in the legacy direct debit system.

Returns:

  • (String)


21
22
23
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 21

def legacy_store_id
  @legacy_store_id
end

#lockDirectDebitBankTransferLock

Whether the transfer can still be edited. Transfers are unlocked until the upload deadline for their debit cycle passes, after which they are locked and can no longer be changed or deleted.



79
80
81
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 79

def lock
  @lock
end

#merchant_idUUID | String

The merchant that owns this transfer.

Returns:

  • (UUID | String)


25
26
27
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 25

def merchant_id
  @merchant_id
end

#statusDirectDebitBankTransferStatus

Transfer state. awaiting until the bank reports back, then successful or failed. Results are reflected days after the debit date, not immediately.



85
86
87
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 85

def status
  @status
end

#updated_onDateTime

Timestamp when the resource was last updated.

Returns:

  • (DateTime)


98
99
100
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 98

def updated_on
  @updated_on
end

#user_numberString

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

Returns:

  • (String)


34
35
36
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 34

def user_number
  @user_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 190

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
   =
    hash.key?('bank_account_id') ? hash['bank_account_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
  amount = hash.key?('amount') ? hash['amount'] : SKIP
  debit_date = hash.key?('debit_date') ? hash['debit_date'] : SKIP
  calculated_debit_date =
    hash.key?('calculated_debit_date') ? hash['calculated_debit_date'] : SKIP
  lock = hash.key?('lock') ? hash['lock'] : SKIP
  status = hash.key?('status') ? hash['status'] : SKIP
  error = hash.key?('error') ? hash['error'] : 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.
  DirectDebitBankTransfer.new(id: id,
                              legacy_store_id: legacy_store_id,
                              merchant_id: merchant_id,
                              bank_account_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: ,
                              amount: amount,
                              debit_date: debit_date,
                              calculated_debit_date: calculated_debit_date,
                              lock: lock,
                              status: status,
                              error: error,
                              created_on: created_on,
                              updated_on: updated_on,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 101

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['legacy_store_id'] = 'legacy_store_id'
  @_hash['merchant_id'] = 'merchant_id'
  @_hash['bank_account_id'] = 'bank_account_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['amount'] = 'amount'
  @_hash['debit_date'] = 'debit_date'
  @_hash['calculated_debit_date'] = 'calculated_debit_date'
  @_hash['lock'] = 'lock'
  @_hash['status'] = 'status'
  @_hash['error'] = 'error'
  @_hash['created_on'] = 'created_on'
  @_hash['updated_on'] = 'updated_on'
  @_hash
end

.nullablesObject

An array for nullable fields



151
152
153
154
155
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 151

def self.nullables
  %w[
    error
  ]
end

.optionalsObject

An array for optional fields



126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 126

def self.optionals
  %w[
    id
    legacy_store_id
    merchant_id
    bank_account_id
    user_number
    bank_code
    bank_name
    branch_code
    bank_account_type
    bank_account_name
    bank_account_number
    amount
    debit_date
    calculated_debit_date
    lock
    status
    error
    created_on
    updated_on
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 280

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}, bank_account_id: #{@bank_account_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}, amount: #{@amount.inspect},"\
  " debit_date: #{@debit_date.inspect}, calculated_debit_date:"\
  " #{@calculated_debit_date.inspect}, lock: #{@lock.inspect}, status: #{@status.inspect},"\
  " error: #{@error.inspect}, created_on: #{@created_on.inspect}, updated_on:"\
  " #{@updated_on.inspect}, additional_properties: #{@additional_properties}>"
end

#to_custom_created_onObject



258
259
260
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 258

def to_custom_created_on
  DateTimeHelper.to_rfc3339(created_on)
end

#to_custom_updated_onObject



262
263
264
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 262

def to_custom_updated_on
  DateTimeHelper.to_rfc3339(updated_on)
end

#to_sObject

Provides a human-readable string representation of the object.



267
268
269
270
271
272
273
274
275
276
277
# File 'lib/univapay_client_sdk/models/direct_debit_bank_transfer.rb', line 267

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, legacy_store_id: #{@legacy_store_id}, merchant_id:"\
  " #{@merchant_id}, bank_account_id: #{@bank_account_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}, amount: #{@amount}, debit_date:"\
  " #{@debit_date}, calculated_debit_date: #{@calculated_debit_date}, lock: #{@lock}, status:"\
  " #{@status}, error: #{@error}, created_on: #{@created_on}, updated_on: #{@updated_on},"\
  " additional_properties: #{@additional_properties}>"
end