Class: LogaltyCertificateIssuanceApiCerty::TransactionStatus

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

Overview

TransactionStatus Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(code: SKIP, cert_id: SKIP, created: SKIP, profile_data: SKIP, external_id: SKIP, state: SKIP, state_date: SKIP, result: SKIP, result_date: SKIP, core_cancel_code: SKIP, core_cancel_reason: SKIP, activation_url: SKIP, additional_properties: nil) ⇒ TransactionStatus

Returns a new instance of TransactionStatus.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 146

def initialize(code: SKIP, cert_id: SKIP, created: SKIP, profile_data: SKIP,
               external_id: SKIP, state: SKIP, state_date: SKIP,
               result: SKIP, result_date: SKIP, core_cancel_code: SKIP,
               core_cancel_reason: SKIP, activation_url: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @code = code unless code == SKIP
  @cert_id = cert_id unless cert_id == SKIP
  @created = created unless created == SKIP
  @profile_data = profile_data unless profile_data == SKIP
  @external_id = external_id unless external_id == SKIP
  @state = state unless state == SKIP
  @state_date = state_date unless state_date == SKIP
  @result = result unless result == SKIP
  @result_date = result_date unless result_date == SKIP
  @core_cancel_code = core_cancel_code unless core_cancel_code == SKIP
  @core_cancel_reason = core_cancel_reason unless core_cancel_reason == SKIP
  @activation_url = activation_url unless activation_url == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#activation_urlString

URL to access the certificate activation process.

Returns:

  • (String)


103
104
105
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 103

def activation_url
  @activation_url
end

#cert_idString

Unique certificate identifier in Logalty.

Returns:

  • (String)


18
19
20
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 18

def cert_id
  @cert_id
end

#codeUUID | String

Transaction’s unique identifier in Logalty (UUIDv4 format).

Returns:

  • (UUID | String)


14
15
16
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 14

def code
  @code
end

#core_cancel_codeCancellationCode

Cancellation code provided by the end-user:

  • ‘OPTION_ZERO`: No reason indicated.

  • ‘USER_MOBILE_CHANGED`: User changed their phone number.

  • ‘SMS_NOT_RECEIVED`: User did not receive the SMS.

  • ‘USER_NO_TOKENS_AVAILABLE`: User does not have a cell phone.

  • ‘TECHNICAL_PROBLEMS`: Technical problems reported by the user.

  • ‘RCPT_INVALID`: Transaction not directed at the user.

  • ‘SENDER_UNKNOWN`: User does not know the sender.

  • ‘USER_DATA_INVALID`: User data is incorrect.

  • ‘DOCUMENT_DATA_INVALID`: Documentation is incorrect.

  • ‘OTHER_REASONS`: Other problems.

  • ‘NOT_DOCUMENT_AGREE`: User does not agree with the documentation.

Returns:



95
96
97
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 95

def core_cancel_code
  @core_cancel_code
end

#core_cancel_reasonString

Free-text reason for cancellation.

Returns:

  • (String)


99
100
101
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 99

def core_cancel_reason
  @core_cancel_reason
end

#createdInteger

Transaction creation date in epoch (milliseconds) format.

Returns:

  • (Integer)


22
23
24
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 22

def created
  @created
end

#external_idString

Unique identifier in the client system external to Logalty.

Returns:

  • (String)


30
31
32
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 30

def external_id
  @external_id
end

#profile_dataProfile

Transaction creation date in epoch (milliseconds) format.

Returns:



26
27
28
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 26

def profile_data
  @profile_data
end

#resultTransactionResult

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.

Returns:



76
77
78
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 76

def result
  @result
end

#result_dateInteger

Result date in epoch format.

Returns:

  • (Integer)


80
81
82
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 80

def result_date
  @result_date
end

#stateTransactionState

Transaction state:

  • ‘0`: CREATED — Transaction created.

  • ‘1`: ACCESS_SENT — Access notification sent.

  • ‘10`: PENDING_CERTIFICATE_CONTRACT_SIGNATURE — Pending signature of the

certificate issuance contract.

  • ‘11`: PENDING_CERTIFICATE_VALIDATION — Pending validation by the video

operator.

  • ‘12`: CLOSED — Transaction closed.

  • ‘13`: PENDING_CERTIFICATE_ISSUING — Pending issuance by the RA operator.

  • ‘14`: PENDING_CERTIFICATE_ACTIVATION — Pending certificate activation by

the end-user.

  • ‘15`: PENDING_CERTIFICATE_DOWNLOAD — Pending certificate download by the

end-user (software support only).

Returns:



46
47
48
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 46

def state
  @state
end

#state_dateInteger

Date of last status change in epoch format.

Returns:

  • (Integer)


50
51
52
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 50

def state_date
  @state_date
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 170

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  code = hash.key?('code') ? hash['code'] : SKIP
  cert_id = hash.key?('certId') ? hash['certId'] : SKIP
  created = hash.key?('created') ? hash['created'] : SKIP
  profile_data = Profile.from_hash(hash['profileData']) if hash['profileData']
  external_id = hash.key?('externalId') ? hash['externalId'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  state_date = hash.key?('stateDate') ? hash['stateDate'] : SKIP
  result = hash.key?('result') ? hash['result'] : SKIP
  result_date = hash.key?('resultDate') ? hash['resultDate'] : SKIP
  core_cancel_code =
    hash.key?('coreCancelCode') ? hash['coreCancelCode'] : SKIP
  core_cancel_reason =
    hash.key?('coreCancelReason') ? hash['coreCancelReason'] : SKIP
  activation_url = hash.key?('activationUrl') ? hash['activationUrl'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  TransactionStatus.new(code: code,
                        cert_id: cert_id,
                        created: created,
                        profile_data: profile_data,
                        external_id: external_id,
                        state: state,
                        state_date: state_date,
                        result: result,
                        result_date: result_date,
                        core_cancel_code: core_cancel_code,
                        core_cancel_reason: core_cancel_reason,
                        activation_url: activation_url,
                        additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 106

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['code'] = 'code'
  @_hash['cert_id'] = 'certId'
  @_hash['created'] = 'created'
  @_hash['profile_data'] = 'profileData'
  @_hash['external_id'] = 'externalId'
  @_hash['state'] = 'state'
  @_hash['state_date'] = 'stateDate'
  @_hash['result'] = 'result'
  @_hash['result_date'] = 'resultDate'
  @_hash['core_cancel_code'] = 'coreCancelCode'
  @_hash['core_cancel_reason'] = 'coreCancelReason'
  @_hash['activation_url'] = 'activationUrl'
  @_hash
end

.nullablesObject

An array for nullable fields



142
143
144
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 142

def self.nullables
  []
end

.optionalsObject

An array for optional fields



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 124

def self.optionals
  %w[
    code
    cert_id
    created
    profile_data
    external_id
    state
    state_date
    result
    result_date
    core_cancel_code
    core_cancel_reason
    activation_url
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



223
224
225
226
227
228
229
230
231
232
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 223

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} code: #{@code.inspect}, cert_id: #{@cert_id.inspect}, created:"\
  " #{@created.inspect}, profile_data: #{@profile_data.inspect}, external_id:"\
  " #{@external_id.inspect}, state: #{@state.inspect}, state_date: #{@state_date.inspect},"\
  " result: #{@result.inspect}, result_date: #{@result_date.inspect}, core_cancel_code:"\
  " #{@core_cancel_code.inspect}, core_cancel_reason: #{@core_cancel_reason.inspect},"\
  " activation_url: #{@activation_url.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



213
214
215
216
217
218
219
220
# File 'lib/logalty_certificate_issuance_api_certy/models/transaction_status.rb', line 213

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} code: #{@code}, cert_id: #{@cert_id}, created: #{@created}, profile_data:"\
  " #{@profile_data}, external_id: #{@external_id}, state: #{@state}, state_date:"\
  " #{@state_date}, result: #{@result}, result_date: #{@result_date}, core_cancel_code:"\
  " #{@core_cancel_code}, core_cancel_reason: #{@core_cancel_reason}, activation_url:"\
  " #{@activation_url}, additional_properties: #{@additional_properties}>"
end