class CityPayApiClient::AuthResponse

Attributes

amount[RW]

The amount of the transaction processed.

atrn[RW]

A reference number provided by the acquirer for a transaction it can be used to cross reference transactions with an Acquirers reporting panel.

atsd[RW]

Additional Transaction Security Data used for ecommerce transactions to decipher security capabilities and attempts against a transaction.

authcode[RW]

The authorisation code as returned by the card issuer or acquiring bank when a transaction has successfully been authorised. Authorisation codes contain alphanumeric values. Whilst the code confirms authorisation it should not be used to determine whether a transaction was successfully processed. For instance an auth code may be returned when a transaction has been subsequently declined due to a CSC mismatch.

authen_result[RW]

The result of any authentication using 3d_secure authorisation against ecommerce transactions. Values are | Value | Description | |——-|————-| | Y | Authentication Successful. The Cardholder's password was successfully validated. | | N | Authentication Failed. Customer failed or cancelled authentication, transaction denied. | | A | Attempts Processing Performed Authentication could not be completed but a proof of authentication attempt (CAVV) was generated | | U | Authentication Could Not Be Performed Authentication could not be completed, due to technical or other problem |

authorised[RW]

A boolean definition that indicates that the transaction was authorised. It will return false if the transaction was declined, rejected or cancelled due to CSC matching failures. Attention should be referenced to the AuthResult and Response code for accurate determination of the result.

avs_result[RW]

The AVS result codes determine the result of checking the AVS values within the Address Verification fraud system. If a transaction is declined due to the AVS code not matching, this value can help determine the reason for the decline. | Code | Description | |——|————| | Y | Address and 5 digit post code match | | M | Street address and Postal codes match for international transaction | | U | No AVS data available from issuer auth system | | A | Addres matches, post code does not | | I | Address information verified for international transaction | | Z | 5 digit post code matches, Address does not | | W | 9 digit post code matches, Address does not | | X | Postcode and address match | | B | Postal code not verified due to incompatible formats | | P | Postal codes match. Street address not verified due to to incompatible formats | | E | AVS Error | | C | Street address and Postal code not verified due to incompatible formats | | D | Street address and postal codes match | | | No information | | N | Neither postcode nor address match | | R | Retry, System unavailble or Timed Out | | S | AVS Service not supported by issuer or processor | | G | Issuer does not participate in AVS |

bin_commercial[RW]

Determines whether the bin range was found to be a commercial or business card.

bin_debit[RW]

Determines whether the bin range was found to be a debit card. If false the card was considered as a credit card.

bin_description[RW]

A description of the bin range found for the card.

cavv[RW]

The cardholder authentication verification value which can be returned for verification purposes of the authenticated transaction for dispute realisation.

context[RW]

The context which processed the transaction, can be used for support purposes to trace transactions.

csc_result[RW]

The CSC rseult codes determine the result of checking the provided CSC value within the Card Security Code fraud system. If a transaction is declined due to the CSC code not matching, this value can help determine the reason for the decline. | Code | Description | |——|————| | | No information | | M | Card verification data matches | | N | Card verification data was checked but did not match | | P | Card verification was not processed | | S | The card verification data should be on the card but the merchant indicates that it is not | | U | The card issuer is not certified |

currency[RW]

The currency the transaction was processed in. This is an `ISO4217` alpha currency value.

datetime[RW]

The UTC date time of the transaction in ISO data time format.

eci[RW]

An Electronic Commerce Indicator (ECI) used to identify the result of authentication using 3DSecure.

identifier[RW]

The identifier provided within the request.

live[RW]

Used to identify that a tranasction was processed on a live authorisation platform.

maskedpan[RW]

A masked value of the card number used for processing displaying limited values that can be used on a receipt.

merchantid[RW]

The merchant id that processed this transaction.

result[RW]

An integer result that indicates the outcome of the transaction. The Code value below maps to the result value | Code | Abbrev | Description | |——|——-|————-| | 0 | Declined | Declined | | 1 | Accepted | Accepted | | 2 | Rejected | Rejected | | 3 | Not Attempted | Not Attempted | | 4 | Referred | Referred | | 5 | PinRetry | Perform PIN Retry | | 6 | ForSigVer | Force Signature Verification | | 7 | Hold | Hold | | 8 | SecErr | Security Error | | 9 | CallAcq | Call Acquirer | | 10 | DNH | Do Not Honour | | 11 | RtnCrd | Retain Card | | 12 | ExprdCrd | Expired Card | | 13 | InvldCrd | Invalid Card No | | 14 | PinExcd | Pin Tries Exceeded | | 15 | PinInvld | Pin Invalid | | 16 | AuthReq | Authentication Required | | 17 | AuthenFail | Authentication Failed | | 18 | Verified | Card Verified | | 19 | Cancelled | Cancelled | | 20 | Un | Unknown |

result_code[RW]

The result code as defined in the Response Codes Reference for example 000 is an accepted live transaction whilst 001 is an accepted test transaction. Result codes identify the source of success and failure. Codes may start with an alpha character i.e. C001 indicating a type of error such as a card validation error.

result_message[RW]

The message regarding the result which provides further narrative to the result code.

scheme[RW]

A name of the card scheme of the transaction that processed the transaction such as Visa or MasterCard.

sha256[RW]

A SHA256 digest value of the transaction used to validate the response data The digest is calculated by concatenating * authcode * amount * response_code * merchant_id * trans_no * identifier * licence_key - which is not provided in the response.

trans_status[RW]

Used to identify the status of a transaction. The status is used to track a transaction through its life cycle. | Id | Description | |—-|————-| | O | Transaction is open for settlement | | A | Transaction is assigned for settlement and can no longer be voided | | S | Transaction has been settled | | D | Transaction has been declined | | R | Transaction has been rejected | | P | Transaction has been authorised only and awaiting a capture. Used in pre-auth situations | | C | Transaction has been cancelled | | E | Transaction has expired | | I | Transaction has been initialised but no action was able to be carried out | | H | Transaction is awaiting authorisation | | . | Transaction is on hold | | V | Transaction has been verified |

transno[RW]

The resulting transaction number, ordered incrementally from 1 for every merchant_id. The value will default to less than 1 for transactions that do not have a transaction number issued.

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/citypay_api_client/models/auth_response.rb, line 98
def self.attribute_map
  {
    :'amount' => :'amount',
    :'atrn' => :'atrn',
    :'atsd' => :'atsd',
    :'authcode' => :'authcode',
    :'authen_result' => :'authen_result',
    :'authorised' => :'authorised',
    :'avs_result' => :'avs_result',
    :'bin_commercial' => :'bin_commercial',
    :'bin_debit' => :'bin_debit',
    :'bin_description' => :'bin_description',
    :'cavv' => :'cavv',
    :'context' => :'context',
    :'csc_result' => :'csc_result',
    :'currency' => :'currency',
    :'datetime' => :'datetime',
    :'eci' => :'eci',
    :'identifier' => :'identifier',
    :'live' => :'live',
    :'maskedpan' => :'maskedpan',
    :'merchantid' => :'merchantid',
    :'result' => :'result',
    :'result_code' => :'result_code',
    :'result_message' => :'result_message',
    :'scheme' => :'scheme',
    :'sha256' => :'sha256',
    :'trans_status' => :'trans_status',
    :'transno' => :'transno'
  }
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/citypay_api_client/models/auth_response.rb, line 451
def self.build_from_hash(attributes)
  new.build_from_hash(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/citypay_api_client/models/auth_response.rb, line 171
def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `CityPayApiClient::AuthResponse` 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 `CityPayApiClient::AuthResponse`. 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?(:'amount')
    self.amount = attributes[:'amount']
  end

  if attributes.key?(:'atrn')
    self.atrn = attributes[:'atrn']
  end

  if attributes.key?(:'atsd')
    self.atsd = attributes[:'atsd']
  end

  if attributes.key?(:'authcode')
    self.authcode = attributes[:'authcode']
  end

  if attributes.key?(:'authen_result')
    self.authen_result = attributes[:'authen_result']
  end

  if attributes.key?(:'authorised')
    self.authorised = attributes[:'authorised']
  end

  if attributes.key?(:'avs_result')
    self.avs_result = attributes[:'avs_result']
  end

  if attributes.key?(:'bin_commercial')
    self.bin_commercial = attributes[:'bin_commercial']
  end

  if attributes.key?(:'bin_debit')
    self.bin_debit = attributes[:'bin_debit']
  end

  if attributes.key?(:'bin_description')
    self.bin_description = attributes[:'bin_description']
  end

  if attributes.key?(:'cavv')
    self.cavv = attributes[:'cavv']
  end

  if attributes.key?(:'context')
    self.context = attributes[:'context']
  end

  if attributes.key?(:'csc_result')
    self.csc_result = attributes[:'csc_result']
  end

  if attributes.key?(:'currency')
    self.currency = attributes[:'currency']
  end

  if attributes.key?(:'datetime')
    self.datetime = attributes[:'datetime']
  end

  if attributes.key?(:'eci')
    self.eci = attributes[:'eci']
  end

  if attributes.key?(:'identifier')
    self.identifier = attributes[:'identifier']
  end

  if attributes.key?(:'live')
    self.live = attributes[:'live']
  end

  if attributes.key?(:'maskedpan')
    self.maskedpan = attributes[:'maskedpan']
  end

  if attributes.key?(:'merchantid')
    self.merchantid = attributes[:'merchantid']
  end

  if attributes.key?(:'result')
    self.result = attributes[:'result']
  end

  if attributes.key?(:'result_code')
    self.result_code = attributes[:'result_code']
  end

  if attributes.key?(:'result_message')
    self.result_message = attributes[:'result_message']
  end

  if attributes.key?(:'scheme')
    self.scheme = attributes[:'scheme']
  end

  if attributes.key?(:'sha256')
    self.sha256 = attributes[:'sha256']
  end

  if attributes.key?(:'trans_status')
    self.trans_status = attributes[:'trans_status']
  end

  if attributes.key?(:'transno')
    self.transno = attributes[:'transno']
  end
end
openapi_nullable() click to toggle source

List of attributes with nullable: true

# File lib/citypay_api_client/models/auth_response.rb, line 164
def self.openapi_nullable
  Set.new([
  ])
end
openapi_types() click to toggle source

Attribute type mapping.

# File lib/citypay_api_client/models/auth_response.rb, line 131
def self.openapi_types
  {
    :'amount' => :'Integer',
    :'atrn' => :'String',
    :'atsd' => :'String',
    :'authcode' => :'String',
    :'authen_result' => :'String',
    :'authorised' => :'Boolean',
    :'avs_result' => :'String',
    :'bin_commercial' => :'Boolean',
    :'bin_debit' => :'Boolean',
    :'bin_description' => :'String',
    :'cavv' => :'String',
    :'context' => :'String',
    :'csc_result' => :'String',
    :'currency' => :'String',
    :'datetime' => :'DateTime',
    :'eci' => :'String',
    :'identifier' => :'String',
    :'live' => :'Boolean',
    :'maskedpan' => :'String',
    :'merchantid' => :'Integer',
    :'result' => :'Integer',
    :'result_code' => :'String',
    :'result_message' => :'String',
    :'scheme' => :'String',
    :'sha256' => :'String',
    :'trans_status' => :'String',
    :'transno' => :'Integer'
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/citypay_api_client/models/auth_response.rb, line 404
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      amount == o.amount &&
      atrn == o.atrn &&
      atsd == o.atsd &&
      authcode == o.authcode &&
      authen_result == o.authen_result &&
      authorised == o.authorised &&
      avs_result == o.avs_result &&
      bin_commercial == o.bin_commercial &&
      bin_debit == o.bin_debit &&
      bin_description == o.bin_description &&
      cavv == o.cavv &&
      context == o.context &&
      csc_result == o.csc_result &&
      currency == o.currency &&
      datetime == o.datetime &&
      eci == o.eci &&
      identifier == o.identifier &&
      live == o.live &&
      maskedpan == o.maskedpan &&
      merchantid == o.merchantid &&
      result == o.result &&
      result_code == o.result_code &&
      result_message == o.result_message &&
      scheme == o.scheme &&
      sha256 == o.sha256 &&
      trans_status == o.trans_status &&
      transno == o.transno
end
_deserialize(type, value) click to toggle source

Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data

# File lib/citypay_api_client/models/auth_response.rb, line 479
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
    CityPayApiClient.const_get(type).build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash

# File lib/citypay_api_client/models/auth_response.rb, line 548
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
avs_result=(avs_result) click to toggle source

Custom attribute writer method with validation @param [Object] avs_result Value to be assigned

# File lib/citypay_api_client/models/auth_response.rb, line 348
def avs_result=(avs_result)
  if !avs_result.nil? && avs_result.to_s.length > 1
    fail ArgumentError, 'invalid value for "avs_result", the character length must be smaller than or equal to 1.'
  end

  if !avs_result.nil? && avs_result.to_s.length < 1
    fail ArgumentError, 'invalid value for "avs_result", the character length must be great than or equal to 1.'
  end

  @avs_result = avs_result
end
build_from_hash(attributes) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself

# File lib/citypay_api_client/models/auth_response.rb, line 458
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.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[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    end # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end
csc_result=(csc_result) click to toggle source

Custom attribute writer method with validation @param [Object] csc_result Value to be assigned

# File lib/citypay_api_client/models/auth_response.rb, line 362
def csc_result=(csc_result)
  if !csc_result.nil? && csc_result.to_s.length > 1
    fail ArgumentError, 'invalid value for "csc_result", the character length must be smaller than or equal to 1.'
  end

  if !csc_result.nil? && csc_result.to_s.length < 1
    fail ArgumentError, 'invalid value for "csc_result", the character length must be great than or equal to 1.'
  end

  @csc_result = csc_result
end
currency=(currency) click to toggle source

Custom attribute writer method with validation @param [Object] currency Value to be assigned

# File lib/citypay_api_client/models/auth_response.rb, line 376
def currency=(currency)
  if !currency.nil? && currency.to_s.length > 3
    fail ArgumentError, 'invalid value for "currency", the character length must be smaller than or equal to 3.'
  end

  if !currency.nil? && currency.to_s.length < 3
    fail ArgumentError, 'invalid value for "currency", the character length must be great than or equal to 3.'
  end

  @currency = currency
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/citypay_api_client/models/auth_response.rb, line 438
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Integer] Hash code

# File lib/citypay_api_client/models/auth_response.rb, line 444
def hash
  [amount, atrn, atsd, authcode, authen_result, authorised, avs_result, bin_commercial, bin_debit, bin_description, cavv, context, csc_result, currency, datetime, eci, identifier, live, maskedpan, merchantid, result, result_code, result_message, scheme, sha256, trans_status, transno].hash
end
identifier=(identifier) click to toggle source

Custom attribute writer method with validation @param [Object] identifier Value to be assigned

# File lib/citypay_api_client/models/auth_response.rb, line 390
def identifier=(identifier)
  if !identifier.nil? && identifier.to_s.length > 50
    fail ArgumentError, 'invalid value for "identifier", the character length must be smaller than or equal to 50.'
  end

  if !identifier.nil? && identifier.to_s.length < 4
    fail ArgumentError, 'invalid value for "identifier", the character length must be great than or equal to 4.'
  end

  @identifier = identifier
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/citypay_api_client/models/auth_response.rb, line 295
def list_invalid_properties
  invalid_properties = Array.new
  if !@avs_result.nil? && @avs_result.to_s.length > 1
    invalid_properties.push('invalid value for "avs_result", the character length must be smaller than or equal to 1.')
  end

  if !@avs_result.nil? && @avs_result.to_s.length < 1
    invalid_properties.push('invalid value for "avs_result", the character length must be great than or equal to 1.')
  end

  if !@csc_result.nil? && @csc_result.to_s.length > 1
    invalid_properties.push('invalid value for "csc_result", the character length must be smaller than or equal to 1.')
  end

  if !@csc_result.nil? && @csc_result.to_s.length < 1
    invalid_properties.push('invalid value for "csc_result", the character length must be great than or equal to 1.')
  end

  if !@currency.nil? && @currency.to_s.length > 3
    invalid_properties.push('invalid value for "currency", the character length must be smaller than or equal to 3.')
  end

  if !@currency.nil? && @currency.to_s.length < 3
    invalid_properties.push('invalid value for "currency", the character length must be great than or equal to 3.')
  end

  if !@identifier.nil? && @identifier.to_s.length > 50
    invalid_properties.push('invalid value for "identifier", the character length must be smaller than or equal to 50.')
  end

  if !@identifier.nil? && @identifier.to_s.length < 4
    invalid_properties.push('invalid value for "identifier", the character length must be great than or equal to 4.')
  end

  invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_hash (backward compatibility) @return [Hash] Returns the object in the form of hash

# File lib/citypay_api_client/models/auth_response.rb, line 524
def to_body
  to_hash
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/citypay_api_client/models/auth_response.rb, line 530
def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.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() click to toggle source

Returns the string representation of the object @return [String] String presentation of the object

# File lib/citypay_api_client/models/auth_response.rb, line 518
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/citypay_api_client/models/auth_response.rb, line 334
def valid?
  return false if !@avs_result.nil? && @avs_result.to_s.length > 1
  return false if !@avs_result.nil? && @avs_result.to_s.length < 1
  return false if !@csc_result.nil? && @csc_result.to_s.length > 1
  return false if !@csc_result.nil? && @csc_result.to_s.length < 1
  return false if !@currency.nil? && @currency.to_s.length > 3
  return false if !@currency.nil? && @currency.to_s.length < 3
  return false if !@identifier.nil? && @identifier.to_s.length > 50
  return false if !@identifier.nil? && @identifier.to_s.length < 4
  true
end