Package com.six.timapi
Class TimException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.six.timapi.TimException
-
- All Implemented Interfaces:
Serializable
public class TimException extends Exception
Contains information about a failed request or method call. For synchronous method calls TimException is thrown as exception. For asynchronous method calls TimException is included in the TimEvent. Immutable class.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TimException(ResultCode resultCode)
Create exception.TimException(ResultCode resultCode, String errorMessage, NativeError nativeError, PpInfo ppInfo, Map<String,String> additionalErrorInfo, PrintData printData, Basket rejectedBasket)
Create exception.TimException(ResultCode resultCode, String errorMessage, String localizedMessage, NativeError nativeError, PpInfo ppInfo, Map<String,String> additionalErrorInfo, PrintData printData, Basket rejectedBasket)
Create exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Map<String,String>
getAdditionalErrorInfo()
Additional error information mapping error text to error type.String
getErrorMessage()
Returns the error message as transmitted from the terminal.String
getLocalizedMessage()
Returns the localised error message in human readable form derived from the error code sent by the terminal.String
getLocalizedMessage(String language)
Returns the localized error message in human readable form derived from the error code sent by the terminal.String
getMessage()
Deprecated.NativeError
getNativeError()
Native error if present.PpInfo
getPpInfo()
Payment protocol specific information.PrintData
getPrintData()
Print data, e.g.Basket
getRejectedBasket()
Rejected basket as modified by host or null if absent.ResultCode
getResultCode()
Contains the result code with the error.void
setPrintData(PrintData printData)
Set print data.String
toString()
String representation for debugging purpose.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
TimException
public TimException(ResultCode resultCode)
Create exception.
-
TimException
public TimException(ResultCode resultCode, String errorMessage, NativeError nativeError, PpInfo ppInfo, Map<String,String> additionalErrorInfo, PrintData printData, Basket rejectedBasket)
Create exception.
-
TimException
public TimException(ResultCode resultCode, String errorMessage, String localizedMessage, NativeError nativeError, PpInfo ppInfo, Map<String,String> additionalErrorInfo, PrintData printData, Basket rejectedBasket)
Create exception.
-
-
Method Detail
-
getErrorMessage
public String getErrorMessage()
Returns the error message as transmitted from the terminal. The message language depends on the terminal but will generally be in English. An empty string is returned if the terminal does not send a message.
-
getLocalizedMessage
public String getLocalizedMessage()
Returns the localised error message in human readable form derived from the error code sent by the terminal. The message will be in the merchant language of the terminal provided systemInformation() has been executed (English otherwise).- Overrides:
getLocalizedMessage
in classThrowable
-
getLocalizedMessage
public String getLocalizedMessage(String language)
Returns the localized error message in human readable form derived from the error code sent by the terminal. The message will be in the language supplied in the parameter. Valid language strings are currently: "en","de","de-AT","de-CH","fr","fr-BE","fr-CH","it","bg", "hr","cs","nl","nl-BE","nl-NL","el","hu","lt","pl","pt","ro","sk","sl","es","sv","fi","no","da" "de" defaults to "de-CH" "fr" defaults to "fr-CH" "nl" defaults to "nl-BE"
-
getMessage
@Deprecated public String getMessage()
Deprecated.Returns the error message as transmitted from the terminal. Internally this method calls getErrorMessage(). It is deprecated and only here for historical reasons.- Overrides:
getMessage
in classThrowable
-
getResultCode
public ResultCode getResultCode()
Contains the result code with the error.
-
getNativeError
public NativeError getNativeError()
Native error if present.
-
getPpInfo
public PpInfo getPpInfo()
Payment protocol specific information.
-
getAdditionalErrorInfo
public Map<String,String> getAdditionalErrorInfo()
Additional error information mapping error text to error type.
-
getPrintData
public PrintData getPrintData()
Print data, e.g. with declined receipt.
-
setPrintData
public void setPrintData(PrintData printData)
Set print data. Used only to replace print data after formatting receipts.
-
getRejectedBasket
public Basket getRejectedBasket()
Rejected basket as modified by host or null if absent. Used forGuides.PETROL
only.
-
-