Class: PaypalServerSdk::EciFlag

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

Overview

Electronic Commerce Indicator (ECI). The ECI value is part of the 2 data elements that indicate the transaction was processed electronically. This should be passed on the authorization transaction to the Gateway/Processor.

Constant Summary collapse

ECI_FLAG =
[
  # Mastercard non-3-D Secure transaction.
  MASTERCARD_NON_3D_SECURE_TRANSACTION = 'MASTERCARD_NON_3D_SECURE_TRANSACTION'.freeze,

  # Mastercard attempted authentication transaction.
  MASTERCARD_ATTEMPTED_AUTHENTICATION_TRANSACTION = 'MASTERCARD_ATTEMPTED_AUTHENTICATION_TRANSACTION'.freeze,

  # Mastercard fully authenticated transaction.
  MASTERCARD_FULLY_AUTHENTICATED_TRANSACTION = 'MASTERCARD_FULLY_AUTHENTICATED_TRANSACTION'.freeze,

  # VISA, AMEX, JCB, DINERS CLUB fully authenticated transaction.
  FULLY_AUTHENTICATED_TRANSACTION = 'FULLY_AUTHENTICATED_TRANSACTION'.freeze,

  # VISA, AMEX, JCB, DINERS CLUB attempted authentication transaction.
  ATTEMPTED_AUTHENTICATION_TRANSACTION = 'ATTEMPTED_AUTHENTICATION_TRANSACTION'.freeze,

  # VISA, AMEX, JCB, DINERS CLUB non-3-D Secure transaction.
  NON_3D_SECURE_TRANSACTION = 'NON_3D_SECURE_TRANSACTION'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = MASTERCARD_NON_3D_SECURE_TRANSACTION) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/paypal_server_sdk/models/eci_flag.rb', line 37

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

  str = value.to_s.strip

  case str.downcase
  when 'mastercard_non_3d_secure_transaction' then MASTERCARD_NON_3D_SECURE_TRANSACTION
  when 'mastercard_attempted_authentication_transaction' then MASTERCARD_ATTEMPTED_AUTHENTICATION_TRANSACTION
  when 'mastercard_fully_authenticated_transaction' then MASTERCARD_FULLY_AUTHENTICATED_TRANSACTION
  when 'fully_authenticated_transaction' then FULLY_AUTHENTICATED_TRANSACTION
  when 'attempted_authentication_transaction' then ATTEMPTED_AUTHENTICATION_TRANSACTION
  when 'non_3d_secure_transaction' then NON_3D_SECURE_TRANSACTION
  else
    default_value
  end
end

.validate(value) ⇒ Object



31
32
33
34
35
# File 'lib/paypal_server_sdk/models/eci_flag.rb', line 31

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

  true
end