Calling Methods
Initial Configuration
import com.oracle.fb.kioskpaymentinterface.*;
import com.oracle.fb.kioskpaymentinterface.generated.*;
import com.oracle.fb.kioskpaymentinterface.kiosklogging.KioskLogging;
import com.oracle.fb.kioskpaymentinterface.kiosklogging.KioskLogging.LogLevels;
KioskPaymentinterface kioskPaymentinterface = new KioskPaymentinterface(rootPath);
When creating the KioskPaymentinterface object, an option parameter can be passed to
indicate where the configuration file kioskpaymentinterface.properties
can be located if not in the same location as the JAR file.
IsOnline
IsOnlineResponse response = new IsOnlineResponse();
response = kioskPaymentinterface.isOnline();
ReadNonPCICard
ReadNonPCICardResponse response = new ReadNonPCICardResponse();
response = kioskPaymentinterface.readNonPCICard();
SaleTransaction
SaleParameters request = new SaleParameters();
SaleResponse response = new SaleResponse();
request.setTransAmount("100"));
request.setTipAmount("0"));
request.setOperator("900001""));
request.setGuestNo("1");
response = kioskPaymentinterface.saleTransaction(request);
VoidTransaction
The void parameters are the details as returned from a SaleTransaction request:
VoidParameters request = new VoidParameters();
VoidResponse response = new VoidResponse();
request.setTransAmount(saleResponse.getTransAmount());
request.setOriginalRRN(saleResponse.getOriginalRRN());
request.setAlternateTransRef(saleResponse.getAlternateTransRef());
request.setTransToken(saleResponse.getTransToken());
request.setIssuerId(saleResponse.getIssuerId());
request.setPAN(saleResponse.getPAN());
request.setExpiryDate(saleResponse.getExpiryDate());
request.setOperator(saleResponse.getOperator());
request.setGuestNo(saleResponse.getGuestNo());
response = kioskPaymentinterface.voidTransaction(request);
Logging callback
The host can create a logging interface to let KioskPaymentinterface send log messages as shown in the following code:
public static class KioskLoggingClass implements KioskLogging.loggingListener {
/*
Interface to receive logging from the Kiosk Payment Interface
LogLevels
FATAL(100)
ERROR(200)
WARN(300)
INFO(400)
DEBUG(500)
*/
public KioskLoggingClass() {
KioskLogging kioskLogging = new KioskLogging();
kioskLogging.setLoggingListener(this);
}
@Override
public void log(KioskLogging.LogLevels logLevel, String logMessage) {
// Here this would be redirected to the host's logging
}
}
Parent topic: Configuration