Class: PaypalServerSdk::EnrollmentStatus

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

Overview

Status of Authentication eligibility.

Constant Summary collapse

ENROLLMENT_STATUS =
[
  # Yes. The bank is participating in 3-D Secure protocol and will return

  # the ACSUrl.

  ENROLLED = 'Y'.freeze,

  # No. The bank is not participating in 3-D Secure protocol.

  NOTENROLLED = 'N'.freeze,

  # Unavailable. The DS or ACS is not available for authentication at the

  # time of the request.

  UNAVAILABLE = 'U'.freeze,

  # Bypass. The merchant authentication rule is triggered to bypass

  # authentication.

  BYPASS = 'B'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENROLLED) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/paypal_server_sdk/models/enrollment_status.rb', line 32

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

  str = value.to_s.strip

  case str.downcase
  when 'enrolled' then ENROLLED
  when 'notenrolled' then NOTENROLLED
  when 'unavailable' then UNAVAILABLE
  when 'bypass' then BYPASS
  else
    default_value
  end
end

.validate(value) ⇒ Object



26
27
28
29
30
# File 'lib/paypal_server_sdk/models/enrollment_status.rb', line 26

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

  true
end