use of com.ingenico.connect.gateway.sdk.java.MetaDataProvider in project connect-sdk-java by Ingenico-ePayments.
the class MultiLineHeaderTest method test.
/**
* Smoke test for products service.
*/
@Test
public void test() throws URISyntaxException, IOException {
CommunicatorConfiguration configuration = getCommunicatorConfiguration();
String multiLineHeader = " some value \r\n \n with some \r\n spaces ";
MetaDataProvider metaDataProvider = new MetaDataProviderBuilder("Ingenico").withAdditionalRequestHeader(new RequestHeader("X-GCS-MultiLineHeader", multiLineHeader)).build();
DirectoryParams params = new DirectoryParams();
params.setCountryCode("NL");
params.setCurrencyCode("EUR");
Session session = Factory.createSessionBuilder(configuration).withMetaDataProvider(metaDataProvider).build();
Client client = Factory.createClient(session);
try {
Directory response = client.merchant("8500").products().directory(809, params);
Assert.assertTrue(response.getEntries().size() > 0);
} finally {
client.close();
}
}
use of com.ingenico.connect.gateway.sdk.java.MetaDataProvider 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.MetaDataProvider in project connect-sdk-java by Ingenico-ePayments.
the class PaymentsClientTest method initializeSession.
@Before
public void initializeSession() {
URI apiEndpoint = URI.create("http://localhost");
session = new Session(apiEndpoint, connection, new DefaultAuthenticator(AuthorizationType.V1HMAC, "test", "test"), new MetaDataProvider("Ingenico"));
}
use of com.ingenico.connect.gateway.sdk.java.MetaDataProvider 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