Class: UnivapayClientSdk::DirectDebitBankAccountStatus

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

Overview

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

Constant Summary collapse

DIRECT_DEBIT_BANK_ACCOUNT_STATUS =
[
  # TODO: Write general description for ACTIVE
  ACTIVE = 'active'.freeze,

  # TODO: Write general description for INACTIVE
  INACTIVE = 'inactive'.freeze,

  # TODO: Write general description for REGISTRATION_FAILED
  REGISTRATION_FAILED = 'registration_failed'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ACTIVE) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account_status.rb', line 28

def self.from_value(value, default_value = ACTIVE)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'active' then ACTIVE
  when 'inactive' then INACTIVE
  when 'registration_failed' then REGISTRATION_FAILED
  else
    default_value
  end
end

.validate(value) ⇒ Object



22
23
24
25
26
# File 'lib/univapay_client_sdk/models/direct_debit_bank_account_status.rb', line 22

def self.validate(value)
  return false if value.nil?

  DIRECT_DEBIT_BANK_ACCOUNT_STATUS.include?(value)
end