Class GatewayConnector


  • public class GatewayConnector
    extends java.lang.Object
    Handles connections to the eWay servers. Based on public domain sample code provided by eWay.com.au
    • Constructor Detail

      • GatewayConnector

        public GatewayConnector​(int timeout)
      • GatewayConnector

        public GatewayConnector()
    • Method Detail

      • getTimeout

        public int getTimeout()
        Get the timeout value set in the corresponding setter.
        Returns:
        timeout value in seconds, 0 for infinite
      • setTimeout

        public void setTimeout​(int time)
        Set the timout value. Note that setting the timeout for an HttpURLConnection is possible only since Java 1.5. This method has no effect on earlier versions.
        Parameters:
        time - timeout value in seconds, 0 for infinite
      • sendRequest

        public GatewayResponse sendRequest​(GatewayRequest request)
                                    throws java.lang.Exception
        Send a request to the payment gateway and get the response. This is a blocking method: when it returns the response object is filled in with the parameters from the gateway.
        Parameters:
        request - the request object, can be any of the 3 supported payment methods. Its data have to be filled in by its setter methods before calling sendRequest().
        Returns:
        the response object, containing the gateway's response to the request
        Throws:
        java.lang.Exception - in case of networking and xml parsing errors