br.com.moip.request.InvoiceRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk Show documentation
Show all versions of java-sdk Show documentation
Java SDK for Moip v2 APIs
package br.com.moip.request;
import java.util.ArrayList;
import java.util.List;
public class InvoiceRequest {
private List items = new ArrayList<>();
private CustomerRequest customer;
private CheckoutPreferencesRequest checkoutPreferences;
public InvoiceRequest addItem(final String product, final Integer quantity, final String detail, final Integer price) {
this.items.add(new ItemRequest(product, quantity, detail, price));
return this;
}
public List getItems() {
return items;
}
public InvoiceRequest customer(final CustomerRequest customer) {
this.customer = customer;
return this;
}
public CustomerRequest getCustomer() {
return customer;
}
public InvoiceRequest checkoutPreferences(final CheckoutPreferencesRequest checkoutPreferences) {
this.checkoutPreferences = checkoutPreferences;
return this;
}
public CheckoutPreferencesRequest getCheckoutPreferences() {
return checkoutPreferences;
}
@Override
public String toString() {
final StringBuffer sb = new StringBuffer("InvoiceRequest{");
sb.append("items=").append(items);
sb.append(", customer=").append(customer);
sb.append(", checkoutPreferences=").append(checkoutPreferences);
sb.append('}');
return sb.toString();
}
}