use of com.ingenico.connect.gateway.sdk.java.domain.product.Directory in project connect-sdk-java by Ingenico-ePayments.
the class PaymentProductsTest method test.
/**
* Smoke test for products service.
*/
@Test
public void test() throws URISyntaxException, IOException {
DirectoryParams params = new DirectoryParams();
params.setCountryCode("NL");
params.setCurrencyCode("EUR");
Client client = getClient();
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.domain.product.Directory in project connect-sdk-java by Ingenico-ePayments.
the class GetDirectoryExample method example.
@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
Client client = getClient();
try {
DirectoryParams query = new DirectoryParams();
query.setCountryCode("NL");
query.setCurrencyCode("EUR");
Directory response = client.merchant("merchantId").products().directory(809, query);
} finally {
client.close();
}
}
use of com.ingenico.connect.gateway.sdk.java.domain.product.Directory 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();
}
}
Aggregations