public class PaymentService
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Method and Description |
---|---|
void |
abort(java.lang.String transactionID,
java.lang.String dateTime)
Performs template abort transaction.
|
void |
cancellation(int terminalNum,
java.lang.String transactionID,
java.lang.String dateTime,
java.lang.String targetID,
int amount,
java.lang.String currency)
Performs template cancellation transaction.
|
boolean |
connect()
Connects (sync) to set hostname and port.
|
void |
connectionStatus(java.lang.String transactionID,
java.lang.String dateTime)
Performs checking of internet connection status.
|
void |
disconnect()
Disconnects from connected hostname.
|
java.lang.String |
getHostname() |
static PaymentService |
getInstance() |
static PaymentService |
getInstance(iConnection connection) |
java.lang.String |
getPort() |
boolean |
isConnected() |
boolean |
listen(ResponseListener responseListener)
Receives responses from connection.
|
void |
refund(int terminalNum,
java.lang.String transactionID,
java.lang.String dateTime,
int amount,
java.lang.String currency)
Performs template refund transaction.
|
void |
requestReconciliation(java.lang.String transactionID,
java.lang.String dateTime)
Performs reconciliation request.
|
void |
sale(int terminalNum,
java.lang.String transactionID,
java.lang.String dateTime,
int amount,
int tip,
java.lang.String currency)
Performs template sale transaction.
|
void |
sale(int terminalNum,
java.lang.String transactionID,
java.lang.String dateTime,
int amount,
java.lang.String currency)
Performs template sale transaction.
|
void |
scan(int terminalNum,
java.lang.String transactionID,
java.lang.String dateTime)
Start scanner mode.
|
void |
scanCamera(int terminalNum,
java.lang.String transactionID,
java.lang.String dateTime)
Start scanner mode with camera view.
|
void |
sendTransaction(Transaction transaction)
Sends transaction to connected hostname.
|
void |
setHostname(java.lang.String hostname) |
void |
setLogger(Logger logger,
LogLevel logLevel) |
void |
setPort(int port) |
public static PaymentService getInstance(iConnection connection)
public static PaymentService getInstance()
public boolean connect()
public boolean isConnected()
public boolean listen(ResponseListener responseListener)
responseListener
- Returns catched responses.public void disconnect() throws java.io.IOException
java.io.IOException
public void sendTransaction(Transaction transaction) throws TransactionFieldException
transaction
- TransactionFieldException
public void scan(int terminalNum, java.lang.String transactionID, java.lang.String dateTime) throws TransactionFieldException
terminalNum
- Target terminal number.transactionID
- TransactionFieldException
public void scanCamera(int terminalNum, java.lang.String transactionID, java.lang.String dateTime) throws TransactionFieldException
terminalNum
- Target terminal number.transactionID
- TransactionFieldException
public void sale(int terminalNum, java.lang.String transactionID, java.lang.String dateTime, int amount, java.lang.String currency) throws TransactionFieldException
terminalNum
- Target terminal number.transactionID
- amount
- currency
- TransactionFieldException
public void sale(int terminalNum, java.lang.String transactionID, java.lang.String dateTime, int amount, int tip, java.lang.String currency) throws TransactionFieldException
terminalNum
- transactionID
- amount
- tip
- currency
- TransactionFieldException
public void refund(int terminalNum, java.lang.String transactionID, java.lang.String dateTime, int amount, java.lang.String currency) throws TransactionFieldException
terminalNum
- Target terminal number.transactionID
- ID of transaction.amount
- Amount of refund transaction.currency
- Currency of refund transaction.TransactionFieldException
public void cancellation(int terminalNum, java.lang.String transactionID, java.lang.String dateTime, java.lang.String targetID, int amount, java.lang.String currency) throws TransactionFieldException
terminalNum
- Target terminal number.transactionID
- ID of this transaction.targetID
- Target transaction ID.amount
- Amount of cancellation transaction.currency
- Currency of cancellation transaction.TransactionFieldException
public void abort(java.lang.String transactionID, java.lang.String dateTime) throws TransactionFieldException
transactionID
- ID of this transaction.TransactionFieldException
public void connectionStatus(java.lang.String transactionID, java.lang.String dateTime) throws TransactionFieldException
TransactionFieldException
public void requestReconciliation(java.lang.String transactionID, java.lang.String dateTime) throws TransactionFieldException
TransactionFieldException
public java.lang.String getPort()
public void setPort(int port)
public void setHostname(java.lang.String hostname)
public java.lang.String getHostname()