Class ComplexResponse
public class ComplexResponse extends BasicResponse
Field Summary
Fields inherited from class com.mypos.myposcheckout.ipc.response.BasicResponse
basicData, config, dataNormalized, format, rawData, signature
Constructor Summary
| Constructor and Description |
|---|
ComplexResponse(BasicResponse response) |
ComplexResponse(Config config, java.lang.String rawData, CommunicationFormat format) |
Method Summary
| 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
getBasicData, getConfig, getDataNormalized, getFormat, getRawData, getStatusCode, getStatusMessage, processApiResponse, verifySignature
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitConstructor 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
- Overrides:
decodeRawDatain classBasicResponse- Throws:
IPCException- If the response could not be decoded. If the communication format is not set, or invalid.
getSignedData
protected byte[] getSignedData()
throws IPCException
- Overrides:
getSignedDatain classBasicResponse- 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()
- Overrides:
normalizeDatain classBasicResponse
extractSignature
protected void extractSignature()
- Overrides:
extractSignaturein classBasicResponse