Customer
Customer Model
public class Customer extends AbstractPayment {
public enum Salutation {mr, mrs, unknown};
private String firstname;
private String lastname;
private Salutation salutation;
private String customerId;
private Date birthDate;
private String email;
private String phone;
private String mobile;
private Address billingAddress;
private Address shippingAddress;
private String company;
private CustomerCompanyData companyData;
}
Create customer
Create and initialize address
protected Address getAddress() {
return getAddress("Peter Universum", "Hugo-Junkers-Str. 6", "Frankfurt am Main", "DE-BO", "60386", "DE");
}
protected Address getAddress(String name, String street, String city, String state, String zip, String country) {
Address address = new Address();
address
.setName(name)
.setStreet(street)
.setCity(city)
.setState(state)
.setZip(zip)
.setCountry(country);
return address;
}
Create and initialize customer request
protected Customer getMaximumCustomer(String customerId) throws ParseException {
Customer customer = new Customer("Rene", "Felder");
customer
.setCustomerId(customerId)
.setSalutation(Salutation.mr)
.setEmail("info@heidelpay.com")
.setMobile("+43676123456")
.setBirthDate(getDate("03.10.1974"))
.setBillingAddress(getAddress())
.setShippingAddress(getAddress("Schubert", "Vangerowstraße 18", "Heidelberg", "BW", "69115", "DE"));
return customer;
}
Create and initialize customer
protected Customer getMaximumCustomer(String customerId) throws ParseException {
Customer customer = new Customer("Rene", "Felder");
customer
.setCustomerId(customerId)
.setSalutation(Salutation.mr)
.setEmail("info@heidelpay.com")
.setMobile("+43676123456")
.setBirthDate(getDate("03.10.1974"))
.setBillingAddress(getAddress())
.setShippingAddress(getAddress("Schubert", "Vangerowstraße 18", "Heidelberg", "BW", "69115", "DE"));
return customer;
}
Create customer
Customer maxCustomer = getMaximumCustomer(getRandomId())
Heidelpay heidelpay = new Heidelpay("s-priv-xxxxxxxxxx");;
Customer customer = heidelpay.createCustomer(maxCustomer);