Search in sources :

Example 1 with BankAccountIban

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

the class RefundPaymentExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        AmountOfMoney amountOfMoney = new AmountOfMoney();
        amountOfMoney.setAmount(1L);
        amountOfMoney.setCurrencyCode("EUR");
        BankAccountIban bankAccountIban = new BankAccountIban();
        bankAccountIban.setIban("NL53INGB0000000036");
        BankRefundMethodSpecificInput bankRefundMethodSpecificInput = new BankRefundMethodSpecificInput();
        bankRefundMethodSpecificInput.setBankAccountIban(bankAccountIban);
        PersonalName name = new PersonalName();
        name.setSurname("Coyote");
        AddressPersonal address = new AddressPersonal();
        address.setCountryCode("US");
        address.setName(name);
        ContactDetailsBase contactDetails = new ContactDetailsBase();
        contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com");
        contactDetails.setEmailMessageType("html");
        RefundCustomer customer = new RefundCustomer();
        customer.setAddress(address);
        customer.setContactDetails(contactDetails);
        RefundReferences refundReferences = new RefundReferences();
        refundReferences.setMerchantReference("AcmeOrder0001");
        RefundRequest body = new RefundRequest();
        body.setAmountOfMoney(amountOfMoney);
        body.setBankRefundMethodSpecificInput(bankRefundMethodSpecificInput);
        body.setCustomer(customer);
        body.setRefundDate("20140306");
        body.setRefundReferences(refundReferences);
        try {
            RefundResponse response = client.merchant("merchantId").payments().refund("paymentId", body);
        } catch (DeclinedRefundException e) {
            handleDeclinedRefund(e.getRefundResult());
        } catch (ApiException e) {
            handleApiErrors(e.getErrors());
        }
    } finally {
        client.close();
    }
}
Also used : BankRefundMethodSpecificInput(com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.BankRefundMethodSpecificInput) AddressPersonal(com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal) ContactDetailsBase(com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase) AmountOfMoney(com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney) RefundReferences(com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundReferences) RefundRequest(com.ingenico.connect.gateway.sdk.java.domain.refund.RefundRequest) PersonalName(com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName) DeclinedRefundException(com.ingenico.connect.gateway.sdk.java.DeclinedRefundException) RefundCustomer(com.ingenico.connect.gateway.sdk.java.domain.refund.definitions.RefundCustomer) BankAccountIban(com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban) Client(com.ingenico.connect.gateway.sdk.java.Client) RefundResponse(com.ingenico.connect.gateway.sdk.java.domain.refund.RefundResponse) ApiException(com.ingenico.connect.gateway.sdk.java.ApiException)

Example 2 with BankAccountIban

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

the class CreateMandateExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        BankAccountIban bankAccountIban = new BankAccountIban();
        bankAccountIban.setIban("DE46940594210000012345");
        MandateContactDetails contactDetails = new MandateContactDetails();
        contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com");
        contactDetails.setPhoneNumber("+1234567890");
        MandateAddress mandateAddress = new MandateAddress();
        mandateAddress.setCity("Monumentenvallei");
        mandateAddress.setCountryCode("NL");
        mandateAddress.setStreet("Woestijnweg");
        mandateAddress.setZip("1337XD");
        MandatePersonalName name = new MandatePersonalName();
        name.setFirstName("Wile");
        name.setSurname("Coyote");
        MandatePersonalInformation personalInformation = new MandatePersonalInformation();
        personalInformation.setName(name);
        personalInformation.setTitle("Miss");
        MandateCustomer customer = new MandateCustomer();
        customer.setBankAccountIban(bankAccountIban);
        customer.setCompanyName("Acme labs");
        customer.setContactDetails(contactDetails);
        customer.setMandateAddress(mandateAddress);
        customer.setPersonalInformation(personalInformation);
        CreateMandateRequest body = new CreateMandateRequest();
        body.setCustomer(customer);
        body.setCustomerReference("idonthaveareference");
        body.setLanguage("nl");
        body.setRecurrenceType("UNIQUE");
        body.setSignatureType("UNSIGNED");
        CreateMandateResponse response = client.merchant("merchantId").mandates().create(body);
    } finally {
        client.close();
    }
}
Also used : MandateCustomer(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateCustomer) CreateMandateResponse(com.ingenico.connect.gateway.sdk.java.domain.mandates.CreateMandateResponse) MandateContactDetails(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateContactDetails) CreateMandateRequest(com.ingenico.connect.gateway.sdk.java.domain.mandates.CreateMandateRequest) BankAccountIban(com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban) Client(com.ingenico.connect.gateway.sdk.java.Client) MandatePersonalName(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandatePersonalName) MandatePersonalInformation(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandatePersonalInformation) MandateAddress(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateAddress)

Example 3 with BankAccountIban

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

the class CreatePayoutExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        AmountOfMoney amountOfMoney = new AmountOfMoney();
        amountOfMoney.setAmount(2345L);
        amountOfMoney.setCurrencyCode("EUR");
        BankAccountIban bankAccountIban = new BankAccountIban();
        bankAccountIban.setAccountHolderName("Wile E. Coyote");
        bankAccountIban.setIban("IT60X0542811101000000123456");
        Address address = new Address();
        address.setCity("Burbank");
        address.setCountryCode("US");
        address.setHouseNumber("411");
        address.setState("California");
        address.setStreet("N Hollywood Way");
        address.setZip("91505");
        CompanyInformation companyInformation = new CompanyInformation();
        companyInformation.setName("Acme Labs");
        ContactDetailsBase contactDetails = new ContactDetailsBase();
        contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com");
        PersonalName name = new PersonalName();
        name.setFirstName("Wile");
        name.setSurname("Coyote");
        name.setSurnamePrefix("E.");
        name.setTitle("Mr.");
        PayoutCustomer customer = new PayoutCustomer();
        customer.setAddress(address);
        customer.setCompanyInformation(companyInformation);
        customer.setContactDetails(contactDetails);
        customer.setName(name);
        BankTransferPayoutMethodSpecificInput bankTransferPayoutMethodSpecificInput = new BankTransferPayoutMethodSpecificInput();
        bankTransferPayoutMethodSpecificInput.setBankAccountIban(bankAccountIban);
        bankTransferPayoutMethodSpecificInput.setCustomer(customer);
        bankTransferPayoutMethodSpecificInput.setPayoutDate("20150102");
        bankTransferPayoutMethodSpecificInput.setPayoutText("Payout Acme");
        bankTransferPayoutMethodSpecificInput.setSwiftCode("swift");
        PayoutReferences references = new PayoutReferences();
        references.setMerchantReference("AcmeOrder001");
        CreatePayoutRequest body = new CreatePayoutRequest();
        body.setAmountOfMoney(amountOfMoney);
        body.setBankTransferPayoutMethodSpecificInput(bankTransferPayoutMethodSpecificInput);
        body.setReferences(references);
        try {
            PayoutResponse response = client.merchant("merchantId").payouts().create(body);
        } catch (DeclinedPayoutException e) {
            handleDeclinedPayout(e.getPayoutResult());
        } catch (ApiException e) {
            handleApiErrors(e.getErrors());
        }
    } finally {
        client.close();
    }
}
Also used : PayoutCustomer(com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutCustomer) CreatePayoutRequest(com.ingenico.connect.gateway.sdk.java.domain.payout.CreatePayoutRequest) PayoutReferences(com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.PayoutReferences) Address(com.ingenico.connect.gateway.sdk.java.domain.definitions.Address) ContactDetailsBase(com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase) AmountOfMoney(com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney) DeclinedPayoutException(com.ingenico.connect.gateway.sdk.java.DeclinedPayoutException) CompanyInformation(com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation) BankTransferPayoutMethodSpecificInput(com.ingenico.connect.gateway.sdk.java.domain.payout.definitions.BankTransferPayoutMethodSpecificInput) PersonalName(com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName) BankAccountIban(com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban) Client(com.ingenico.connect.gateway.sdk.java.Client) PayoutResponse(com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutResponse) ApiException(com.ingenico.connect.gateway.sdk.java.ApiException)

Example 4 with BankAccountIban

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

the class CreateMandateWithReferenceExample method example.

@SuppressWarnings("unused")
public void example() throws URISyntaxException, IOException {
    Client client = getClient();
    try {
        BankAccountIban bankAccountIban = new BankAccountIban();
        bankAccountIban.setIban("DE46940594210000012345");
        MandateContactDetails contactDetails = new MandateContactDetails();
        contactDetails.setEmailAddress("wile.e.coyote@acmelabs.com");
        contactDetails.setPhoneNumber("+1234567890");
        MandateAddress mandateAddress = new MandateAddress();
        mandateAddress.setCity("Monumentenvallei");
        mandateAddress.setCountryCode("NL");
        mandateAddress.setStreet("Woestijnweg");
        mandateAddress.setZip("1337XD");
        MandatePersonalName name = new MandatePersonalName();
        name.setFirstName("Wile");
        name.setSurname("Coyote");
        MandatePersonalInformation personalInformation = new MandatePersonalInformation();
        personalInformation.setName(name);
        personalInformation.setTitle("Miss");
        MandateCustomer customer = new MandateCustomer();
        customer.setBankAccountIban(bankAccountIban);
        customer.setCompanyName("Acme labs");
        customer.setContactDetails(contactDetails);
        customer.setMandateAddress(mandateAddress);
        customer.setPersonalInformation(personalInformation);
        CreateMandateRequest body = new CreateMandateRequest();
        body.setCustomer(customer);
        body.setCustomerReference("idonthaveareference");
        body.setLanguage("nl");
        body.setRecurrenceType("UNIQUE");
        body.setSignatureType("UNSIGNED");
        CreateMandateResponse response = client.merchant("merchantId").mandates().createWithMandateReference("42268d8067df43e18a50a2ebf4bdb729", body);
    } finally {
        client.close();
    }
}
Also used : MandateCustomer(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateCustomer) CreateMandateResponse(com.ingenico.connect.gateway.sdk.java.domain.mandates.CreateMandateResponse) MandateContactDetails(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateContactDetails) CreateMandateRequest(com.ingenico.connect.gateway.sdk.java.domain.mandates.CreateMandateRequest) BankAccountIban(com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban) Client(com.ingenico.connect.gateway.sdk.java.Client) MandatePersonalName(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandatePersonalName) MandatePersonalInformation(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandatePersonalInformation) MandateAddress(com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateAddress)

Aggregations

Client (com.ingenico.connect.gateway.sdk.java.Client)4 BankAccountIban (com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban)4 ApiException (com.ingenico.connect.gateway.sdk.java.ApiException)2 AmountOfMoney (com.ingenico.connect.gateway.sdk.java.domain.definitions.AmountOfMoney)2 ContactDetailsBase (com.ingenico.connect.gateway.sdk.java.domain.definitions.ContactDetailsBase)2 CreateMandateRequest (com.ingenico.connect.gateway.sdk.java.domain.mandates.CreateMandateRequest)2 CreateMandateResponse (com.ingenico.connect.gateway.sdk.java.domain.mandates.CreateMandateResponse)2 MandateAddress (com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateAddress)2 MandateContactDetails (com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateContactDetails)2 MandateCustomer (com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateCustomer)2 MandatePersonalInformation (com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandatePersonalInformation)2 MandatePersonalName (com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandatePersonalName)2 PersonalName (com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.PersonalName)2 DeclinedPayoutException (com.ingenico.connect.gateway.sdk.java.DeclinedPayoutException)1 DeclinedRefundException (com.ingenico.connect.gateway.sdk.java.DeclinedRefundException)1 Address (com.ingenico.connect.gateway.sdk.java.domain.definitions.Address)1 CompanyInformation (com.ingenico.connect.gateway.sdk.java.domain.definitions.CompanyInformation)1 AddressPersonal (com.ingenico.connect.gateway.sdk.java.domain.payment.definitions.AddressPersonal)1 CreatePayoutRequest (com.ingenico.connect.gateway.sdk.java.domain.payout.CreatePayoutRequest)1 PayoutResponse (com.ingenico.connect.gateway.sdk.java.domain.payout.PayoutResponse)1