jp.gopay.sdk.utils.builders.CardConfigurationBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gopay-java-sdk Show documentation
Show all versions of gopay-java-sdk Show documentation
Official Gyro-n Payments Java SDK
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;
}
}