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

com.braintreegateway.TransactionCloneRequest Maven / Gradle / Ivy

The newest version!
package com.braintreegateway;

import java.math.BigDecimal;

public class TransactionCloneRequest extends Request {
    private BigDecimal amount;
    private String channel;
    private TransactionOptionsCloneRequest transactionOptionsCloneRequest;

    public TransactionCloneRequest amount(BigDecimal amount) {
        this.amount = amount;
        return this;
    }

    public TransactionCloneRequest channel(String channel) {
        this.channel = channel;
        return this;
    }

    public TransactionOptionsCloneRequest options() {
        transactionOptionsCloneRequest = new TransactionOptionsCloneRequest(this);
        return transactionOptionsCloneRequest;
    }

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

    protected RequestBuilder buildRequest(String root) {
        RequestBuilder builder = new RequestBuilder(root)
            .addElement("amount", amount)
            .addElement("channel", channel)
            .addElement("options", transactionOptionsCloneRequest);

        return builder;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy