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

jp.gopay.sdk.utils.builders.CardConfigurationBuilder Maven / Gradle / Ivy

There is a newer version: 0.11.17
Show newest version
package jp.gopay.sdk.utils.builders;

import jp.gopay.sdk.models.response.CardLimit;
import jp.gopay.sdk.models.response.store.CardConfiguration;
import jp.gopay.sdk.types.CardBrand;
import jp.gopay.sdk.types.Country;

import java.util.List;

public class CardConfigurationBuilder implements Builder {

    private Boolean enabled;
    private Boolean debitEnabled;
    private Boolean prepaidEnabled;
    private List forbiddenCardBrands;
    private List allowedCountriesByIp;
    private Boolean foreignCardsAllowed;
    private Boolean failOnNewEmail;
    private Boolean allowEmptyCvv;
    private CardLimit cardLimit;

    public CardConfigurationBuilder withEnabled(Boolean enabled){
        this.enabled = enabled;
        return this;
    }

    public CardConfigurationBuilder withDebitEnabled(Boolean debitEnabled){
        this.debitEnabled = debitEnabled;
        return this;
    }

    public CardConfigurationBuilder withPrepaidEnabled(Boolean prepaidEnabled){
        this.prepaidEnabled = prepaidEnabled;
        return this;
    }

    public CardConfigurationBuilder withForbiddenCardBrands(List forbiddenCardBrands){
        this.forbiddenCardBrands = forbiddenCardBrands;
        return this;
    }

    public CardConfigurationBuilder withAllowedCountriesByIp(List allowedCountriesByIp){
        this.allowedCountriesByIp = allowedCountriesByIp;
        return this;
    }

    public CardConfigurationBuilder withForeignCardsAllowed(Boolean foreignCardsAllowed){
        this.foreignCardsAllowed = foreignCardsAllowed;
        return this;
    }

    public CardConfigurationBuilder withFailOnNewEmail(Boolean failOnNewEmail){
        this.failOnNewEmail = failOnNewEmail;
        return this;
    }

    public CardConfigurationBuilder withAllowEmptyCvv(Boolean allowEmptyCvv){
        this.allowEmptyCvv = allowEmptyCvv;
        return this;
    }

    public CardConfigurationBuilder withCardLimit(CardLimit cardLimit){
        this.cardLimit = cardLimit;
        return this;
    }

    @Override
    public CardConfiguration build(){
        return new CardConfiguration(enabled, debitEnabled, prepaidEnabled, forbiddenCardBrands, allowedCountriesByIp, foreignCardsAllowed, failOnNewEmail, allowEmptyCvv, cardLimit);
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public Boolean getDebitEnabled() {
        return debitEnabled;
    }

    public Boolean getPrepaidEnabled() {
        return prepaidEnabled;
    }

    public List getForbiddenCardBrands() {
        return forbiddenCardBrands;
    }

    public List getAllowedCountriesByIp() {
        return allowedCountriesByIp;
    }

    public Boolean getForeignCardsAllowed() {
        return foreignCardsAllowed;
    }

    public Boolean getFailOnNewEmail() {
        return failOnNewEmail;
    }

    public Boolean getAllowEmptyCvv() {
        return allowEmptyCvv;
    }

    public CardLimit getCardLimit() {
        return cardLimit;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy