From ca9e53a2ab5278cf00207b23f4e4e88463884914 Mon Sep 17 00:00:00 2001 From: Manfred Karrer Date: Sat, 15 Jul 2017 13:12:09 +0200 Subject: [PATCH] Remove email from sepa account --- .../main/java/io/bisq/common/app/DevEnv.java | 2 +- .../resources/i18n/displayStrings.properties | 13 +++++------- .../io/bisq/core/payment/SepaAccount.java | 8 ------- .../core/payment/payload/PaymentMethod.java | 1 - .../payment/payload/SepaAccountPayload.java | 9 +------- .../paymentmethods/ClearXchangeForm.java | 4 ---- .../paymentmethods/PaymentMethodForm.java | 4 ---- .../components/paymentmethods/SepaForm.java | 21 +++---------------- .../fiataccounts/FiatAccountsView.java | 19 ++++++++++++++--- 9 files changed, 26 insertions(+), 55 deletions(-) diff --git a/common/src/main/java/io/bisq/common/app/DevEnv.java b/common/src/main/java/io/bisq/common/app/DevEnv.java index eecf7433e9..e08acd93ec 100644 --- a/common/src/main/java/io/bisq/common/app/DevEnv.java +++ b/common/src/main/java/io/bisq/common/app/DevEnv.java @@ -20,6 +20,6 @@ public class DevEnv { @SuppressWarnings("PointlessBooleanExpression") public static final boolean DEV_MODE = STRESS_TEST_MODE || true; - public static final boolean DAO_ACTIVATED = true; + public static final boolean DAO_ACTIVATED = false; public static final boolean DAO_PHASE2_ACTIVATED = false; } diff --git a/common/src/main/resources/i18n/displayStrings.properties b/common/src/main/resources/i18n/displayStrings.properties index f5423a4677..9e64838485 100644 --- a/common/src/main/resources/i18n/displayStrings.properties +++ b/common/src/main/resources/i18n/displayStrings.properties @@ -1513,15 +1513,12 @@ otherwise it is very likely that the Zelle (ClearXchange) transfer fails and the 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 Zelle (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. +to get in contact with the {1} buyer by using the provided email address or mobile number to verify that he or she \ + is really the owner of the Zelle (ClearXchange) account. -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 the payment \ - account for verifying the peer''s 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. +popup.info.revertIdCheckRequirement=We removed the requirement introduced in version 0.5.0 for verifying the peers ID by email when payment methods \ + with bank transfer was used.\n\ + The email address is not exposed anymore (if not part of the payment method anyway) # We use constants from the code so we do not use our normal naming convention # dynamic values are not recognized by IntelliJ diff --git a/core/src/main/java/io/bisq/core/payment/SepaAccount.java b/core/src/main/java/io/bisq/core/payment/SepaAccount.java index a50c49cca0..a307de6cec 100644 --- a/core/src/main/java/io/bisq/core/payment/SepaAccount.java +++ b/core/src/main/java/io/bisq/core/payment/SepaAccount.java @@ -50,14 +50,6 @@ public final class SepaAccount extends CountryBasedPaymentAccount implements Ban 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) { ((SepaAccountPayload) paymentAccountPayload).setIban(iban); } diff --git a/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java b/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java index f83a04172f..42a09ddcff 100644 --- a/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java +++ b/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java @@ -137,7 +137,6 @@ public final class PaymentMethod implements PersistablePayload, Comparable { maxTradeLimitMidRisk = Coin.parseCoin("250000"); maxTradeLimitLowRisk = Coin.parseCoin("500000"); break; - default: log.error("Unsupported BaseCurrency. " + BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()); throw new RuntimeException("Unsupported BaseCurrency. " + BisqEnvironment.getBaseCurrencyNetwork().getCurrencyCode()); diff --git a/core/src/main/java/io/bisq/core/payment/payload/SepaAccountPayload.java b/core/src/main/java/io/bisq/core/payment/payload/SepaAccountPayload.java index 70c467f9f8..92a193d0db 100644 --- a/core/src/main/java/io/bisq/core/payment/payload/SepaAccountPayload.java +++ b/core/src/main/java/io/bisq/core/payment/payload/SepaAccountPayload.java @@ -43,8 +43,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload private String iban; @Setter 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 private final List acceptedCountryCodes; @@ -68,13 +66,11 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload String holderName, String iban, String bic, - String email, List acceptedCountryCodes) { super(paymentMethodName, id, maxTradePeriod, countryCode); this.holderName = holderName; this.iban = iban; this.bic = bic; - this.email = email; this.acceptedCountryCodes = acceptedCountryCodes; } @@ -85,7 +81,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload .setHolderName(holderName) .setIban(iban) .setBic(bic) - .setEmail(email) .addAllAcceptedCountryCodes(acceptedCountryCodes); final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder() .getCountryBasedPaymentAccountPayloadBuilder() @@ -105,7 +100,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload sepaAccountPayload.getHolderName(), sepaAccountPayload.getIban(), sepaAccountPayload.getBic(), - sepaAccountPayload.getEmail(), new ArrayList<>(sepaAccountPayload.getAcceptedCountryCodesList())); } @@ -126,7 +120,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload @Override public String getPaymentDetails() { - return "SEPA - Holder name: " + holderName + ", IBAN: " + iban + ", BIC: " + bic + ", Email: " + email + ", country code: " + getCountryCode(); + return "SEPA - Holder name: " + holderName + ", IBAN: " + iban + ", BIC: " + bic + ", country code: " + getCountryCode(); } @Override @@ -134,7 +128,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload return "Holder name: " + holderName + "\n" + "IBAN: " + iban + "\n" + "BIC: " + bic + "\n" + - "Email: " + email + "\n" + "Country of bank: " + CountryUtil.getNameByCode(countryCode); } } diff --git a/gui/src/main/java/io/bisq/gui/components/paymentmethods/ClearXchangeForm.java b/gui/src/main/java/io/bisq/gui/components/paymentmethods/ClearXchangeForm.java index 98285de913..7933efdc09 100644 --- a/gui/src/main/java/io/bisq/gui/components/paymentmethods/ClearXchangeForm.java +++ b/gui/src/main/java/io/bisq/gui/components/paymentmethods/ClearXchangeForm.java @@ -32,12 +32,8 @@ import io.bisq.gui.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public class ClearXchangeForm extends PaymentMethodForm { - private static final Logger log = LoggerFactory.getLogger(ClearXchangeForm.class); - private final ClearXchangeAccount clearXchangeAccount; private final ClearXchangeValidator clearXchangeValidator; private InputTextField mobileNrInputTextField; diff --git a/gui/src/main/java/io/bisq/gui/components/paymentmethods/PaymentMethodForm.java b/gui/src/main/java/io/bisq/gui/components/paymentmethods/PaymentMethodForm.java index db2847d483..298abc5d78 100644 --- a/gui/src/main/java/io/bisq/gui/components/paymentmethods/PaymentMethodForm.java +++ b/gui/src/main/java/io/bisq/gui/components/paymentmethods/PaymentMethodForm.java @@ -34,16 +34,12 @@ import javafx.scene.control.ComboBox; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.util.StringConverter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import javax.annotation.Nullable; import static io.bisq.gui.util.FormBuilder.*; public abstract class PaymentMethodForm { - private static final Logger log = LoggerFactory.getLogger(PaymentMethodForm.class); - protected final PaymentAccount paymentAccount; protected final InputValidator inputValidator; protected final GridPane gridPane; diff --git a/gui/src/main/java/io/bisq/gui/components/paymentmethods/SepaForm.java b/gui/src/main/java/io/bisq/gui/components/paymentmethods/SepaForm.java index 1a09cb5486..2fe80a1654 100644 --- a/gui/src/main/java/io/bisq/gui/components/paymentmethods/SepaForm.java +++ b/gui/src/main/java/io/bisq/gui/components/paymentmethods/SepaForm.java @@ -28,7 +28,6 @@ import io.bisq.gui.util.BSFormatter; import io.bisq.gui.util.FormBuilder; import io.bisq.gui.util.Layout; 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.InputValidator; import javafx.collections.FXCollections; @@ -46,15 +45,15 @@ import org.apache.commons.lang3.StringUtils; import java.util.ArrayList; import java.util.List; -import static io.bisq.gui.util.FormBuilder.*; +import static io.bisq.gui.util.FormBuilder.addLabelTextFieldWithCopyIcon; public class SepaForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { SepaAccountPayload sepaAccountPayload = (SepaAccountPayload) paymentAccountPayload; - final String title = Res.get("payment.account.owner") + " / " + Res.get("payment.email"); - final String value = sepaAccountPayload.getHolderName() + " / " + sepaAccountPayload.getEmail(); + final String title = Res.get("payment.account.owner"); + final String value = sepaAccountPayload.getHolderName(); addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, @@ -74,7 +73,6 @@ public class SepaForm extends PaymentMethodForm { private final List euroCountryCheckBoxes = new ArrayList<>(); private final List nonEuroCountryCheckBoxes = new ArrayList<>(); private ComboBox currencyComboBox; - private final EmailValidator emailValidator; public SepaForm(PaymentAccount paymentAccount, IBANValidator ibanValidator, BICValidator bicValidator, InputValidator inputValidator, @@ -83,8 +81,6 @@ public class SepaForm extends PaymentMethodForm { this.sepaAccount = (SepaAccount) paymentAccount; this.ibanValidator = ibanValidator; this.bicValidator = bicValidator; - - emailValidator = new EmailValidator(); } @Override @@ -99,15 +95,6 @@ public class SepaForm extends PaymentMethodForm { 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.setValidator(ibanValidator); ibanInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { @@ -328,7 +315,6 @@ public class SepaForm extends PaymentMethodForm { @Override public void updateAllInputsValid() { allInputsValid.set(isAccountNameValid() - && emailValidator.validate(sepaAccount.getEmail()).isValid && bicValidator.validate(sepaAccount.getBic()).isValid && ibanValidator.validate(sepaAccount.getIban()).isValid && inputValidator.validate(sepaAccount.getHolderName()).isValid @@ -344,7 +330,6 @@ public class SepaForm extends PaymentMethodForm { FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"), Res.get(sepaAccount.getPaymentMethod().getId())); FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"), sepaAccount.getHolderName()); - addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), sepaAccount.getEmail()).second.setMouseTransparent(false); FormBuilder.addLabelTextField(gridPane, ++gridRow, "IBAN:", sepaAccount.getIban()).second.setMouseTransparent(false); FormBuilder.addLabelTextField(gridPane, ++gridRow, "BIC:", sepaAccount.getBic()).second.setMouseTransparent(false); FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), diff --git a/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java b/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java index 79e45c62db..81628e691a 100644 --- a/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java +++ b/gui/src/main/java/io/bisq/gui/main/account/content/fiataccounts/FiatAccountsView.java @@ -22,7 +22,9 @@ import io.bisq.common.locale.Res; import io.bisq.common.util.Tuple2; import io.bisq.common.util.Tuple3; import io.bisq.core.app.BisqEnvironment; -import io.bisq.core.payment.*; +import io.bisq.core.payment.ClearXchangeAccount; +import io.bisq.core.payment.PaymentAccount; +import io.bisq.core.payment.PaymentAccountFactory; import io.bisq.core.payment.payload.PaymentMethod; import io.bisq.gui.common.view.ActivatableViewAndModel; import io.bisq.gui.common.view.FxmlView; @@ -144,7 +146,18 @@ public class FiatAccountsView extends ActivatableViewAndModel().information(Res.get("payment.clearXchange.info", currencyName, currencyName)) + .width(900) + .closeButtonText(Res.get("shared.cancel")) + .actionButtonText(Res.get("shared.iConfirm")) + .onAction(() -> doSaveNewAccount(paymentAccount)) + .show(); + } else { + doSaveNewAccount(paymentAccount); + } + + /* if (paymentAccount instanceof SepaAccount || paymentAccount instanceof BankAccount || paymentAccount instanceof ClearXchangeAccount || paymentAccount instanceof FasterPaymentsAccount || @@ -171,7 +184,7 @@ public class FiatAccountsView extends ActivatableViewAndModel