Search in sources :

Example 36 with Client

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

the class FindRefundsExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        FindRefundsParams query = new FindRefundsParams();
        query.setMerchantReference("AcmeOrder0001");
        query.setMerchantOrderId(123456L);
        query.setOffset(0);
        query.setLimit(10);
        FindRefundsResponse response = client.merchant("merchantId").refunds().find(query);
    } finally {
        client.close();
    }
}
Also used : FindRefundsResponse(com.ingenico.connect.gateway.sdk.java.domain.refund.FindRefundsResponse) Client(com.ingenico.connect.gateway.sdk.java.Client)

Example 37 with Client

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

the class RiskAssessmentBankAccountExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        BankAccountBban bankAccountBban = new BankAccountBban();
        bankAccountBban.setAccountNumber("0532013000");
        bankAccountBban.setBankCode("37040044");
        bankAccountBban.setCountryCode("DE");
        AmountOfMoney amountOfMoney = new AmountOfMoney();
        amountOfMoney.setAmount(100L);
        amountOfMoney.setCurrencyCode("EUR");
        Address billingAddress = new Address();
        billingAddress.setCountryCode("US");
        CustomerRiskAssessment customer = new CustomerRiskAssessment();
        customer.setBillingAddress(billingAddress);
        customer.setLocale("en_US");
        OrderRiskAssessment order = new OrderRiskAssessment();
        order.setAmountOfMoney(amountOfMoney);
        order.setCustomer(customer);
        RiskAssessmentBankAccount body = new RiskAssessmentBankAccount();
        body.setBankAccountBban(bankAccountBban);
        body.setOrder(order);
        RiskAssessmentResponse response = client.merchant("merchantId").riskassessments().bankaccounts(body);
    } finally {
        client.close();
    }
}
Also used : Address(com.ingenico.connect.gateway.sdk.java.domain.definitions.Address) RiskAssessmentBankAccount(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentBankAccount) BankAccountBban(com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban) OrderRiskAssessment(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment) CustomerRiskAssessment(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment) RiskAssessmentResponse(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse) Client(com.ingenico.connect.gateway.sdk.java.Client) AmountOfMoney(com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney)

Example 38 with Client

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

the class ConvertAmountExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        ConvertAmountParams query = new ConvertAmountParams();
        query.setSource("EUR");
        query.setTarget("USD");
        query.setAmount(100L);
        ConvertAmount response = client.merchant("merchantId").services().convertAmount(query);
    } finally {
        client.close();
    }
}
Also used : ConvertAmount(com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount) Client(com.ingenico.connect.gateway.sdk.java.Client)

Example 39 with Client

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

the class IINDetailsExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        GetIINDetailsRequest body = new GetIINDetailsRequest();
        body.setBin("4567350000427977");
        GetIINDetailsResponse response = client.merchant("merchantId").services().getIINdetails(body);
    } finally {
        client.close();
    }
}
Also used : GetIINDetailsRequest(com.ingenico.connect.gateway.sdk.java.domain.services.GetIINDetailsRequest) Client(com.ingenico.connect.gateway.sdk.java.Client) GetIINDetailsResponse(com.ingenico.connect.gateway.sdk.java.domain.services.GetIINDetailsResponse)

Example 40 with Client

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

the class CreateSessionExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        List<String> tokens = new ArrayList<String>();
        tokens.add("126166b16ed04b3ab85fb06da1d7a167");
        tokens.add("226166b16ed04b3ab85fb06da1d7a167");
        tokens.add("122c5b4d-dd40-49f0-b7c9-3594212167a9");
        tokens.add("326166b16ed04b3ab85fb06da1d7a167");
        tokens.add("426166b16ed04b3ab85fb06da1d7a167");
        SessionRequest body = new SessionRequest();
        body.setTokens(tokens);
        SessionResponse response = client.merchant("merchantId").sessions().create(body);
    } finally {
        client.close();
    }
}
Also used : ArrayList(java.util.ArrayList) Client(com.ingenico.connect.gateway.sdk.java.Client) SessionResponse(com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionResponse) SessionRequest(com.ingenico.connect.gateway.sdk.java.domain.sessions.SessionRequest)

Aggregations

Client (com.ingenico.connect.gateway.sdk.java.Client)70 Test (org.junit.Test)35 CreatePaymentRequest (com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentRequest)19 HttpHost (org.apache.http.HttpHost)17 CreatePaymentResponse (com.ingenico.connect.gateway.sdk.java.domain.payment.CreatePaymentResponse)14 Address (com.ingenico.connect.gateway.sdk.java.domain.definitions.Address)12 AmountOfMoney (com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney)11 Response (com.ingenico.connect.gateway.sdk.java.Response)9 CallContext (com.ingenico.connect.gateway.sdk.java.CallContext)7 Customer (com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Customer)6 Order (com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.Order)6 DeclinedPaymentException (com.ingenico.connect.gateway.sdk.java.DeclinedPaymentException)5 ConvertAmount (com.ingenico.connect.gateway.sdk.java.domain.services.ConvertAmount)5 HashMap (java.util.HashMap)5 ApiException (com.ingenico.connect.gateway.sdk.java.ApiException)4 Card (com.ingenico.connect.gateway.sdk.java.domain.definitions.Card)4 CompanyInformation (com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation)4 TestConnection (com.ingenico.connect.gateway.sdk.java.domain.services.TestConnection)4 ConvertAmountParams (com.ingenico.connect.gateway.sdk.java.merchant.services.ConvertAmountParams)4 ArrayList (java.util.ArrayList)4