Search in sources :

Example 1 with Connection

use of com.ingenico.connect.gateway.sdk.java.Connection in project connect-sdk-java by Ingenico-ePayments.

the class DefaultConnectionLoggerTest method createClient.

@SuppressWarnings("resource")
private Client createClient(HttpHost host, int connectTimeout, int socketTimeout) throws URISyntaxException {
    URI uri = new URI(host.getSchemeName(), null, host.getHostName(), host.getPort(), null, null, null);
    Connection connection = new DefaultConnection(connectTimeout, socketTimeout);
    Authenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKey", "secret");
    MetaDataProvider metaDataProvider = new MetaDataProvider("Ingenico");
    Session session = new Session(uri, connection, authenticator, metaDataProvider);
    Communicator communicator = Factory.createCommunicator(session);
    Client client = Factory.createClient(communicator);
    return client;
}
Also used : MetaDataProvider(com.ingenico.connect.gateway.sdk.java.MetaDataProvider) Communicator(com.ingenico.connect.gateway.sdk.java.Communicator) Connection(com.ingenico.connect.gateway.sdk.java.Connection) TestConnection(com.ingenico.connect.gateway.sdk.java.domain.services.TestConnection) Client(com.ingenico.connect.gateway.sdk.java.Client) URI(java.net.URI) Authenticator(com.ingenico.connect.gateway.sdk.java.Authenticator) Session(com.ingenico.connect.gateway.sdk.java.Session)

Example 2 with Connection

use of com.ingenico.connect.gateway.sdk.java.Connection in project connect-sdk-java by Ingenico-ePayments.

the class DefaultConnectionIdempotenceTest method createClient.

@SuppressWarnings("resource")
private Client createClient(HttpHost host) {
    Connection connection = new DefaultConnection(500, 500);
    Authenticator authenticator = new DefaultAuthenticator(AuthorizationType.V1HMAC, "apiKey", "secret");
    MetaDataProvider metaDataProvider = new MetaDataProvider("Ingenico");
    Session session = new Session(URI.create(host.toURI()), connection, authenticator, metaDataProvider);
    Communicator communicator = Factory.createCommunicator(session);
    Client client = Factory.createClient(communicator);
    return client;
}
Also used : MetaDataProvider(com.ingenico.connect.gateway.sdk.java.MetaDataProvider) Communicator(com.ingenico.connect.gateway.sdk.java.Communicator) Connection(com.ingenico.connect.gateway.sdk.java.Connection) Client(com.ingenico.connect.gateway.sdk.java.Client) Authenticator(com.ingenico.connect.gateway.sdk.java.Authenticator) Session(com.ingenico.connect.gateway.sdk.java.Session)

Aggregations

Authenticator (com.ingenico.connect.gateway.sdk.java.Authenticator)2 Client (com.ingenico.connect.gateway.sdk.java.Client)2 Communicator (com.ingenico.connect.gateway.sdk.java.Communicator)2 Connection (com.ingenico.connect.gateway.sdk.java.Connection)2 MetaDataProvider (com.ingenico.connect.gateway.sdk.java.MetaDataProvider)2 Session (com.ingenico.connect.gateway.sdk.java.Session)2 TestConnection (com.ingenico.connect.gateway.sdk.java.domain.services.TestConnection)1 URI (java.net.URI)1