Class Refund
public class Refund extends Request
Field Summary
Fields inherited from class com.mypos.myposcheckout.ipc.request.Request
config, outputFormat
Constructor Summary
Constructor and Description |
---|
Refund(Config config) |
Method Summary
Modifier and Type | Method and Description |
---|---|
java.math.BigDecimal |
getAmount() |
Currency |
getCurrency() |
java.lang.String |
getOrderId() |
java.lang.String |
getTrnRef() |
boolean |
process()
Gather all request parameters needed to make an API call, and make one.
|
void |
setAmount(java.math.BigDecimal amount) |
void |
setAmount(double amount) |
void |
setCurrency(Currency currency) |
void |
setOrderId(java.lang.String orderId) |
void |
setTrnRef(java.lang.String trnRef) |
boolean |
validate()
Checks if the class members are valid API request parameter values.
|
Methods inherited from class com.mypos.myposcheckout.ipc.request.Request
addRequestParam, addRequestParam, addRequestParam, addRequestParam, addRequestParam, addStandardParams, clearRequestParams, createApiCallFormHtml, createApiCallFormHtml,createApiCallFormHtml, createSignature, getConfig, getOutputFormat, getSignedRequestParams, processApiCall, removeRequestParam, setConfig, setOutputFormat
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Constructor Detail
Refund
public Refund(Config config)
Method Detail
getCurrency
public Currency getCurrency()
setCurrency
public void setCurrency(Currency currency)
getAmount
public java.math.BigDecimal getAmount()
setAmount
public void setAmount(double amount)
setAmount
public void setAmount(java.math.BigDecimal amount)
getTrnRef
public java.lang.String getTrnRef()
setTrnRef
public void setTrnRef(java.lang.String trnRef)
getOrderId
public java.lang.String getOrderId()
setOrderId
public void setOrderId(java.lang.String orderId)
validate
public boolean validate() throws IPCException
- Returns:
- true if all members can be used as valid API request parameters
- Throws:
IPCException
- If there are values which are missing, or invalid API request parameters.
process
public boolean process() throws IPCException
- Returns:
- true if all parameters and configurations are valid, or false if either the transaction reference, the amount or the currency don't match with the ones from the order.
- Throws:
IPCException
- If there are invalid or missing parameters, or configuration values. If there were errors while making the call to the API, or decoding it's response.