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

com.braintreegateway.MerchantRequest Maven / Gradle / Ivy

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

import java.util.List;

public class MerchantRequest extends Request {

    public String email;
    public String countryCodeAlpha3;
    public String companyName;
    public String scope;
    public PayPalOnlyAccountRequest payPalOnlyAccountRequest;
    public List paymentMethods;
    public List currencies;

    public MerchantRequest email(String email) {
        this.email = email;
        return this;
    }

    public MerchantRequest countryCodeAlpha3(String countryCodeAlpha3) {
        this.countryCodeAlpha3 = countryCodeAlpha3;
        return this;
    }

    public MerchantRequest companyName(String companyName) {
        this.companyName = companyName;
        return this;
    }

    public MerchantRequest paymentMethods(List paymentMethods) {
        this.paymentMethods = paymentMethods;
        return this;
    }

    public MerchantRequest currencies(List currencies) {
        this.currencies = currencies;
        return this;
    }

    public MerchantRequest scope(String scope) {
        this.scope = scope;
        return this;
    }

    @Override
    public String toXML() {
        return new RequestBuilder("merchant")
            .addElement("email", email)
            .addElement("countryCodeAlpha3", countryCodeAlpha3)
            .addElement("companyName", companyName)
            .addElement("paymentMethods", paymentMethods)
            .addElement("currencies", currencies)
            .addElement("scope", scope)
            .addElement("paypalAccount", payPalOnlyAccountRequest)
            .toXML();
    }

    public PayPalOnlyAccountRequest payPalAccount() {
        this.payPalOnlyAccountRequest = new PayPalOnlyAccountRequest(this);
        return this.payPalOnlyAccountRequest;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy