Class: SVStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/SVClient/SVStatus.rb

Overview

© 2011 QwikCilver Solutions Private Limited, All Rights Reserved.

Overview

Class that contains the different Status Codes.

Author:

  • Nityananda

Constant Summary collapse

SUCCESS =

SUCCESS - Return value that indicates SUCCESS

0
HTTP_OK =
200
TOTALS_MATCH_BATCH_CLOSED =

TOTALS_MATCH_BATCH_CLOSED - Batch Closed/Settlement Done. Totals at the Client end and QwikCilver Server end match.

0
TOTALS_MISMATCH_BATCH_CLOSED =

TOTALS_MISMATCH_BATCH_CLOSED - Batch Closed/Settlement Done. Totals at the Client End and QwikCilver Server end do not match.

99
UNKNOWN_ERROR =

UNKNOWN_ERROR - Unknown Error (Generic Error code).

801
INVALID_PARAM =

INVALID_PARAM - Invalid Parameters, Usually thrown if there are any invalid or type mismatch parameters found.

802
NOT_INITIALIZED_ERROR =

NOT_INITIALIZED_ERROR - If a factory method is called without initializing the SV Client library.

803
SERVICE_UNAVAILABLE_ERROR =

SERVICE_UNAVAILABLE_ERROR - If server returns a bad response or if the server is down.

804
OPERATION_FAILED_ERROR =

OPERATION_FAILED_ERROR - Describes if the requested operation was failed due to various reasons such as server error, network down time etc.,

805
CONNECTION_TIMEOUT_ERROR =

CONNECTION_TIMEOUT_ERROR - Thrown if the connection is timed out for the transaction’s response.

806
REQUEST_SEND_ERROR =

REQUEST_SEND_ERROR - Unable to send the request to the server.

807
UNSUPPORTED_TYPE_ERROR =

UNSUPPORTED_TYPE_ERROR - The requested interface or the POSType is currently not supported.

808
MISSING_MANDATORY_ATTRIBUTES =

MISSING_MANDATORY_ATTRIBUTES - One or more of the required attributes missing.

809
UNSUPPORTED_POS_TYPE =

UNSUPPORTED_POS_TYPE - The requested POSType is currently not supported by the client.

810
INVALID_VALUE =

INVALID_VALUE - Invalid value.

-1

Class Method Summary collapse

Class Method Details

.gethttpmessage(httpresponse) ⇒ Object



79
80
81
# File 'lib/SVClient/SVStatus.rb', line 79

def self.gethttpmessage(httpresponse)
  return "HTTP Error [ #{httpresponse}]"
end

.getmessage(code) ⇒ Object

Use this function to get the proper error message for the respective error code.



73
74
75
76
77
# File 'lib/SVClient/SVStatus.rb', line 73

def self.getmessage(code)
  return nil if code == nil
  return SVStatus::ERROR_MESSAGES[INVALID_VALUE] if ERROR_MESSAGES[code] == nil
  return SVStatus::ERROR_MESSAGES[code]
end