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

com.braintreegateway.IndustryRequest Maven / Gradle / Ivy

There is a newer version: 3.32.0_1
Show newest version
package com.braintreegateway;

public abstract class IndustryRequest extends Request {

    protected Transaction.IndustryType industryType;
    protected TransactionIndustryDataRequest data;

    public IndustryRequest() {
        super();
    }

    public IndustryRequest industryType(Transaction.IndustryType industryType) {
        this.industryType = industryType;
        return this;
    }

    public TransactionIndustryDataRequest data() {
        this.data = new TransactionIndustryDataRequest(this);
        return data;
    }

    @Override
    public String toXML() {
        return buildRequest("industry").toXML();
    }

    @Override
    public String toQueryString(String root) {
        return buildRequest(root).toQueryString();
    }

    protected RequestBuilder buildRequest(String root) {
        return new RequestBuilder(root)
                .addElement("industryType", industryType)
                .addElement("data", data);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy