From 0d02be197395cb829cfbd7852d6a81972a6ebf6d Mon Sep 17 00:00:00 2001 From: boldsuck Date: Wed, 15 Jan 2025 23:45:39 +0100 Subject: [PATCH] Revert "Apply 1527.patch" This reverts commit 72ccd3186ad30d4ed0a052e0977fa9b6cdbb0921. --- .../main/java/haveno/core/offer/Offer.java | 6 -- .../java/haveno/core/offer/OfferPayload.java | 3 - .../java/haveno/core/offer/OfferUtil.java | 18 ------ .../java/haveno/core/payment/SepaAccount.java | 9 --- .../core/payment/SepaInstantAccount.java | 10 ---- .../haveno/core/payment/ZelleAccount.java | 9 --- .../payment/payload/SepaAccountPayload.java | 14 +---- .../payload/SepaInstantAccountPayload.java | 13 +--- .../payment/payload/ZelleAccountPayload.java | 13 +--- .../components/paymentmethods/SepaForm.java | 24 -------- .../paymentmethods/SepaInstantForm.java | 25 -------- .../components/paymentmethods/ZelleForm.java | 22 ------- .../main/offer/takeoffer/TakeOfferView.java | 60 ++----------------- proto/src/main/proto/pb.proto | 3 - 14 files changed, 14 insertions(+), 215 deletions(-) diff --git a/core/src/main/java/haveno/core/offer/Offer.java b/core/src/main/java/haveno/core/offer/Offer.java index 1ff5eb11..3dc566b3 100644 --- a/core/src/main/java/haveno/core/offer/Offer.java +++ b/core/src/main/java/haveno/core/offer/Offer.java @@ -432,12 +432,6 @@ public class Offer implements NetworkPayload, PersistablePayload { return getExtraDataMap().get(OfferPayload.PAYPAL_EXTRA_INFO); else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.CASHAPP_EXTRA_INFO)) return getExtraDataMap().get(OfferPayload.CASHAPP_EXTRA_INFO); - else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.ZELLE_EXTRA_INFO)) - return getExtraDataMap().get(OfferPayload.ZELLE_EXTRA_INFO); - else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.SEPA_EXTRA_INFO)) - return getExtraDataMap().get(OfferPayload.SEPA_EXTRA_INFO); - else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.SEPA_INSTANT_EXTRA_INFO)) - return getExtraDataMap().get(OfferPayload.SEPA_INSTANT_EXTRA_INFO); else return ""; } diff --git a/core/src/main/java/haveno/core/offer/OfferPayload.java b/core/src/main/java/haveno/core/offer/OfferPayload.java index df9bc211..0dadf882 100644 --- a/core/src/main/java/haveno/core/offer/OfferPayload.java +++ b/core/src/main/java/haveno/core/offer/OfferPayload.java @@ -102,9 +102,6 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay public static final String PAY_BY_MAIL_EXTRA_INFO = "payByMailExtraInfo"; public static final String AUSTRALIA_PAYID_EXTRA_INFO = "australiaPayidExtraInfo"; public static final String PAYPAL_EXTRA_INFO = "payPalExtraInfo"; - public static final String ZELLE_EXTRA_INFO = "zelleExtraInfo"; - public static final String SEPA_EXTRA_INFO = "sepaExtraInfo"; - public static final String SEPA_INSTANT_EXTRA_INFO = "sepaInstantExtraInfo"; // Comma separated list of ordinal of a haveno.common.app.Capability. E.g. ordinal of // Capability.SIGNED_ACCOUNT_AGE_WITNESS is 11 and Capability.MEDIATION is 12 so if we want to signal that maker diff --git a/core/src/main/java/haveno/core/offer/OfferUtil.java b/core/src/main/java/haveno/core/offer/OfferUtil.java index ee995251..3d4c1c37 100644 --- a/core/src/main/java/haveno/core/offer/OfferUtil.java +++ b/core/src/main/java/haveno/core/offer/OfferUtil.java @@ -42,9 +42,6 @@ import static haveno.core.offer.OfferPayload.F2F_CITY; import static haveno.core.offer.OfferPayload.F2F_EXTRA_INFO; import static haveno.core.offer.OfferPayload.PAY_BY_MAIL_EXTRA_INFO; import static haveno.core.offer.OfferPayload.PAYPAL_EXTRA_INFO; -import static haveno.core.offer.OfferPayload.SEPA_EXTRA_INFO; -import static haveno.core.offer.OfferPayload.SEPA_INSTANT_EXTRA_INFO; -import static haveno.core.offer.OfferPayload.ZELLE_EXTRA_INFO; import static haveno.core.offer.OfferPayload.REFERRAL_ID; import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF; import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF_ENABLED_VALUE; @@ -55,9 +52,6 @@ import haveno.core.payment.F2FAccount; import haveno.core.payment.PayByMailAccount; import haveno.core.payment.PayPalAccount; import haveno.core.payment.PaymentAccount; -import haveno.core.payment.SepaAccount; -import haveno.core.payment.SepaInstantAccount; -import haveno.core.payment.ZelleAccount; import haveno.core.provider.price.MarketPrice; import haveno.core.provider.price.PriceFeedService; import haveno.core.trade.statistics.ReferralIdService; @@ -223,18 +217,6 @@ public class OfferUtil { extraDataMap.put(AUSTRALIA_PAYID_EXTRA_INFO, ((AustraliaPayidAccount) paymentAccount).getExtraInfo()); } - if (paymentAccount instanceof ZelleAccount) { - extraDataMap.put(ZELLE_EXTRA_INFO, ((ZelleAccount) paymentAccount).getExtraInfo()); - } - - if (paymentAccount instanceof SepaAccount) { - extraDataMap.put(SEPA_EXTRA_INFO, ((SepaAccount) paymentAccount).getExtraInfo()); - } - - if (paymentAccount instanceof SepaInstantAccount) { - extraDataMap.put(SEPA_INSTANT_EXTRA_INFO, ((SepaInstantAccount) paymentAccount).getExtraInfo()); - } - extraDataMap.put(CAPABILITIES, Capabilities.app.toStringList()); if (currencyCode.equals("XMR") && direction == OfferDirection.SELL) { diff --git a/core/src/main/java/haveno/core/payment/SepaAccount.java b/core/src/main/java/haveno/core/payment/SepaAccount.java index 17b561df..1ad98445 100644 --- a/core/src/main/java/haveno/core/payment/SepaAccount.java +++ b/core/src/main/java/haveno/core/payment/SepaAccount.java @@ -43,7 +43,6 @@ public final class SepaAccount extends CountryBasedPaymentAccount implements Ban PaymentAccountFormField.FieldId.BIC, PaymentAccountFormField.FieldId.COUNTRY, PaymentAccountFormField.FieldId.ACCEPTED_COUNTRY_CODES, - PaymentAccountFormField.FieldId.EXTRA_INFO, PaymentAccountFormField.FieldId.SALT ); @@ -105,14 +104,6 @@ public final class SepaAccount extends CountryBasedPaymentAccount implements Ban ((SepaAccountPayload) paymentAccountPayload).removeAcceptedCountry(countryCode); } - public void setExtraInfo(String extraInfo) { - ((SepaAccountPayload) paymentAccountPayload).setExtraInfo(extraInfo); - } - - public String getExtraInfo() { - return ((SepaAccountPayload) paymentAccountPayload).getExtraInfo(); - } - @Override public void onPersistChanges() { super.onPersistChanges(); diff --git a/core/src/main/java/haveno/core/payment/SepaInstantAccount.java b/core/src/main/java/haveno/core/payment/SepaInstantAccount.java index 3db7849a..d006aa84 100644 --- a/core/src/main/java/haveno/core/payment/SepaInstantAccount.java +++ b/core/src/main/java/haveno/core/payment/SepaInstantAccount.java @@ -25,7 +25,6 @@ import haveno.core.locale.TraditionalCurrency; import haveno.core.locale.TradeCurrency; import haveno.core.payment.payload.PaymentAccountPayload; import haveno.core.payment.payload.PaymentMethod; -import haveno.core.payment.payload.SepaAccountPayload; import haveno.core.payment.payload.SepaInstantAccountPayload; import haveno.core.payment.validation.SepaIBANValidator; import lombok.EqualsAndHashCode; @@ -91,15 +90,6 @@ public final class SepaInstantAccount extends CountryBasedPaymentAccount impleme ((SepaInstantAccountPayload) paymentAccountPayload).removeAcceptedCountry(countryCode); } - - public void setExtraInfo(String extraInfo) { - ((SepaAccountPayload) paymentAccountPayload).setExtraInfo(extraInfo); - } - - public String getExtraInfo() { - return ((SepaAccountPayload) paymentAccountPayload).getExtraInfo(); - } - @Override public void onPersistChanges() { super.onPersistChanges(); diff --git a/core/src/main/java/haveno/core/payment/ZelleAccount.java b/core/src/main/java/haveno/core/payment/ZelleAccount.java index 2f268548..4415f4ed 100644 --- a/core/src/main/java/haveno/core/payment/ZelleAccount.java +++ b/core/src/main/java/haveno/core/payment/ZelleAccount.java @@ -42,7 +42,6 @@ public final class ZelleAccount extends PaymentAccount { PaymentAccountFormField.FieldId.ACCOUNT_NAME, PaymentAccountFormField.FieldId.HOLDER_NAME, PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR, - PaymentAccountFormField.FieldId.EXTRA_INFO, PaymentAccountFormField.FieldId.SALT ); @@ -76,12 +75,4 @@ public final class ZelleAccount extends PaymentAccount { public String getHolderName() { return ((ZelleAccountPayload) paymentAccountPayload).getHolderName(); } - - public void setExtraInfo(String extraInfo) { - ((ZelleAccountPayload) paymentAccountPayload).setExtraInfo(extraInfo); - } - - public String getExtraInfo() { - return ((ZelleAccountPayload) paymentAccountPayload).getExtraInfo(); - } } diff --git a/core/src/main/java/haveno/core/payment/payload/SepaAccountPayload.java b/core/src/main/java/haveno/core/payment/payload/SepaAccountPayload.java index 901c6edc..3446a979 100644 --- a/core/src/main/java/haveno/core/payment/payload/SepaAccountPayload.java +++ b/core/src/main/java/haveno/core/payment/payload/SepaAccountPayload.java @@ -47,8 +47,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload @Setter private String bic = ""; private String email = ""; // not used anymore but need to keep it for backward compatibility, must not be null but empty string, otherwise hash check fails for contract - @Setter - private String extraInfo = ""; // Don't use a set here as we need a deterministic ordering, otherwise the contract hash does not match private final List persistedAcceptedCountryCodes = new ArrayList<>(); @@ -75,7 +73,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload String iban, String bic, String email, - String extraInfo, long maxTradePeriod, Map excludeFromJsonDataMap) { super(paymentMethodName, @@ -90,7 +87,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload this.bic = bic; this.email = email; this.acceptedCountryCodes = acceptedCountryCodes; - this.extraInfo = extraInfo; persistedAcceptedCountryCodes.addAll(acceptedCountryCodes); } @@ -101,8 +97,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload .setHolderName(holderName) .setIban(iban) .setBic(bic) - .setEmail(email) - .setExtraInfo(extraInfo); + .setEmail(email); final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder() .getCountryBasedPaymentAccountPayloadBuilder() .setSepaAccountPayload(builder); @@ -122,7 +117,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload sepaAccountPayloadPB.getIban(), sepaAccountPayloadPB.getBic(), sepaAccountPayloadPB.getEmail(), - sepaAccountPayloadPB.getExtraInfo(), proto.getMaxTradePeriod(), new HashMap<>(proto.getExcludeFromJsonDataMap())); } @@ -160,8 +154,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload @Override public String getPaymentDetails() { return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " + - iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode() + ", " + - Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo; + iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode(); } @Override @@ -169,8 +162,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" + "IBAN: " + iban + "\n" + "BIC: " + bic + "\n" + - Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode) + "\n" + - Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo; + Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode); } @Override diff --git a/core/src/main/java/haveno/core/payment/payload/SepaInstantAccountPayload.java b/core/src/main/java/haveno/core/payment/payload/SepaInstantAccountPayload.java index e5fbbda4..66a5c106 100644 --- a/core/src/main/java/haveno/core/payment/payload/SepaInstantAccountPayload.java +++ b/core/src/main/java/haveno/core/payment/payload/SepaInstantAccountPayload.java @@ -46,7 +46,6 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP private String iban = ""; @Setter private String bic = ""; - private String extraInfo = ""; // Don't use a set here as we need a deterministic ordering, otherwise the contract hash does not match private final List persistedAcceptedCountryCodes = new ArrayList<>(); @@ -72,7 +71,6 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP String holderName, String iban, String bic, - String extraInfo, long maxTradePeriod, Map excludeFromJsonDataMap) { super(paymentMethodName, @@ -85,7 +83,6 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP this.holderName = holderName; this.iban = iban; this.bic = bic; - this.extraInfo = extraInfo; persistedAcceptedCountryCodes.addAll(acceptedCountryCodes); } @@ -95,8 +92,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP protobuf.SepaInstantAccountPayload.newBuilder() .setHolderName(holderName) .setIban(iban) - .setBic(bic) - .setExtraInfo(extraInfo); + .setBic(bic); final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder() .getCountryBasedPaymentAccountPayloadBuilder() .setSepaInstantAccountPayload(builder); @@ -115,7 +111,6 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP sepaInstantAccountPayloadPB.getHolderName(), sepaInstantAccountPayloadPB.getIban(), sepaInstantAccountPayloadPB.getBic(), - sepaInstantAccountPayloadPB.getExtraInfo(), proto.getMaxTradePeriod(), new HashMap<>(proto.getExcludeFromJsonDataMap())); } @@ -147,8 +142,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP @Override public String getPaymentDetails() { return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " + - iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode() + ", " + - Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo; + iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode(); } @Override @@ -156,8 +150,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" + "IBAN: " + iban + "\n" + "BIC: " + bic + "\n" + - Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode) + "\n" + - Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo; + Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode); } @Override diff --git a/core/src/main/java/haveno/core/payment/payload/ZelleAccountPayload.java b/core/src/main/java/haveno/core/payment/payload/ZelleAccountPayload.java index ddc720a7..86c94abd 100644 --- a/core/src/main/java/haveno/core/payment/payload/ZelleAccountPayload.java +++ b/core/src/main/java/haveno/core/payment/payload/ZelleAccountPayload.java @@ -37,7 +37,6 @@ import java.util.Map; public final class ZelleAccountPayload extends PaymentAccountPayload implements PayloadWithHolderName { private String emailOrMobileNr = ""; private String holderName = ""; - private String extraInfo = ""; public ZelleAccountPayload(String paymentMethod, String id) { super(paymentMethod, id); @@ -52,7 +51,6 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements String id, String emailOrMobileNr, String holderName, - String extraInfo, long maxTradePeriod, Map excludeFromJsonDataMap) { super(paymentMethod, @@ -62,7 +60,6 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements this.emailOrMobileNr = emailOrMobileNr; this.holderName = holderName; - this.extraInfo = extraInfo; } @Override @@ -70,8 +67,7 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements return getPaymentAccountPayloadBuilder() .setZelleAccountPayload(protobuf.ZelleAccountPayload.newBuilder() .setEmailOrMobileNr(emailOrMobileNr) - .setHolderName(holderName) - .setExtraInfo(extraInfo)) + .setHolderName(holderName)) .build(); } @@ -80,7 +76,6 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements proto.getId(), proto.getZelleAccountPayload().getEmailOrMobileNr(), proto.getZelleAccountPayload().getHolderName(), - proto.getZelleAccountPayload().getExtraInfo(), proto.getMaxTradePeriod(), new HashMap<>(proto.getExcludeFromJsonDataMap())); } @@ -93,15 +88,13 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements @Override public String getPaymentDetails() { return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " + - Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr + ", " + - Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo; + Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr; } @Override public String getPaymentDetailsForTradePopup() { return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" + - Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr + "\n" + - Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo; + Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr; } @Override diff --git a/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaForm.java b/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaForm.java index 0726dfad..526d9d37 100644 --- a/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaForm.java +++ b/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaForm.java @@ -35,19 +35,14 @@ import haveno.desktop.util.FormBuilder; import haveno.desktop.util.normalization.IBANNormalizer; import javafx.collections.FXCollections; import javafx.scene.control.ComboBox; -import javafx.scene.control.TextArea; import javafx.scene.control.TextFormatter; import javafx.scene.layout.GridPane; import java.util.List; import java.util.Optional; -import com.jfoenix.controls.JFXTextArea; - -import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextArea; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextField; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; -import static haveno.desktop.util.FormBuilder.addTopLabelTextArea; public class SepaForm extends GeneralSepaForm { @@ -65,10 +60,6 @@ public class SepaForm extends GeneralSepaForm { // IBAN, BIC will not be translated addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaAccountPayload.getIban()); addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, BIC, sepaAccountPayload.getBic()); - TextArea textExtraInfo = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second; - textExtraInfo.setMinHeight(70); - textExtraInfo.setEditable(false); - textExtraInfo.setText(((SepaAccountPayload) paymentAccountPayload).getExtraInfo()); return gridRow; } @@ -150,15 +141,6 @@ public class SepaForm extends GeneralSepaForm { ibanInputTextField.refreshValidation(); }); - TextArea extraTextArea = addTopLabelTextArea(gridPane, ++gridRow, - Res.get("payment.shared.optionalExtra"), Res.get("payment.shared.extraInfo.prompt")).second; - extraTextArea.setMinHeight(70); - ((JFXTextArea) extraTextArea).setLabelFloat(false); - extraTextArea.textProperty().addListener((ov, oldValue, newValue) -> { - sepaAccount.setExtraInfo(newValue); - updateFromInputs(); - }); - updateFromInputs(); } @@ -190,12 +172,6 @@ public class SepaForm extends GeneralSepaForm { addCountriesGrid(Res.get("payment.accept.euro"), CountryUtil.getAllSepaEuroCountries()); addCountriesGrid(Res.get("payment.accept.nonEuro"), CountryUtil.getAllSepaNonEuroCountries()); - - TextArea textAreaExtra = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second; - textAreaExtra.setText(sepaAccount.getExtraInfo()); - textAreaExtra.setMinHeight(70); - textAreaExtra.setEditable(false); - addLimitations(true); } diff --git a/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaInstantForm.java b/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaInstantForm.java index b0031161..380f31ac 100644 --- a/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaInstantForm.java +++ b/desktop/src/main/java/haveno/desktop/components/paymentmethods/SepaInstantForm.java @@ -25,7 +25,6 @@ import haveno.core.locale.TradeCurrency; import haveno.core.payment.PaymentAccount; import haveno.core.payment.SepaInstantAccount; import haveno.core.payment.payload.PaymentAccountPayload; -import haveno.core.payment.payload.SepaAccountPayload; import haveno.core.payment.payload.SepaInstantAccountPayload; import haveno.core.payment.validation.BICValidator; import haveno.core.payment.validation.SepaIBANValidator; @@ -36,19 +35,14 @@ import haveno.desktop.util.FormBuilder; import haveno.desktop.util.normalization.IBANNormalizer; import javafx.collections.FXCollections; import javafx.scene.control.ComboBox; -import javafx.scene.control.TextArea; import javafx.scene.control.TextFormatter; import javafx.scene.layout.GridPane; import java.util.List; import java.util.Optional; -import com.jfoenix.controls.JFXTextArea; - -import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextArea; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextField; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; -import static haveno.desktop.util.FormBuilder.addTopLabelTextArea; public class SepaInstantForm extends GeneralSepaForm { @@ -66,10 +60,6 @@ public class SepaInstantForm extends GeneralSepaForm { // IBAN, BIC will not be translated addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaInstantAccountPayload.getIban()); addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, BIC, sepaInstantAccountPayload.getBic()); - TextArea textExtraInfo = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second; - textExtraInfo.setMinHeight(70); - textExtraInfo.setEditable(false); - textExtraInfo.setText(((SepaAccountPayload) paymentAccountPayload).getExtraInfo()); return gridRow; } @@ -153,15 +143,6 @@ public class SepaInstantForm extends GeneralSepaForm { ibanInputTextField.refreshValidation(); }); - TextArea extraTextArea = addTopLabelTextArea(gridPane, ++gridRow, - Res.get("payment.shared.optionalExtra"), Res.get("payment.shared.extraInfo.prompt")).second; - extraTextArea.setMinHeight(70); - ((JFXTextArea) extraTextArea).setLabelFloat(false); - extraTextArea.textProperty().addListener((ov, oldValue, newValue) -> { - sepaInstantAccount.setExtraInfo(newValue); - updateFromInputs(); - }); - updateFromInputs(); } @@ -193,12 +174,6 @@ public class SepaInstantForm extends GeneralSepaForm { addCountriesGrid(Res.get("payment.accept.euro"), CountryUtil.getAllSepaEuroCountries()); addCountriesGrid(Res.get("payment.accept.nonEuro"), CountryUtil.getAllSepaNonEuroCountries()); - - TextArea textAreaExtra = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second; - textAreaExtra.setText(sepaInstantAccount.getExtraInfo()); - textAreaExtra.setMinHeight(70); - textAreaExtra.setEditable(false); - addLimitations(true); } diff --git a/desktop/src/main/java/haveno/desktop/components/paymentmethods/ZelleForm.java b/desktop/src/main/java/haveno/desktop/components/paymentmethods/ZelleForm.java index 3f9069f6..79dab45e 100644 --- a/desktop/src/main/java/haveno/desktop/components/paymentmethods/ZelleForm.java +++ b/desktop/src/main/java/haveno/desktop/components/paymentmethods/ZelleForm.java @@ -17,7 +17,6 @@ package haveno.desktop.components.paymentmethods; -import com.jfoenix.controls.JFXTextArea; import haveno.core.account.witness.AccountAgeWitnessService; import haveno.core.locale.Res; import haveno.core.locale.TradeCurrency; @@ -30,14 +29,11 @@ import haveno.core.util.coin.CoinFormatter; import haveno.core.util.validation.InputValidator; import haveno.desktop.components.InputTextField; import haveno.desktop.util.FormBuilder; -import javafx.scene.control.TextArea; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; -import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextArea; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextField; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; -import static haveno.desktop.util.FormBuilder.addTopLabelTextArea; import static haveno.desktop.util.FormBuilder.addTopLabelTextField; public class ZelleForm extends PaymentMethodForm { @@ -49,10 +45,6 @@ public class ZelleForm extends PaymentMethodForm { ((ZelleAccountPayload) paymentAccountPayload).getHolderName()); addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile"), ((ZelleAccountPayload) paymentAccountPayload).getEmailOrMobileNr()); - TextArea textExtraInfo = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second; - textExtraInfo.setMinHeight(70); - textExtraInfo.setEditable(false); - textExtraInfo.setText(((ZelleAccountPayload) paymentAccountPayload).getExtraInfo()); return gridRow; } @@ -85,16 +77,6 @@ public class ZelleForm extends PaymentMethodForm { final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); - - TextArea extraTextArea = addTopLabelTextArea(gridPane, ++gridRow, - Res.get("payment.shared.optionalExtra"), Res.get("payment.shared.extraInfo.prompt")).second; - extraTextArea.setMinHeight(70); - ((JFXTextArea) extraTextArea).setLabelFloat(false); - extraTextArea.textProperty().addListener((ov, oldValue, newValue) -> { - zelleAccount.setExtraInfo(newValue); - updateFromInputs(); - }); - addLimitations(false); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -119,10 +101,6 @@ public class ZelleForm extends PaymentMethodForm { final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); - TextArea textAreaExtra = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second; - textAreaExtra.setText(zelleAccount.getExtraInfo()); - textAreaExtra.setMinHeight(70); - textAreaExtra.setEditable(false); addLimitations(true); } diff --git a/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java b/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java index e8029471..1d662aeb 100644 --- a/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java +++ b/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java @@ -160,9 +160,9 @@ public class TakeOfferView extends ActivatableViewAndModel paymentAccountWarningDisplayed = new HashMap<>(); - private boolean offerDetailsWindowDisplayed, zelleWarningDisplayed, zelleExtraInfoDisplayed, fasterPaymentsWarningDisplayed, + private boolean offerDetailsWindowDisplayed, zelleWarningDisplayed, fasterPaymentsWarningDisplayed, takeOfferFromUnsignedAccountWarningDisplayed, payByMailWarningDisplayed, cashAtAtmWarningDisplayed, - australiaPayidWarningDisplayed, paypalWarningDisplayed, cashAppWarningDisplayed, sepaExtraInfoDisplayed, sepaInstantExtraInfoDisplayed; + australiaPayidWarningDisplayed, paypalWarningDisplayed, cashAppWarningDisplayed; private SimpleBooleanProperty errorPopupDisplayed; private ChangeListener amountFocusedListener, getShowWalletFundedNotificationListener; @@ -268,7 +268,7 @@ public class TakeOfferView extends ActivatableViewAndModel { PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem(); if (paymentAccount != null) { - maybeShowZelleWarning(paymentAccount, model.dataModel.getOffer()); + maybeShowZelleWarning(paymentAccount); maybeShowFasterPaymentsWarning(paymentAccount); maybeShowAccountWarning(paymentAccount, model.dataModel.isBuyOffer()); } @@ -1130,26 +1128,12 @@ public class TakeOfferView extends ActivatableViewAndModel { - new GenericMessageWindow() - .preamble(Res.get("payment.tradingRestrictions")) - .instruction(offer.getExtraInfo()) - .actionButtonText(Res.get("shared.iConfirm")) - .closeButtonText(Res.get("shared.close")) - .width(Layout.INITIAL_WINDOW_WIDTH) - .onClose(() -> close(false)) - .show(); - }, 500, TimeUnit.MILLISECONDS); - } } private void maybeShowFasterPaymentsWarning(PaymentAccount paymentAccount) { @@ -1251,40 +1235,6 @@ public class TakeOfferView extends ActivatableViewAndModel { - new GenericMessageWindow() - .preamble(Res.get("payment.tradingRestrictions")) - .instruction(offer.getExtraInfo()) - .actionButtonText(Res.get("shared.iConfirm")) - .closeButtonText(Res.get("shared.close")) - .width(Layout.INITIAL_WINDOW_WIDTH) - .onClose(() -> close(false)) - .show(); - }, 500, TimeUnit.MILLISECONDS); - } - } - - private void maybeShowSepaInstantWarning(PaymentAccount paymentAccount, Offer offer) { - if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.SEPA_INSTANT_ID) && - !sepaInstantExtraInfoDisplayed && !offer.getExtraInfo().isEmpty()) { - sepaInstantExtraInfoDisplayed = true; - UserThread.runAfter(() -> { - new GenericMessageWindow() - .preamble(Res.get("payment.tradingRestrictions")) - .instruction(offer.getExtraInfo()) - .actionButtonText(Res.get("shared.iConfirm")) - .closeButtonText(Res.get("shared.close")) - .width(Layout.INITIAL_WINDOW_WIDTH) - .onClose(() -> close(false)) - .show(); - }, 500, TimeUnit.MILLISECONDS); - } - } - private Tuple2 getTradeInputBox(HBox amountValueBox, String promptText) { Label descriptionLabel = new AutoTooltipLabel(promptText); descriptionLabel.setId("input-description-label"); diff --git a/proto/src/main/proto/pb.proto b/proto/src/main/proto/pb.proto index c8283383..b52274ae 100644 --- a/proto/src/main/proto/pb.proto +++ b/proto/src/main/proto/pb.proto @@ -901,7 +901,6 @@ message ChaseQuickPayAccountPayload { message ZelleAccountPayload { string holder_name = 1; string email_or_mobile_nr = 2; - string extra_info = 3; } message CountryBasedPaymentAccountPayload { @@ -1022,14 +1021,12 @@ message SepaAccountPayload { string iban = 2; string bic = 3; string email = 4 [deprecated = true]; - string extra_info = 5; } message SepaInstantAccountPayload { string holder_name = 1; string iban = 2; string bic = 3; - string extra_info = 4; } message CryptoCurrencyAccountPayload {