mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-02-27 21:40:29 +00:00
add extra info for zelle, sepa, sepa instant
This commit is contained in:
parent
944c189166
commit
7e3e1f90de
14 changed files with 215 additions and 14 deletions
core/src/main/java/haveno/core
offer
payment
desktop/src/main/java/haveno/desktop
components/paymentmethods
main/offer/takeoffer
proto/src/main/proto
|
@ -432,6 +432,12 @@ public class Offer implements NetworkPayload, PersistablePayload {
|
||||||
return getExtraDataMap().get(OfferPayload.PAYPAL_EXTRA_INFO);
|
return getExtraDataMap().get(OfferPayload.PAYPAL_EXTRA_INFO);
|
||||||
else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.CASHAPP_EXTRA_INFO))
|
else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.CASHAPP_EXTRA_INFO))
|
||||||
return getExtraDataMap().get(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
|
else
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,6 +102,9 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay
|
||||||
public static final String PAY_BY_MAIL_EXTRA_INFO = "payByMailExtraInfo";
|
public static final String PAY_BY_MAIL_EXTRA_INFO = "payByMailExtraInfo";
|
||||||
public static final String AUSTRALIA_PAYID_EXTRA_INFO = "australiaPayidExtraInfo";
|
public static final String AUSTRALIA_PAYID_EXTRA_INFO = "australiaPayidExtraInfo";
|
||||||
public static final String PAYPAL_EXTRA_INFO = "payPalExtraInfo";
|
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
|
// 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
|
// Capability.SIGNED_ACCOUNT_AGE_WITNESS is 11 and Capability.MEDIATION is 12 so if we want to signal that maker
|
||||||
|
|
|
@ -42,6 +42,9 @@ import static haveno.core.offer.OfferPayload.F2F_CITY;
|
||||||
import static haveno.core.offer.OfferPayload.F2F_EXTRA_INFO;
|
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.PAY_BY_MAIL_EXTRA_INFO;
|
||||||
import static haveno.core.offer.OfferPayload.PAYPAL_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.REFERRAL_ID;
|
||||||
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF;
|
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF;
|
||||||
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF_ENABLED_VALUE;
|
import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF_ENABLED_VALUE;
|
||||||
|
@ -52,6 +55,9 @@ import haveno.core.payment.F2FAccount;
|
||||||
import haveno.core.payment.PayByMailAccount;
|
import haveno.core.payment.PayByMailAccount;
|
||||||
import haveno.core.payment.PayPalAccount;
|
import haveno.core.payment.PayPalAccount;
|
||||||
import haveno.core.payment.PaymentAccount;
|
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.MarketPrice;
|
||||||
import haveno.core.provider.price.PriceFeedService;
|
import haveno.core.provider.price.PriceFeedService;
|
||||||
import haveno.core.trade.statistics.ReferralIdService;
|
import haveno.core.trade.statistics.ReferralIdService;
|
||||||
|
@ -217,6 +223,18 @@ public class OfferUtil {
|
||||||
extraDataMap.put(AUSTRALIA_PAYID_EXTRA_INFO, ((AustraliaPayidAccount) paymentAccount).getExtraInfo());
|
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());
|
extraDataMap.put(CAPABILITIES, Capabilities.app.toStringList());
|
||||||
|
|
||||||
if (currencyCode.equals("XMR") && direction == OfferDirection.SELL) {
|
if (currencyCode.equals("XMR") && direction == OfferDirection.SELL) {
|
||||||
|
|
|
@ -43,6 +43,7 @@ public final class SepaAccount extends CountryBasedPaymentAccount implements Ban
|
||||||
PaymentAccountFormField.FieldId.BIC,
|
PaymentAccountFormField.FieldId.BIC,
|
||||||
PaymentAccountFormField.FieldId.COUNTRY,
|
PaymentAccountFormField.FieldId.COUNTRY,
|
||||||
PaymentAccountFormField.FieldId.ACCEPTED_COUNTRY_CODES,
|
PaymentAccountFormField.FieldId.ACCEPTED_COUNTRY_CODES,
|
||||||
|
PaymentAccountFormField.FieldId.EXTRA_INFO,
|
||||||
PaymentAccountFormField.FieldId.SALT
|
PaymentAccountFormField.FieldId.SALT
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -104,6 +105,14 @@ public final class SepaAccount extends CountryBasedPaymentAccount implements Ban
|
||||||
((SepaAccountPayload) paymentAccountPayload).removeAcceptedCountry(countryCode);
|
((SepaAccountPayload) paymentAccountPayload).removeAcceptedCountry(countryCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setExtraInfo(String extraInfo) {
|
||||||
|
((SepaAccountPayload) paymentAccountPayload).setExtraInfo(extraInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExtraInfo() {
|
||||||
|
return ((SepaAccountPayload) paymentAccountPayload).getExtraInfo();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPersistChanges() {
|
public void onPersistChanges() {
|
||||||
super.onPersistChanges();
|
super.onPersistChanges();
|
||||||
|
|
|
@ -25,6 +25,7 @@ import haveno.core.locale.TraditionalCurrency;
|
||||||
import haveno.core.locale.TradeCurrency;
|
import haveno.core.locale.TradeCurrency;
|
||||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||||
import haveno.core.payment.payload.PaymentMethod;
|
import haveno.core.payment.payload.PaymentMethod;
|
||||||
|
import haveno.core.payment.payload.SepaAccountPayload;
|
||||||
import haveno.core.payment.payload.SepaInstantAccountPayload;
|
import haveno.core.payment.payload.SepaInstantAccountPayload;
|
||||||
import haveno.core.payment.validation.SepaIBANValidator;
|
import haveno.core.payment.validation.SepaIBANValidator;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -90,6 +91,15 @@ public final class SepaInstantAccount extends CountryBasedPaymentAccount impleme
|
||||||
((SepaInstantAccountPayload) paymentAccountPayload).removeAcceptedCountry(countryCode);
|
((SepaInstantAccountPayload) paymentAccountPayload).removeAcceptedCountry(countryCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setExtraInfo(String extraInfo) {
|
||||||
|
((SepaAccountPayload) paymentAccountPayload).setExtraInfo(extraInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExtraInfo() {
|
||||||
|
return ((SepaAccountPayload) paymentAccountPayload).getExtraInfo();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPersistChanges() {
|
public void onPersistChanges() {
|
||||||
super.onPersistChanges();
|
super.onPersistChanges();
|
||||||
|
|
|
@ -42,6 +42,7 @@ public final class ZelleAccount extends PaymentAccount {
|
||||||
PaymentAccountFormField.FieldId.ACCOUNT_NAME,
|
PaymentAccountFormField.FieldId.ACCOUNT_NAME,
|
||||||
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
PaymentAccountFormField.FieldId.HOLDER_NAME,
|
||||||
PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR,
|
PaymentAccountFormField.FieldId.EMAIL_OR_MOBILE_NR,
|
||||||
|
PaymentAccountFormField.FieldId.EXTRA_INFO,
|
||||||
PaymentAccountFormField.FieldId.SALT
|
PaymentAccountFormField.FieldId.SALT
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -75,4 +76,12 @@ public final class ZelleAccount extends PaymentAccount {
|
||||||
public String getHolderName() {
|
public String getHolderName() {
|
||||||
return ((ZelleAccountPayload) paymentAccountPayload).getHolderName();
|
return ((ZelleAccountPayload) paymentAccountPayload).getHolderName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setExtraInfo(String extraInfo) {
|
||||||
|
((ZelleAccountPayload) paymentAccountPayload).setExtraInfo(extraInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getExtraInfo() {
|
||||||
|
return ((ZelleAccountPayload) paymentAccountPayload).getExtraInfo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,6 +47,8 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
@Setter
|
@Setter
|
||||||
private String bic = "";
|
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
|
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
|
// Don't use a set here as we need a deterministic ordering, otherwise the contract hash does not match
|
||||||
private final List<String> persistedAcceptedCountryCodes = new ArrayList<>();
|
private final List<String> persistedAcceptedCountryCodes = new ArrayList<>();
|
||||||
|
@ -73,6 +75,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
String iban,
|
String iban,
|
||||||
String bic,
|
String bic,
|
||||||
String email,
|
String email,
|
||||||
|
String extraInfo,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
|
@ -87,6 +90,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
this.bic = bic;
|
this.bic = bic;
|
||||||
this.email = email;
|
this.email = email;
|
||||||
this.acceptedCountryCodes = acceptedCountryCodes;
|
this.acceptedCountryCodes = acceptedCountryCodes;
|
||||||
|
this.extraInfo = extraInfo;
|
||||||
persistedAcceptedCountryCodes.addAll(acceptedCountryCodes);
|
persistedAcceptedCountryCodes.addAll(acceptedCountryCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +101,8 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
.setHolderName(holderName)
|
.setHolderName(holderName)
|
||||||
.setIban(iban)
|
.setIban(iban)
|
||||||
.setBic(bic)
|
.setBic(bic)
|
||||||
.setEmail(email);
|
.setEmail(email)
|
||||||
|
.setExtraInfo(extraInfo);
|
||||||
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
||||||
.getCountryBasedPaymentAccountPayloadBuilder()
|
.getCountryBasedPaymentAccountPayloadBuilder()
|
||||||
.setSepaAccountPayload(builder);
|
.setSepaAccountPayload(builder);
|
||||||
|
@ -117,6 +122,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
sepaAccountPayloadPB.getIban(),
|
sepaAccountPayloadPB.getIban(),
|
||||||
sepaAccountPayloadPB.getBic(),
|
sepaAccountPayloadPB.getBic(),
|
||||||
sepaAccountPayloadPB.getEmail(),
|
sepaAccountPayloadPB.getEmail(),
|
||||||
|
sepaAccountPayloadPB.getExtraInfo(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
@ -154,7 +160,8 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
|
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
|
||||||
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode();
|
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode() + ", " +
|
||||||
|
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -162,7 +169,8 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
|
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
|
||||||
"IBAN: " + iban + "\n" +
|
"IBAN: " + iban + "\n" +
|
||||||
"BIC: " + bic + "\n" +
|
"BIC: " + bic + "\n" +
|
||||||
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode);
|
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode) + "\n" +
|
||||||
|
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -46,6 +46,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
private String iban = "";
|
private String iban = "";
|
||||||
@Setter
|
@Setter
|
||||||
private String bic = "";
|
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
|
// Don't use a set here as we need a deterministic ordering, otherwise the contract hash does not match
|
||||||
private final List<String> persistedAcceptedCountryCodes = new ArrayList<>();
|
private final List<String> persistedAcceptedCountryCodes = new ArrayList<>();
|
||||||
|
@ -71,6 +72,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
String holderName,
|
String holderName,
|
||||||
String iban,
|
String iban,
|
||||||
String bic,
|
String bic,
|
||||||
|
String extraInfo,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
|
@ -83,6 +85,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
this.holderName = holderName;
|
this.holderName = holderName;
|
||||||
this.iban = iban;
|
this.iban = iban;
|
||||||
this.bic = bic;
|
this.bic = bic;
|
||||||
|
this.extraInfo = extraInfo;
|
||||||
persistedAcceptedCountryCodes.addAll(acceptedCountryCodes);
|
persistedAcceptedCountryCodes.addAll(acceptedCountryCodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +95,8 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
protobuf.SepaInstantAccountPayload.newBuilder()
|
protobuf.SepaInstantAccountPayload.newBuilder()
|
||||||
.setHolderName(holderName)
|
.setHolderName(holderName)
|
||||||
.setIban(iban)
|
.setIban(iban)
|
||||||
.setBic(bic);
|
.setBic(bic)
|
||||||
|
.setExtraInfo(extraInfo);
|
||||||
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
final protobuf.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
||||||
.getCountryBasedPaymentAccountPayloadBuilder()
|
.getCountryBasedPaymentAccountPayloadBuilder()
|
||||||
.setSepaInstantAccountPayload(builder);
|
.setSepaInstantAccountPayload(builder);
|
||||||
|
@ -111,6 +115,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
sepaInstantAccountPayloadPB.getHolderName(),
|
sepaInstantAccountPayloadPB.getHolderName(),
|
||||||
sepaInstantAccountPayloadPB.getIban(),
|
sepaInstantAccountPayloadPB.getIban(),
|
||||||
sepaInstantAccountPayloadPB.getBic(),
|
sepaInstantAccountPayloadPB.getBic(),
|
||||||
|
sepaInstantAccountPayloadPB.getExtraInfo(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
@ -142,7 +147,8 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
|
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
|
||||||
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode();
|
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode() + ", " +
|
||||||
|
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -150,7 +156,8 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
|
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
|
||||||
"IBAN: " + iban + "\n" +
|
"IBAN: " + iban + "\n" +
|
||||||
"BIC: " + bic + "\n" +
|
"BIC: " + bic + "\n" +
|
||||||
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode);
|
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode) + "\n" +
|
||||||
|
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,6 +37,7 @@ import java.util.Map;
|
||||||
public final class ZelleAccountPayload extends PaymentAccountPayload implements PayloadWithHolderName {
|
public final class ZelleAccountPayload extends PaymentAccountPayload implements PayloadWithHolderName {
|
||||||
private String emailOrMobileNr = "";
|
private String emailOrMobileNr = "";
|
||||||
private String holderName = "";
|
private String holderName = "";
|
||||||
|
private String extraInfo = "";
|
||||||
|
|
||||||
public ZelleAccountPayload(String paymentMethod, String id) {
|
public ZelleAccountPayload(String paymentMethod, String id) {
|
||||||
super(paymentMethod, id);
|
super(paymentMethod, id);
|
||||||
|
@ -51,6 +52,7 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements
|
||||||
String id,
|
String id,
|
||||||
String emailOrMobileNr,
|
String emailOrMobileNr,
|
||||||
String holderName,
|
String holderName,
|
||||||
|
String extraInfo,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
|
@ -60,6 +62,7 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements
|
||||||
|
|
||||||
this.emailOrMobileNr = emailOrMobileNr;
|
this.emailOrMobileNr = emailOrMobileNr;
|
||||||
this.holderName = holderName;
|
this.holderName = holderName;
|
||||||
|
this.extraInfo = extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -67,7 +70,8 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements
|
||||||
return getPaymentAccountPayloadBuilder()
|
return getPaymentAccountPayloadBuilder()
|
||||||
.setZelleAccountPayload(protobuf.ZelleAccountPayload.newBuilder()
|
.setZelleAccountPayload(protobuf.ZelleAccountPayload.newBuilder()
|
||||||
.setEmailOrMobileNr(emailOrMobileNr)
|
.setEmailOrMobileNr(emailOrMobileNr)
|
||||||
.setHolderName(holderName))
|
.setHolderName(holderName)
|
||||||
|
.setExtraInfo(extraInfo))
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,6 +80,7 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getZelleAccountPayload().getEmailOrMobileNr(),
|
proto.getZelleAccountPayload().getEmailOrMobileNr(),
|
||||||
proto.getZelleAccountPayload().getHolderName(),
|
proto.getZelleAccountPayload().getHolderName(),
|
||||||
|
proto.getZelleAccountPayload().getExtraInfo(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
@ -88,13 +93,15 @@ public final class ZelleAccountPayload extends PaymentAccountPayload implements
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
|
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
|
||||||
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr;
|
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr + ", " +
|
||||||
|
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetailsForTradePopup() {
|
public String getPaymentDetailsForTradePopup() {
|
||||||
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
|
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
|
||||||
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr;
|
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr + "\n" +
|
||||||
|
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,14 +35,19 @@ import haveno.desktop.util.FormBuilder;
|
||||||
import haveno.desktop.util.normalization.IBANNormalizer;
|
import haveno.desktop.util.normalization.IBANNormalizer;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.scene.control.ComboBox;
|
import javafx.scene.control.ComboBox;
|
||||||
|
import javafx.scene.control.TextArea;
|
||||||
import javafx.scene.control.TextFormatter;
|
import javafx.scene.control.TextFormatter;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
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.addCompactTopLabelTextField;
|
||||||
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
|
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
|
||||||
|
import static haveno.desktop.util.FormBuilder.addTopLabelTextArea;
|
||||||
|
|
||||||
public class SepaForm extends GeneralSepaForm {
|
public class SepaForm extends GeneralSepaForm {
|
||||||
|
|
||||||
|
@ -60,6 +65,10 @@ public class SepaForm extends GeneralSepaForm {
|
||||||
// IBAN, BIC will not be translated
|
// IBAN, BIC will not be translated
|
||||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaAccountPayload.getIban());
|
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaAccountPayload.getIban());
|
||||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, BIC, sepaAccountPayload.getBic());
|
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;
|
return gridRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,6 +150,15 @@ public class SepaForm extends GeneralSepaForm {
|
||||||
ibanInputTextField.refreshValidation();
|
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();
|
updateFromInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,6 +190,12 @@ public class SepaForm extends GeneralSepaForm {
|
||||||
|
|
||||||
addCountriesGrid(Res.get("payment.accept.euro"), CountryUtil.getAllSepaEuroCountries());
|
addCountriesGrid(Res.get("payment.accept.euro"), CountryUtil.getAllSepaEuroCountries());
|
||||||
addCountriesGrid(Res.get("payment.accept.nonEuro"), CountryUtil.getAllSepaNonEuroCountries());
|
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);
|
addLimitations(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ import haveno.core.locale.TradeCurrency;
|
||||||
import haveno.core.payment.PaymentAccount;
|
import haveno.core.payment.PaymentAccount;
|
||||||
import haveno.core.payment.SepaInstantAccount;
|
import haveno.core.payment.SepaInstantAccount;
|
||||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||||
|
import haveno.core.payment.payload.SepaAccountPayload;
|
||||||
import haveno.core.payment.payload.SepaInstantAccountPayload;
|
import haveno.core.payment.payload.SepaInstantAccountPayload;
|
||||||
import haveno.core.payment.validation.BICValidator;
|
import haveno.core.payment.validation.BICValidator;
|
||||||
import haveno.core.payment.validation.SepaIBANValidator;
|
import haveno.core.payment.validation.SepaIBANValidator;
|
||||||
|
@ -35,14 +36,19 @@ import haveno.desktop.util.FormBuilder;
|
||||||
import haveno.desktop.util.normalization.IBANNormalizer;
|
import haveno.desktop.util.normalization.IBANNormalizer;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.scene.control.ComboBox;
|
import javafx.scene.control.ComboBox;
|
||||||
|
import javafx.scene.control.TextArea;
|
||||||
import javafx.scene.control.TextFormatter;
|
import javafx.scene.control.TextFormatter;
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
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.addCompactTopLabelTextField;
|
||||||
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
|
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
|
||||||
|
import static haveno.desktop.util.FormBuilder.addTopLabelTextArea;
|
||||||
|
|
||||||
public class SepaInstantForm extends GeneralSepaForm {
|
public class SepaInstantForm extends GeneralSepaForm {
|
||||||
|
|
||||||
|
@ -60,6 +66,10 @@ public class SepaInstantForm extends GeneralSepaForm {
|
||||||
// IBAN, BIC will not be translated
|
// IBAN, BIC will not be translated
|
||||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaInstantAccountPayload.getIban());
|
addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaInstantAccountPayload.getIban());
|
||||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, BIC, sepaInstantAccountPayload.getBic());
|
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;
|
return gridRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,6 +153,15 @@ public class SepaInstantForm extends GeneralSepaForm {
|
||||||
ibanInputTextField.refreshValidation();
|
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();
|
updateFromInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,6 +193,12 @@ public class SepaInstantForm extends GeneralSepaForm {
|
||||||
|
|
||||||
addCountriesGrid(Res.get("payment.accept.euro"), CountryUtil.getAllSepaEuroCountries());
|
addCountriesGrid(Res.get("payment.accept.euro"), CountryUtil.getAllSepaEuroCountries());
|
||||||
addCountriesGrid(Res.get("payment.accept.nonEuro"), CountryUtil.getAllSepaNonEuroCountries());
|
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);
|
addLimitations(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package haveno.desktop.components.paymentmethods;
|
package haveno.desktop.components.paymentmethods;
|
||||||
|
|
||||||
|
import com.jfoenix.controls.JFXTextArea;
|
||||||
import haveno.core.account.witness.AccountAgeWitnessService;
|
import haveno.core.account.witness.AccountAgeWitnessService;
|
||||||
import haveno.core.locale.Res;
|
import haveno.core.locale.Res;
|
||||||
import haveno.core.locale.TradeCurrency;
|
import haveno.core.locale.TradeCurrency;
|
||||||
|
@ -29,11 +30,14 @@ import haveno.core.util.coin.CoinFormatter;
|
||||||
import haveno.core.util.validation.InputValidator;
|
import haveno.core.util.validation.InputValidator;
|
||||||
import haveno.desktop.components.InputTextField;
|
import haveno.desktop.components.InputTextField;
|
||||||
import haveno.desktop.util.FormBuilder;
|
import haveno.desktop.util.FormBuilder;
|
||||||
|
import javafx.scene.control.TextArea;
|
||||||
import javafx.scene.control.TextField;
|
import javafx.scene.control.TextField;
|
||||||
import javafx.scene.layout.GridPane;
|
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.addCompactTopLabelTextField;
|
||||||
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
|
import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
|
||||||
|
import static haveno.desktop.util.FormBuilder.addTopLabelTextArea;
|
||||||
import static haveno.desktop.util.FormBuilder.addTopLabelTextField;
|
import static haveno.desktop.util.FormBuilder.addTopLabelTextField;
|
||||||
|
|
||||||
public class ZelleForm extends PaymentMethodForm {
|
public class ZelleForm extends PaymentMethodForm {
|
||||||
|
@ -45,6 +49,10 @@ public class ZelleForm extends PaymentMethodForm {
|
||||||
((ZelleAccountPayload) paymentAccountPayload).getHolderName());
|
((ZelleAccountPayload) paymentAccountPayload).getHolderName());
|
||||||
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile"),
|
addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.email.mobile"),
|
||||||
((ZelleAccountPayload) paymentAccountPayload).getEmailOrMobileNr());
|
((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;
|
return gridRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,6 +85,16 @@ public class ZelleForm extends PaymentMethodForm {
|
||||||
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
|
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
|
||||||
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
|
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
|
||||||
nameAndCode);
|
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);
|
addLimitations(false);
|
||||||
addAccountNameTextFieldWithAutoFillToggleButton();
|
addAccountNameTextFieldWithAutoFillToggleButton();
|
||||||
}
|
}
|
||||||
|
@ -101,6 +119,10 @@ public class ZelleForm extends PaymentMethodForm {
|
||||||
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
|
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
|
||||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
|
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
|
||||||
nameAndCode);
|
nameAndCode);
|
||||||
|
TextArea textAreaExtra = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second;
|
||||||
|
textAreaExtra.setText(zelleAccount.getExtraInfo());
|
||||||
|
textAreaExtra.setMinHeight(70);
|
||||||
|
textAreaExtra.setEditable(false);
|
||||||
addLimitations(true);
|
addLimitations(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,9 +160,9 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
|
|
||||||
private int gridRow = 0;
|
private int gridRow = 0;
|
||||||
private final HashMap<String, Boolean> paymentAccountWarningDisplayed = new HashMap<>();
|
private final HashMap<String, Boolean> paymentAccountWarningDisplayed = new HashMap<>();
|
||||||
private boolean offerDetailsWindowDisplayed, zelleWarningDisplayed, fasterPaymentsWarningDisplayed,
|
private boolean offerDetailsWindowDisplayed, zelleWarningDisplayed, zelleExtraInfoDisplayed, fasterPaymentsWarningDisplayed,
|
||||||
takeOfferFromUnsignedAccountWarningDisplayed, payByMailWarningDisplayed, cashAtAtmWarningDisplayed,
|
takeOfferFromUnsignedAccountWarningDisplayed, payByMailWarningDisplayed, cashAtAtmWarningDisplayed,
|
||||||
australiaPayidWarningDisplayed, paypalWarningDisplayed, cashAppWarningDisplayed;
|
australiaPayidWarningDisplayed, paypalWarningDisplayed, cashAppWarningDisplayed, sepaExtraInfoDisplayed, sepaInstantExtraInfoDisplayed;
|
||||||
private SimpleBooleanProperty errorPopupDisplayed;
|
private SimpleBooleanProperty errorPopupDisplayed;
|
||||||
private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener;
|
private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener;
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
balanceTextField.setTargetAmount(model.dataModel.getTotalToPay().get());
|
balanceTextField.setTargetAmount(model.dataModel.getTotalToPay().get());
|
||||||
|
|
||||||
maybeShowTakeOfferFromUnsignedAccountWarning(model.dataModel.getOffer());
|
maybeShowTakeOfferFromUnsignedAccountWarning(model.dataModel.getOffer());
|
||||||
maybeShowZelleWarning(lastPaymentAccount);
|
maybeShowZelleWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
maybeShowFasterPaymentsWarning(lastPaymentAccount);
|
maybeShowFasterPaymentsWarning(lastPaymentAccount);
|
||||||
maybeShowAccountWarning(lastPaymentAccount, model.dataModel.isBuyOffer());
|
maybeShowAccountWarning(lastPaymentAccount, model.dataModel.isBuyOffer());
|
||||||
maybeShowPayByMailWarning(lastPaymentAccount, model.dataModel.getOffer());
|
maybeShowPayByMailWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
|
@ -276,6 +276,8 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
maybeShowAustraliaPayidWarning(lastPaymentAccount, model.dataModel.getOffer());
|
maybeShowAustraliaPayidWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
maybeShowPayPalWarning(lastPaymentAccount, model.dataModel.getOffer());
|
maybeShowPayPalWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
maybeShowCashAppWarning(lastPaymentAccount, model.dataModel.getOffer());
|
maybeShowCashAppWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
|
maybeShowSepaWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
|
maybeShowSepaInstantWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||||
|
|
||||||
if (!model.isRange()) {
|
if (!model.isRange()) {
|
||||||
nextButton.setVisible(false);
|
nextButton.setVisible(false);
|
||||||
|
@ -759,7 +761,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
paymentAccountsComboBox.setOnAction(e -> {
|
paymentAccountsComboBox.setOnAction(e -> {
|
||||||
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
|
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
|
||||||
if (paymentAccount != null) {
|
if (paymentAccount != null) {
|
||||||
maybeShowZelleWarning(paymentAccount);
|
maybeShowZelleWarning(paymentAccount, model.dataModel.getOffer());
|
||||||
maybeShowFasterPaymentsWarning(paymentAccount);
|
maybeShowFasterPaymentsWarning(paymentAccount);
|
||||||
maybeShowAccountWarning(paymentAccount, model.dataModel.isBuyOffer());
|
maybeShowAccountWarning(paymentAccount, model.dataModel.isBuyOffer());
|
||||||
}
|
}
|
||||||
|
@ -1128,12 +1130,26 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeShowZelleWarning(PaymentAccount paymentAccount) {
|
private void maybeShowZelleWarning(PaymentAccount paymentAccount, Offer offer) {
|
||||||
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.ZELLE_ID) &&
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.ZELLE_ID) &&
|
||||||
!zelleWarningDisplayed) {
|
!zelleWarningDisplayed) {
|
||||||
zelleWarningDisplayed = true;
|
zelleWarningDisplayed = true;
|
||||||
UserThread.runAfter(GUIUtil::showZelleWarning, 500, TimeUnit.MILLISECONDS);
|
UserThread.runAfter(GUIUtil::showZelleWarning, 500, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.ZELLE_ID) &&
|
||||||
|
!zelleExtraInfoDisplayed && !offer.getExtraInfo().isEmpty()) {
|
||||||
|
zelleExtraInfoDisplayed = 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 void maybeShowFasterPaymentsWarning(PaymentAccount paymentAccount) {
|
private void maybeShowFasterPaymentsWarning(PaymentAccount paymentAccount) {
|
||||||
|
@ -1235,6 +1251,40 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void maybeShowSepaWarning(PaymentAccount paymentAccount, Offer offer) {
|
||||||
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.SEPA_ID) &&
|
||||||
|
!sepaExtraInfoDisplayed && !offer.getExtraInfo().isEmpty()) {
|
||||||
|
sepaExtraInfoDisplayed = 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 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<Label, VBox> getTradeInputBox(HBox amountValueBox, String promptText) {
|
private Tuple2<Label, VBox> getTradeInputBox(HBox amountValueBox, String promptText) {
|
||||||
Label descriptionLabel = new AutoTooltipLabel(promptText);
|
Label descriptionLabel = new AutoTooltipLabel(promptText);
|
||||||
descriptionLabel.setId("input-description-label");
|
descriptionLabel.setId("input-description-label");
|
||||||
|
|
|
@ -901,6 +901,7 @@ message ChaseQuickPayAccountPayload {
|
||||||
message ZelleAccountPayload {
|
message ZelleAccountPayload {
|
||||||
string holder_name = 1;
|
string holder_name = 1;
|
||||||
string email_or_mobile_nr = 2;
|
string email_or_mobile_nr = 2;
|
||||||
|
string extra_info = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CountryBasedPaymentAccountPayload {
|
message CountryBasedPaymentAccountPayload {
|
||||||
|
@ -1021,12 +1022,14 @@ message SepaAccountPayload {
|
||||||
string iban = 2;
|
string iban = 2;
|
||||||
string bic = 3;
|
string bic = 3;
|
||||||
string email = 4 [deprecated = true];
|
string email = 4 [deprecated = true];
|
||||||
|
string extra_info = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SepaInstantAccountPayload {
|
message SepaInstantAccountPayload {
|
||||||
string holder_name = 1;
|
string holder_name = 1;
|
||||||
string iban = 2;
|
string iban = 2;
|
||||||
string bic = 3;
|
string bic = 3;
|
||||||
|
string extra_info = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CryptoCurrencyAccountPayload {
|
message CryptoCurrencyAccountPayload {
|
||||||
|
|
Loading…
Reference in a new issue