Class: OpenapiClient::TransactionResponse
- Inherits:
-
Object
- Object
- OpenapiClient::TransactionResponse
- Defined in:
- lib/openapi_client/models/transaction_response.rb
Overview
Common object for primary and secondary payment request responses.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_updater_response ⇒ Object
Returns the value of attribute account_updater_response.
-
#ach_response ⇒ Object
Returns the value of attribute ach_response.
-
#additional_details ⇒ Object
Returns the value of attribute additional_details.
-
#api_trace_id ⇒ Object
Request identifier in API, can be used to request logs from the support team.
-
#approved_amount ⇒ Object
Returns the value of attribute approved_amount.
-
#authentication_response ⇒ Object
Returns the value of attribute authentication_response.
-
#client_request_id ⇒ Object
Echoes back the value in the request header for tracking.
-
#country ⇒ Object
Country of the card issuer.
-
#currency_conversion_response ⇒ Object
Returns the value of attribute currency_conversion_response.
-
#ipg_transaction_id ⇒ Object
The response transaction ID.
-
#merchant_id ⇒ Object
The unique (on Acquirer level) mechant ID.
-
#merchant_transaction_id ⇒ Object
The unique merchant transaction ID from the request header, if supplied.
-
#order_id ⇒ Object
Client order ID if supplied by client, otherwise the order ID.
-
#payment_method_details ⇒ Object
Returns the value of attribute payment_method_details.
-
#payment_token ⇒ Object
Returns the value of attribute payment_token.
-
#processor ⇒ Object
Returns the value of attribute processor.
-
#redirect_url ⇒ Object
The endpoint redirection URL.
-
#response_type ⇒ Object
Returns the value of attribute response_type.
-
#scheme_transaction_id ⇒ Object
The transaction ID received from schemes for the initial transaction of card on file flows.
-
#secure3d_response ⇒ Object
Returns the value of attribute secure3d_response.
-
#terminal_id ⇒ Object
The terminal that is processing the transaction.
-
#transaction_origin ⇒ Object
Returns the value of attribute transaction_origin.
-
#transaction_state ⇒ Object
Shows the state of the current transaction.
-
#transaction_status ⇒ Object
Represents the status of a transaction immediately following the original processing request.
-
#transaction_time ⇒ Object
The transaction time in seconds since epoch.
-
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3).
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ TransactionResponse
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash(attribute_map = self.class.attribute_map, openapi_nullable = Set.new([])) ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ TransactionResponse
Initializes the object
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 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File 'lib/openapi_client/models/transaction_response.rb', line 178 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `OpenapiClient::TransactionResponse` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `OpenapiClient::TransactionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'client_request_id') self.client_request_id = attributes[:'client_request_id'] end if attributes.key?(:'api_trace_id') self.api_trace_id = attributes[:'api_trace_id'] end if attributes.key?(:'response_type') self.response_type = attributes[:'response_type'] end if attributes.key?(:'ipg_transaction_id') self.ipg_transaction_id = attributes[:'ipg_transaction_id'] end if attributes.key?(:'order_id') self.order_id = attributes[:'order_id'] end if attributes.key?(:'transaction_type') self.transaction_type = attributes[:'transaction_type'] end if attributes.key?(:'payment_token') self.payment_token = attributes[:'payment_token'] end if attributes.key?(:'transaction_origin') self.transaction_origin = attributes[:'transaction_origin'] end if attributes.key?(:'payment_method_details') self.payment_method_details = attributes[:'payment_method_details'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'terminal_id') self.terminal_id = attributes[:'terminal_id'] end if attributes.key?(:'merchant_id') self.merchant_id = attributes[:'merchant_id'] end if attributes.key?(:'merchant_transaction_id') self.merchant_transaction_id = attributes[:'merchant_transaction_id'] end if attributes.key?(:'transaction_time') self.transaction_time = attributes[:'transaction_time'] end if attributes.key?(:'approved_amount') self.approved_amount = attributes[:'approved_amount'] end if attributes.key?(:'transaction_status') self.transaction_status = attributes[:'transaction_status'] end if attributes.key?(:'transaction_state') self.transaction_state = attributes[:'transaction_state'] end if attributes.key?(:'secure3d_response') self.secure3d_response = attributes[:'secure3d_response'] end if attributes.key?(:'redirect_url') self.redirect_url = attributes[:'redirect_url'] end if attributes.key?(:'authentication_response') self.authentication_response = attributes[:'authentication_response'] end if attributes.key?(:'scheme_transaction_id') self.scheme_transaction_id = attributes[:'scheme_transaction_id'] end if attributes.key?(:'processor') self.processor = attributes[:'processor'] end if attributes.key?(:'additional_details') self.additional_details = attributes[:'additional_details'] end if attributes.key?(:'account_updater_response') self.account_updater_response = attributes[:'account_updater_response'] end if attributes.key?(:'ach_response') self.ach_response = attributes[:'ach_response'] end if attributes.key?(:'currency_conversion_response') self.currency_conversion_response = attributes[:'currency_conversion_response'] end end |
Instance Attribute Details
#account_updater_response ⇒ Object
Returns the value of attribute account_updater_response.
77 78 79 |
# File 'lib/openapi_client/models/transaction_response.rb', line 77 def account_updater_response @account_updater_response end |
#ach_response ⇒ Object
Returns the value of attribute ach_response.
79 80 81 |
# File 'lib/openapi_client/models/transaction_response.rb', line 79 def ach_response @ach_response end |
#additional_details ⇒ Object
Returns the value of attribute additional_details.
75 76 77 |
# File 'lib/openapi_client/models/transaction_response.rb', line 75 def additional_details @additional_details end |
#api_trace_id ⇒ Object
Request identifier in API, can be used to request logs from the support team.
22 23 24 |
# File 'lib/openapi_client/models/transaction_response.rb', line 22 def api_trace_id @api_trace_id end |
#approved_amount ⇒ Object
Returns the value of attribute approved_amount.
55 56 57 |
# File 'lib/openapi_client/models/transaction_response.rb', line 55 def approved_amount @approved_amount end |
#authentication_response ⇒ Object
Returns the value of attribute authentication_response.
68 69 70 |
# File 'lib/openapi_client/models/transaction_response.rb', line 68 def authentication_response @authentication_response end |
#client_request_id ⇒ Object
Echoes back the value in the request header for tracking.
19 20 21 |
# File 'lib/openapi_client/models/transaction_response.rb', line 19 def client_request_id @client_request_id end |
#country ⇒ Object
Country of the card issuer.
41 42 43 |
# File 'lib/openapi_client/models/transaction_response.rb', line 41 def country @country end |
#currency_conversion_response ⇒ Object
Returns the value of attribute currency_conversion_response.
81 82 83 |
# File 'lib/openapi_client/models/transaction_response.rb', line 81 def currency_conversion_response @currency_conversion_response end |
#ipg_transaction_id ⇒ Object
The response transaction ID.
27 28 29 |
# File 'lib/openapi_client/models/transaction_response.rb', line 27 def ipg_transaction_id @ipg_transaction_id end |
#merchant_id ⇒ Object
The unique (on Acquirer level) mechant ID. Usually this value has been chosen from the merchant itself and will be used in communication with the endpoint.
47 48 49 |
# File 'lib/openapi_client/models/transaction_response.rb', line 47 def merchant_id @merchant_id end |
#merchant_transaction_id ⇒ Object
The unique merchant transaction ID from the request header, if supplied.
50 51 52 |
# File 'lib/openapi_client/models/transaction_response.rb', line 50 def merchant_transaction_id @merchant_transaction_id end |
#order_id ⇒ Object
Client order ID if supplied by client, otherwise the order ID.
30 31 32 |
# File 'lib/openapi_client/models/transaction_response.rb', line 30 def order_id @order_id end |
#payment_method_details ⇒ Object
Returns the value of attribute payment_method_details.
38 39 40 |
# File 'lib/openapi_client/models/transaction_response.rb', line 38 def payment_method_details @payment_method_details end |
#payment_token ⇒ Object
Returns the value of attribute payment_token.
34 35 36 |
# File 'lib/openapi_client/models/transaction_response.rb', line 34 def payment_token @payment_token end |
#processor ⇒ Object
Returns the value of attribute processor.
73 74 75 |
# File 'lib/openapi_client/models/transaction_response.rb', line 73 def processor @processor end |
#redirect_url ⇒ Object
The endpoint redirection URL.
66 67 68 |
# File 'lib/openapi_client/models/transaction_response.rb', line 66 def redirect_url @redirect_url end |
#response_type ⇒ Object
Returns the value of attribute response_type.
24 25 26 |
# File 'lib/openapi_client/models/transaction_response.rb', line 24 def response_type @response_type end |
#scheme_transaction_id ⇒ Object
The transaction ID received from schemes for the initial transaction of card on file flows.
71 72 73 |
# File 'lib/openapi_client/models/transaction_response.rb', line 71 def scheme_transaction_id @scheme_transaction_id end |
#secure3d_response ⇒ Object
Returns the value of attribute secure3d_response.
63 64 65 |
# File 'lib/openapi_client/models/transaction_response.rb', line 63 def secure3d_response @secure3d_response end |
#terminal_id ⇒ Object
The terminal that is processing the transaction.
44 45 46 |
# File 'lib/openapi_client/models/transaction_response.rb', line 44 def terminal_id @terminal_id end |
#transaction_origin ⇒ Object
Returns the value of attribute transaction_origin.
36 37 38 |
# File 'lib/openapi_client/models/transaction_response.rb', line 36 def transaction_origin @transaction_origin end |
#transaction_state ⇒ Object
Shows the state of the current transaction.
61 62 63 |
# File 'lib/openapi_client/models/transaction_response.rb', line 61 def transaction_state @transaction_state end |
#transaction_status ⇒ Object
Represents the status of a transaction immediately following the original processing request. This value is not stored for the transaction and is only available in the response when the transaction is processed. TransactionStatus is not returned on either the transaction inquiry or on the order inquiry.
58 59 60 |
# File 'lib/openapi_client/models/transaction_response.rb', line 58 def transaction_status @transaction_status end |
#transaction_time ⇒ Object
The transaction time in seconds since epoch.
53 54 55 |
# File 'lib/openapi_client/models/transaction_response.rb', line 53 def transaction_time @transaction_time end |
#transaction_type ⇒ Object
Returns the value of attribute transaction_type.
32 33 34 |
# File 'lib/openapi_client/models/transaction_response.rb', line 32 def transaction_type @transaction_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/openapi_client/models/transaction_response.rb', line 106 def self.attribute_map { :'client_request_id' => :'clientRequestId', :'api_trace_id' => :'apiTraceId', :'response_type' => :'responseType', :'ipg_transaction_id' => :'ipgTransactionId', :'order_id' => :'orderId', :'transaction_type' => :'transactionType', :'payment_token' => :'paymentToken', :'transaction_origin' => :'transactionOrigin', :'payment_method_details' => :'paymentMethodDetails', :'country' => :'country', :'terminal_id' => :'terminalId', :'merchant_id' => :'merchantId', :'merchant_transaction_id' => :'merchantTransactionId', :'transaction_time' => :'transactionTime', :'approved_amount' => :'approvedAmount', :'transaction_status' => :'transactionStatus', :'transaction_state' => :'transactionState', :'secure3d_response' => :'secure3dResponse', :'redirect_url' => :'redirectURL', :'authentication_response' => :'authenticationResponse', :'scheme_transaction_id' => :'schemeTransactionId', :'processor' => :'processor', :'additional_details' => :'additionalDetails', :'account_updater_response' => :'accountUpdaterResponse', :'ach_response' => :'achResponse', :'currency_conversion_response' => :'currencyConversionResponse' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
426 427 428 |
# File 'lib/openapi_client/models/transaction_response.rb', line 426 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_all_of ⇒ Object
List of class defined in allOf (OpenAPI v3)
170 171 172 173 174 |
# File 'lib/openapi_client/models/transaction_response.rb', line 170 def self.openapi_all_of [ :'BasicResponse' ] end |
.openapi_types ⇒ Object
Attribute type mapping.
138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
# File 'lib/openapi_client/models/transaction_response.rb', line 138 def self.openapi_types { :'client_request_id' => :'String', :'api_trace_id' => :'String', :'response_type' => :'ResponseType', :'ipg_transaction_id' => :'String', :'order_id' => :'String', :'transaction_type' => :'TransactionType', :'payment_token' => :'PaymentTokenDetails', :'transaction_origin' => :'TransactionOrigin', :'payment_method_details' => :'PaymentMethodDetails', :'country' => :'String', :'terminal_id' => :'String', :'merchant_id' => :'String', :'merchant_transaction_id' => :'String', :'transaction_time' => :'Integer', :'approved_amount' => :'Amount', :'transaction_status' => :'String', :'transaction_state' => :'String', :'secure3d_response' => :'Secure3dResponse', :'redirect_url' => :'String', :'authentication_response' => :'Secure3DAuthenticationResponse', :'scheme_transaction_id' => :'String', :'processor' => :'ProcessorData', :'additional_details' => :'AdditionalTransactionDetails', :'account_updater_response' => :'AccountUpdaterResponse', :'ach_response' => :'AchResponse', :'currency_conversion_response' => :'CurrencyConversionResponse' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/openapi_client/models/transaction_response.rb', line 380 def ==(o) return true if self.equal?(o) self.class == o.class && client_request_id == o.client_request_id && api_trace_id == o.api_trace_id && response_type == o.response_type && ipg_transaction_id == o.ipg_transaction_id && order_id == o.order_id && transaction_type == o.transaction_type && payment_token == o.payment_token && transaction_origin == o.transaction_origin && payment_method_details == o.payment_method_details && country == o.country && terminal_id == o.terminal_id && merchant_id == o.merchant_id && merchant_transaction_id == o.merchant_transaction_id && transaction_time == o.transaction_time && approved_amount == o.approved_amount && transaction_status == o.transaction_status && transaction_state == o.transaction_state && secure3d_response == o.secure3d_response && redirect_url == o.redirect_url && authentication_response == o.authentication_response && scheme_transaction_id == o.scheme_transaction_id && processor == o.processor && additional_details == o.additional_details && account_updater_response == o.account_updater_response && ach_response == o.ach_response && currency_conversion_response == o.currency_conversion_response end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/openapi_client/models/transaction_response.rb', line 454 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model klass = OpenapiClient.const_get(type) if klass.respond_to?(:openapi_discriminator_name) klass = OpenapiClient.const_get(value[klass.attribute_map[klass.openapi_discriminator_name]]) end klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
528 529 530 531 532 533 534 535 536 537 538 539 540 |
# File 'lib/openapi_client/models/transaction_response.rb', line 528 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) ⇒ Object
Builds the object from hash
433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/openapi_client/models/transaction_response.rb', line 433 def build_from_hash(attributes, attribute_map = self.class.attribute_map, openapi_types = self.class.openapi_types) return nil unless attributes.is_a?(Hash) openapi_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
413 414 415 |
# File 'lib/openapi_client/models/transaction_response.rb', line 413 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
419 420 421 |
# File 'lib/openapi_client/models/transaction_response.rb', line 419 def hash [client_request_id, api_trace_id, response_type, ipg_transaction_id, order_id, transaction_type, payment_token, transaction_origin, payment_method_details, country, terminal_id, merchant_id, merchant_transaction_id, transaction_time, approved_amount, transaction_status, transaction_state, secure3d_response, redirect_url, authentication_response, scheme_transaction_id, processor, additional_details, account_updater_response, ach_response, currency_conversion_response].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/openapi_client/models/transaction_response.rb', line 298 def list_invalid_properties invalid_properties = Array.new if !@merchant_id.nil? && @merchant_id.to_s.length > 30 invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 30.') end if !@merchant_transaction_id.nil? && @merchant_transaction_id.to_s.length > 40 invalid_properties.push('invalid value for "merchant_transaction_id", the character length must be smaller than or equal to 40.') end if !@scheme_transaction_id.nil? && @scheme_transaction_id.to_s.length > 40 invalid_properties.push('invalid value for "scheme_transaction_id", the character length must be smaller than or equal to 40.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
504 505 506 |
# File 'lib/openapi_client/models/transaction_response.rb', line 504 def to_body to_hash end |
#to_hash(attribute_map = self.class.attribute_map, openapi_nullable = Set.new([])) ⇒ Hash
Returns the object in the form of hash
510 511 512 513 514 515 516 517 518 519 520 521 522 |
# File 'lib/openapi_client/models/transaction_response.rb', line 510 def to_hash(attribute_map = self.class.attribute_map, openapi_nullable = Set.new([])) hash = {} attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
498 499 500 |
# File 'lib/openapi_client/models/transaction_response.rb', line 498 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
317 318 319 320 321 322 323 324 325 326 |
# File 'lib/openapi_client/models/transaction_response.rb', line 317 def valid? return false if !@merchant_id.nil? && @merchant_id.to_s.length > 30 return false if !@merchant_transaction_id.nil? && @merchant_transaction_id.to_s.length > 40 transaction_status_validator = EnumAttributeValidator.new('String', ["APPROVED", "WAITING", "VALIDATION_FAILED", "PROCESSING_FAILED", "DECLINED"]) return false unless transaction_status_validator.valid?(@transaction_status) transaction_state_validator = EnumAttributeValidator.new('String', ["AUTHORIZED", "CAPTURED", "DECLINED", "CHECKED", "COMPLETED_GET", "INITIALIZED", "PENDING", "READY", "TEMPLATE", "SETTLED", "VOIDED", "WAITING"]) return false unless transaction_state_validator.valid?(@transaction_state) return false if !@scheme_transaction_id.nil? && @scheme_transaction_id.to_s.length > 40 true end |