mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 07:07:43 +01:00
Merge pull request #4046 from stejbac/add-faster-payments-holder-name
Add holder name for new Faster Payments accounts
This commit is contained in:
commit
b321cd9272
41 changed files with 307 additions and 349 deletions
|
@ -36,6 +36,14 @@ public final class FasterPaymentsAccount extends PaymentAccount {
|
||||||
return new FasterPaymentsAccountPayload(paymentMethod.getId(), id);
|
return new FasterPaymentsAccountPayload(paymentMethod.getId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setHolderName(String value) {
|
||||||
|
((FasterPaymentsAccountPayload) paymentAccountPayload).setHolderName(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHolderName() {
|
||||||
|
return ((FasterPaymentsAccountPayload) paymentAccountPayload).getHolderName();
|
||||||
|
}
|
||||||
|
|
||||||
public void setSortCode(String value) {
|
public void setSortCode(String value) {
|
||||||
((FasterPaymentsAccountPayload) paymentAccountPayload).setSortCode(value);
|
((FasterPaymentsAccountPayload) paymentAccountPayload).setSortCode(value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -57,7 +53,7 @@ public final class AdvancedCashAccountPayload extends PaymentAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String accountNr,
|
String accountNr,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -79,7 +75,7 @@ public final class AdvancedCashAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getAdvancedCashAccountPayload().getAccountNr(),
|
proto.getAdvancedCashAccountPayload().getAccountNr(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,6 +95,6 @@ public final class AdvancedCashAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -33,8 +31,6 @@ import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -55,7 +51,7 @@ public final class AliPayAccountPayload extends PaymentAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String accountNr,
|
String accountNr,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -76,7 +72,7 @@ public final class AliPayAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getAliPayAccountPayload().getAccountNr(),
|
proto.getAliPayAccountPayload().getAccountNr(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +92,6 @@ public final class AliPayAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -29,8 +29,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -52,7 +50,7 @@ public abstract class AssetsAccountPayload extends PaymentAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String address,
|
String address,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -77,6 +75,6 @@ public abstract class AssetsAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(address.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(address.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import bisq.core.locale.BankUtil;
|
||||||
import bisq.core.locale.CountryUtil;
|
import bisq.core.locale.CountryUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -56,7 +56,7 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
|
||||||
@Nullable
|
@Nullable
|
||||||
protected String nationalAccountId;
|
protected String nationalAccountId;
|
||||||
|
|
||||||
public BankAccountPayload(String paymentMethod, String id) {
|
protected BankAccountPayload(String paymentMethod, String id) {
|
||||||
super(paymentMethod, id);
|
super(paymentMethod, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,20 +64,19 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
|
||||||
// PROTO BUFFER
|
// PROTO BUFFER
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@SuppressWarnings("NullableProblems")
|
|
||||||
protected BankAccountPayload(String paymentMethodName,
|
protected BankAccountPayload(String paymentMethodName,
|
||||||
String id,
|
String id,
|
||||||
String countryCode,
|
String countryCode,
|
||||||
String holderName,
|
String holderName,
|
||||||
String bankName,
|
@Nullable String bankName,
|
||||||
String branchId,
|
@Nullable String branchId,
|
||||||
String accountNr,
|
@Nullable String accountNr,
|
||||||
String accountType,
|
@Nullable String accountType,
|
||||||
String holderTaxId,
|
@Nullable String holderTaxId,
|
||||||
String bankId,
|
@Nullable String bankId,
|
||||||
String nationalAccountId,
|
@Nullable String nationalAccountId,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -178,6 +177,6 @@ public abstract class BankAccountPayload extends CountryBasedPaymentAccountPaylo
|
||||||
holderTaxIdString +
|
holderTaxIdString +
|
||||||
nationalAccountId;
|
nationalAccountId;
|
||||||
|
|
||||||
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(all.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -80,7 +78,7 @@ public final class CashAppAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getCashAppAccountPayload().getCashTag(),
|
proto.getCashAppAccountPayload().getCashTag(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -100,6 +98,6 @@ public final class CashAppAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(cashTag.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(cashTag.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,9 @@ import bisq.core.locale.BankUtil;
|
||||||
import bisq.core.locale.CountryUtil;
|
import bisq.core.locale.CountryUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -88,7 +86,7 @@ public class CashDepositAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
@Nullable String bankId,
|
@Nullable String bankId,
|
||||||
@Nullable String nationalAccountId,
|
@Nullable String nationalAccountId,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -146,7 +144,7 @@ public class CashDepositAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
cashDepositAccountPayload.getBankId().isEmpty() ? null : cashDepositAccountPayload.getBankId(),
|
cashDepositAccountPayload.getBankId().isEmpty() ? null : cashDepositAccountPayload.getBankId(),
|
||||||
cashDepositAccountPayload.getNationalAccountId().isEmpty() ? null : cashDepositAccountPayload.getNationalAccountId(),
|
cashDepositAccountPayload.getNationalAccountId().isEmpty() ? null : cashDepositAccountPayload.getNationalAccountId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -224,6 +222,6 @@ public class CashDepositAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
holderTaxIdString +
|
holderTaxIdString +
|
||||||
nationalAccountId;
|
nationalAccountId;
|
||||||
|
|
||||||
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(all.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -59,7 +55,7 @@ public final class ChaseQuickPayAccountPayload extends PaymentAccountPayload {
|
||||||
String email,
|
String email,
|
||||||
String holderName,
|
String holderName,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -84,7 +80,7 @@ public final class ChaseQuickPayAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getChaseQuickPayAccountPayload().getEmail(),
|
proto.getChaseQuickPayAccountPayload().getEmail(),
|
||||||
proto.getChaseQuickPayAccountPayload().getHolderName(),
|
proto.getChaseQuickPayAccountPayload().getHolderName(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +90,8 @@ public final class ChaseQuickPayAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " + Res.get("payment.email") + " " + email;
|
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
|
||||||
|
Res.get("payment.email") + " " + email;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,6 +104,6 @@ public final class ChaseQuickPayAccountPayload extends PaymentAccountPayload {
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
||||||
// slight changes in holder name (e.g. add or remove middle name)
|
// slight changes in holder name (e.g. add or remove middle name)
|
||||||
return super.getAgeWitnessInputData(email.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(email.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -59,7 +55,7 @@ public final class ClearXchangeAccountPayload extends PaymentAccountPayload {
|
||||||
String emailOrMobileNr,
|
String emailOrMobileNr,
|
||||||
String holderName,
|
String holderName,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -84,7 +80,7 @@ public final class ClearXchangeAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getClearXchangeAccountPayload().getEmailOrMobileNr(),
|
proto.getClearXchangeAccountPayload().getEmailOrMobileNr(),
|
||||||
proto.getClearXchangeAccountPayload().getHolderName(),
|
proto.getClearXchangeAccountPayload().getHolderName(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +90,8 @@ public final class ClearXchangeAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " + Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr;
|
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
|
||||||
|
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,6 +104,6 @@ public final class ClearXchangeAccountPayload extends PaymentAccountPayload {
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
||||||
// slight changes in holder name (e.g. add or remove middle name)
|
// slight changes in holder name (e.g. add or remove middle name)
|
||||||
return super.getAgeWitnessInputData(emailOrMobileNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(emailOrMobileNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,10 +17,9 @@
|
||||||
|
|
||||||
package bisq.core.payment.payload;
|
package bisq.core.payment.payload;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -30,8 +29,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -48,7 +45,7 @@ public abstract class CountryBasedPaymentAccountPayload extends PaymentAccountPa
|
||||||
String id,
|
String id,
|
||||||
String countryCode,
|
String countryCode,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -71,6 +68,6 @@ public abstract class CountryBasedPaymentAccountPayload extends PaymentAccountPa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected byte[] getAgeWitnessInputData(byte[] data) {
|
protected byte[] getAgeWitnessInputData(byte[] data) {
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(countryCode.getBytes(Charset.forName("UTF-8")), data));
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(countryCode.getBytes(StandardCharsets.UTF_8), data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,6 @@
|
||||||
|
|
||||||
package bisq.core.payment.payload;
|
package bisq.core.payment.payload;
|
||||||
|
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -31,8 +28,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -53,7 +48,7 @@ public final class CryptoCurrencyAccountPayload extends AssetsAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String address,
|
String address,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
address,
|
address,
|
||||||
|
@ -74,7 +69,6 @@ public final class CryptoCurrencyAccountPayload extends AssetsAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getCryptoCurrencyAccountPayload().getAddress(),
|
proto.getCryptoCurrencyAccountPayload().getAddress(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,13 +19,11 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -36,8 +34,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -64,7 +60,7 @@ public final class F2FAccountPayload extends CountryBasedPaymentAccountPayload {
|
||||||
String city,
|
String city,
|
||||||
String extraInfo,
|
String extraInfo,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -99,7 +95,7 @@ public final class F2FAccountPayload extends CountryBasedPaymentAccountPayload {
|
||||||
f2fAccountPayloadPB.getCity(),
|
f2fAccountPayloadPB.getCity(),
|
||||||
f2fAccountPayloadPB.getExtraInfo(),
|
f2fAccountPayloadPB.getExtraInfo(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,7 +121,7 @@ public final class F2FAccountPayload extends CountryBasedPaymentAccountPayload {
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We use here the city because the address alone seems to be too weak
|
// We use here the city because the address alone seems to be too weak
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(contact.getBytes(Charset.forName("UTF-8")),
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(contact.getBytes(StandardCharsets.UTF_8),
|
||||||
city.getBytes(Charset.forName("UTF-8"))));
|
city.getBytes(StandardCharsets.UTF_8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,13 +19,13 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -36,8 +36,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -64,7 +62,7 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
|
||||||
String accountNr,
|
String accountNr,
|
||||||
String email,
|
String email,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -91,7 +89,7 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getFasterPaymentsAccountPayload().getAccountNr(),
|
proto.getFasterPaymentsAccountPayload().getAccountNr(),
|
||||||
proto.getFasterPaymentsAccountPayload().getEmail(),
|
proto.getFasterPaymentsAccountPayload().getEmail(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,20 +97,29 @@ public final class FasterPaymentsAccountPayload extends PaymentAccountPayload {
|
||||||
// API
|
// API
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
public String getHolderName() {
|
||||||
|
return excludeFromJsonDataMap.getOrDefault(HOLDER_NAME, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHolderName(String holderName) {
|
||||||
|
excludeFromJsonDataMap.compute(HOLDER_NAME, (k, v) -> Strings.emptyToNull(holderName));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - UK Sort code: " + sortCode + ", " + Res.getWithCol("payment.accountNr") + " " + accountNr;
|
return Res.get(paymentMethodId) + " - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetailsForTradePopup() {
|
public String getPaymentDetailsForTradePopup() {
|
||||||
return "UK Sort code: " + sortCode + "\n" +
|
return (getHolderName().isEmpty() ? "" : Res.getWithCol("payment.account.owner") + " " + getHolderName() + "\n") +
|
||||||
|
"UK Sort code: " + sortCode + "\n" +
|
||||||
Res.getWithCol("payment.accountNr") + " " + accountNr;
|
Res.getWithCol("payment.accountNr") + " " + accountNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(sortCode.getBytes(Charset.forName("UTF-8")),
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(sortCode.getBytes(StandardCharsets.UTF_8),
|
||||||
accountNr.getBytes(Charset.forName("UTF-8"))));
|
accountNr.getBytes(StandardCharsets.UTF_8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -56,7 +52,7 @@ public final class HalCashAccountPayload extends PaymentAccountPayload {
|
||||||
private HalCashAccountPayload(String paymentMethod, String id,
|
private HalCashAccountPayload(String paymentMethod, String id,
|
||||||
String mobileNr,
|
String mobileNr,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -77,7 +73,7 @@ public final class HalCashAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getHalCashAccountPayload().getMobileNr(),
|
proto.getHalCashAccountPayload().getMobileNr(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,6 +93,6 @@ public final class HalCashAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(mobileNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(mobileNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,6 @@
|
||||||
|
|
||||||
package bisq.core.payment.payload;
|
package bisq.core.payment.payload;
|
||||||
|
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -31,8 +28,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -53,7 +48,7 @@ public final class InstantCryptoCurrencyPayload extends AssetsAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String address,
|
String address,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
address,
|
address,
|
||||||
|
@ -74,6 +69,6 @@ public final class InstantCryptoCurrencyPayload extends AssetsAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getInstantCryptoCurrencyAccountPayload().getAddress(),
|
proto.getInstantCryptoCurrencyAccountPayload().getAddress(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,13 +19,11 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -36,8 +34,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -65,7 +61,7 @@ public final class InteracETransferAccountPayload extends PaymentAccountPayload
|
||||||
String question,
|
String question,
|
||||||
String answer,
|
String answer,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -95,7 +91,7 @@ public final class InteracETransferAccountPayload extends PaymentAccountPayload
|
||||||
proto.getInteracETransferAccountPayload().getQuestion(),
|
proto.getInteracETransferAccountPayload().getQuestion(),
|
||||||
proto.getInteracETransferAccountPayload().getAnswer(),
|
proto.getInteracETransferAccountPayload().getAnswer(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -120,8 +116,8 @@ public final class InteracETransferAccountPayload extends PaymentAccountPayload
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(email.getBytes(Charset.forName("UTF-8")),
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(email.getBytes(StandardCharsets.UTF_8),
|
||||||
ArrayUtils.addAll(question.getBytes(Charset.forName("UTF-8")),
|
ArrayUtils.addAll(question.getBytes(StandardCharsets.UTF_8),
|
||||||
answer.getBytes(Charset.forName("UTF-8")))));
|
answer.getBytes(StandardCharsets.UTF_8))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -61,16 +59,16 @@ public final class JapanBankAccountPayload extends PaymentAccountPayload {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private JapanBankAccountPayload(String paymentMethod,
|
private JapanBankAccountPayload(String paymentMethod,
|
||||||
String id,
|
String id,
|
||||||
String bankName,
|
String bankName,
|
||||||
String bankCode,
|
String bankCode,
|
||||||
String bankBranchName,
|
String bankBranchName,
|
||||||
String bankBranchCode,
|
String bankBranchCode,
|
||||||
String bankAccountType,
|
String bankAccountType,
|
||||||
String bankAccountName,
|
String bankAccountName,
|
||||||
String bankAccountNumber,
|
String bankAccountNumber,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -90,13 +88,13 @@ public final class JapanBankAccountPayload extends PaymentAccountPayload {
|
||||||
return getPaymentAccountPayloadBuilder()
|
return getPaymentAccountPayloadBuilder()
|
||||||
.setJapanBankAccountPayload(
|
.setJapanBankAccountPayload(
|
||||||
protobuf.JapanBankAccountPayload.newBuilder()
|
protobuf.JapanBankAccountPayload.newBuilder()
|
||||||
.setBankName(bankName)
|
.setBankName(bankName)
|
||||||
.setBankCode(bankCode)
|
.setBankCode(bankCode)
|
||||||
.setBankBranchName(bankBranchName)
|
.setBankBranchName(bankBranchName)
|
||||||
.setBankBranchCode(bankBranchCode)
|
.setBankBranchCode(bankBranchCode)
|
||||||
.setBankAccountType(bankAccountType)
|
.setBankAccountType(bankAccountType)
|
||||||
.setBankAccountName(bankAccountName)
|
.setBankAccountName(bankAccountName)
|
||||||
.setBankAccountNumber(bankAccountNumber)
|
.setBankAccountNumber(bankAccountNumber)
|
||||||
).build();
|
).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +110,7 @@ public final class JapanBankAccountPayload extends PaymentAccountPayload {
|
||||||
japanBankAccountPayload.getBankAccountName(),
|
japanBankAccountPayload.getBankAccountName(),
|
||||||
japanBankAccountPayload.getBankAccountNumber(),
|
japanBankAccountPayload.getBankAccountNumber(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,24 +119,22 @@ public final class JapanBankAccountPayload extends PaymentAccountPayload {
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails()
|
public String getPaymentDetails() {
|
||||||
{
|
|
||||||
return Res.get(paymentMethodId) + " - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
|
return Res.get(paymentMethodId) + " - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetailsForTradePopup()
|
public String getPaymentDetailsForTradePopup() {
|
||||||
{
|
return Res.get("payment.japan.bank") + ": " + bankName + "(" + bankCode + ")\n" +
|
||||||
return
|
Res.get("payment.japan.branch") + ": " + bankBranchName + "(" + bankBranchCode + ")\n" +
|
||||||
Res.get("payment.japan.bank") + ": " + bankName + "(" + bankCode + ")\n" +
|
Res.get("payment.japan.account") + ": " + bankAccountType + " " + bankAccountNumber + "\n" +
|
||||||
Res.get("payment.japan.branch") + ": " + bankBranchName + "(" + bankBranchCode + ")\n" +
|
Res.get("payment.japan.recipient") + ": " + bankAccountName;
|
||||||
Res.get("payment.japan.account") + ": " + bankAccountType + " " + bankAccountNumber + "\n" + Res.get("payment.japan.recipient") + ": " + bankAccountName;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
String all = this.bankName + this.bankBranchName + this.bankAccountType + this.bankAccountNumber + this.bankAccountName;
|
String all = this.bankName + this.bankBranchName + this.bankAccountType + this.bankAccountNumber + this.bankAccountName;
|
||||||
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(all.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -77,7 +75,7 @@ public final class MoneyBeamAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getMoneyBeamAccountPayload().getAccountId(),
|
proto.getMoneyBeamAccountPayload().getAccountId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,6 +95,6 @@ public final class MoneyBeamAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountId.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountId.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,9 @@ import bisq.core.locale.BankUtil;
|
||||||
import bisq.core.locale.CountryUtil;
|
import bisq.core.locale.CountryUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -36,8 +34,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -65,7 +61,7 @@ public class MoneyGramAccountPayload extends PaymentAccountPayload {
|
||||||
String state,
|
String state,
|
||||||
String email,
|
String email,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -99,7 +95,7 @@ public class MoneyGramAccountPayload extends PaymentAccountPayload {
|
||||||
moneyGramAccountPayload.getState(),
|
moneyGramAccountPayload.getState(),
|
||||||
moneyGramAccountPayload.getEmail(),
|
moneyGramAccountPayload.getEmail(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -128,6 +124,6 @@ public class MoneyGramAccountPayload extends PaymentAccountPayload {
|
||||||
this.state +
|
this.state +
|
||||||
this.holderName +
|
this.holderName +
|
||||||
this.email;
|
this.email;
|
||||||
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(all.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -30,8 +28,6 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -58,7 +54,7 @@ public final class NationalBankAccountPayload extends BankAccountPayload {
|
||||||
String bankId,
|
String bankId,
|
||||||
String nationalAccountId,
|
String nationalAccountId,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -105,7 +101,7 @@ public final class NationalBankAccountPayload extends BankAccountPayload {
|
||||||
bankAccountPayloadPB.getBankId().isEmpty() ? null : bankAccountPayloadPB.getBankId(),
|
bankAccountPayloadPB.getBankId().isEmpty() ? null : bankAccountPayloadPB.getBankId(),
|
||||||
bankAccountPayloadPB.getNationalAccountId().isEmpty() ? null : bankAccountPayloadPB.getNationalAccountId(),
|
bankAccountPayloadPB.getNationalAccountId().isEmpty() ? null : bankAccountPayloadPB.getNationalAccountId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -79,7 +77,7 @@ public final class OKPayAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getOKPayAccountPayload().getAccountNr(),
|
proto.getOKPayAccountPayload().getAccountNr(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,6 +97,6 @@ public final class OKPayAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,21 +25,17 @@ import bisq.common.util.Utilities;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import static com.google.common.base.Preconditions.checkArgument;
|
import static com.google.common.base.Preconditions.checkArgument;
|
||||||
import static com.google.common.base.Preconditions.checkNotNull;
|
|
||||||
|
|
||||||
// That class is used in the contract for creating the contract json. Any change will break the contract.
|
// That class is used in the contract for creating the contract json. Any change will break the contract.
|
||||||
// If a field gets added it need to be be annotated with @JsonExclude (excluded from contract).
|
// If a field gets added it need to be be annotated with @JsonExclude (excluded from contract).
|
||||||
|
@ -53,6 +49,7 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
|
|
||||||
// Keys for excludeFromJsonDataMap
|
// Keys for excludeFromJsonDataMap
|
||||||
public static final String SALT = "salt";
|
public static final String SALT = "salt";
|
||||||
|
public static final String HOLDER_NAME = "holderName";
|
||||||
|
|
||||||
protected final String paymentMethodId;
|
protected final String paymentMethodId;
|
||||||
protected final String id;
|
protected final String id;
|
||||||
|
@ -67,7 +64,6 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
// PaymentAccountPayload is used for the json contract and a trade with a user who has an older version would
|
// PaymentAccountPayload is used for the json contract and a trade with a user who has an older version would
|
||||||
// fail the contract verification.
|
// fail the contract verification.
|
||||||
@JsonExclude
|
@JsonExclude
|
||||||
@Nullable
|
|
||||||
protected final Map<String, String> excludeFromJsonDataMap;
|
protected final Map<String, String> excludeFromJsonDataMap;
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,7 +75,7 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
this(paymentMethodId,
|
this(paymentMethodId,
|
||||||
id,
|
id,
|
||||||
-1,
|
-1,
|
||||||
null);
|
new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -89,11 +85,11 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
protected PaymentAccountPayload(String paymentMethodId,
|
protected PaymentAccountPayload(String paymentMethodId,
|
||||||
String id,
|
String id,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMapParam) {
|
Map<String, String> excludeFromJsonDataMapParam) {
|
||||||
this.paymentMethodId = paymentMethodId;
|
this.paymentMethodId = paymentMethodId;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.maxTradePeriod = maxTradePeriod;
|
this.maxTradePeriod = maxTradePeriod;
|
||||||
this.excludeFromJsonDataMap = excludeFromJsonDataMapParam == null ? new HashMap<>() : excludeFromJsonDataMapParam;
|
this.excludeFromJsonDataMap = excludeFromJsonDataMapParam;
|
||||||
|
|
||||||
// If not set (old versions) we set by default a random 256 bit salt.
|
// If not set (old versions) we set by default a random 256 bit salt.
|
||||||
// User can set salt as well by hex string.
|
// User can set salt as well by hex string.
|
||||||
|
@ -108,7 +104,7 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
.setMaxTradePeriod(maxTradePeriod)
|
.setMaxTradePeriod(maxTradePeriod)
|
||||||
.setId(id);
|
.setId(id);
|
||||||
|
|
||||||
Optional.ofNullable(excludeFromJsonDataMap).ifPresent(builder::putAllExcludeFromJsonData);
|
builder.putAllExcludeFromJsonData(excludeFromJsonDataMap);
|
||||||
|
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
@ -123,13 +119,11 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
public abstract String getPaymentDetailsForTradePopup();
|
public abstract String getPaymentDetailsForTradePopup();
|
||||||
|
|
||||||
public byte[] getSalt() {
|
public byte[] getSalt() {
|
||||||
checkNotNull(excludeFromJsonDataMap, "excludeFromJsonDataMap must not be null");
|
|
||||||
checkArgument(excludeFromJsonDataMap.containsKey(SALT), "Salt must have been set in excludeFromJsonDataMap.");
|
checkArgument(excludeFromJsonDataMap.containsKey(SALT), "Salt must have been set in excludeFromJsonDataMap.");
|
||||||
return Utilities.decodeFromHex(excludeFromJsonDataMap.get(SALT));
|
return Utilities.decodeFromHex(excludeFromJsonDataMap.get(SALT));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSalt(byte[] salt) {
|
public void setSalt(byte[] salt) {
|
||||||
checkNotNull(excludeFromJsonDataMap, "excludeFromJsonDataMap must not be null");
|
|
||||||
excludeFromJsonDataMap.put(SALT, Utilities.encodeToHex(salt));
|
excludeFromJsonDataMap.put(SALT, Utilities.encodeToHex(salt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,6 +133,6 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr
|
||||||
public abstract byte[] getAgeWitnessInputData();
|
public abstract byte[] getAgeWitnessInputData();
|
||||||
|
|
||||||
protected byte[] getAgeWitnessInputData(byte[] data) {
|
protected byte[] getAgeWitnessInputData(byte[] data) {
|
||||||
return ArrayUtils.addAll(paymentMethodId.getBytes(Charset.forName("UTF-8")), data);
|
return ArrayUtils.addAll(paymentMethodId.getBytes(StandardCharsets.UTF_8), data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -57,7 +53,7 @@ public final class PerfectMoneyAccountPayload extends PaymentAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String accountNr,
|
String accountNr,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -79,7 +75,7 @@ public final class PerfectMoneyAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getPerfectMoneyAccountPayload().getAccountNr(),
|
proto.getPerfectMoneyAccountPayload().getAccountNr(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,6 +95,6 @@ public final class PerfectMoneyAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -82,7 +80,7 @@ public final class PopmoneyAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getPopmoneyAccountPayload().getAccountId(),
|
proto.getPopmoneyAccountPayload().getAccountId(),
|
||||||
proto.getPopmoneyAccountPayload().getHolderName(),
|
proto.getPopmoneyAccountPayload().getHolderName(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,6 +101,6 @@ public final class PopmoneyAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountId.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountId.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -56,7 +52,7 @@ public final class PromptPayAccountPayload extends PaymentAccountPayload {
|
||||||
private PromptPayAccountPayload(String paymentMethod, String id,
|
private PromptPayAccountPayload(String paymentMethod, String id,
|
||||||
String promptPayId,
|
String promptPayId,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -78,7 +74,7 @@ public final class PromptPayAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getPromptPayAccountPayload().getPromptPayId(),
|
proto.getPromptPayAccountPayload().getPromptPayId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -98,6 +94,6 @@ public final class PromptPayAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(promptPayId.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(promptPayId.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -77,7 +75,7 @@ public final class RevolutAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getRevolutAccountPayload().getAccountId(),
|
proto.getRevolutAccountPayload().getAccountId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,6 +95,6 @@ public final class RevolutAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountId.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountId.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -30,8 +28,6 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -58,7 +54,7 @@ public final class SameBankAccountPayload extends BankAccountPayload {
|
||||||
String bankId,
|
String bankId,
|
||||||
String nationalAccountId,
|
String nationalAccountId,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -72,7 +68,6 @@ public final class SameBankAccountPayload extends BankAccountPayload {
|
||||||
nationalAccountId,
|
nationalAccountId,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
excludeFromJsonDataMap);
|
excludeFromJsonDataMap);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -106,7 +101,7 @@ public final class SameBankAccountPayload extends BankAccountPayload {
|
||||||
bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId(),
|
bankAccountPayload.getBankId().isEmpty() ? null : bankAccountPayload.getBankId(),
|
||||||
bankAccountPayload.getNationalAccountId().isEmpty() ? null : bankAccountPayload.getNationalAccountId(),
|
bankAccountPayload.getNationalAccountId().isEmpty() ? null : bankAccountPayload.getNationalAccountId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -21,19 +21,16 @@ import bisq.core.locale.Country;
|
||||||
import bisq.core.locale.CountryUtil;
|
import bisq.core.locale.CountryUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -42,8 +39,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -57,15 +52,16 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
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
|
||||||
|
|
||||||
// Dont 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> acceptedCountryCodes;
|
private final List<String> acceptedCountryCodes;
|
||||||
|
|
||||||
public SepaAccountPayload(String paymentMethod, String id, List<Country> acceptedCountries) {
|
public SepaAccountPayload(String paymentMethod, String id, List<Country> acceptedCountries) {
|
||||||
super(paymentMethod, id);
|
super(paymentMethod, id);
|
||||||
Set<String> acceptedCountryCodesAsSet = acceptedCountries.stream()
|
acceptedCountryCodes = acceptedCountries.stream()
|
||||||
.map(e -> e.code).collect(Collectors.toSet());
|
.map(e -> e.code)
|
||||||
acceptedCountryCodes = new ArrayList<>(acceptedCountryCodesAsSet);
|
.sorted()
|
||||||
acceptedCountryCodes.sort(String::compareTo);
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +78,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
String email,
|
String email,
|
||||||
List<String> acceptedCountryCodes,
|
List<String> acceptedCountryCodes,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -125,7 +121,7 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
sepaAccountPayloadPB.getEmail(),
|
sepaAccountPayloadPB.getEmail(),
|
||||||
new ArrayList<>(sepaAccountPayloadPB.getAcceptedCountryCodesList()),
|
new ArrayList<>(sepaAccountPayloadPB.getAcceptedCountryCodesList()),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -139,13 +135,13 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAcceptedCountry(String countryCode) {
|
public void removeAcceptedCountry(String countryCode) {
|
||||||
if (acceptedCountryCodes.contains(countryCode))
|
acceptedCountryCodes.remove(countryCode);
|
||||||
acceptedCountryCodes.remove(countryCode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " + iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode();
|
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
|
||||||
|
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -160,6 +156,6 @@ public final class SepaAccountPayload extends CountryBasedPaymentAccountPayload
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
||||||
// slight changes in holder name (e.g. add or remove middle name)
|
// slight changes in holder name (e.g. add or remove middle name)
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(iban.getBytes(Charset.forName("UTF-8")), bic.getBytes(Charset.forName("UTF-8"))));
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(iban.getBytes(StandardCharsets.UTF_8), bic.getBytes(StandardCharsets.UTF_8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,19 +21,16 @@ import bisq.core.locale.Country;
|
||||||
import bisq.core.locale.CountryUtil;
|
import bisq.core.locale.CountryUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -42,8 +39,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Getter
|
@Getter
|
||||||
|
@ -61,10 +56,11 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
|
|
||||||
public SepaInstantAccountPayload(String paymentMethod, String id, List<Country> acceptedCountries) {
|
public SepaInstantAccountPayload(String paymentMethod, String id, List<Country> acceptedCountries) {
|
||||||
super(paymentMethod, id);
|
super(paymentMethod, id);
|
||||||
Set<String> acceptedCountryCodesAsSet = acceptedCountries.stream()
|
acceptedCountryCodes = acceptedCountries.stream()
|
||||||
.map(e -> e.code).collect(Collectors.toSet());
|
.map(e -> e.code)
|
||||||
acceptedCountryCodes = new ArrayList<>(acceptedCountryCodesAsSet);
|
.sorted()
|
||||||
acceptedCountryCodes.sort(String::compareTo);
|
.distinct()
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -80,7 +76,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
String bic,
|
String bic,
|
||||||
List<String> acceptedCountryCodes,
|
List<String> acceptedCountryCodes,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -120,7 +116,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
sepaInstantAccountPayloadPB.getBic(),
|
sepaInstantAccountPayloadPB.getBic(),
|
||||||
new ArrayList<>(sepaInstantAccountPayloadPB.getAcceptedCountryCodesList()),
|
new ArrayList<>(sepaInstantAccountPayloadPB.getAcceptedCountryCodesList()),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -134,8 +130,7 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAcceptedCountry(String countryCode) {
|
public void removeAcceptedCountry(String countryCode) {
|
||||||
if (acceptedCountryCodes.contains(countryCode))
|
acceptedCountryCodes.remove(countryCode);
|
||||||
acceptedCountryCodes.remove(countryCode);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -156,6 +151,6 @@ public final class SepaInstantAccountPayload extends CountryBasedPaymentAccountP
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
||||||
// slight changes in holder name (e.g. add or remove middle name)
|
// slight changes in holder name (e.g. add or remove middle name)
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(iban.getBytes(Charset.forName("UTF-8")), bic.getBytes(Charset.forName("UTF-8"))));
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(iban.getBytes(StandardCharsets.UTF_8), bic.getBytes(StandardCharsets.UTF_8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,8 +19,6 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
import com.google.common.base.Joiner;
|
||||||
|
@ -34,14 +32,12 @@ import lombok.Getter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Getter
|
@Getter
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public final class SpecificBanksAccountPayload extends BankAccountPayload {
|
public final class SpecificBanksAccountPayload extends BankAccountPayload {
|
||||||
// Dont 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 ArrayList<String> acceptedBanks = new ArrayList<>();
|
private ArrayList<String> acceptedBanks = new ArrayList<>();
|
||||||
|
|
||||||
public SpecificBanksAccountPayload(String paymentMethod, String id) {
|
public SpecificBanksAccountPayload(String paymentMethod, String id) {
|
||||||
|
@ -66,7 +62,7 @@ public final class SpecificBanksAccountPayload extends BankAccountPayload {
|
||||||
String nationalAccountId,
|
String nationalAccountId,
|
||||||
ArrayList<String> acceptedBanks,
|
ArrayList<String> acceptedBanks,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -120,7 +116,7 @@ public final class SpecificBanksAccountPayload extends BankAccountPayload {
|
||||||
bankAccountPayload.getNationalAccountId().isEmpty() ? null : bankAccountPayload.getNationalAccountId(),
|
bankAccountPayload.getNationalAccountId().isEmpty() ? null : bankAccountPayload.getNationalAccountId(),
|
||||||
new ArrayList<>(specificBanksAccountPayload.getAcceptedBanksList()),
|
new ArrayList<>(specificBanksAccountPayload.getAcceptedBanksList()),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -34,8 +32,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -58,7 +54,7 @@ public final class SwishAccountPayload extends PaymentAccountPayload {
|
||||||
String mobileNr,
|
String mobileNr,
|
||||||
String holderName,
|
String holderName,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -82,7 +78,7 @@ public final class SwishAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getSwishAccountPayload().getMobileNr(),
|
proto.getSwishAccountPayload().getMobileNr(),
|
||||||
proto.getSwishAccountPayload().getHolderName(),
|
proto.getSwishAccountPayload().getHolderName(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +102,6 @@ public final class SwishAccountPayload extends PaymentAccountPayload {
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
// We don't add holderName because we don't want to break age validation if the user recreates an account with
|
||||||
// slight changes in holder name (e.g. add or remove middle name)
|
// slight changes in holder name (e.g. add or remove middle name)
|
||||||
return super.getAgeWitnessInputData(mobileNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(mobileNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,13 +19,11 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -36,8 +34,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -60,7 +56,7 @@ public final class USPostalMoneyOrderAccountPayload extends PaymentAccountPayloa
|
||||||
String postalAddress,
|
String postalAddress,
|
||||||
String holderName,
|
String holderName,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -84,7 +80,7 @@ public final class USPostalMoneyOrderAccountPayload extends PaymentAccountPayloa
|
||||||
proto.getUSPostalMoneyOrderAccountPayload().getPostalAddress(),
|
proto.getUSPostalMoneyOrderAccountPayload().getPostalAddress(),
|
||||||
proto.getUSPostalMoneyOrderAccountPayload().getHolderName(),
|
proto.getUSPostalMoneyOrderAccountPayload().getHolderName(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -108,7 +104,7 @@ public final class USPostalMoneyOrderAccountPayload extends PaymentAccountPayloa
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
// We use here the holderName because the address alone seems to be too weak
|
// We use here the holderName because the address alone seems to be too weak
|
||||||
return super.getAgeWitnessInputData(ArrayUtils.addAll(holderName.getBytes(Charset.forName("UTF-8")),
|
return super.getAgeWitnessInputData(ArrayUtils.addAll(holderName.getBytes(StandardCharsets.UTF_8),
|
||||||
postalAddress.getBytes(Charset.forName("UTF-8"))));
|
postalAddress.getBytes(StandardCharsets.UTF_8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -77,7 +75,7 @@ public final class UpholdAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getUpholdAccountPayload().getAccountId(),
|
proto.getUpholdAccountPayload().getAccountId(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -97,6 +95,6 @@ public final class UpholdAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountId.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountId.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -85,7 +83,7 @@ public final class VenmoAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getVenmoAccountPayload().getVenmoUserName(),
|
proto.getVenmoAccountPayload().getVenmoUserName(),
|
||||||
proto.getVenmoAccountPayload().getHolderName(),
|
proto.getVenmoAccountPayload().getHolderName(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +104,6 @@ public final class VenmoAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(venmoUserName.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(venmoUserName.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,9 @@ package bisq.core.payment.payload;
|
||||||
|
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -33,8 +31,6 @@ import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -55,7 +51,7 @@ public final class WeChatPayAccountPayload extends PaymentAccountPayload {
|
||||||
String id,
|
String id,
|
||||||
String accountNr,
|
String accountNr,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethod,
|
super(paymentMethod,
|
||||||
id,
|
id,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
|
@ -76,7 +72,7 @@ public final class WeChatPayAccountPayload extends PaymentAccountPayload {
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
proto.getWeChatPayAccountPayload().getAccountNr(),
|
proto.getWeChatPayAccountPayload().getAccountNr(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,6 +92,6 @@ public final class WeChatPayAccountPayload extends PaymentAccountPayload {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
return super.getAgeWitnessInputData(accountNr.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(accountNr.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,9 @@ import bisq.core.locale.BankUtil;
|
||||||
import bisq.core.locale.CountryUtil;
|
import bisq.core.locale.CountryUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
|
|
||||||
import bisq.common.util.CollectionUtils;
|
|
||||||
|
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
|
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -36,8 +34,6 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -66,7 +62,7 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
String state,
|
String state,
|
||||||
String email,
|
String email,
|
||||||
long maxTradePeriod,
|
long maxTradePeriod,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
|
@ -106,7 +102,7 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
westernUnionAccountPayload.getState(),
|
westernUnionAccountPayload.getState(),
|
||||||
westernUnionAccountPayload.getEmail(),
|
westernUnionAccountPayload.getEmail(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -121,7 +117,8 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetailsForTradePopup() {
|
public String getPaymentDetailsForTradePopup() {
|
||||||
String cityState = BankUtil.isStateRequired(countryCode) ? (Res.get("payment.account.city") + " / " + Res.getWithCol("payment.account.state") + " " + city + " / " + state + "\n")
|
String cityState = BankUtil.isStateRequired(countryCode)
|
||||||
|
? (Res.get("payment.account.city") + " / " + Res.getWithCol("payment.account.state") + " " + city + " / " + state + "\n")
|
||||||
: (Res.getWithCol("payment.account.city") + " " + city + "\n");
|
: (Res.getWithCol("payment.account.city") + " " + city + "\n");
|
||||||
return Res.getWithCol("payment.account.fullName") + " " + holderName + "\n" +
|
return Res.getWithCol("payment.account.fullName") + " " + holderName + "\n" +
|
||||||
cityState +
|
cityState +
|
||||||
|
@ -134,6 +131,6 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
String all = this.countryCode +
|
String all = this.countryCode +
|
||||||
this.holderName +
|
this.holderName +
|
||||||
this.email;
|
this.email;
|
||||||
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(all.getBytes(StandardCharsets.UTF_8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -621,9 +621,9 @@ portfolio.pending.step2_buyer.halCashInfo.headline=Send HalCash code
|
||||||
portfolio.pending.step2_buyer.halCashInfo.msg=You need to send a text message with the HalCash code as well as the \
|
portfolio.pending.step2_buyer.halCashInfo.msg=You need to send a text message with the HalCash code as well as the \
|
||||||
trade ID ({0}) to the BTC seller.\nThe seller''s mobile nr. is {1}.\n\n\
|
trade ID ({0}) to the BTC seller.\nThe seller''s mobile nr. is {1}.\n\n\
|
||||||
Did you send the code to the seller?
|
Did you send the code to the seller?
|
||||||
portfolio.pending.step2_buyer.fasterPaymentsHolderNameInfo=Some banks might require the receiver's name. \
|
portfolio.pending.step2_buyer.fasterPaymentsHolderNameInfo=Some banks might verify the receiver's name. \
|
||||||
The UK sort code and account number is sufficient for a Faster Payment transfer and the receivers name is not verified \
|
Faster Payments accounts created in old Bisq clients do not provide the receiver's name, \
|
||||||
by any of the banks.
|
so please use trade chat to obtain it (if needed).
|
||||||
portfolio.pending.step2_buyer.confirmStart.headline=Confirm that you have started the payment
|
portfolio.pending.step2_buyer.confirmStart.headline=Confirm that you have started the payment
|
||||||
portfolio.pending.step2_buyer.confirmStart.msg=Did you initiate the {0} payment to your trading partner?
|
portfolio.pending.step2_buyer.confirmStart.msg=Did you initiate the {0} payment to your trading partner?
|
||||||
portfolio.pending.step2_buyer.confirmStart.yes=Yes, I have started the payment
|
portfolio.pending.step2_buyer.confirmStart.yes=Yes, I have started the payment
|
||||||
|
@ -3015,7 +3015,12 @@ If you have not fulfilled the above requirements you will lose your security dep
|
||||||
For the {0} seller it is highly recommended \
|
For the {0} seller it is highly recommended \
|
||||||
to get in contact with the {1} buyer by using the provided email address or mobile number to verify that he or she \
|
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.
|
is really the owner of the Zelle (ClearXchange) account.
|
||||||
|
payment.fasterPayments.newRequirements.info=Some banks have started verifying the receiver''s full name for Faster \
|
||||||
|
Payments transfers. Your current Faster Payments account does not specify a full name.\n\n\
|
||||||
|
Please consider recreating your Faster Payments account in Bisq to provide future {0} buyers with a full name.\n\n\
|
||||||
|
When you recreate the account, make sure to copy the precise sort code, account number and account age verification \
|
||||||
|
salt values from your old account to your new account. This will ensure your existing account''s age and signing \
|
||||||
|
status are preserved.
|
||||||
payment.moneyGram.info=When using MoneyGram the BTC buyer has to send the Authorisation number and a photo of the receipt by email to the BTC seller. \
|
payment.moneyGram.info=When using MoneyGram the BTC buyer has to send the Authorisation number and a photo of the receipt by email to the BTC seller. \
|
||||||
The receipt must clearly show the seller's full name, country, state and the amount. The buyer will get displayed the seller's email in the trade process.
|
The receipt must clearly show the seller's full name, country, state and the amount. The buyer will get displayed the seller's email in the trade process.
|
||||||
payment.westernUnion.info=When using Western Union the BTC buyer has to send the MTCN (tracking number) and a photo of the receipt by email to the BTC seller. \
|
payment.westernUnion.info=When using Western Union the BTC buyer has to send the MTCN (tracking number) and a photo of the receipt by email to the BTC seller. \
|
||||||
|
|
|
@ -44,21 +44,30 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||||
|
|
||||||
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||||
PaymentAccountPayload paymentAccountPayload) {
|
PaymentAccountPayload paymentAccountPayload) {
|
||||||
|
if (!((FasterPaymentsAccountPayload) paymentAccountPayload).getHolderName().isEmpty()) {
|
||||||
|
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
|
||||||
|
((FasterPaymentsAccountPayload) paymentAccountPayload).getHolderName());
|
||||||
|
}
|
||||||
// do not translate as it is used in English only
|
// do not translate as it is used in English only
|
||||||
addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE,
|
addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE,
|
||||||
((FasterPaymentsAccountPayload) paymentAccountPayload).getSortCode());
|
((FasterPaymentsAccountPayload) paymentAccountPayload).getSortCode());
|
||||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"),
|
addCompactTopLabelTextField(gridPane, gridRow, 1, Res.get("payment.accountNr"),
|
||||||
((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr());
|
((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr());
|
||||||
return gridRow;
|
return gridRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private final FasterPaymentsAccount fasterPaymentsAccount;
|
private final FasterPaymentsAccount fasterPaymentsAccount;
|
||||||
|
private InputTextField holderNameInputTextField;
|
||||||
private InputTextField accountNrInputTextField;
|
private InputTextField accountNrInputTextField;
|
||||||
private InputTextField sortCodeInputTextField;
|
private InputTextField sortCodeInputTextField;
|
||||||
|
|
||||||
public FasterPaymentsForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator, GridPane gridPane,
|
public FasterPaymentsForm(PaymentAccount paymentAccount,
|
||||||
int gridRow, CoinFormatter formatter) {
|
AccountAgeWitnessService accountAgeWitnessService,
|
||||||
|
InputValidator inputValidator,
|
||||||
|
GridPane gridPane,
|
||||||
|
int gridRow,
|
||||||
|
CoinFormatter formatter) {
|
||||||
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
||||||
this.fasterPaymentsAccount = (FasterPaymentsAccount) paymentAccount;
|
this.fasterPaymentsAccount = (FasterPaymentsAccount) paymentAccount;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +75,13 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||||
@Override
|
@Override
|
||||||
public void addFormForAddAccount() {
|
public void addFormForAddAccount() {
|
||||||
gridRowFrom = gridRow + 1;
|
gridRowFrom = gridRow + 1;
|
||||||
|
holderNameInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("payment.account.owner"));
|
||||||
|
holderNameInputTextField.setValidator(inputValidator);
|
||||||
|
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
|
fasterPaymentsAccount.setHolderName(newValue);
|
||||||
|
updateFromInputs();
|
||||||
|
});
|
||||||
|
|
||||||
// do not translate as it is used in English only
|
// do not translate as it is used in English only
|
||||||
sortCodeInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, UK_SORT_CODE);
|
sortCodeInputTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, UK_SORT_CODE);
|
||||||
sortCodeInputTextField.setValidator(inputValidator);
|
sortCodeInputTextField.setValidator(inputValidator);
|
||||||
|
@ -102,6 +118,10 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||||
fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
|
||||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
|
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
|
||||||
Res.get(fasterPaymentsAccount.getPaymentMethod().getId()));
|
Res.get(fasterPaymentsAccount.getPaymentMethod().getId()));
|
||||||
|
if (!fasterPaymentsAccount.getHolderName().isEmpty()) {
|
||||||
|
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
|
||||||
|
fasterPaymentsAccount.getHolderName());
|
||||||
|
}
|
||||||
// do not translate as it is used in English only
|
// do not translate as it is used in English only
|
||||||
addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode());
|
addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode());
|
||||||
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"),
|
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"),
|
||||||
|
@ -116,6 +136,7 @@ public class FasterPaymentsForm extends PaymentMethodForm {
|
||||||
@Override
|
@Override
|
||||||
public void updateAllInputsValid() {
|
public void updateAllInputsValid() {
|
||||||
allInputsValid.set(isAccountNameValid()
|
allInputsValid.set(isAccountNameValid()
|
||||||
|
&& holderNameInputTextField.getValidator().validate(fasterPaymentsAccount.getHolderName()).isValid
|
||||||
&& sortCodeInputTextField.getValidator().validate(fasterPaymentsAccount.getSortCode()).isValid
|
&& sortCodeInputTextField.getValidator().validate(fasterPaymentsAccount.getSortCode()).isValid
|
||||||
&& accountNrInputTextField.getValidator().validate(fasterPaymentsAccount.getAccountNr()).isValid
|
&& accountNrInputTextField.getValidator().validate(fasterPaymentsAccount.getAccountNr()).isValid
|
||||||
&& fasterPaymentsAccount.getTradeCurrencies().size() > 0);
|
&& fasterPaymentsAccount.getTradeCurrencies().size() > 0);
|
||||||
|
|
|
@ -51,6 +51,7 @@ import bisq.core.locale.Res;
|
||||||
import bisq.core.locale.TradeCurrency;
|
import bisq.core.locale.TradeCurrency;
|
||||||
import bisq.core.offer.Offer;
|
import bisq.core.offer.Offer;
|
||||||
import bisq.core.offer.OfferPayload;
|
import bisq.core.offer.OfferPayload;
|
||||||
|
import bisq.core.payment.FasterPaymentsAccount;
|
||||||
import bisq.core.payment.PaymentAccount;
|
import bisq.core.payment.PaymentAccount;
|
||||||
import bisq.core.payment.payload.PaymentMethod;
|
import bisq.core.payment.payload.PaymentMethod;
|
||||||
import bisq.core.user.DontShowAgainLookup;
|
import bisq.core.user.DontShowAgainLookup;
|
||||||
|
@ -170,7 +171,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
||||||
|
|
||||||
protected int gridRow = 0;
|
protected int gridRow = 0;
|
||||||
private final List<Node> editOfferElements = new ArrayList<>();
|
private final List<Node> editOfferElements = new ArrayList<>();
|
||||||
private boolean clearXchangeWarningDisplayed, isActivated;
|
private boolean clearXchangeWarningDisplayed, fasterPaymentsWarningDisplayed, isActivated;
|
||||||
private InfoInputTextField marketBasedPriceInfoInputTextField, volumeInfoInputTextField,
|
private InfoInputTextField marketBasedPriceInfoInputTextField, volumeInfoInputTextField,
|
||||||
buyerSecurityDepositInfoInputTextField;
|
buyerSecurityDepositInfoInputTextField;
|
||||||
private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle;
|
private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle;
|
||||||
|
@ -492,8 +493,16 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
||||||
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.CLEAR_X_CHANGE_ID) &&
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.CLEAR_X_CHANGE_ID) &&
|
||||||
!clearXchangeWarningDisplayed) {
|
!clearXchangeWarningDisplayed) {
|
||||||
clearXchangeWarningDisplayed = true;
|
clearXchangeWarningDisplayed = true;
|
||||||
UserThread.runAfter(GUIUtil::showClearXchangeWarning,
|
UserThread.runAfter(GUIUtil::showClearXchangeWarning, 500, TimeUnit.MILLISECONDS);
|
||||||
500, TimeUnit.MILLISECONDS);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void maybeShowFasterPaymentsWarning(PaymentAccount paymentAccount) {
|
||||||
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.FASTER_PAYMENTS_ID) &&
|
||||||
|
((FasterPaymentsAccount) paymentAccount).getHolderName().isEmpty() &&
|
||||||
|
!fasterPaymentsWarningDisplayed) {
|
||||||
|
fasterPaymentsWarningDisplayed = true;
|
||||||
|
UserThread.runAfter(() -> GUIUtil.showFasterPaymentsWarning(navigation), 500, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -505,6 +514,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
|
||||||
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
|
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
|
||||||
if (paymentAccount != null) {
|
if (paymentAccount != null) {
|
||||||
maybeShowClearXchangeWarning(paymentAccount);
|
maybeShowClearXchangeWarning(paymentAccount);
|
||||||
|
maybeShowFasterPaymentsWarning(paymentAccount);
|
||||||
|
|
||||||
currencySelection.setVisible(paymentAccount.hasMultipleCurrencies());
|
currencySelection.setVisible(paymentAccount.hasMultipleCurrencies());
|
||||||
currencySelection.setManaged(paymentAccount.hasMultipleCurrencies());
|
currencySelection.setManaged(paymentAccount.hasMultipleCurrencies());
|
||||||
|
|
|
@ -51,6 +51,7 @@ import bisq.core.locale.CurrencyUtil;
|
||||||
import bisq.core.locale.Res;
|
import bisq.core.locale.Res;
|
||||||
import bisq.core.offer.Offer;
|
import bisq.core.offer.Offer;
|
||||||
import bisq.core.offer.OfferPayload;
|
import bisq.core.offer.OfferPayload;
|
||||||
|
import bisq.core.payment.FasterPaymentsAccount;
|
||||||
import bisq.core.payment.PaymentAccount;
|
import bisq.core.payment.PaymentAccount;
|
||||||
import bisq.core.payment.payload.PaymentMethod;
|
import bisq.core.payment.payload.PaymentMethod;
|
||||||
import bisq.core.user.DontShowAgainLookup;
|
import bisq.core.user.DontShowAgainLookup;
|
||||||
|
@ -159,7 +160,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
isOfferAvailableSubscription;
|
isOfferAvailableSubscription;
|
||||||
|
|
||||||
private int gridRow = 0;
|
private int gridRow = 0;
|
||||||
private boolean offerDetailsWindowDisplayed, clearXchangeWarningDisplayed;
|
private boolean offerDetailsWindowDisplayed, clearXchangeWarningDisplayed, fasterPaymentsWarningDisplayed;
|
||||||
private SimpleBooleanProperty errorPopupDisplayed;
|
private SimpleBooleanProperty errorPopupDisplayed;
|
||||||
private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener;
|
private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener;
|
||||||
private InfoInputTextField volumeInfoTextField;
|
private InfoInputTextField volumeInfoTextField;
|
||||||
|
@ -283,14 +284,14 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
priceDescriptionLabel.setText(CurrencyUtil.getPriceWithCurrencyCode(currencyCode));
|
priceDescriptionLabel.setText(CurrencyUtil.getPriceWithCurrencyCode(currencyCode));
|
||||||
volumeDescriptionLabel.setText(model.volumeDescriptionLabel.get());
|
volumeDescriptionLabel.setText(model.volumeDescriptionLabel.get());
|
||||||
|
|
||||||
if (model.getPossiblePaymentAccounts().size() > 1) {
|
PaymentAccount lastPaymentAccount = model.getLastSelectedPaymentAccount();
|
||||||
|
|
||||||
|
if (model.getPossiblePaymentAccounts().size() > 1) {
|
||||||
new Popup().headLine(Res.get("popup.info.multiplePaymentAccounts.headline"))
|
new Popup().headLine(Res.get("popup.info.multiplePaymentAccounts.headline"))
|
||||||
.information(Res.get("popup.info.multiplePaymentAccounts.msg"))
|
.information(Res.get("popup.info.multiplePaymentAccounts.msg"))
|
||||||
.dontShowAgainId("MultiplePaymentAccountsAvailableWarning")
|
.dontShowAgainId("MultiplePaymentAccountsAvailableWarning")
|
||||||
.show();
|
.show();
|
||||||
|
|
||||||
PaymentAccount lastPaymentAccount = model.getLastSelectedPaymentAccount();
|
|
||||||
paymentAccountsComboBox.setItems(model.getPossiblePaymentAccounts());
|
paymentAccountsComboBox.setItems(model.getPossiblePaymentAccounts());
|
||||||
paymentAccountsComboBox.getSelectionModel().select(lastPaymentAccount);
|
paymentAccountsComboBox.getSelectionModel().select(lastPaymentAccount);
|
||||||
model.onPaymentAccountSelected(lastPaymentAccount);
|
model.onPaymentAccountSelected(lastPaymentAccount);
|
||||||
|
@ -299,7 +300,8 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
|
|
||||||
balanceTextField.setTargetAmount(model.dataModel.getTotalToPayAsCoin().get());
|
balanceTextField.setTargetAmount(model.dataModel.getTotalToPayAsCoin().get());
|
||||||
|
|
||||||
maybeShowClearXchangeWarning();
|
maybeShowClearXchangeWarning(lastPaymentAccount);
|
||||||
|
maybeShowFasterPaymentsWarning(lastPaymentAccount);
|
||||||
|
|
||||||
if (!DevEnv.isDaoActivated() && !model.isRange()) {
|
if (!DevEnv.isDaoActivated() && !model.isRange()) {
|
||||||
nextButton.setVisible(false);
|
nextButton.setVisible(false);
|
||||||
|
@ -647,7 +649,6 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
takeOfferButton.disableProperty().unbind();
|
takeOfferButton.disableProperty().unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("PointlessBooleanExpression")
|
|
||||||
private void addSubscriptions() {
|
private void addSubscriptions() {
|
||||||
errorPopupDisplayed = new SimpleBooleanProperty();
|
errorPopupDisplayed = new SimpleBooleanProperty();
|
||||||
offerWarningSubscription = EasyBind.subscribe(model.offerWarning, newValue -> {
|
offerWarningSubscription = EasyBind.subscribe(model.offerWarning, newValue -> {
|
||||||
|
@ -712,29 +713,27 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
});
|
});
|
||||||
|
|
||||||
showTransactionPublishedScreenSubscription = EasyBind.subscribe(model.showTransactionPublishedScreen, newValue -> {
|
showTransactionPublishedScreenSubscription = EasyBind.subscribe(model.showTransactionPublishedScreen, newValue -> {
|
||||||
//noinspection ConstantConditions
|
|
||||||
if (newValue && DevEnv.isDevMode()) {
|
if (newValue && DevEnv.isDevMode()) {
|
||||||
close();
|
close();
|
||||||
} else //noinspection ConstantConditions,ConstantConditions
|
} else if (newValue && model.getTrade() != null && !model.getTrade().hasFailed()) {
|
||||||
if (newValue && model.getTrade() != null && !model.getTrade().hasFailed()) {
|
String key = "takeOfferSuccessInfo";
|
||||||
String key = "takeOfferSuccessInfo";
|
if (DontShowAgainLookup.showAgain(key)) {
|
||||||
if (DontShowAgainLookup.showAgain(key)) {
|
UserThread.runAfter(() -> new Popup().headLine(Res.get("takeOffer.success.headline"))
|
||||||
UserThread.runAfter(() -> new Popup().headLine(Res.get("takeOffer.success.headline"))
|
.feedback(Res.get("takeOffer.success.info"))
|
||||||
.feedback(Res.get("takeOffer.success.info"))
|
.actionButtonTextWithGoTo("navigation.portfolio.pending")
|
||||||
.actionButtonTextWithGoTo("navigation.portfolio.pending")
|
.dontShowAgainId(key)
|
||||||
.dontShowAgainId(key)
|
.onAction(() -> {
|
||||||
.onAction(() -> {
|
UserThread.runAfter(
|
||||||
UserThread.runAfter(
|
() -> navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class)
|
||||||
() -> navigation.navigateTo(MainView.class, PortfolioView.class, PendingTradesView.class)
|
, 100, TimeUnit.MILLISECONDS);
|
||||||
, 100, TimeUnit.MILLISECONDS);
|
close();
|
||||||
close();
|
})
|
||||||
})
|
.onClose(this::close)
|
||||||
.onClose(this::close)
|
.show(), 1);
|
||||||
.show(), 1);
|
} else {
|
||||||
} else {
|
close();
|
||||||
close();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* noSufficientFeeBinding = EasyBind.combine(model.dataModel.getIsWalletFunded(), model.dataModel.isMainNet, model.dataModel.isFeeFromFundingTxSufficient,
|
/* noSufficientFeeBinding = EasyBind.combine(model.dataModel.getIsWalletFunded(), model.dataModel.isMainNet, model.dataModel.isFeeFromFundingTxSufficient,
|
||||||
|
@ -837,8 +836,12 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
paymentAccountsComboBox.setVisible(false);
|
paymentAccountsComboBox.setVisible(false);
|
||||||
paymentAccountsComboBox.setManaged(false);
|
paymentAccountsComboBox.setManaged(false);
|
||||||
paymentAccountsComboBox.setOnAction(e -> {
|
paymentAccountsComboBox.setOnAction(e -> {
|
||||||
maybeShowClearXchangeWarning();
|
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
|
||||||
model.onPaymentAccountSelected(paymentAccountsComboBox.getSelectionModel().getSelectedItem());
|
if (paymentAccount != null) {
|
||||||
|
maybeShowClearXchangeWarning(paymentAccount);
|
||||||
|
maybeShowFasterPaymentsWarning(paymentAccount);
|
||||||
|
}
|
||||||
|
model.onPaymentAccountSelected(paymentAccount);
|
||||||
});
|
});
|
||||||
|
|
||||||
paymentMethodLabel = paymentAccountTuple.second;
|
paymentMethodLabel = paymentAccountTuple.second;
|
||||||
|
@ -898,9 +901,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
nextButton = tuple.first;
|
nextButton = tuple.first;
|
||||||
nextButton.setMaxWidth(200);
|
nextButton.setMaxWidth(200);
|
||||||
nextButton.setDefaultButton(true);
|
nextButton.setDefaultButton(true);
|
||||||
nextButton.setOnAction(e -> {
|
nextButton.setOnAction(e -> showNextStepAfterAmountIsSet());
|
||||||
showNextStepAfterAmountIsSet();
|
|
||||||
});
|
|
||||||
|
|
||||||
cancelButton1 = tuple.second;
|
cancelButton1 = tuple.second;
|
||||||
cancelButton1.setMaxWidth(200);
|
cancelButton1.setMaxWidth(200);
|
||||||
|
@ -1236,12 +1237,20 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void maybeShowClearXchangeWarning() {
|
private void maybeShowClearXchangeWarning(PaymentAccount paymentAccount) {
|
||||||
if (model.getPaymentMethod().getId().equals(PaymentMethod.CLEAR_X_CHANGE_ID) &&
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.CLEAR_X_CHANGE_ID) &&
|
||||||
!clearXchangeWarningDisplayed) {
|
!clearXchangeWarningDisplayed) {
|
||||||
clearXchangeWarningDisplayed = true;
|
clearXchangeWarningDisplayed = true;
|
||||||
UserThread.runAfter(GUIUtil::showClearXchangeWarning,
|
UserThread.runAfter(GUIUtil::showClearXchangeWarning, 500, TimeUnit.MILLISECONDS);
|
||||||
500, TimeUnit.MILLISECONDS);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void maybeShowFasterPaymentsWarning(PaymentAccount paymentAccount) {
|
||||||
|
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.FASTER_PAYMENTS_ID) &&
|
||||||
|
((FasterPaymentsAccount) paymentAccount).getHolderName().isEmpty() &&
|
||||||
|
!fasterPaymentsWarningDisplayed) {
|
||||||
|
fasterPaymentsWarningDisplayed = true;
|
||||||
|
UserThread.runAfter(() -> GUIUtil.showFasterPaymentsWarning(navigation), 500, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,9 @@ public class GUIUtil {
|
||||||
GUIUtil.preferences = preferences;
|
GUIUtil.preferences = preferences;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getUserLanguage() { return preferences.getUserLanguage(); }
|
public static String getUserLanguage() {
|
||||||
|
return preferences.getUserLanguage();
|
||||||
|
}
|
||||||
|
|
||||||
public static double getScrollbarWidth(Node scrollablePane) {
|
public static double getScrollbarWidth(Node scrollablePane) {
|
||||||
Node node = scrollablePane.lookup(".scroll-bar");
|
Node node = scrollablePane.lookup(".scroll-bar");
|
||||||
|
@ -700,6 +702,20 @@ public class GUIUtil {
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void showFasterPaymentsWarning(Navigation navigation) {
|
||||||
|
String key = "recreateFasterPaymentsAccount";
|
||||||
|
String currencyName = Config.baseCurrencyNetwork().getCurrencyName();
|
||||||
|
new Popup().information(Res.get("payment.fasterPayments.newRequirements.info", currencyName))
|
||||||
|
.width(900)
|
||||||
|
.actionButtonTextWithGoTo("navigation.account")
|
||||||
|
.onAction(() -> {
|
||||||
|
navigation.setReturnPath(navigation.getCurrentPath());
|
||||||
|
navigation.navigateTo(MainView.class, AccountView.class, FiatAccountsView.class);
|
||||||
|
})
|
||||||
|
.dontShowAgainId(key)
|
||||||
|
.show();
|
||||||
|
}
|
||||||
|
|
||||||
public static String getBitcoinURI(String address, Coin amount, String label) {
|
public static String getBitcoinURI(String address, Coin amount, String label) {
|
||||||
return address != null ?
|
return address != null ?
|
||||||
BitcoinURI.convertToBitcoinURI(Address.fromBase58(Config.baseCurrencyNetworkParameters(),
|
BitcoinURI.convertToBitcoinURI(Address.fromBase58(Config.baseCurrencyNetworkParameters(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue