Search in sources :

Example 1 with OrderRiskAssessment

use of com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment in project connect-sdk-java by Ingenico-ePayments.

the class RiskAssessmentCardsExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        Card card = new Card();
        card.setCardNumber("4567350000427977");
        card.setCvv("123");
        card.setExpiryDate("0820");
        List<AirlineFlightLeg> flightLegs = new ArrayList<AirlineFlightLeg>();
        AirlineFlightLeg flightLeg1 = new AirlineFlightLeg();
        flightLeg1.setAirlineClass("1");
        flightLeg1.setArrivalAirport("AMS");
        flightLeg1.setCarrierCode("KL");
        flightLeg1.setDate("20150102");
        flightLeg1.setDepartureTime("17:59");
        flightLeg1.setFare("fare");
        flightLeg1.setFareBasis("INTERNET");
        flightLeg1.setFlightNumber("791");
        flightLeg1.setNumber(1);
        flightLeg1.setOriginAirport("BCN");
        flightLeg1.setStopoverCode("non-permitted");
        flightLegs.add(flightLeg1);
        AirlineFlightLeg flightLeg2 = new AirlineFlightLeg();
        flightLeg2.setAirlineClass("1");
        flightLeg2.setArrivalAirport("BCN");
        flightLeg2.setCarrierCode("KL");
        flightLeg2.setDate("20150102");
        flightLeg2.setDepartureTime("23:59");
        flightLeg2.setFare("fare");
        flightLeg2.setFareBasis("INTERNET");
        flightLeg2.setFlightNumber("792");
        flightLeg2.setNumber(2);
        flightLeg2.setOriginAirport("AMS");
        flightLeg2.setStopoverCode("non-permitted");
        flightLegs.add(flightLeg2);
        AirlineData airlineData = new AirlineData();
        airlineData.setAgentNumericCode("123321");
        airlineData.setCode("123");
        airlineData.setFlightDate("20150102");
        airlineData.setFlightLegs(flightLegs);
        airlineData.setInvoiceNumber("123456");
        airlineData.setIsETicket(true);
        airlineData.setIsRegisteredCustomer(true);
        airlineData.setIsRestrictedTicket(true);
        airlineData.setIsThirdParty(true);
        airlineData.setIssueDate("20150101");
        airlineData.setMerchantCustomerId("14");
        airlineData.setName("Air France KLM");
        airlineData.setPassengerName("WECOYOTE");
        airlineData.setPlaceOfIssue("Utah");
        airlineData.setPnr("4JTGKT");
        airlineData.setPointOfSale("IATA point of sale name");
        airlineData.setPosCityCode("AMS");
        airlineData.setTicketDeliveryMethod("e-ticket");
        airlineData.setTicketNumber("KLM20050000");
        AdditionalOrderInputAirlineData additionalInput = new AdditionalOrderInputAirlineData();
        additionalInput.setAirlineData(airlineData);
        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.setAdditionalInput(additionalInput);
        order.setAmountOfMoney(amountOfMoney);
        order.setCustomer(customer);
        RiskAssessmentCard body = new RiskAssessmentCard();
        body.setCard(card);
        body.setOrder(order);
        RiskAssessmentResponse response = client.merchant("merchantId").riskassessments().cards(body);
    } finally {
        client.close();
    }
}
Also used : AirlineFlightLeg(com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineFlightLeg) Address(com.ingenico.connect.gateway.sdk.java.domain.definitions.Address) OrderRiskAssessment(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment) ArrayList(java.util.ArrayList) Card(com.ingenico.connect.gateway.sdk.java.domain.definitions.Card) RiskAssessmentCard(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentCard) AmountOfMoney(com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney) AirlineData(com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineData) AdditionalOrderInputAirlineData(com.ingenico.connect.gateway.sdk.java.domain.definitions.AdditionalOrderInputAirlineData) CustomerRiskAssessment(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment) AdditionalOrderInputAirlineData(com.ingenico.connect.gateway.sdk.java.domain.definitions.AdditionalOrderInputAirlineData) RiskAssessmentResponse(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse) Client(com.ingenico.connect.gateway.sdk.java.Client) RiskAssessmentCard(com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentCard)

Example 2 with OrderRiskAssessment

use of com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment 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 3 with OrderRiskAssessment

use of com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment in project connect-sdk-java by Ingenico-ePayments.

the class RiskAssessmentsTest method test.

/**
 * Smoke test for risk assessments service.
 */
@Test
public void test() throws URISyntaxException, IOException {
    RiskAssessmentBankAccount body = new RiskAssessmentBankAccount();
    BankAccountBban bankAccountBban = new BankAccountBban();
    bankAccountBban.setCountryCode("DE");
    bankAccountBban.setAccountNumber("0532013000");
    bankAccountBban.setBankCode("37040044");
    body.setBankAccountBban(bankAccountBban);
    OrderRiskAssessment order = new OrderRiskAssessment();
    AmountOfMoney amountOfMoney = new AmountOfMoney();
    amountOfMoney.setAmount(100L);
    amountOfMoney.setCurrencyCode("EUR");
    order.setAmountOfMoney(amountOfMoney);
    CustomerRiskAssessment customer = new CustomerRiskAssessment();
    customer.setLocale("en_GB");
    order.setCustomer(customer);
    body.setOrder(order);
    Client client = getClient();
    try {
        RiskAssessmentResponse riskAssessmentResponse = client.merchant("8500").riskassessments().bankaccounts(body);
        Assert.assertTrue(riskAssessmentResponse.getResults().size() > 0);
    } finally {
        client.close();
    }
}
Also used : 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) Test(org.junit.Test)

Aggregations

Client (com.ingenico.connect.gateway.sdk.java.Client)3 AmountOfMoney (com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney)3 RiskAssessmentResponse (com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentResponse)3 CustomerRiskAssessment (com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.CustomerRiskAssessment)3 OrderRiskAssessment (com.ingenico.connect.gateway.sdk.java.domain.riskassessments.definitions.OrderRiskAssessment)3 Address (com.ingenico.connect.gateway.sdk.java.domain.definitions.Address)2 BankAccountBban (com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountBban)2 RiskAssessmentBankAccount (com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentBankAccount)2 AdditionalOrderInputAirlineData (com.ingenico.connect.gateway.sdk.java.domain.definitions.AdditionalOrderInputAirlineData)1 AirlineData (com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineData)1 AirlineFlightLeg (com.ingenico.connect.gateway.sdk.java.domain.definitions.AirlineFlightLeg)1 Card (com.ingenico.connect.gateway.sdk.java.domain.definitions.Card)1 RiskAssessmentCard (com.ingenico.connect.gateway.sdk.java.domain.riskassessments.RiskAssessmentCard)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1