Class: PaypalServerSdk::LiabilityShiftIndicator

Inherits:
Object
  • Object
show all
Defined in:
lib/paypal_server_sdk/models/liability_shift_indicator.rb

Overview

Liability shift indicator. The outcome of the issuer’s authentication.

Constant Summary collapse

LIABILITY_SHIFT_INDICATOR =
[
  # Liability is with the merchant.
  NO = 'NO'.freeze,

  # Liability may shift to the card issuer.
  POSSIBLE = 'POSSIBLE'.freeze,

  # The authentication system is not available.
  UNKNOWN = 'UNKNOWN'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = NO) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/paypal_server_sdk/models/liability_shift_indicator.rb', line 26

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

  str = value.to_s.strip

  case str.downcase
  when 'no' then NO
  when 'possible' then POSSIBLE
  when 'unknown' then UNKNOWN
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/paypal_server_sdk/models/liability_shift_indicator.rb', line 20

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

  true
end