use of com.ingenico.connect.gateway.sdk.java.Authenticator 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;
}
use of com.ingenico.connect.gateway.sdk.java.Authenticator 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;
}
Aggregations