com.mypos.myposcheckout.ipc.request

 

Class Refund

java.lang.Object com.mypos.myposcheckout.ipc.request.Request com.mypos.myposcheckout.ipc.request.Refund


public class Refund
extends Request
Process IPC method: IPCRefund. This method is used by the Merchant to initiate a refund of a previously executed payment.

 

Field Summary

Fields inherited from class com.mypos.myposcheckout.ipc.request.Request

configoutputFormat

 

Constructor Summary

Constructors
Constructor and Description
Refund(Config config) 

 

Method Summary

All MethodsInstance MethodsConcrete Methods
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

addRequestParamaddRequestParamaddRequestParamaddRequestParamaddRequestParamaddStandardParamsclearRequestParamscreateApiCallFormHtmlcreateApiCallFormHtml,createApiCallFormHtmlcreateSignaturegetConfiggetOutputFormatgetSignedRequestParamsprocessApiCallremoveRequestParamsetConfigsetOutputFormat

 

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
Checks if the class members are valid API request parameter values.
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
Gather all request parameters needed to make an API call, and make one. Checks the API response if the transaction reference, amount and currency, are matching the ones from the purchase request.
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.