Add email to bank accounts. Add warning and info for bank accounts regarding chargeback risk and id verification. Add warning to CXC accounts.

This commit is contained in:
Manfred Karrer 2017-06-27 21:05:47 +02:00
parent d4269adda7
commit e11b314bbb
31 changed files with 367 additions and 177 deletions

View File

@ -221,6 +221,17 @@ public class BankUtil {
} }
} }
public static String getHolderIdLabelShort(String countryCode) {
switch (countryCode) {
case "BR":
return "CPF:"; // do not translate as it is used in portuguese only
case "CL":
return "RUT:"; // do not translate as it is used in spanish only
default:
return "ID";
}
}
// Validation // Validation
public static boolean useValidation(String countryCode) { public static boolean useValidation(String countryCode) {
switch (countryCode) { switch (countryCode) {

View File

@ -503,15 +503,14 @@ message OfferPayload {
int64 seller_security_deposit = 28; int64 seller_security_deposit = 28;
int64 max_trade_limit = 29; int64 max_trade_limit = 29;
int64 max_trade_period = 30; int64 max_trade_period = 30;
bool supportsDirectContact = 31; bool use_auto_close = 31;
bool use_auto_close = 32; bool use_re_open_after_auto_close = 32;
bool use_re_open_after_auto_close = 33; int64 lower_close_price = 33;
int64 lower_close_price = 34; int64 upper_close_price = 34;
int64 upper_close_price = 35; bool is_private_offer = 35;
bool is_private_offer = 36; string hash_of_challenge = 36;
string hash_of_challenge = 37; map<string, string> extra_data = 37;
map<string, string> extra_data = 38; int32 protocol_version = 38;
int32 protocol_version = 39;
} }
// TODO not fully verified as impl. is not completed // TODO not fully verified as impl. is not completed
@ -709,10 +708,11 @@ message BankAccountPayload {
string account_nr = 5; string account_nr = 5;
string account_type = 6; string account_type = 6;
string holder_tax_id = 7; string holder_tax_id = 7;
string email = 8;
oneof message { oneof message {
NationalBankAccountPayload national_bank_account_payload = 8; NationalBankAccountPayload national_bank_account_payload = 9;
SameBankAccountPayload same_bank_accont_payload = 9; SameBankAccountPayload same_bank_accont_payload = 10;
SpecificBanksAccountPayload specific_banks_account_payload = 10; SpecificBanksAccountPayload specific_banks_account_payload = 11;
} }
} }
@ -742,7 +742,8 @@ message SepaAccountPayload {
string holder_name = 1; string holder_name = 1;
string iban = 2; string iban = 2;
string bic = 3; string bic = 3;
repeated string accepted_country_codes = 4; string email = 4;
repeated string accepted_country_codes = 5;
} }
message CryptoCurrencyAccountPayload { message CryptoCurrencyAccountPayload {
@ -752,6 +753,7 @@ message CryptoCurrencyAccountPayload {
message FasterPaymentsAccountPayload { message FasterPaymentsAccountPayload {
string sort_code = 1; string sort_code = 1;
string account_nr = 2; string account_nr = 2;
string email = 3;
} }
message InteracETransferAccountPayload { message InteracETransferAccountPayload {
@ -1108,7 +1110,6 @@ message PreferencesPayload {
bool use_animations = 31; bool use_animations = 31;
PaymentAccount selectedPayment_account_for_createOffer = 32; PaymentAccount selectedPayment_account_for_createOffer = 32;
bool pay_fee_in_Btc = 33; bool pay_fee_in_Btc = 33;
bool supportsDirectContact = 34;
} }

View File

@ -1431,7 +1431,6 @@ payment.account.name=Account name:
payment.account.owner=Account holder name payment.account.owner=Account holder name
payment.bank.country=Country of bank: payment.bank.country=Country of bank:
payment.account.name.email=Account holder name / email payment.account.name.email=Account holder name / email
payment.account.name.holderId=Account holder name / {0}
payment.account.name.emailAndHolderId=Account holder name / email / {0} payment.account.name.emailAndHolderId=Account holder name / email / {0}
payment.bank.name=Bank name: payment.bank.name=Bank name:
payment.select.account=Select account type payment.select.account=Select account type
@ -1442,7 +1441,6 @@ payment.foreign.currency=Are you sure you want to choose a currency other than t
payment.restore.default=No, restore default currency payment.restore.default=No, restore default currency
payment.email=Email: payment.email=Email:
payment.country=Country: payment.country=Country:
payment.owner.email=Account holder email:
payment.extras=Extra requirements: payment.extras=Extra requirements:
payment.us.info=Bank transfer with WIRE or ACH is not supported for the US because WIRE is too expensive and ACH has a high chargeback risk.\n\nPlease use payment methods \"ClearXchange\", \"US Postal Money Order\" or \"Cash Deposit\" instead. payment.us.info=Bank transfer with WIRE or ACH is not supported for the US because WIRE is too expensive and ACH has a high chargeback risk.\n\nPlease use payment methods \"ClearXchange\", \"US Postal Money Order\" or \"Cash Deposit\" instead.
payment.email.mobile=Email or mobile no.: payment.email.mobile=Email or mobile no.:
@ -1457,7 +1455,7 @@ payment.limitations=Limitations:
payment.accept.euro=Accept trades from these Euro countries: payment.accept.euro=Accept trades from these Euro countries:
payment.accept.nonEuro=Accept trades from these non-Euro countries: payment.accept.nonEuro=Accept trades from these non-Euro countries:
payment.accepted.countries=Accepted countries: payment.accepted.countries=Accepted countries:
payment.accepted.banks=Accepted banks: payment.accepted.banks=Accepted banks (ID):
payment.mobile=Mobile no.: payment.mobile=Mobile no.:
payment.postal.address=Postal address: payment.postal.address=Postal address:
@ -1488,17 +1486,27 @@ payment.clearXchange.info=Please be sure that you fulfill the requirements for t
1. You need to have your ClearXchange account verified at their platform \ 1. You need to have your ClearXchange account verified at their platform \
before starting a trade or creating an offer.\n\n\ before starting a trade or creating an offer.\n\n\
2. You need to have a bank account at one of the following member banks:\n\ 2. You need to have a bank account at one of the following member banks:\n\
Bank of America\n\ \tBank of America\n\
Capital One P2P Payments\n\ \tCapital One P2P Payments\n\
Chase QuickPay\n\ \tChase QuickPay\n\
FirstBank Person to Person Transfers\n\ \tFirstBank Person to Person Transfers\n\
Frost Send Money\n\ \tFrost Send Money\n\
U.S. Bank Send Money\n\ \tU.S. Bank Send Money\n\
Wells Fargo SurePay\n\n\ \tWells Fargo SurePay\n\n\
Please use ClearXchange only if you fulfill those requirements, \ Please use ClearXchange only if you fulfill those requirements, \
otherwise it is very likely that the ClearXchange transfer fails and the trade ends up in a dispute.\n\ otherwise it is very likely that the ClearXchange transfer fails and the trade ends up in a dispute.\n\
If you have not fulfilled the above requirements you would lose your security deposit in such a case. If you have not fulfilled the above requirements you would lose your security deposit in such a case.\n\n\
Please be also aware of a higher chargeback risk when using ClearXchange.\n\
For the {0} seller it is highly recommended \
to verify the identity of the {1} buyer by contacting the peer using the provided email address or mobile number.
payment.chargeback.info=Any bank transfer carries some chargeback risks (reversal of payment).\n\n\
To protect {0} sellers against fraudulent payments the traders can get in touch using the email address from in the payment \
account for verifying the peers identity (e.g. by providing government issued ID, utility bill,...).\n\n\
When receiving an email please check with Anti-Virus software to be sure to not get exposed to malware or phishing attacks. \
Also be aware of risks from social engineering scam attempts.\n\
In doubt contact the arbitrator or get in touch with the community on the Bisq Forum.\n\n\
By confirming with the button below you agree to exercise identity verification with the peer if requested.
# We use constants from the code so we do not use our normal naming convention # We use constants from the code so we do not use our normal naming convention
# dynamic values are not recognized by IntelliJ # dynamic values are not recognized by IntelliJ
@ -1595,7 +1603,7 @@ validation.bic.invalidLocationCode=BIC contains invalid location code
validation.bic.invalidBranchCode=BIC contains invalid branch code validation.bic.invalidBranchCode=BIC contains invalid branch code
validation.btc.invalidFormat=Invalid format of the bitcoin address. validation.btc.invalidFormat=Invalid format of the bitcoin address.
validation.bsq.invalidFormat=Invalid format of the BSQ address. validation.bsq.invalidFormat=Invalid format of the BSQ address.
validation.email.invalidAddress=Invalid address= validation.email.invalidAddress=Invalid address
validation.iban.invalidCountryCode=Country code invalid validation.iban.invalidCountryCode=Country code invalid
validation.iban.checkSumNotNumeric=Checksum must be numeric validation.iban.checkSumNotNumeric=Checksum must be numeric
validation.iban.nonNumericChars=Non-alphanumeric character detected validation.iban.nonNumericChars=Non-alphanumeric character detected

View File

@ -116,7 +116,6 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
private final long sellerSecurityDeposit; private final long sellerSecurityDeposit;
private final long maxTradeLimit; private final long maxTradeLimit;
private final long maxTradePeriod; private final long maxTradePeriod;
private final boolean supportsDirectContact;
// reserved for future use cases // reserved for future use cases
// Close offer when certain price is reached // Close offer when certain price is reached
@ -174,7 +173,6 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
long sellerSecurityDeposit, long sellerSecurityDeposit,
long maxTradeLimit, long maxTradeLimit,
long maxTradePeriod, long maxTradePeriod,
boolean supportsDirectContact,
boolean useAutoClose, boolean useAutoClose,
boolean useReOpenAfterAutoClose, boolean useReOpenAfterAutoClose,
long lowerClosePrice, long lowerClosePrice,
@ -213,7 +211,6 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
this.sellerSecurityDeposit = sellerSecurityDeposit; this.sellerSecurityDeposit = sellerSecurityDeposit;
this.maxTradeLimit = maxTradeLimit; this.maxTradeLimit = maxTradeLimit;
this.maxTradePeriod = maxTradePeriod; this.maxTradePeriod = maxTradePeriod;
this.supportsDirectContact = supportsDirectContact;
this.useAutoClose = useAutoClose; this.useAutoClose = useAutoClose;
this.useReOpenAfterAutoClose = useReOpenAfterAutoClose; this.useReOpenAfterAutoClose = useReOpenAfterAutoClose;
this.lowerClosePrice = lowerClosePrice; this.lowerClosePrice = lowerClosePrice;
@ -260,7 +257,6 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
.setSellerSecurityDeposit(sellerSecurityDeposit) .setSellerSecurityDeposit(sellerSecurityDeposit)
.setMaxTradeLimit(maxTradeLimit) .setMaxTradeLimit(maxTradeLimit)
.setMaxTradePeriod(maxTradePeriod) .setMaxTradePeriod(maxTradePeriod)
.setSupportsDirectContact(supportsDirectContact)
.setUseAutoClose(useAutoClose) .setUseAutoClose(useAutoClose)
.setUseReOpenAfterAutoClose(useReOpenAfterAutoClose) .setUseReOpenAfterAutoClose(useReOpenAfterAutoClose)
.setLowerClosePrice(lowerClosePrice) .setLowerClosePrice(lowerClosePrice)
@ -324,7 +320,6 @@ public final class OfferPayload implements StoragePayload, RequiresOwnerIsOnline
proto.getSellerSecurityDeposit(), proto.getSellerSecurityDeposit(),
proto.getMaxTradeLimit(), proto.getMaxTradeLimit(),
proto.getMaxTradePeriod(), proto.getMaxTradePeriod(),
proto.getSupportsDirectContact(),
proto.getUseAutoClose(), proto.getUseAutoClose(),
proto.getUseReOpenAfterAutoClose(), proto.getUseReOpenAfterAutoClose(),
proto.getLowerClosePrice(), proto.getLowerClosePrice(),

View File

@ -50,4 +50,12 @@ public final class FasterPaymentsAccount extends PaymentAccount {
public String getAccountNr() { public String getAccountNr() {
return ((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr(); return ((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr();
} }
public void setEmail(String value) {
((FasterPaymentsAccountPayload) paymentAccountPayload).setEmail(value);
}
public String getEmail() {
return ((FasterPaymentsAccountPayload) paymentAccountPayload).getEmail();
}
} }

View File

@ -43,4 +43,12 @@ public final class NationalBankAccount extends CountryBasedPaymentAccount implem
public String getCountryCode() { public String getCountryCode() {
return getCountry() != null ? getCountry().code : ""; return getCountry() != null ? getCountry().code : "";
} }
public void setEmail(String value) {
((BankAccountPayload) paymentAccountPayload).setEmail(value);
}
public String getEmail() {
return ((BankAccountPayload) paymentAccountPayload).getEmail();
}
} }

View File

@ -43,4 +43,12 @@ public final class SameBankAccount extends CountryBasedPaymentAccount implements
public String getCountryCode() { public String getCountryCode() {
return getCountry() != null ? getCountry().code : ""; return getCountry() != null ? getCountry().code : "";
} }
public void setEmail(String value) {
((BankAccountPayload) paymentAccountPayload).setEmail(value);
}
public String getEmail() {
return ((BankAccountPayload) paymentAccountPayload).getEmail();
}
} }

View File

@ -50,6 +50,14 @@ public final class SepaAccount extends CountryBasedPaymentAccount implements Ban
return ((SepaAccountPayload) paymentAccountPayload).getHolderName(); return ((SepaAccountPayload) paymentAccountPayload).getHolderName();
} }
public void setEmail(String value) {
((SepaAccountPayload) paymentAccountPayload).setEmail(value);
}
public String getEmail() {
return ((SepaAccountPayload) paymentAccountPayload).getEmail();
}
public void setIban(String iban) { public void setIban(String iban) {
((SepaAccountPayload) paymentAccountPayload).setIban(iban); ((SepaAccountPayload) paymentAccountPayload).setIban(iban);
} }

View File

@ -17,6 +17,7 @@
package io.bisq.core.payment; package io.bisq.core.payment;
import io.bisq.core.payment.payload.BankAccountPayload;
import io.bisq.core.payment.payload.PaymentAccountPayload; import io.bisq.core.payment.payload.PaymentAccountPayload;
import io.bisq.core.payment.payload.PaymentMethod; import io.bisq.core.payment.payload.PaymentMethod;
import io.bisq.core.payment.payload.SpecificBanksAccountPayload; import io.bisq.core.payment.payload.SpecificBanksAccountPayload;
@ -48,4 +49,12 @@ public final class SpecificBanksAccount extends CountryBasedPaymentAccount imple
public String getCountryCode() { public String getCountryCode() {
return getCountry() != null ? getCountry().code : ""; return getCountry() != null ? getCountry().code : "";
} }
public void setEmail(String value) {
((BankAccountPayload) paymentAccountPayload).setEmail(value);
}
public String getEmail() {
return ((BankAccountPayload) paymentAccountPayload).getEmail();
}
} }

View File

@ -19,6 +19,7 @@ package io.bisq.core.payment.payload;
import io.bisq.common.locale.BankUtil; import io.bisq.common.locale.BankUtil;
import io.bisq.common.locale.CountryUtil; import io.bisq.common.locale.CountryUtil;
import io.bisq.common.locale.Res;
import io.bisq.generated.protobuffer.PB; import io.bisq.generated.protobuffer.PB;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
@ -48,6 +49,8 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
protected String holderTaxId; protected String holderTaxId;
@Nullable @Nullable
protected String bankId; protected String bankId;
@Nullable
protected String email;
public BankAccountPayload(String paymentMethod, String id, long maxTradePeriod) { public BankAccountPayload(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
@ -68,7 +71,8 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
String accountNr, String accountNr,
String accountType, String accountType,
String holderTaxId, String holderTaxId,
String bankId) { String bankId,
String email) {
super(paymentMethodName, id, maxTradePeriod, countryCode); super(paymentMethodName, id, maxTradePeriod, countryCode);
this.holderName = holderName; this.holderName = holderName;
this.bankName = bankName; this.bankName = bankName;
@ -77,6 +81,7 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
this.accountType = accountType; this.accountType = accountType;
this.holderTaxId = holderTaxId; this.holderTaxId = holderTaxId;
this.bankId = bankId; this.bankId = bankId;
this.email = email;
} }
@Override @Override
@ -90,6 +95,7 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
Optional.ofNullable(accountNr).ifPresent(builder::setAccountNr); Optional.ofNullable(accountNr).ifPresent(builder::setAccountNr);
Optional.ofNullable(accountType).ifPresent(builder::setAccountType); Optional.ofNullable(accountType).ifPresent(builder::setAccountType);
Optional.ofNullable(bankId).ifPresent(builder::setBankId); Optional.ofNullable(bankId).ifPresent(builder::setBankId);
Optional.ofNullable(email).ifPresent(builder::setEmail);
final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayloadBuilder = super.getPaymentAccountPayloadBuilder() final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayloadBuilder = super.getPaymentAccountPayloadBuilder()
.getCountryBasedPaymentAccountPayloadBuilder() .getCountryBasedPaymentAccountPayloadBuilder()
.setBankAccountPayload(builder); .setBankAccountPayload(builder);
@ -117,8 +123,11 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
BankUtil.getAccountTypeLabel(countryCode) + " " + this.accountType + "\n" : ""; BankUtil.getAccountTypeLabel(countryCode) + " " + this.accountType + "\n" : "";
String holderIdString = BankUtil.isHolderIdRequired(countryCode) ? String holderIdString = BankUtil.isHolderIdRequired(countryCode) ?
(BankUtil.getHolderIdLabel(countryCode) + " " + holderTaxId + "\n") : ""; (BankUtil.getHolderIdLabel(countryCode) + " " + holderTaxId + "\n") : "";
String emailString = email != null ?
(Res.get("payment.email") + " " + email + "\n") : "";
return "Holder name: " + holderName + "\n" + return "Holder name: " + holderName + "\n" +
emailString +
bankName + bankName +
bankId + bankId +
branchId + branchId +

View File

@ -20,6 +20,7 @@ package io.bisq.core.payment.payload;
import com.google.protobuf.Message; import com.google.protobuf.Message;
import io.bisq.common.locale.BankUtil; import io.bisq.common.locale.BankUtil;
import io.bisq.common.locale.CountryUtil; import io.bisq.common.locale.CountryUtil;
import io.bisq.common.locale.Res;
import io.bisq.generated.protobuffer.PB; import io.bisq.generated.protobuffer.PB;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.Getter; import lombok.Getter;
@ -154,9 +155,11 @@ public class CashDepositAccountPayload extends CountryBasedPaymentAccountPayload
(BankUtil.getHolderIdLabel(countryCode) + " " + holderTaxId + "\n") : ""; (BankUtil.getHolderIdLabel(countryCode) + " " + holderTaxId + "\n") : "";
String requirementsString = requirements != null && !requirements.isEmpty() ? String requirementsString = requirements != null && !requirements.isEmpty() ?
("Extra requirements: " + requirements + "\n") : ""; ("Extra requirements: " + requirements + "\n") : "";
String emailString = holderEmail != null ?
(Res.get("payment.email") + " " + holderEmail + "\n") : "";
return "Holder name: " + holderName + "\n" + return "Holder name: " + holderName + "\n" +
"Holder email: " + holderEmail + "\n" + emailString +
bankName + bankName +
bankId + bankId +
branchId + branchId +

View File

@ -33,6 +33,7 @@ import lombok.extern.slf4j.Slf4j;
public final class FasterPaymentsAccountPayload extends PaymentAccountPayload { public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
private String sortCode; private String sortCode;
private String accountNr; private String accountNr;
private String email;
public FasterPaymentsAccountPayload(String paymentMethod, String id, long maxTradePeriod) { public FasterPaymentsAccountPayload(String paymentMethod, String id, long maxTradePeriod) {
super(paymentMethod, id, maxTradePeriod); super(paymentMethod, id, maxTradePeriod);
@ -47,11 +48,13 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
String id, String id,
long maxTradePeriod, long maxTradePeriod,
String sortCode, String sortCode,
String accountNr) { String accountNr,
String email) {
this(paymentMethod, id, maxTradePeriod); this(paymentMethod, id, maxTradePeriod);
this.sortCode = sortCode; this.sortCode = sortCode;
this.accountNr = accountNr; this.accountNr = accountNr;
this.email = email;
} }
@Override @Override
@ -59,7 +62,8 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
return getPaymentAccountPayloadBuilder() return getPaymentAccountPayloadBuilder()
.setFasterPaymentsAccountPayload(PB.FasterPaymentsAccountPayload.newBuilder() .setFasterPaymentsAccountPayload(PB.FasterPaymentsAccountPayload.newBuilder()
.setSortCode(sortCode) .setSortCode(sortCode)
.setAccountNr(accountNr)) .setAccountNr(accountNr)
.setEmail(email))
.build(); .build();
} }
@ -68,7 +72,8 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
proto.getId(), proto.getId(),
proto.getMaxTradePeriod(), proto.getMaxTradePeriod(),
proto.getFasterPaymentsAccountPayload().getSortCode(), proto.getFasterPaymentsAccountPayload().getSortCode(),
proto.getFasterPaymentsAccountPayload().getAccountNr()); proto.getFasterPaymentsAccountPayload().getAccountNr(),
proto.getFasterPaymentsAccountPayload().getEmail());
} }
@ -78,12 +83,13 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
@Override @Override
public String getPaymentDetails() { public String getPaymentDetails() {
return "FasterPayments - UK Sort code: " + sortCode + ", Account number: " + accountNr; return "FasterPayments - UK Sort code: " + sortCode + ", Account number: " + accountNr + ", Email: " + email;
} }
@Override @Override
public String getPaymentDetailsForTradePopup() { public String getPaymentDetailsForTradePopup() {
return "UK Sort code: " + sortCode + "\n" + return "UK Sort code: " + sortCode + "\n" +
"Account number: " + accountNr; "Account number: " + accountNr + "\n" +
"Email: " + email;
} }
} }

View File

@ -47,7 +47,8 @@ public final class NationalBankAccountPayload extends BankAccountPayload {
String accountNr, String accountNr,
String accountType, String accountType,
String holderTaxId, String holderTaxId,
String bankId) { String bankId,
String email) {
super(paymentMethodName, super(paymentMethodName,
id, id,
maxTradePeriod, maxTradePeriod,
@ -58,7 +59,8 @@ public final class NationalBankAccountPayload extends BankAccountPayload {
accountNr, accountNr,
accountType, accountType,
holderTaxId, holderTaxId,
bankId); bankId,
email);
} }
@Override @Override
@ -90,7 +92,8 @@ public final class NationalBankAccountPayload extends BankAccountPayload {
bankAccountPayload.getAccountNr().isEmpty() ? null : bankAccountPayload.getAccountNr(), bankAccountPayload.getAccountNr().isEmpty() ? null : bankAccountPayload.getAccountNr(),
bankAccountPayload.getAccountType().isEmpty() ? null : bankAccountPayload.getAccountType(), bankAccountPayload.getAccountType().isEmpty() ? null : bankAccountPayload.getAccountType(),
bankAccountPayload.getHolderTaxId().isEmpty() ? null : bankAccountPayload.getHolderTaxId(), bankAccountPayload.getHolderTaxId().isEmpty() ? null : bankAccountPayload.getHolderTaxId(),
bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId()); bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId(),
bankAccountPayload.getEmail().isEmpty() ? null : bankAccountPayload.getEmail());
} }
@Override @Override

View File

@ -147,30 +147,29 @@ public final class PaymentMethod implements PersistablePayload, Comparable {
// EUR // EUR
SEPA = new PaymentMethod(SEPA_ID, 6 * DAY, maxTradeLimitMidRisk), SEPA = new PaymentMethod(SEPA_ID, 6 * DAY, maxTradeLimitMidRisk),
// Global
NATIONAL_BANK = new PaymentMethod(NATIONAL_BANK_ID, 4 * DAY, maxTradeLimitMidRisk),
SAME_BANK = new PaymentMethod(SAME_BANK_ID, 2 * DAY, maxTradeLimitMidRisk),
SPECIFIC_BANKS = new PaymentMethod(SPECIFIC_BANKS_ID, 4 * DAY, maxTradeLimitMidRisk),
CASH_DEPOSIT = new PaymentMethod(CASH_DEPOSIT_ID, 4 * DAY, maxTradeLimitMidRisk),
// Trans national
OK_PAY = new PaymentMethod(OK_PAY_ID, DAY, maxTradeLimitLowRisk),
PERFECT_MONEY = new PaymentMethod(PERFECT_MONEY_ID, DAY, maxTradeLimitLowRisk),
// UK // UK
FASTER_PAYMENTS = new PaymentMethod(FASTER_PAYMENTS_ID, DAY, maxTradeLimitMidRisk), FASTER_PAYMENTS = new PaymentMethod(FASTER_PAYMENTS_ID, DAY, maxTradeLimitMidRisk),
// Sweden
SWISH = new PaymentMethod(SWISH_ID, DAY, maxTradeLimitLowRisk),
// US
CLEAR_X_CHANGE = new PaymentMethod(CLEAR_X_CHANGE_ID, 4 * DAY, maxTradeLimitMidRisk),
CHASE_QUICK_PAY = new PaymentMethod(CHASE_QUICK_PAY_ID, DAY, maxTradeLimitMidRisk),
US_POSTAL_MONEY_ORDER = new PaymentMethod(US_POSTAL_MONEY_ORDER_ID, 8 * DAY, maxTradeLimitMidRisk),
// Canada // Canada
INTERAC_E_TRANSFER = new PaymentMethod(INTERAC_E_TRANSFER_ID, DAY, maxTradeLimitMidRisk), INTERAC_E_TRANSFER = new PaymentMethod(INTERAC_E_TRANSFER_ID, DAY, maxTradeLimitMidRisk),
// US // Global
// CXC is to risky regarding chargeback CASH_DEPOSIT = new PaymentMethod(CASH_DEPOSIT_ID, 4 * DAY, maxTradeLimitMidRisk),
// CLEAR_X_CHANGE = new PaymentMethod(CLEAR_X_CHANGE_ID, 4 * DAY, maxTradeLimitMidRisk), NATIONAL_BANK = new PaymentMethod(NATIONAL_BANK_ID, 4 * DAY, maxTradeLimitMidRisk),
CHASE_QUICK_PAY = new PaymentMethod(CHASE_QUICK_PAY_ID, DAY, maxTradeLimitMidRisk), SAME_BANK = new PaymentMethod(SAME_BANK_ID, 2 * DAY, maxTradeLimitMidRisk),
US_POSTAL_MONEY_ORDER = new PaymentMethod(US_POSTAL_MONEY_ORDER_ID, 8 * DAY, maxTradeLimitMidRisk), SPECIFIC_BANKS = new PaymentMethod(SPECIFIC_BANKS_ID, 4 * DAY, maxTradeLimitMidRisk),
// Sweden // Trans national
SWISH = new PaymentMethod(SWISH_ID, DAY, maxTradeLimitLowRisk), OK_PAY = new PaymentMethod(OK_PAY_ID, DAY, maxTradeLimitLowRisk),
PERFECT_MONEY = new PaymentMethod(PERFECT_MONEY_ID, DAY, maxTradeLimitLowRisk),
// China // China
ALI_PAY = new PaymentMethod(ALI_PAY_ID, DAY, maxTradeLimitLowRisk), ALI_PAY = new PaymentMethod(ALI_PAY_ID, DAY, maxTradeLimitLowRisk),

View File

@ -47,7 +47,8 @@ public final class SameBankAccountPayload extends BankAccountPayload {
String accountNr, String accountNr,
String accountType, String accountType,
String holderTaxId, String holderTaxId,
String bankId) { String bankId,
String email) {
super(paymentMethodName, super(paymentMethodName,
id, id,
maxTradePeriod, maxTradePeriod,
@ -58,7 +59,8 @@ public final class SameBankAccountPayload extends BankAccountPayload {
accountNr, accountNr,
accountType, accountType,
holderTaxId, holderTaxId,
bankId); bankId,
email);
} }
@Override @Override
@ -90,7 +92,8 @@ public final class SameBankAccountPayload extends BankAccountPayload {
bankAccountPayload.getAccountNr().isEmpty() ? null : bankAccountPayload.getAccountNr(), bankAccountPayload.getAccountNr().isEmpty() ? null : bankAccountPayload.getAccountNr(),
bankAccountPayload.getAccountType().isEmpty() ? null : bankAccountPayload.getAccountType(), bankAccountPayload.getAccountType().isEmpty() ? null : bankAccountPayload.getAccountType(),
bankAccountPayload.getHolderTaxId().isEmpty() ? null : bankAccountPayload.getHolderTaxId(), bankAccountPayload.getHolderTaxId().isEmpty() ? null : bankAccountPayload.getHolderTaxId(),
bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId()); bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId(),
bankAccountPayload.getEmail().isEmpty() ? null : bankAccountPayload.getEmail());
} }
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////

View File

@ -43,6 +43,8 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
private String iban; private String iban;
@Setter @Setter
private String bic; private String bic;
@Setter
private String email;
// Dont use a set here as we need a deterministic ordering, otherwise the contract hash does not match // Dont use a set here as we need a deterministic ordering, otherwise the contract hash does not match
private final List<String> acceptedCountryCodes; private final List<String> acceptedCountryCodes;
@ -66,11 +68,13 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
String holderName, String holderName,
String iban, String iban,
String bic, String bic,
String email,
List<String> acceptedCountryCodes) { List<String> acceptedCountryCodes) {
super(paymentMethodName, id, maxTradePeriod, countryCode); super(paymentMethodName, id, maxTradePeriod, countryCode);
this.holderName = holderName; this.holderName = holderName;
this.iban = iban; this.iban = iban;
this.bic = bic; this.bic = bic;
this.email = email;
this.acceptedCountryCodes = acceptedCountryCodes; this.acceptedCountryCodes = acceptedCountryCodes;
} }
@ -81,6 +85,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
.setHolderName(holderName) .setHolderName(holderName)
.setIban(iban) .setIban(iban)
.setBic(bic) .setBic(bic)
.setEmail(email)
.addAllAcceptedCountryCodes(acceptedCountryCodes); .addAllAcceptedCountryCodes(acceptedCountryCodes);
final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder() final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
.getCountryBasedPaymentAccountPayloadBuilder() .getCountryBasedPaymentAccountPayloadBuilder()
@ -100,6 +105,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
sepaAccountPayload.getHolderName(), sepaAccountPayload.getHolderName(),
sepaAccountPayload.getIban(), sepaAccountPayload.getIban(),
sepaAccountPayload.getBic(), sepaAccountPayload.getBic(),
sepaAccountPayload.getEmail(),
new ArrayList<>(sepaAccountPayload.getAcceptedCountryCodesList())); new ArrayList<>(sepaAccountPayload.getAcceptedCountryCodesList()));
} }
@ -120,7 +126,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
@Override @Override
public String getPaymentDetails() { public String getPaymentDetails() {
return "SEPA - Holder name: " + holderName + ", IBAN: " + iban + ", BIC: " + bic + ", country code: " + getCountryCode(); return "SEPA - Holder name: " + holderName + ", IBAN: " + iban + ", BIC: " + bic + ", Email: " + email + ", country code: " + getCountryCode();
} }
@Override @Override
@ -128,6 +134,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
return "Holder name: " + holderName + "\n" + return "Holder name: " + holderName + "\n" +
"IBAN: " + iban + "\n" + "IBAN: " + iban + "\n" +
"BIC: " + bic + "\n" + "BIC: " + bic + "\n" +
"Email: " + email + "\n" +
"Country of bank: " + CountryUtil.getNameByCode(countryCode); "Country of bank: " + CountryUtil.getNameByCode(countryCode);
} }
} }

View File

@ -55,6 +55,7 @@ public final class SpecificBanksAccountPayload extends BankAccountPayload {
String accountType, String accountType,
String holderTaxId, String holderTaxId,
String bankId, String bankId,
String email,
ArrayList<String> acceptedBanks) { ArrayList<String> acceptedBanks) {
super(paymentMethodName, super(paymentMethodName,
id, id,
@ -66,7 +67,8 @@ public final class SpecificBanksAccountPayload extends BankAccountPayload {
accountNr, accountNr,
accountType, accountType,
holderTaxId, holderTaxId,
bankId); bankId,
email);
this.acceptedBanks = acceptedBanks; this.acceptedBanks = acceptedBanks;
} }
@ -104,6 +106,7 @@ public final class SpecificBanksAccountPayload extends BankAccountPayload {
bankAccountPayload.getAccountType().isEmpty() ? null : bankAccountPayload.getAccountType(), bankAccountPayload.getAccountType().isEmpty() ? null : bankAccountPayload.getAccountType(),
bankAccountPayload.getHolderTaxId().isEmpty() ? null : bankAccountPayload.getHolderTaxId(), bankAccountPayload.getHolderTaxId().isEmpty() ? null : bankAccountPayload.getHolderTaxId(),
bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId(), bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId(),
bankAccountPayload.getEmail().isEmpty() ? null : bankAccountPayload.getEmail(),
new ArrayList<>(specificBanksAccountPayload.getAcceptedBanksList()) new ArrayList<>(specificBanksAccountPayload.getAcceptedBanksList())
); );
} }

View File

@ -67,7 +67,6 @@ public final class PreferencesPayload implements PersistableEnvelope {
@Nullable @Nullable
private PaymentAccount selectedPaymentAccountForCreateOffer; private PaymentAccount selectedPaymentAccountForCreateOffer;
private boolean payFeeInBtc = true; private boolean payFeeInBtc = true;
private boolean supportsDirectContact = true;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -114,8 +113,7 @@ public final class PreferencesPayload implements PersistableEnvelope {
.setDirectoryChooserPath(directoryChooserPath) .setDirectoryChooserPath(directoryChooserPath)
.setBuyerSecurityDepositAsLong(buyerSecurityDepositAsLong) .setBuyerSecurityDepositAsLong(buyerSecurityDepositAsLong)
.setUseAnimations(useAnimations) .setUseAnimations(useAnimations)
.setPayFeeInBtc(payFeeInBtc) .setPayFeeInBtc(payFeeInBtc);
.setSupportsDirectContact(supportsDirectContact);
Optional.ofNullable(backupDirectory).ifPresent(builder::setBackupDirectory); Optional.ofNullable(backupDirectory).ifPresent(builder::setBackupDirectory);
Optional.ofNullable(preferredTradeCurrency).ifPresent(e -> builder.setPreferredTradeCurrency((PB.TradeCurrency) e.toProtoMessage())); Optional.ofNullable(preferredTradeCurrency).ifPresent(e -> builder.setPreferredTradeCurrency((PB.TradeCurrency) e.toProtoMessage()));
@ -173,7 +171,6 @@ public final class PreferencesPayload implements PersistableEnvelope {
proto.getBuyerSecurityDepositAsLong(), proto.getBuyerSecurityDepositAsLong(),
proto.getUseAnimations(), proto.getUseAnimations(),
paymentAccount, paymentAccount,
proto.getPayFeeInBtc(), proto.getPayFeeInBtc());
proto.getSupportsDirectContact());
} }
} }

View File

@ -29,10 +29,7 @@ import io.bisq.gui.components.InputTextField;
import io.bisq.gui.main.overlays.popups.Popup; import io.bisq.gui.main.overlays.popups.Popup;
import io.bisq.gui.util.BSFormatter; import io.bisq.gui.util.BSFormatter;
import io.bisq.gui.util.Layout; import io.bisq.gui.util.Layout;
import io.bisq.gui.util.validation.AccountNrValidator; import io.bisq.gui.util.validation.*;
import io.bisq.gui.util.validation.BankIdValidator;
import io.bisq.gui.util.validation.BranchIdValidator;
import io.bisq.gui.util.validation.InputValidator;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.scene.control.ComboBox; import javafx.scene.control.ComboBox;
import javafx.scene.control.Label; import javafx.scene.control.Label;
@ -48,38 +45,21 @@ import static io.bisq.gui.util.FormBuilder.*;
abstract class BankForm extends PaymentMethodForm { abstract class BankForm extends PaymentMethodForm {
private static final Logger log = LoggerFactory.getLogger(BankForm.class); private static final Logger log = LoggerFactory.getLogger(BankForm.class);
protected final BankAccountPayload bankAccountPayload;
private InputTextField bankNameInputTextField, bankIdInputTextField, branchIdInputTextField, accountNrInputTextField, holderIdInputTextField;
private Label holderIdLabel;
protected InputTextField holderNameInputTextField;
private Label bankIdLabel;
private Label branchIdLabel;
private Label accountNrLabel;
private Tuple2<Label, InputTextField> bankIdTuple;
private Tuple2<Label, InputTextField> accountNrTuple;
private Tuple2<Label, InputTextField> branchIdTuple;
private Tuple2<Label, InputTextField> bankNameTuple;
private Tuple2<Label, ComboBox> accountTypeTuple;
private Label accountTypeLabel;
private ComboBox<String> accountTypeComboBox;
private boolean validatorsApplied;
private boolean useHolderID;
private final Runnable closeHandler;
private ComboBox<TradeCurrency> currencyComboBox;
static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
BankAccountPayload data = (BankAccountPayload) paymentAccountPayload; BankAccountPayload data = (BankAccountPayload) paymentAccountPayload;
String countryCode = ((BankAccountPayload) paymentAccountPayload).getCountryCode(); String countryCode = ((BankAccountPayload) paymentAccountPayload).getCountryCode();
if (data.getHolderTaxId() != null) if (data.getHolderTaxId() != null) {
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, final String title = Res.get("payment.account.owner") + " / " + Res.get("payment.email") + " / " + BankUtil.getHolderIdLabelShort(countryCode);
Res.get("payment.account.name.holderId", BankUtil.getHolderIdLabel(countryCode)), final String value = data.getHolderName() + " / " + data.getEmail() + " / " + data.getHolderTaxId();
data.getHolderName() + " / " + data.getHolderTaxId()); addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value);
else } else {
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), final String title = Res.get("payment.account.owner") + " / " + Res.get("payment.email");
data.getHolderName()); final String value = data.getHolderName() + " / " + data.getEmail();
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value);
}
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.bank.country"), addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"),
CountryUtil.getNameAndCode(countryCode)); CountryUtil.getNameAndCode(countryCode));
// We don't want to display more than 6 rows to avoid scrolling, so if we get too many fields we combine them horizontally // We don't want to display more than 6 rows to avoid scrolling, so if we get too many fields we combine them horizontally
@ -200,11 +180,33 @@ abstract class BankForm extends PaymentMethodForm {
return gridRow; return gridRow;
} }
protected final BankAccountPayload bankAccountPayload;
private InputTextField bankNameInputTextField, bankIdInputTextField, branchIdInputTextField, accountNrInputTextField, holderIdInputTextField;
private Label holderIdLabel;
protected InputTextField holderNameInputTextField;
private Label bankIdLabel;
private Label branchIdLabel;
private Label accountNrLabel;
private Tuple2<Label, InputTextField> bankIdTuple;
private Tuple2<Label, InputTextField> accountNrTuple;
private Tuple2<Label, InputTextField> branchIdTuple;
private Tuple2<Label, InputTextField> bankNameTuple;
private Tuple2<Label, ComboBox> accountTypeTuple;
private Label accountTypeLabel;
private ComboBox<String> accountTypeComboBox;
private boolean validatorsApplied;
private boolean useHolderID;
private final Runnable closeHandler;
private ComboBox<TradeCurrency> currencyComboBox;
protected final EmailValidator emailValidator;
BankForm(PaymentAccount paymentAccount, InputValidator inputValidator, BankForm(PaymentAccount paymentAccount, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter, Runnable closeHandler) { GridPane gridPane, int gridRow, BSFormatter formatter, Runnable closeHandler) {
super(paymentAccount, inputValidator, gridPane, gridRow, formatter); super(paymentAccount, inputValidator, gridPane, gridRow, formatter);
this.closeHandler = closeHandler; this.closeHandler = closeHandler;
this.bankAccountPayload = (BankAccountPayload) paymentAccount.paymentAccountPayload; this.bankAccountPayload = (BankAccountPayload) paymentAccount.paymentAccountPayload;
emailValidator = new EmailValidator();
} }
@Override @Override
@ -214,6 +216,8 @@ abstract class BankForm extends PaymentMethodForm {
addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addEmailForDisplayAccount();
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"),
Res.get(paymentAccount.getPaymentMethod().getId())); Res.get(paymentAccount.getPaymentMethod().getId()));
addLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), addLabelTextField(gridPane, ++gridRow, Res.get("payment.country"),
@ -339,7 +343,7 @@ abstract class BankForm extends PaymentMethodForm {
boolean requiresHolderId = BankUtil.isHolderIdRequired(countryCode); boolean requiresHolderId = BankUtil.isHolderIdRequired(countryCode);
if (requiresHolderId) { if (requiresHolderId) {
holderNameInputTextField.minWidthProperty().unbind(); holderNameInputTextField.minWidthProperty().unbind();
holderNameInputTextField.setMinWidth(300); holderNameInputTextField.setMinWidth(250);
} else { } else {
holderNameInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty()); holderNameInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty());
} }
@ -507,7 +511,7 @@ abstract class BankForm extends PaymentMethodForm {
Tuple4<Label, InputTextField, Label, InputTextField> tuple = addLabelInputTextFieldLabelInputTextField(gridPane, Tuple4<Label, InputTextField, Label, InputTextField> tuple = addLabelInputTextFieldLabelInputTextField(gridPane,
++gridRow, Res.getWithCol("payment.account.owner"), BankUtil.getHolderIdLabel("")); ++gridRow, Res.getWithCol("payment.account.owner"), BankUtil.getHolderIdLabel(""));
holderNameInputTextField = tuple.second; holderNameInputTextField = tuple.second;
holderNameInputTextField.setMinWidth(300); holderNameInputTextField.setMinWidth(250);
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
bankAccountPayload.setHolderName(newValue); bankAccountPayload.setHolderName(newValue);
updateFromInputs(); updateFromInputs();
@ -527,6 +531,14 @@ abstract class BankForm extends PaymentMethodForm {
bankAccountPayload.setHolderTaxId(newValue); bankAccountPayload.setHolderTaxId(newValue);
updateFromInputs(); updateFromInputs();
}); });
InputTextField emailTextField = addLabelInputTextField(gridPane,
++gridRow, Res.get("payment.email")).second;
emailTextField.textProperty().addListener((ov, oldValue, newValue) -> {
bankAccountPayload.setEmail(newValue);
updateFromInputs();
});
emailTextField.setValidator(emailValidator);
} }
@Override @Override
@ -567,7 +579,8 @@ abstract class BankForm extends PaymentMethodForm {
boolean result = isAccountNameValid() boolean result = isAccountNameValid()
&& paymentAccount.getSingleTradeCurrency() != null && paymentAccount.getSingleTradeCurrency() != null
&& getCountryBasedPaymentAccount().getCountry() != null && getCountryBasedPaymentAccount().getCountry() != null
&& holderNameInputTextField.getValidator().validate(bankAccountPayload.getHolderName()).isValid; && holderNameInputTextField.getValidator().validate(bankAccountPayload.getHolderName()).isValid
&& emailValidator.validate(bankAccountPayload.getEmail()).isValid;
String countryCode = bankAccountPayload.getCountryCode(); String countryCode = bankAccountPayload.getCountryCode();
if (validatorsApplied && BankUtil.useValidation(countryCode)) { if (validatorsApplied && BankUtil.useValidation(countryCode)) {
@ -599,11 +612,13 @@ abstract class BankForm extends PaymentMethodForm {
Res.getWithCol("payment.account.owner"), BankUtil.getHolderIdLabel(countryCode)); Res.getWithCol("payment.account.owner"), BankUtil.getHolderIdLabel(countryCode));
TextField holderNameTextField = tuple.second; TextField holderNameTextField = tuple.second;
holderNameTextField.setText(bankAccountPayload.getHolderName()); holderNameTextField.setText(bankAccountPayload.getHolderName());
holderNameTextField.setMinWidth(300); holderNameTextField.setMinWidth(250);
tuple.forth.setText(bankAccountPayload.getHolderTaxId()); tuple.forth.setText(bankAccountPayload.getHolderTaxId());
} else { } else {
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), bankAccountPayload.getHolderName()); addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), bankAccountPayload.getHolderName());
} }
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), bankAccountPayload.getEmail());
} }
protected void addAcceptedBanksForAddAccount() { protected void addAcceptedBanksForAddAccount() {
@ -611,4 +626,7 @@ abstract class BankForm extends PaymentMethodForm {
public void addAcceptedBanksForDisplayAccount() { public void addAcceptedBanksForDisplayAccount() {
} }
public void addEmailForDisplayAccount() {
}
} }

View File

@ -30,10 +30,7 @@ import io.bisq.gui.main.overlays.popups.Popup;
import io.bisq.gui.util.BSFormatter; import io.bisq.gui.util.BSFormatter;
import io.bisq.gui.util.FormBuilder; import io.bisq.gui.util.FormBuilder;
import io.bisq.gui.util.Layout; import io.bisq.gui.util.Layout;
import io.bisq.gui.util.validation.AccountNrValidator; import io.bisq.gui.util.validation.*;
import io.bisq.gui.util.validation.BankIdValidator;
import io.bisq.gui.util.validation.BranchIdValidator;
import io.bisq.gui.util.validation.InputValidator;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
import javafx.scene.control.ComboBox; import javafx.scene.control.ComboBox;
import javafx.scene.control.Label; import javafx.scene.control.Label;
@ -48,24 +45,6 @@ import org.slf4j.LoggerFactory;
public class CashDepositForm extends PaymentMethodForm { public class CashDepositForm extends PaymentMethodForm {
private static final Logger log = LoggerFactory.getLogger(CashDepositForm.class); private static final Logger log = LoggerFactory.getLogger(CashDepositForm.class);
protected final CashDepositAccountPayload cashDepositAccountPayload;
private InputTextField bankNameInputTextField, bankIdInputTextField, branchIdInputTextField, accountNrInputTextField, holderIdInputTextField;
private Label holderIdLabel;
protected InputTextField holderNameInputTextField, holderEmailInputTextField;
private Label bankIdLabel;
private Label branchIdLabel;
private Label accountNrLabel;
private Tuple2<Label, InputTextField> bankIdTuple;
private Tuple2<Label, InputTextField> accountNrTuple;
private Tuple2<Label, InputTextField> branchIdTuple;
private Tuple2<Label, InputTextField> bankNameTuple;
private Tuple2<Label, ComboBox> accountTypeTuple;
private Label accountTypeLabel;
private ComboBox<String> accountTypeComboBox;
private boolean validatorsApplied;
private boolean useHolderID;
private ComboBox<TradeCurrency> currencyComboBox;
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
CashDepositAccountPayload data = (CashDepositAccountPayload) paymentAccountPayload; CashDepositAccountPayload data = (CashDepositAccountPayload) paymentAccountPayload;
String countryCode = data.getCountryCode(); String countryCode = data.getCountryCode();
@ -212,10 +191,32 @@ public class CashDepositForm extends PaymentMethodForm {
return gridRow; return gridRow;
} }
protected final CashDepositAccountPayload cashDepositAccountPayload;
private InputTextField bankNameInputTextField, bankIdInputTextField, branchIdInputTextField, accountNrInputTextField, holderIdInputTextField;
private Label holderIdLabel;
protected InputTextField holderNameInputTextField, emailInputTextField;
private Label bankIdLabel;
private Label branchIdLabel;
private Label accountNrLabel;
private Tuple2<Label, InputTextField> bankIdTuple;
private Tuple2<Label, InputTextField> accountNrTuple;
private Tuple2<Label, InputTextField> branchIdTuple;
private Tuple2<Label, InputTextField> bankNameTuple;
private Tuple2<Label, ComboBox> accountTypeTuple;
private Label accountTypeLabel;
private ComboBox<String> accountTypeComboBox;
private boolean validatorsApplied;
private boolean useHolderID;
private ComboBox<TradeCurrency> currencyComboBox;
private final EmailValidator emailValidator;
public CashDepositForm(PaymentAccount paymentAccount, InputValidator inputValidator, public CashDepositForm(PaymentAccount paymentAccount, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) { GridPane gridPane, int gridRow, BSFormatter formatter) {
super(paymentAccount, inputValidator, gridPane, gridRow, formatter); super(paymentAccount, inputValidator, gridPane, gridRow, formatter);
this.cashDepositAccountPayload = (CashDepositAccountPayload) paymentAccount.paymentAccountPayload; this.cashDepositAccountPayload = (CashDepositAccountPayload) paymentAccount.paymentAccountPayload;
emailValidator = new EmailValidator();
} }
@Override @Override
@ -234,7 +235,7 @@ public class CashDepositForm extends PaymentMethodForm {
nameAndCode); nameAndCode);
addAcceptedBanksForDisplayAccount(); addAcceptedBanksForDisplayAccount();
addHolderNameAndIdForDisplayAccount(); addHolderNameAndIdForDisplayAccount();
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.owner.email"), FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
cashDepositAccountPayload.getHolderEmail()); cashDepositAccountPayload.getHolderEmail());
if (BankUtil.isBankNameRequired(countryCode)) if (BankUtil.isBankNameRequired(countryCode))
@ -349,7 +350,7 @@ public class CashDepositForm extends PaymentMethodForm {
accountNrInputTextField.setValidator(null); accountNrInputTextField.setValidator(null);
} }
holderNameInputTextField.resetValidation(); holderNameInputTextField.resetValidation();
holderEmailInputTextField.resetValidation(); emailInputTextField.resetValidation();
bankNameInputTextField.resetValidation(); bankNameInputTextField.resetValidation();
bankIdInputTextField.resetValidation(); bankIdInputTextField.resetValidation();
branchIdInputTextField.resetValidation(); branchIdInputTextField.resetValidation();
@ -540,13 +541,13 @@ public class CashDepositForm extends PaymentMethodForm {
holderNameInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty()); holderNameInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty());
holderNameInputTextField.setValidator(inputValidator); holderNameInputTextField.setValidator(inputValidator);
holderEmailInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.owner.email")).second; emailInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.email")).second;
holderEmailInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { emailInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
cashDepositAccountPayload.setHolderEmail(newValue); cashDepositAccountPayload.setHolderEmail(newValue);
updateFromInputs(); updateFromInputs();
}); });
holderEmailInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty()); emailInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty());
holderEmailInputTextField.setValidator(inputValidator); emailInputTextField.setValidator(emailValidator);
useHolderID = true; useHolderID = true;
holderIdLabel = tuple.third; holderIdLabel = tuple.third;
@ -601,7 +602,7 @@ public class CashDepositForm extends PaymentMethodForm {
&& paymentAccount.getSingleTradeCurrency() != null && paymentAccount.getSingleTradeCurrency() != null
&& getCountryBasedPaymentAccount().getCountry() != null && getCountryBasedPaymentAccount().getCountry() != null
&& holderNameInputTextField.getValidator().validate(cashDepositAccountPayload.getHolderName()).isValid && holderNameInputTextField.getValidator().validate(cashDepositAccountPayload.getHolderName()).isValid
&& holderEmailInputTextField.getValidator().validate(cashDepositAccountPayload.getHolderEmail()).isValid; && emailInputTextField.getValidator().validate(cashDepositAccountPayload.getHolderEmail()).isValid;
String countryCode = cashDepositAccountPayload.getCountryCode(); String countryCode = cashDepositAccountPayload.getCountryCode();
if (validatorsApplied && BankUtil.useValidation(countryCode)) { if (validatorsApplied && BankUtil.useValidation(countryCode)) {

View File

@ -28,6 +28,7 @@ import io.bisq.gui.util.BSFormatter;
import io.bisq.gui.util.Layout; import io.bisq.gui.util.Layout;
import io.bisq.gui.util.validation.AccountNrValidator; import io.bisq.gui.util.validation.AccountNrValidator;
import io.bisq.gui.util.validation.BranchIdValidator; import io.bisq.gui.util.validation.BranchIdValidator;
import io.bisq.gui.util.validation.EmailValidator;
import io.bisq.gui.util.validation.InputValidator; import io.bisq.gui.util.validation.InputValidator;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
@ -35,16 +36,11 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import static io.bisq.gui.util.FormBuilder.addLabelInputTextField; import static io.bisq.gui.util.FormBuilder.*;
import static io.bisq.gui.util.FormBuilder.addLabelTextField;
public class FasterPaymentsForm extends PaymentMethodForm { public class FasterPaymentsForm extends PaymentMethodForm {
private static final Logger log = LoggerFactory.getLogger(FasterPaymentsForm.class); private static final Logger log = LoggerFactory.getLogger(FasterPaymentsForm.class);
private final FasterPaymentsAccount fasterPaymentsAccount;
private InputTextField accountNrInputTextField;
private InputTextField sortCodeInputTextField;
public static int addFormForBuyer(GridPane gridPane, int gridRow, public static int addFormForBuyer(GridPane gridPane, int gridRow,
PaymentAccountPayload paymentAccountPayload) { PaymentAccountPayload paymentAccountPayload) {
// do not translate as it is used in english only // do not translate as it is used in english only
@ -52,13 +48,23 @@ public class FasterPaymentsForm extends PaymentMethodForm {
((FasterPaymentsAccountPayload) paymentAccountPayload).getSortCode()); ((FasterPaymentsAccountPayload) paymentAccountPayload).getSortCode());
addLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), addLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"),
((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr()); ((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr());
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"),
((FasterPaymentsAccountPayload) paymentAccountPayload).getEmail());
return gridRow; return gridRow;
} }
private final FasterPaymentsAccount fasterPaymentsAccount;
private InputTextField accountNrInputTextField;
private InputTextField sortCodeInputTextField;
private final EmailValidator emailValidator;
public FasterPaymentsForm(PaymentAccount paymentAccount, InputValidator inputValidator, GridPane gridPane, public FasterPaymentsForm(PaymentAccount paymentAccount, InputValidator inputValidator, GridPane gridPane,
int gridRow, BSFormatter formatter) { int gridRow, BSFormatter formatter) {
super(paymentAccount, inputValidator, gridPane, gridRow, formatter); super(paymentAccount, inputValidator, gridPane, gridRow, formatter);
this.fasterPaymentsAccount = (FasterPaymentsAccount) paymentAccount; this.fasterPaymentsAccount = (FasterPaymentsAccount) paymentAccount;
emailValidator = new EmailValidator();
} }
@Override @Override
@ -80,6 +86,14 @@ public class FasterPaymentsForm extends PaymentMethodForm {
updateFromInputs(); updateFromInputs();
}); });
InputTextField emailTextField = addLabelInputTextField(gridPane,
++gridRow, Res.get("payment.email")).second;
emailTextField.textProperty().addListener((ov, oldValue, newValue) -> {
fasterPaymentsAccount.setEmail(newValue);
updateFromInputs();
});
emailTextField.setValidator(emailValidator);
TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"), addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"),
@ -103,6 +117,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), fasterPaymentsAccount.getEmail());
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"),
Res.get(fasterPaymentsAccount.getPaymentMethod().getId())); Res.get(fasterPaymentsAccount.getPaymentMethod().getId()));
// do not translate as it is used in english only // do not translate as it is used in english only
@ -119,6 +134,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
@Override @Override
public void updateAllInputsValid() { public void updateAllInputsValid() {
allInputsValid.set(isAccountNameValid() allInputsValid.set(isAccountNameValid()
&& emailValidator.validate(fasterPaymentsAccount.getEmail()).isValid
&& sortCodeInputTextField.getValidator().validate(fasterPaymentsAccount.getSortCode()).isValid && sortCodeInputTextField.getValidator().validate(fasterPaymentsAccount.getSortCode()).isValid
&& accountNrInputTextField.getValidator().validate(fasterPaymentsAccount.getAccountNr()).isValid && accountNrInputTextField.getValidator().validate(fasterPaymentsAccount.getAccountNr()).isValid
&& fasterPaymentsAccount.getTradeCurrencies().size() > 0); && fasterPaymentsAccount.getTradeCurrencies().size() > 0);

View File

@ -17,17 +17,16 @@
package io.bisq.gui.components.paymentmethods; package io.bisq.gui.components.paymentmethods;
import io.bisq.common.locale.Res;
import io.bisq.core.payment.PaymentAccount; import io.bisq.core.payment.PaymentAccount;
import io.bisq.core.payment.payload.PaymentAccountPayload; import io.bisq.core.payment.payload.PaymentAccountPayload;
import io.bisq.gui.util.BSFormatter; import io.bisq.gui.util.BSFormatter;
import io.bisq.gui.util.validation.InputValidator; import io.bisq.gui.util.validation.InputValidator;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import static io.bisq.gui.util.FormBuilder.addLabelTextField;
public class NationalBankForm extends BankForm { public class NationalBankForm extends BankForm {
private static final Logger log = LoggerFactory.getLogger(NationalBankForm.class);
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
return BankForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); return BankForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
} }
@ -36,4 +35,9 @@ public class NationalBankForm extends BankForm {
GridPane gridPane, int gridRow, BSFormatter formatter, Runnable closeHandler) { GridPane gridPane, int gridRow, BSFormatter formatter, Runnable closeHandler) {
super(paymentAccount, inputValidator, gridPane, gridRow, formatter, closeHandler); super(paymentAccount, inputValidator, gridPane, gridRow, formatter, closeHandler);
} }
@Override
public void addEmailForDisplayAccount() {
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), bankAccountPayload.getEmail()).second.setMouseTransparent(false);
}
} }

View File

@ -56,12 +56,21 @@ public class SameBankForm extends BankForm {
bankAccountPayload.setHolderName(newValue); bankAccountPayload.setHolderName(newValue);
updateFromInputs(); updateFromInputs();
}); });
InputTextField emailTextField = addLabelInputTextField(gridPane,
++gridRow, Res.get("payment.email")).second;
emailTextField.textProperty().addListener((ov, oldValue, newValue) -> {
bankAccountPayload.setEmail(newValue);
updateFromInputs();
});
emailTextField.setValidator(emailValidator);
} }
@Override @Override
public void updateAllInputsValid() { public void updateAllInputsValid() {
boolean result = isAccountNameValid() boolean result = isAccountNameValid()
&& inputValidator.validate(bankAccountPayload.getHolderName()).isValid && inputValidator.validate(bankAccountPayload.getHolderName()).isValid
&& emailValidator.validate(bankAccountPayload.getEmail()).isValid
&& paymentAccount.getSingleTradeCurrency() != null && paymentAccount.getSingleTradeCurrency() != null
&& ((CountryBasedPaymentAccount) paymentAccount).getCountry() != null; && ((CountryBasedPaymentAccount) paymentAccount).getCountry() != null;
@ -82,12 +91,19 @@ public class SameBankForm extends BankForm {
allInputsValid.set(result); allInputsValid.set(result);
} }
@Override
public void addEmailForDisplayAccount() {
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), bankAccountPayload.getEmail()).second.setMouseTransparent(false);
}
@Override @Override
protected void addHolderNameAndIdForDisplayAccount() { protected void addHolderNameAndIdForDisplayAccount() {
Tuple2<Label, TextField> tuple = addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner")); Tuple2<Label, TextField> tuple = addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"));
TextField holderNameTextField = tuple.second; TextField holderNameTextField = tuple.second;
holderNameTextField.setMinWidth(300); holderNameTextField.setMinWidth(300);
holderNameTextField.setText(bankAccountPayload.getHolderName()); holderNameTextField.setText(bankAccountPayload.getHolderName());
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), bankAccountPayload.getEmail());
} }
} }

View File

@ -28,6 +28,7 @@ import io.bisq.gui.util.BSFormatter;
import io.bisq.gui.util.FormBuilder; import io.bisq.gui.util.FormBuilder;
import io.bisq.gui.util.Layout; import io.bisq.gui.util.Layout;
import io.bisq.gui.util.validation.BICValidator; import io.bisq.gui.util.validation.BICValidator;
import io.bisq.gui.util.validation.EmailValidator;
import io.bisq.gui.util.validation.IBANValidator; import io.bisq.gui.util.validation.IBANValidator;
import io.bisq.gui.util.validation.InputValidator; import io.bisq.gui.util.validation.InputValidator;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
@ -41,30 +42,21 @@ import javafx.scene.layout.HBox;
import javafx.scene.text.TextAlignment; import javafx.scene.text.TextAlignment;
import javafx.util.StringConverter; import javafx.util.StringConverter;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import static io.bisq.gui.util.FormBuilder.*;
public class SepaForm extends PaymentMethodForm { public class SepaForm extends PaymentMethodForm {
private static final Logger log = LoggerFactory.getLogger(SepaForm.class);
private final SepaAccount sepaAccount;
private final IBANValidator ibanValidator;
private final BICValidator bicValidator;
private InputTextField ibanInputTextField;
private TextField currencyTextField;
private final List<CheckBox> euroCountryCheckBoxes = new ArrayList<>();
private final List<CheckBox> nonEuroCountryCheckBoxes = new ArrayList<>();
private ComboBox<TradeCurrency> currencyComboBox;
public static int addFormForBuyer(GridPane gridPane, int gridRow, public static int addFormForBuyer(GridPane gridPane, int gridRow,
PaymentAccountPayload paymentAccountPayload) { PaymentAccountPayload paymentAccountPayload) {
SepaAccountPayload sepaAccountPayload = (SepaAccountPayload) paymentAccountPayload; SepaAccountPayload sepaAccountPayload = (SepaAccountPayload) paymentAccountPayload;
FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow,
Res.getWithCol("payment.account.owner"), final String title = Res.get("payment.account.owner") + " / " + Res.get("payment.email");
sepaAccountPayload.getHolderName()); final String value = sepaAccountPayload.getHolderName() + " / " + sepaAccountPayload.getEmail();
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value);
FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow,
Res.getWithCol("payment.bank.country"), Res.getWithCol("payment.bank.country"),
CountryUtil.getNameAndCode(sepaAccountPayload.getCountryCode())); CountryUtil.getNameAndCode(sepaAccountPayload.getCountryCode()));
@ -74,6 +66,16 @@ public class SepaForm extends PaymentMethodForm {
return gridRow; return gridRow;
} }
private final SepaAccount sepaAccount;
private final IBANValidator ibanValidator;
private final BICValidator bicValidator;
private InputTextField ibanInputTextField;
private TextField currencyTextField;
private final List<CheckBox> euroCountryCheckBoxes = new ArrayList<>();
private final List<CheckBox> nonEuroCountryCheckBoxes = new ArrayList<>();
private ComboBox<TradeCurrency> currencyComboBox;
private final EmailValidator emailValidator;
public SepaForm(PaymentAccount paymentAccount, IBANValidator ibanValidator, public SepaForm(PaymentAccount paymentAccount, IBANValidator ibanValidator,
BICValidator bicValidator, InputValidator inputValidator, BICValidator bicValidator, InputValidator inputValidator,
GridPane gridPane, int gridRow, BSFormatter formatter) { GridPane gridPane, int gridRow, BSFormatter formatter) {
@ -81,6 +83,8 @@ public class SepaForm extends PaymentMethodForm {
this.sepaAccount = (SepaAccount) paymentAccount; this.sepaAccount = (SepaAccount) paymentAccount;
this.ibanValidator = ibanValidator; this.ibanValidator = ibanValidator;
this.bicValidator = bicValidator; this.bicValidator = bicValidator;
emailValidator = new EmailValidator();
} }
@Override @Override
@ -95,6 +99,15 @@ public class SepaForm extends PaymentMethodForm {
updateFromInputs(); updateFromInputs();
}); });
InputTextField emailTextField = addLabelInputTextField(gridPane,
++gridRow, Res.get("payment.email")).second;
emailTextField.textProperty().addListener((ov, oldValue, newValue) -> {
sepaAccount.setEmail(newValue);
updateFromInputs();
});
emailTextField.setValidator(emailValidator);
ibanInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, "IBAN:").second; ibanInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, "IBAN:").second;
ibanInputTextField.setValidator(ibanValidator); ibanInputTextField.setValidator(ibanValidator);
ibanInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { ibanInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
@ -315,6 +328,7 @@ public class SepaForm extends PaymentMethodForm {
@Override @Override
public void updateAllInputsValid() { public void updateAllInputsValid() {
allInputsValid.set(isAccountNameValid() allInputsValid.set(isAccountNameValid()
&& emailValidator.validate(sepaAccount.getEmail()).isValid
&& bicValidator.validate(sepaAccount.getBic()).isValid && bicValidator.validate(sepaAccount.getBic()).isValid
&& ibanValidator.validate(sepaAccount.getIban()).isValid && ibanValidator.validate(sepaAccount.getIban()).isValid
&& inputValidator.validate(sepaAccount.getHolderName()).isValid && inputValidator.validate(sepaAccount.getHolderName()).isValid
@ -327,6 +341,7 @@ public class SepaForm extends PaymentMethodForm {
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), sepaAccount.getEmail()).second.setMouseTransparent(false);
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"),
Res.get(sepaAccount.getPaymentMethod().getId())); Res.get(sepaAccount.getPaymentMethod().getId()));
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), sepaAccount.getHolderName()); FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), sepaAccount.getHolderName());

View File

@ -32,14 +32,10 @@ import javafx.scene.control.Label;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.control.Tooltip; import javafx.scene.control.Tooltip;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static io.bisq.gui.util.FormBuilder.*; import static io.bisq.gui.util.FormBuilder.*;
public class SpecificBankForm extends BankForm { public class SpecificBankForm extends BankForm {
private static final Logger log = LoggerFactory.getLogger(SpecificBankForm.class);
private final SpecificBanksAccountPayload specificBanksAccountPayload; private final SpecificBanksAccountPayload specificBanksAccountPayload;
private TextField acceptedBanksTextField; private TextField acceptedBanksTextField;
private Tooltip acceptedBanksTooltip; private Tooltip acceptedBanksTooltip;
@ -104,6 +100,11 @@ public class SpecificBankForm extends BankForm {
Joiner.on(", ").join(specificBanksAccountPayload.getAcceptedBanks())).second.setMouseTransparent(false); Joiner.on(", ").join(specificBanksAccountPayload.getAcceptedBanks())).second.setMouseTransparent(false);
} }
@Override
public void addEmailForDisplayAccount() {
addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), bankAccountPayload.getEmail()).second.setMouseTransparent(false);
}
@Override @Override
public void updateAllInputsValid() { public void updateAllInputsValid() {
super.updateAllInputsValid(); super.updateAllInputsValid();

View File

@ -21,9 +21,8 @@ import io.bisq.common.UserThread;
import io.bisq.common.locale.Res; import io.bisq.common.locale.Res;
import io.bisq.common.util.Tuple2; import io.bisq.common.util.Tuple2;
import io.bisq.common.util.Tuple3; import io.bisq.common.util.Tuple3;
import io.bisq.core.payment.ClearXchangeAccount; import io.bisq.core.app.BisqEnvironment;
import io.bisq.core.payment.PaymentAccount; import io.bisq.core.payment.*;
import io.bisq.core.payment.PaymentAccountFactory;
import io.bisq.core.payment.payload.PaymentMethod; import io.bisq.core.payment.payload.PaymentMethod;
import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.ActivatableViewAndModel;
import io.bisq.gui.common.view.FxmlView; import io.bisq.gui.common.view.FxmlView;
@ -144,12 +143,31 @@ public class FiatAccountsView extends ActivatableViewAndModel<GridPane, FiatAcco
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
private void onSaveNewAccount(PaymentAccount paymentAccount) { private void onSaveNewAccount(PaymentAccount paymentAccount) {
if (paymentAccount instanceof ClearXchangeAccount) { final String currencyName = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyName();
new Popup<>().information(Res.get("payment.clearXchange.info")) if (paymentAccount instanceof SepaAccount ||
.width(900) paymentAccount instanceof BankAccount ||
paymentAccount instanceof ClearXchangeAccount ||
paymentAccount instanceof FasterPaymentsAccount ||
paymentAccount instanceof ChaseQuickPayAccount ||
paymentAccount instanceof InteracETransferAccount) {
new Popup<>().information(Res.get("payment.chargeback.info", currencyName))
.width(800)
.closeButtonText(Res.get("shared.cancel")) .closeButtonText(Res.get("shared.cancel"))
.actionButtonText(Res.get("shared.iConfirm")) .actionButtonText(Res.get("shared.iConfirm"))
.onAction(() -> doSaveNewAccount(paymentAccount)) .onAction(() -> {
if (paymentAccount instanceof ClearXchangeAccount) {
UserThread.runAfter(() -> {
new Popup<>().information(Res.get("payment.clearXchange.info", currencyName, currencyName))
.width(900)
.closeButtonText(Res.get("shared.cancel"))
.actionButtonText(Res.get("shared.iConfirm"))
.onAction(() -> doSaveNewAccount(paymentAccount))
.show();
}, 1);
} else {
doSaveNewAccount(paymentAccount);
}
})
.show(); .show();
} else { } else {
doSaveNewAccount(paymentAccount); doSaveNewAccount(paymentAccount);

View File

@ -336,7 +336,6 @@ class CreateOfferDataModel extends ActivatableDataModel {
// reserved for future use cases // reserved for future use cases
// Use null values if not set // Use null values if not set
boolean supportsDirectContact = true;
boolean isPrivateOffer = false; boolean isPrivateOffer = false;
boolean useAutoClose = false; boolean useAutoClose = false;
boolean useReOpenAfterAutoClose = false; boolean useReOpenAfterAutoClose = false;
@ -383,7 +382,6 @@ class CreateOfferDataModel extends ActivatableDataModel {
sellerSecurityDeposit.value, sellerSecurityDeposit.value,
maxTradeLimit, maxTradeLimit,
maxTradePeriod, maxTradePeriod,
supportsDirectContact,
useAutoClose, useAutoClose,
useReOpenAfterAutoClose, useReOpenAfterAutoClose,
upperClosePrice, upperClosePrice,

View File

@ -371,7 +371,8 @@ public class GUIUtil {
public static void showClearXchangeWarning() { public static void showClearXchangeWarning() {
String key = "confirmClearXchangeRequirements"; String key = "confirmClearXchangeRequirements";
new Popup<>().information(Res.get("payment.clearXchange.selected") + "\n" + Res.get("payment.clearXchange.info")) final String currencyName = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyName();
new Popup<>().information(Res.get("payment.clearXchange.info", currencyName, currencyName))
.width(900) .width(900)
.closeButtonText(Res.get("shared.iConfirm")) .closeButtonText(Res.get("shared.iConfirm"))
.dontShowAgainId(key) .dontShowAgainId(key)

View File

@ -20,14 +20,29 @@ package io.bisq.gui.util.validation;
public final class ClearXchangeValidator extends InputValidator { public final class ClearXchangeValidator extends InputValidator {
private final EmailValidator emailValidator;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Public methods // Public methods
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public ClearXchangeValidator() {
emailValidator = new EmailValidator();
}
@Override @Override
public ValidationResult validate(String input) { public ValidationResult validate(String input) {
// TODO ValidationResult result = validateIfNotEmpty(input);
return super.validate(input); if (!result.isValid) {
return result;
} else {
ValidationResult emailResult = emailValidator.validate(input);
if (emailResult.isValid)
return emailResult;
else
return validatePhoneNumber(input);
}
} }
@ -35,5 +50,8 @@ public final class ClearXchangeValidator extends InputValidator {
// Private methods // Private methods
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// TODO not impl yet -> see InteracETransferValidator
private ValidationResult validatePhoneNumber(String input) {
return super.validate(input);
}
} }

View File

@ -71,7 +71,6 @@ public class TradesChartsViewModelTest {
0, 0,
false, false,
false, false,
false,
0, 0,
0, 0,
false, false,

View File

@ -297,7 +297,6 @@ public class OfferBookViewModelTest {
0, 0,
false, false,
false, false,
false,
0, 0,
0, 0,
false, false,