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

com.squareup.square.legacy.models.InvoiceAcceptedPaymentMethods Maven / Gradle / Ivy

There is a newer version: 44.2.0.20250521
Show newest version
package com.squareup.square.legacy.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.apimatic.core.types.OptionalNullable;
import java.util.Objects;

/**
 * This is a model class for InvoiceAcceptedPaymentMethods type.
 */
public class InvoiceAcceptedPaymentMethods {
    private final OptionalNullable card;
    private final OptionalNullable squareGiftCard;
    private final OptionalNullable bankAccount;
    private final OptionalNullable buyNowPayLater;
    private final OptionalNullable cashAppPay;

    /**
     * Initialization constructor.
     * @param  card  Boolean value for card.
     * @param  squareGiftCard  Boolean value for squareGiftCard.
     * @param  bankAccount  Boolean value for bankAccount.
     * @param  buyNowPayLater  Boolean value for buyNowPayLater.
     * @param  cashAppPay  Boolean value for cashAppPay.
     */
    @JsonCreator
    public InvoiceAcceptedPaymentMethods(
            @JsonProperty("card") Boolean card,
            @JsonProperty("square_gift_card") Boolean squareGiftCard,
            @JsonProperty("bank_account") Boolean bankAccount,
            @JsonProperty("buy_now_pay_later") Boolean buyNowPayLater,
            @JsonProperty("cash_app_pay") Boolean cashAppPay) {
        this.card = OptionalNullable.of(card);
        this.squareGiftCard = OptionalNullable.of(squareGiftCard);
        this.bankAccount = OptionalNullable.of(bankAccount);
        this.buyNowPayLater = OptionalNullable.of(buyNowPayLater);
        this.cashAppPay = OptionalNullable.of(cashAppPay);
    }

    /**
     * Initialization constructor.
     * @param  card  Boolean value for card.
     * @param  squareGiftCard  Boolean value for squareGiftCard.
     * @param  bankAccount  Boolean value for bankAccount.
     * @param  buyNowPayLater  Boolean value for buyNowPayLater.
     * @param  cashAppPay  Boolean value for cashAppPay.
     */
    protected InvoiceAcceptedPaymentMethods(
            OptionalNullable card,
            OptionalNullable squareGiftCard,
            OptionalNullable bankAccount,
            OptionalNullable buyNowPayLater,
            OptionalNullable cashAppPay) {
        this.card = card;
        this.squareGiftCard = squareGiftCard;
        this.bankAccount = bankAccount;
        this.buyNowPayLater = buyNowPayLater;
        this.cashAppPay = cashAppPay;
    }

    /**
     * Internal Getter for Card.
     * Indicates whether credit card or debit card payments are accepted. The default value is
     * `false`.
     * @return Returns the Internal Boolean
     */
    @JsonGetter("card")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetCard() {
        return this.card;
    }

    /**
     * Getter for Card.
     * Indicates whether credit card or debit card payments are accepted. The default value is
     * `false`.
     * @return Returns the Boolean
     */
    @JsonIgnore
    public Boolean getCard() {
        return OptionalNullable.getFrom(card);
    }

    /**
     * Internal Getter for SquareGiftCard.
     * Indicates whether Square gift card payments are accepted. The default value is `false`.
     * @return Returns the Internal Boolean
     */
    @JsonGetter("square_gift_card")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetSquareGiftCard() {
        return this.squareGiftCard;
    }

    /**
     * Getter for SquareGiftCard.
     * Indicates whether Square gift card payments are accepted. The default value is `false`.
     * @return Returns the Boolean
     */
    @JsonIgnore
    public Boolean getSquareGiftCard() {
        return OptionalNullable.getFrom(squareGiftCard);
    }

    /**
     * Internal Getter for BankAccount.
     * Indicates whether ACH bank transfer payments are accepted. The default value is `false`.
     * @return Returns the Internal Boolean
     */
    @JsonGetter("bank_account")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetBankAccount() {
        return this.bankAccount;
    }

    /**
     * Getter for BankAccount.
     * Indicates whether ACH bank transfer payments are accepted. The default value is `false`.
     * @return Returns the Boolean
     */
    @JsonIgnore
    public Boolean getBankAccount() {
        return OptionalNullable.getFrom(bankAccount);
    }

    /**
     * Internal Getter for BuyNowPayLater.
     * Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value
     * is `false`. This option is allowed only for invoices that have a single payment request of
     * the `BALANCE` type. This payment method is supported if the seller account accepts Afterpay
     * payments and the seller location is in a country where Afterpay invoice payments are
     * supported. As a best practice, consider enabling an additional payment method when allowing
     * `buy_now_pay_later` payments. For more information, including detailed requirements and
     * processing limits, see [Buy Now Pay Later payments with
     * Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later).
     * @return Returns the Internal Boolean
     */
    @JsonGetter("buy_now_pay_later")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetBuyNowPayLater() {
        return this.buyNowPayLater;
    }

    /**
     * Getter for BuyNowPayLater.
     * Indicates whether Afterpay (also known as Clearpay) payments are accepted. The default value
     * is `false`. This option is allowed only for invoices that have a single payment request of
     * the `BALANCE` type. This payment method is supported if the seller account accepts Afterpay
     * payments and the seller location is in a country where Afterpay invoice payments are
     * supported. As a best practice, consider enabling an additional payment method when allowing
     * `buy_now_pay_later` payments. For more information, including detailed requirements and
     * processing limits, see [Buy Now Pay Later payments with
     * Afterpay](https://developer.squareup.com/docs/invoices-api/overview#buy-now-pay-later).
     * @return Returns the Boolean
     */
    @JsonIgnore
    public Boolean getBuyNowPayLater() {
        return OptionalNullable.getFrom(buyNowPayLater);
    }

    /**
     * Internal Getter for CashAppPay.
     * Indicates whether Cash App payments are accepted. The default value is `false`. This payment
     * method is supported only for seller [locations](entity:Location) in the United States.
     * @return Returns the Internal Boolean
     */
    @JsonGetter("cash_app_pay")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonSerialize(using = OptionalNullable.Serializer.class)
    protected OptionalNullable internalGetCashAppPay() {
        return this.cashAppPay;
    }

    /**
     * Getter for CashAppPay.
     * Indicates whether Cash App payments are accepted. The default value is `false`. This payment
     * method is supported only for seller [locations](entity:Location) in the United States.
     * @return Returns the Boolean
     */
    @JsonIgnore
    public Boolean getCashAppPay() {
        return OptionalNullable.getFrom(cashAppPay);
    }

    @Override
    public int hashCode() {
        return Objects.hash(card, squareGiftCard, bankAccount, buyNowPayLater, cashAppPay);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof InvoiceAcceptedPaymentMethods)) {
            return false;
        }
        InvoiceAcceptedPaymentMethods other = (InvoiceAcceptedPaymentMethods) obj;
        return Objects.equals(card, other.card)
                && Objects.equals(squareGiftCard, other.squareGiftCard)
                && Objects.equals(bankAccount, other.bankAccount)
                && Objects.equals(buyNowPayLater, other.buyNowPayLater)
                && Objects.equals(cashAppPay, other.cashAppPay);
    }

    /**
     * Converts this InvoiceAcceptedPaymentMethods into string format.
     * @return String representation of this class
     */
    @Override
    public String toString() {
        return "InvoiceAcceptedPaymentMethods [" + "card=" + card + ", squareGiftCard="
                + squareGiftCard + ", bankAccount=" + bankAccount + ", buyNowPayLater="
                + buyNowPayLater + ", cashAppPay=" + cashAppPay + "]";
    }

    /**
     * Builds a new {@link InvoiceAcceptedPaymentMethods.Builder} object.
     * Creates the instance with the state of the current model.
     * @return a new {@link InvoiceAcceptedPaymentMethods.Builder} object
     */
    public Builder toBuilder() {
        Builder builder = new Builder();
        builder.card = internalGetCard();
        builder.squareGiftCard = internalGetSquareGiftCard();
        builder.bankAccount = internalGetBankAccount();
        builder.buyNowPayLater = internalGetBuyNowPayLater();
        builder.cashAppPay = internalGetCashAppPay();
        return builder;
    }

    /**
     * Class to build instances of {@link InvoiceAcceptedPaymentMethods}.
     */
    public static class Builder {
        private OptionalNullable card;
        private OptionalNullable squareGiftCard;
        private OptionalNullable bankAccount;
        private OptionalNullable buyNowPayLater;
        private OptionalNullable cashAppPay;

        /**
         * Setter for card.
         * @param  card  Boolean value for card.
         * @return Builder
         */
        public Builder card(Boolean card) {
            this.card = OptionalNullable.of(card);
            return this;
        }

        /**
         * UnSetter for card.
         * @return Builder
         */
        public Builder unsetCard() {
            card = null;
            return this;
        }

        /**
         * Setter for squareGiftCard.
         * @param  squareGiftCard  Boolean value for squareGiftCard.
         * @return Builder
         */
        public Builder squareGiftCard(Boolean squareGiftCard) {
            this.squareGiftCard = OptionalNullable.of(squareGiftCard);
            return this;
        }

        /**
         * UnSetter for squareGiftCard.
         * @return Builder
         */
        public Builder unsetSquareGiftCard() {
            squareGiftCard = null;
            return this;
        }

        /**
         * Setter for bankAccount.
         * @param  bankAccount  Boolean value for bankAccount.
         * @return Builder
         */
        public Builder bankAccount(Boolean bankAccount) {
            this.bankAccount = OptionalNullable.of(bankAccount);
            return this;
        }

        /**
         * UnSetter for bankAccount.
         * @return Builder
         */
        public Builder unsetBankAccount() {
            bankAccount = null;
            return this;
        }

        /**
         * Setter for buyNowPayLater.
         * @param  buyNowPayLater  Boolean value for buyNowPayLater.
         * @return Builder
         */
        public Builder buyNowPayLater(Boolean buyNowPayLater) {
            this.buyNowPayLater = OptionalNullable.of(buyNowPayLater);
            return this;
        }

        /**
         * UnSetter for buyNowPayLater.
         * @return Builder
         */
        public Builder unsetBuyNowPayLater() {
            buyNowPayLater = null;
            return this;
        }

        /**
         * Setter for cashAppPay.
         * @param  cashAppPay  Boolean value for cashAppPay.
         * @return Builder
         */
        public Builder cashAppPay(Boolean cashAppPay) {
            this.cashAppPay = OptionalNullable.of(cashAppPay);
            return this;
        }

        /**
         * UnSetter for cashAppPay.
         * @return Builder
         */
        public Builder unsetCashAppPay() {
            cashAppPay = null;
            return this;
        }

        /**
         * Builds a new {@link InvoiceAcceptedPaymentMethods} object using the set fields.
         * @return {@link InvoiceAcceptedPaymentMethods}
         */
        public InvoiceAcceptedPaymentMethods build() {
            return new InvoiceAcceptedPaymentMethods(card, squareGiftCard, bankAccount, buyNowPayLater, cashAppPay);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy