com.braintreegateway.UsBankAccountVerificationGateway 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.
package com.braintreegateway;
import com.braintreegateway.exceptions.NotFoundException;
import com.braintreegateway.util.Http;
import com.braintreegateway.util.NodeWrapper;
import java.util.ArrayList;
import java.util.List;
public class UsBankAccountVerificationGateway {
private Http http;
private Configuration configuration;
public UsBankAccountVerificationGateway(Http http, Configuration configuration) {
this.http = http;
this.configuration = configuration;
}
public UsBankAccountVerification find(String id) {
if (id == null || id.trim().equals("")) {
throw new NotFoundException();
}
return new UsBankAccountVerification(http.get(configuration.getMerchantPath() + "/us_bank_account_verifications/" + id));
}
public ResourceCollection search(UsBankAccountVerificationSearchRequest query) {
NodeWrapper node = http.post(configuration.getMerchantPath() + "/us_bank_account_verifications/advanced_search_ids", query);
return new ResourceCollection(new UsBankAccountVerificationPager(this, query), node);
}
public Result confirmMicroTransferAmounts(String id, UsBankAccountVerificationConfirmRequest request) {
NodeWrapper nodeWrapper = http.put(configuration.getMerchantPath() + "/us_bank_account_verifications/" + id + "/confirm_micro_transfer_amounts", request);
return new Result(nodeWrapper, UsBankAccountVerification.class);
}
List fetchUsBankAccountVerifications(UsBankAccountVerificationSearchRequest query, List ids) {
query.ids().in(ids);
NodeWrapper response = http.post(configuration.getMerchantPath() + "/us_bank_account_verifications/advanced_search", query);
List items = new ArrayList();
for (NodeWrapper node : response.findAll("us-bank-account-verification")) {
items.add(new UsBankAccountVerification(node));
}
return items;
}
}