com.braintreegateway.ModificationRequest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.apache.servicemix.bundles.braintree-java
Show all versions of org.apache.servicemix.bundles.braintree-java
This OSGi bundle wraps ${pkgArtifactId} ${pkgVersion} jar file.
The newest version!
package com.braintreegateway;
import java.math.BigDecimal;
public class ModificationRequest extends Request {
private BigDecimal amount;
private Integer numberOfBillingCycles;
private ModificationsRequest parent;
private Integer quantity;
private Boolean neverExpires;
public ModificationRequest(ModificationsRequest parent) {
this.parent = parent;
}
public ModificationRequest amount(BigDecimal amount) {
this.amount = amount;
return this;
}
public ModificationsRequest done() {
return parent;
}
public ModificationRequest numberOfBillingCycles(Integer numberOfBillingCycles) {
this.numberOfBillingCycles = numberOfBillingCycles;
return this;
}
public ModificationRequest neverExpires(Boolean neverExpires) {
this.neverExpires = neverExpires;
return this;
}
public ModificationRequest quantity(Integer quantity) {
this.quantity = quantity;
return this;
}
@Override
public String toXML() {
return buildRequest("modification").toXML();
}
protected RequestBuilder buildRequest(String root) {
return new RequestBuilder(root)
.addElement("amount", amount)
.addElement("neverExpires", neverExpires)
.addElement("numberOfBillingCycles", numberOfBillingCycles)
.addElement("quantity", quantity);
}
}