Search in sources :

Example 1 with DirectoryParams

use of com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams 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();
    }
}
Also used : DirectoryParams(com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams) Client(com.ingenico.connect.gateway.sdk.java.Client) Directory(com.ingenico.connect.gateway.sdk.java.domain.product.Directory) Test(org.junit.Test)

Example 2 with DirectoryParams

use of com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams 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();
    }
}
Also used : MetaDataProvider(com.ingenico.connect.gateway.sdk.java.MetaDataProvider) MetaDataProviderBuilder(com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder) DirectoryParams(com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams) RequestHeader(com.ingenico.connect.gateway.sdk.java.RequestHeader) CommunicatorConfiguration(com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration) Client(com.ingenico.connect.gateway.sdk.java.Client) Session(com.ingenico.connect.gateway.sdk.java.Session) Directory(com.ingenico.connect.gateway.sdk.java.domain.product.Directory) Test(org.junit.Test)

Aggregations

Client (com.ingenico.connect.gateway.sdk.java.Client)2 Directory (com.ingenico.connect.gateway.sdk.java.domain.product.Directory)2 DirectoryParams (com.ingenico.connect.gateway.sdk.java.merchant.products.DirectoryParams)2 Test (org.junit.Test)2 CommunicatorConfiguration (com.ingenico.connect.gateway.sdk.java.CommunicatorConfiguration)1 MetaDataProvider (com.ingenico.connect.gateway.sdk.java.MetaDataProvider)1 MetaDataProviderBuilder (com.ingenico.connect.gateway.sdk.java.MetaDataProviderBuilder)1 RequestHeader (com.ingenico.connect.gateway.sdk.java.RequestHeader)1 Session (com.ingenico.connect.gateway.sdk.java.Session)1