public interface TransactionGateway
TransactionGateway
interface must be implemented by any transaction gateway class
that will be used by the Yello EMV transaction library.
TransactionGateways
enumerated type. All these transaction gateway
classes implement the TransactionGateway
interface.
TransactionGateway
interface.TransactionGatewayFactory
via the method TransactionGatewayFactory.registerCurrentGateway(TransactionGateway)
public class MyAutoApprovedGateway implements TransactionGateway { private boolean connected = false; public void connect() throws IOException { connected = true; } public void disconnect() throws IOException { connected = false; } public boolean isConnected() { return connected; } public boolean isKeepAliveConnection() { return false; } public TransactionGatewayStatus sendOnlineRequest(TransactionRecord transaction) throws IOException { System.out.println("MyAutoApprovedGateWay: sendOnlineRequest"); return new TransactionGatewayStatus(TransactionGatewayResult.APPROVED); } public void sendReversalRequest(TransactionRecord transaction) throws IOException { System.out.println("MyAutoApprovedGateway: sendReversalRequest"); } public void sendCancelRequest(TransactionRecord transaction) throws IOException { System.out.println("MyAutoApprovedGateway: sendCancelRequest"); } public void sendBatchTransactions(List<TransactionRecord> transactionHistory) throws IOException { System.out.println("MyAutoApprovedGateway: sendBatchTransactions"); } } ... MyAutoApprovedGateway gateway = new MyAutoApprovedGateway(); TransactionGatewayFactory gFactory = TransactionGatewayFactory.getInstance(); gFactory.registerCurrentGateway(gateway);
Modifier and Type | Method and Description |
---|---|
TransactionGatewayStatus |
cancelAuthorizedTransaction(TransactionRecord transaction)
Sends a request to the transaction gateway to cancel a transaction that has been
authorized by the transaction gateway
|
void |
connect(TransactionRecord transactionRecord)
Connects to the transaction gateway.
|
void |
disconnect()
Disconnects from a transaction gateway.
|
java.util.LinkedList<com.yello.api.secure.configuration.EMVConfiguration> |
getEMVConfigs(TransactionRecord transaction)
Gets list of EMV configuration from transaction gateway
|
boolean |
isConnected()
Checks whether a connection is established with the transaction gateway.
|
boolean |
isKeepAliveConnection()
Checks whether the connection to the transaction gateway is to be kept alive.
|
boolean |
requireAutoSettlement()
Checks whether the transaction gateway requires the transaction to be settled
automatically upon completion/approval.
|
TransactionGatewayStatus |
sendOnlineRequest(TransactionRecord transaction)
Sends an online authorization request to the transaction gateway.
|
TransactionGatewayStatus |
sendReversalRequest(TransactionRecord transaction)
Sends a reversal request to the transaction gateway if the card declines the transaction
even though it was authorized by the transaction gateway before-hand.
|
TransactionGatewayStatus |
settleTransaction(TransactionRecord transaction)
Settles a completed transaction with the transaction gateway.
|
void connect(TransactionRecord transactionRecord) throws java.io.IOException
transactionRecord
- TransactionRecord
holding information about the transaction
to perform.java.io.IOException
- if there is a communication issue while trying to connect to the
transaction gateway.void disconnect() throws java.io.IOException
java.io.IOException
- if there is communication issue while closing the connection to the
transaction gateway.boolean isConnected()
isConnected()
can always return either true or false.boolean isKeepAliveConnection()
boolean requireAutoSettlement()
TransactionGatewayStatus sendOnlineRequest(TransactionRecord transaction) throws java.lang.Exception
transaction
- TransactionRecord
holding information about the transaction to
authorize. For more information check
TransactionRecord
TransactionGatewayStatus
holding the result of the processing at the
transaction gateway. For more information check TransactionGatewayStatus
.java.lang.Exception
- if there is a communication issue while handling the online request.TransactionGatewayStatus sendReversalRequest(TransactionRecord transaction) throws java.lang.Exception
transaction
- TransactionRecord
holding information about the transaction for
which to handle the reversal. For more
information check TransactionRecord
TransactionGatewayStatus
holding the result of the processing at the
transaction gateway. For more information check TransactionGatewayStatus
.java.io.IOException
- if there is a communication issue while handling the reversal request.java.lang.Exception
TransactionGatewayStatus cancelAuthorizedTransaction(TransactionRecord transaction) throws java.lang.Exception
transaction
- TransactionRecord
holding information about the transaction to
cancel. For more information check
TransactionRecord
TransactionGatewayStatus
holding the result of the processing at the
transaction gateway. For more information check TransactionGatewayStatus
.java.io.IOException
- if there is a communication issue while handling the cancel request.java.lang.Exception
TransactionGatewayStatus settleTransaction(TransactionRecord transaction) throws java.lang.Exception
transaction
- TransactionRecord
holding information about the transaction to
settle. For more information check
TransactionRecord
TransactionGatewayStatus
holding the result of the processing at the
transaction gateway. For more information check TransactionGatewayStatus
.java.io.IOException
- if there is a communication issue while performing the batch process.java.lang.Exception
java.util.LinkedList<com.yello.api.secure.configuration.EMVConfiguration> getEMVConfigs(TransactionRecord transaction) throws java.lang.Exception
transaction
- TransactionRecord
holding information that can be used by the
transaction gateway when performing this operationLinkedList
of EMVConfiguration
representing the of list
of EMV configurations obtained from tha transaction gateway.java.lang.Exception
- if there is a communication issue while handling the online request.Copyright © 2019 Yello. All rights reserved.