com.mypos.myposcheckout.ipc.response

 

Class ComplexResponse

java.lang.Objectcom.mypos.myposcheckout.ipc.response.BasicResponse com.mypos.myposcheckout.ipc.response.ComplexResponse


public class ComplexResponse
extends BasicResponse
IPC Response class. Parse and validate income data into a multi level deep key => value structure.

 

Field Summary

Fields inherited from class com.mypos.myposcheckout.ipc.response.BasicResponse

basicDataconfigdataNormalizedformatrawDatasignature

 

Constructor Summary

Constructors
Constructor and Description
ComplexResponse(BasicResponse response) 
ComplexResponse(Config config, java.lang.String rawData, CommunicationFormat format) 

 

Method Summary

All MethodsInstance MethodsConcrete Methods
Modifier and Type Method and Description
protected void decodeRawData()
Decodes the API response into a multi level deep key => value structure.
protected void extractSignature()
Extract the Base64 encoded signature from the decoded and normalized API response.
ResponseNode<java.lang.String,java.lang.String> getComplexData() 
protected byte[] getSignedData()
Concatenates all response parameters, so they can be used to recreate the data, which was signed by the API.
protected void normalizeData()
Transforms the decoded response data at root level into a normal form (all the keys converted to lowercase).

 

Methods inherited from class com.mypos.myposcheckout.ipc.response.BasicResponse

getBasicDatagetConfiggetDataNormalizedgetFormatgetRawDatagetStatusCodegetStatusMessageprocessApiResponseverifySignature

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ComplexResponse

public ComplexResponse(Config config,
                       java.lang.String rawData,
                       CommunicationFormat format)
                throws IPCException
Throws:
IPCException

ComplexResponse

public ComplexResponse(BasicResponse response)
                throws IPCException
Throws:
IPCException

 

Method Detail

getComplexData

public ResponseNode<java.lang.String,java.lang.String> getComplexData()

decodeRawData

protected void decodeRawData()
                      throws IPCException
Decodes the API response into a multi level deep key => value structure.
Overrides:
decodeRawData in class BasicResponse
Throws:
IPCException - If the response could not be decoded. If the communication format is not set, or invalid.

getSignedData

protected byte[] getSignedData()
                        throws IPCException
Concatenates all response parameters, so they can be used to recreate the data, which was signed by the API.
Overrides:
getSignedData in class BasicResponse
Returns:
a Base64 encoded representation of the data, signed by the API
Throws:
IPCException - if the response data could not be decoded

normalizeData

protected void normalizeData()
Transforms the decoded response data at root level into a normal form (all the keys converted to lowercase).
Overrides:
normalizeData in class BasicResponse

extractSignature

protected void extractSignature()
Extract the Base64 encoded signature from the decoded and normalized API response.
Overrides:
extractSignature in class BasicResponse