Search in sources :

Example 1 with MandateCustomer

use of com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateCustomer 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 2 with MandateCustomer

use of com.ingenico.connect.gateway.sdk.java.domain.mandates.definitions.MandateCustomer 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)2 BankAccountIban (com.ingenico.connect.gateway.sdk.java.domain.definitions.BankAccountIban)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