com.braintreegateway.UsBankAccountGateway 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;
public class UsBankAccountGateway {
private BraintreeGateway gateway;
private Http http;
private Configuration configuration;
public UsBankAccountGateway(BraintreeGateway gateway, Http http, Configuration configuration) {
this.gateway = gateway;
this.http = http;
this.configuration = configuration;
}
public UsBankAccount find(String token) {
return new UsBankAccount(http.get(configuration.getMerchantPath() + "/payment_methods/us_bank_account/" + token));
}
public Result sale(String token, TransactionRequest transactionRequest) {
transactionRequest
.paymentMethodToken(token)
.options()
.submitForSettlement(true);
return gateway.transaction().sale(transactionRequest);
}
}