Class: LogaltyCertificateIssuanceApiCerty::TransactionResult

Inherits:
Object
  • Object
show all
Defined in:
lib/logalty_certificate_issuance_api_certy/models/transaction_result.rb

Overview

Transaction result: - ‘7`: COMPLETED — Process completed and certificate generated. - `8`: USER_REJECT — End-user rejected the process. - `9901`: ERROR_SENDING_ACCESS — Error sending the access notification. - `9910`: ERROR_CERTIFICATE_CONTRACT_SIGNATURE — Error in the signature of the issuance contract. - `9911`: ERROR_CERTIFICATE_CONTRACT_IDENTIFICATION —Error identifying the user during contract signing. - `9912`: ERROR_CERTIFICATE_VALIDATION_REJECTED — Validation rejected by the video operator. - `9913`: ERROR_CERTIFICATE_ISSUING_REJECTED — Issuance rejected by the RA operator. - `9914`: ERROR_CERTIFICATE_ACTIVATION — Certificate activation error. - `99906`: TIME_EXPIRED — Transaction closed due to expired time. - `99908`: OCR_FAILED — OCR validation exceeded. - `99909`: OCR_FAILED — Maximum number of validation attempts exceeded (permissive). - `99910`: DNI_WITHOUT_CHIP — DNI does not have chip or is not readable. - `99915`: TIME_AUTH_EXPIRED — Time for authorization exceeded. - `99932`: CLOSED_BY_REMITANCE — Transaction cancelled by the customer. - `99940`: DELETED_BY_SENDER — Reserved status. - `99945`: ERROR_ID_NUMBER — Error in the identification number. - `99990`: CLOSED_BY_MAINTENANCE — Reserved status.

Constant Summary collapse

TRANSACTION_RESULT =
[
  # TODO: Write general description for ENUM_7
  ENUM_7 = 7,

  # TODO: Write general description for ENUM_8
  ENUM_8 = 8,

  # TODO: Write general description for ENUM_9901
  ENUM_9901 = 9901,

  # TODO: Write general description for ENUM_9910
  ENUM_9910 = 9910,

  # TODO: Write general description for ENUM_9911
  ENUM_9911 = 9911,

  # TODO: Write general description for ENUM_9912
  ENUM_9912 = 9912,

  # TODO: Write general description for ENUM_9913
  ENUM_9913 = 9913,

  # TODO: Write general description for ENUM_9914
  ENUM_9914 = 9914,

  # TODO: Write general description for ENUM_99906
  ENUM_99906 = 99906,

  # TODO: Write general description for ENUM_99908
  ENUM_99908 = 99908,

  # TODO: Write general description for ENUM_99909
  ENUM_99909 = 99909,

  # TODO: Write general description for ENUM_99910
  ENUM_99910 = 99910,

  # TODO: Write general description for ENUM_99915
  ENUM_99915 = 99915,

  # TODO: Write general description for ENUM_99932
  ENUM_99932 = 99932,

  # TODO: Write general description for ENUM_99940
  ENUM_99940 = 99940,

  # TODO: Write general description for ENUM_99945
  ENUM_99945 = 99945,

  # TODO: Write general description for ENUM_99990
  ENUM_99990 = 99990
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_7) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_result.rb', line 85

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

  str = value.to_s.strip
  if str.match?(/\A\d+\z/)
    num = str.to_i
    return num if TRANSACTION_RESULT.include?(num)

    return default_value
  end

  case str.downcase
  when 'enum_7' then ENUM_7
  when 'enum_8' then ENUM_8
  when 'enum_9901' then ENUM_9901
  when 'enum_9910' then ENUM_9910
  when 'enum_9911' then ENUM_9911
  when 'enum_9912' then ENUM_9912
  when 'enum_9913' then ENUM_9913
  when 'enum_9914' then ENUM_9914
  when 'enum_99906' then ENUM_99906
  when 'enum_99908' then ENUM_99908
  when 'enum_99909' then ENUM_99909
  when 'enum_99910' then ENUM_99910
  when 'enum_99915' then ENUM_99915
  when 'enum_99932' then ENUM_99932
  when 'enum_99940' then ENUM_99940
  when 'enum_99945' then ENUM_99945
  when 'enum_99990' then ENUM_99990
  else
    default_value
  end
end

.validate(value) ⇒ Object



79
80
81
82
83
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_result.rb', line 79

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

  TRANSACTION_RESULT.include?(value)
end