Class GatewayConnector

java.lang.Object
org.apache.ofbiz.accounting.thirdparty.eway.GatewayConnector

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

    • GatewayConnector

      public GatewayConnector(int timeout)
    • GatewayConnector

      public GatewayConnector()
  • Method Details

    • 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 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:
      Exception - in case of networking and xml parsing errors