com.braintreegateway.DiscountGateway 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 com.braintreegateway.util.Http;
import com.braintreegateway.util.NodeWrapper;
import java.util.ArrayList;
import java.util.List;
public class DiscountGateway {
private Http http;
private Configuration configuration;
public DiscountGateway(Http http, Configuration configuration) {
this.http = http;
this.configuration = configuration;
}
public List all() {
NodeWrapper node = http.get(configuration.getMerchantPath() + "/discounts");
List discounts = new ArrayList();
for (NodeWrapper discountResponse : node.findAll("discount")) {
discounts.add(new Discount(discountResponse));
}
return discounts;
}
}