All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.braintreegateway.SettlementBatchSummaryGateway Maven / Gradle / Ivy

The newest version!
package com.braintreegateway;

import com.braintreegateway.util.Http;
import com.braintreegateway.util.NodeWrapper;
import java.util.Calendar;

public class SettlementBatchSummaryGateway {

    private Http http;
    private Configuration configuration;

    public SettlementBatchSummaryGateway(Http http, Configuration configuration) {
        this.http = http;
        this.configuration = configuration;
    }

    public Result generate(Calendar settlementDate) {
        SettlementBatchSummaryRequest request = new SettlementBatchSummaryRequest();
        request.settlementDate(settlementDate);
        return doGenerate(request);
    }

    public Result generate(Calendar settlementDate, String groupByCustomField) {
        SettlementBatchSummaryRequest request = new SettlementBatchSummaryRequest();
        request.settlementDate(settlementDate);
        request.groupByCustomField(groupByCustomField);
        return doGenerate(request);
    }

    private Result doGenerate(SettlementBatchSummaryRequest request) {
        NodeWrapper node = http.post(configuration.getMerchantPath() + "/settlement_batch_summary", request);
        return new Result(node, SettlementBatchSummary.class);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy