com.braintreegateway.DocumentUploadGateway 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.util.Http;
import com.braintreegateway.util.NodeWrapper;
public class DocumentUploadGateway {
private final Http http;
private final Configuration configuration;
private final String BASE_URL = "/document_uploads";
public DocumentUploadGateway(Http http, Configuration configuration) {
this.http = http;
this.configuration = configuration;
}
public Result create(DocumentUploadRequest request) {
final NodeWrapper response = http.postMultipart(configuration.getMerchantPath() + BASE_URL, request.getRequest(), request.getFile());
return new Result(response, DocumentUpload.class);
}
}