Skip to content

Commit

Permalink
Merge pull request #7370 from alvasw/sbp_trade_ui_fixes
Browse files Browse the repository at this point in the history
Sbp trade UI fixes
  • Loading branch information
alejandrogarcia83 authored Feb 2, 2025
2 parents ae8d915 + ff8ba70 commit d2566dc
Show file tree
Hide file tree
Showing 67 changed files with 126 additions and 134 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -597,11 +597,11 @@ public boolean verifyPeersTradeAmount(Offer offer,
// TOLERATED_SMALL_TRADE_AMOUNT (0.01 BTC) and only in that case return false.
return findWitness(offer)
.map(witness -> verifyPeersTradeLimit(offer, tradeAmount, witness, new Date(), errorMessageHandler))
.orElse(isToleratedSmalleAmount(tradeAmount));
.orElse(isToleratedSmallestAmount(tradeAmount));
}

private boolean isToleratedSmalleAmount(Coin tradeAmount) {
return tradeAmount.value <= OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value;
private boolean isToleratedSmallestAmount(Coin tradeAmount) {
return tradeAmount.value >= OfferRestrictions.TOLERATED_SMALL_TRADE_AMOUNT.value;
}


Expand Down
8 changes: 0 additions & 8 deletions core/src/main/java/bisq/core/payment/SbpAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,4 @@ public void setBankName(String bankName) {
public String getBankName() {
return ((SbpAccountPayload) paymentAccountPayload).getBankName();
}

public void setHolderName(String holderName) {
((SbpAccountPayload) paymentAccountPayload).setHolderName(holderName);
}

public String getHolderName() {
return ((SbpAccountPayload) paymentAccountPayload).getHolderName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public String getPaymentDetails() {
public String getPaymentDetailsForTradePopup() {
return
Res.get("payment.australia.payid") + ": " + payid + "\n" +
Res.get("payment.account.owner") + ": " + bankAccountName;
Res.get("payment.account.owner.fullname") + ": " + bankAccountName;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public String getPaymentDetailsForTradePopup() {
String holderTaxIdString = BankUtil.isHolderIdRequired(countryCode) ?
(BankUtil.getHolderIdLabel(countryCode) + ": " + holderTaxId + "\n") : "";

return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
bankName +
bankId +
branchId +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ public static CashByMailAccountPayload fromProto(protobuf.PaymentAccountPayload

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + contact + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + contact + ", " +
Res.getWithCol("payment.postal.address") + " " + postalAddress + ", " +
Res.getWithCol("payment.shared.extraInfo") + " " + extraInfo;
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + contact + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + contact + "\n" +
Res.getWithCol("payment.postal.address") + " " + postalAddress;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public String getPaymentDetailsForTradePopup() {
String emailString = holderEmail != null ?
(Res.getWithCol("payment.email") + " " + holderEmail + "\n") : "";

return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
emailString +
bankName +
bankId +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ public static ChaseQuickPayAccountPayload fromProto(protobuf.PaymentAccountPaylo

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.get("payment.email") + " " + email;
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
Res.getWithCol("payment.email") + " " + email;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ public static ClearXchangeAccountPayload fromProto(protobuf.PaymentAccountPayloa

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr;
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
Res.getWithCol("payment.emailOrMobile") + " " + emailOrMobileNr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static DomesticWireTransferAccountPayload fromProto(protobuf.PaymentAccou
@Override
public String getPaymentDetails() {
String paymentDetails = (Res.get(paymentMethodId) + " - " +
Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
BankUtil.getBankNameLabel(countryCode) + ": " + this.bankName + ", " +
BankUtil.getBranchIdLabel(countryCode) + ": " + this.branchId + ", " +
BankUtil.getAccountNrLabel(countryCode) + ": " + this.accountNr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public String getPaymentDetails() {

@Override
public String getPaymentDetailsForTradePopup() {
return (getHolderName().isEmpty() ? "" : Res.getWithCol("payment.account.owner") + " " + getHolderName() + "\n") +
return (getHolderName().isEmpty() ? "" : Res.getWithCol("payment.account.owner.fullname") + " " + getHolderName() + "\n") +
"UK Sort code: " + sortCode + "\n" +
Res.getWithCol("payment.accountNr") + " " + accountNr;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String getPaymentDetails() {

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
BankUtil.getAccountNrLabel(countryCode) + ": " + accountNr + "\n" +
BankUtil.getBankIdLabel(countryCode) + ": " + ifsc + "\n" +
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static ImpsAccountPayload fromProto(protobuf.PaymentAccountPayload proto)

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.account.no") + " " + accountNr +
Res.getWithCol("payment.ifsc") + " " + ifsc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public static InteracETransferAccountPayload fromProto(protobuf.PaymentAccountPa

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.get("payment.email") + " " + email + ", " + Res.getWithCol("payment.secret") + " " +
question + ", " + Res.getWithCol("payment.answer") + " " + answer;
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
Res.getWithCol("payment.email") + " " + email + "\n" +
Res.getWithCol("payment.secret") + " " + question + "\n" +
Res.getWithCol("payment.answer") + " " + answer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public String getPaymentDetails() {
@Override
public String getPaymentDetailsForTradePopup() {
return Res.get("payment.mercadoPago.holderId") + ": " + accountHolderId + "\n" +
Res.get("payment.account.owner") + ": " + accountHolderName;
Res.get("payment.account.owner.fullname") + ": " + accountHolderName;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public String getPaymentDetails() {
@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account") + " " + accountId + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
Res.getWithCol("payment.account.owner.fullname") + " " + getHolderNameOrPromptIfEmpty();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static NeftAccountPayload fromProto(protobuf.PaymentAccountPayload proto)

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.account.no") + " " + accountNr +
Res.getWithCol("payment.ifsc") + " " + ifsc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public String getPaymentDetails() {
@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.pix.key") + " " + pixKey + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
Res.getWithCol("payment.account.owner.fullname") + " " + getHolderNameOrPromptIfEmpty();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static PopmoneyAccountPayload fromProto(protobuf.PaymentAccountPayload pr

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.popmoney.accountId") + " " + accountId;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static RtgsAccountPayload fromProto(protobuf.PaymentAccountPayload proto)

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.account.no") + " " + accountNr +
Res.getWithCol("payment.ifsc") + " " + ifsc;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,14 @@ public static SbpAccountPayload fromProto(protobuf.PaymentAccountPayload proto)
@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " +
Res.getWithCol("payment.account.owner.sbp") + " " + holderName + ", " +
Res.getWithCol("payment.account.owner.name") + " " + holderName + ", " +
Res.getWithCol("payment.mobile") + " " + mobileNumber + ", " +
Res.getWithCol("payment.bank.name") + " " + bankName;
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner.sbp") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.name") + " " + holderName + "\n" +
Res.getWithCol("payment.mobile") + " " + mobileNumber + "\n" +
Res.getWithCol("payment.bank.name") + " " + bankName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ public void revertChanges() {

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", IBAN: " +
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode();
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
"IBAN: " + iban + "\n" +
"BIC: " + bic + "\n" +
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ public void revertChanges() {

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", IBAN: " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", IBAN: " +
iban + ", BIC: " + bic + ", " + Res.getWithCol("payment.bank.country") + " " + getCountryCode();
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
"IBAN: " + iban + "\n" +
"BIC: " + bic + "\n" +
Res.getWithCol("payment.bank.country") + " " + CountryUtil.getNameByCode(countryCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ public static SwishAccountPayload fromProto(protobuf.PaymentAccountPayload proto

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName +
", " + Res.getWithCol("payment.mobile") + " " + mobileNr;
}

@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
Res.getWithCol("payment.mobile") + " " + mobileNr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public String getPaymentDetails() {
@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.email") + " " + email + "\n" +
Res.getWithCol("payment.account.owner") + " " + getHolderNameOrPromptIfEmpty();
Res.getWithCol("payment.account.owner.fullname") + " " + getHolderNameOrPromptIfEmpty();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ public static USPostalMoneyOrderAccountPayload fromProto(protobuf.PaymentAccount

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.postal.address") + " " + postalAddress;
}


@Override
public String getPaymentDetailsForTradePopup() {
return Res.getWithCol("payment.account.owner") + " " + holderName + "\n" +
return Res.getWithCol("payment.account.owner.fullname") + " " + holderName + "\n" +
Res.getWithCol("payment.postal.address") + " " + postalAddress;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ public String getPaymentDetailsForTradePopup() {
if (accountOwner.isEmpty()) {
return
Res.get("payment.account") + ": " + accountId + "\n" +
Res.get("payment.account.owner") + ": N/A";
Res.get("payment.account.owner.fullname") + ": N/A";
} else {
return
Res.get("payment.account") + ": " + accountId + "\n" +
Res.get("payment.account.owner") + ": " + accountOwner;
Res.get("payment.account.owner.fullname") + ": " + accountOwner;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static VenmoAccountPayload fromProto(protobuf.PaymentAccountPayload proto

@Override
public String getPaymentDetails() {
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner") + " " + holderName + ", " +
return Res.get(paymentMethodId) + " - " + Res.getWithCol("payment.account.owner.fullname") + " " + holderName + ", " +
Res.getWithCol("payment.venmo.venmoUserName") + " " + venmoUserName;
}

Expand Down
3 changes: 2 additions & 1 deletion core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3719,7 +3719,8 @@ payment.account.no=Account no.
payment.account.name=Account name
payment.account.userName=User name
payment.account.phoneNr=Phone number
payment.account.owner=Account owner full name
payment.account.owner.fullname=Account owner full name
payment.account.owner.name=Account owner name
payment.account.owner.ask=[Ask trader to provide account name if needed]
payment.account.owner.sbp=Account owner name (first, middle, and initial of last name)
payment.account.fullName=Full name (first, middle, last)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/i18n/displayStrings_cs.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ payment.account.no=Číslo účtu
payment.account.name=Název účtu
payment.account.userName=Uživatelské jméno
payment.account.phoneNr=Telefonní číslo
payment.account.owner=Celé jméno vlastníka účtu
payment.account.owner.fullname=Celé jméno vlastníka účtu
payment.account.owner.ask=[Ask trader to provide account name if needed]
payment.account.owner.sbp=Account owner name (first, middle, and initial of last name)
payment.account.fullName=Celé jméno (křestní, střední, příjmení)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/i18n/displayStrings_de.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ payment.account.no=Kontonummer
payment.account.name=Kontoname
payment.account.userName=Benutzername
payment.account.phoneNr=Telefonnummer
payment.account.owner=Vollständiger Name des Kontoinhabers
payment.account.owner.fullname=Vollständiger Name des Kontoinhabers
payment.account.owner.ask=[Ask trader to provide account name if needed]
payment.account.owner.sbp=Account owner name (first, middle, and initial of last name)
payment.account.fullName=Vollständiger Name (vor, zweit, nach)
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/i18n/displayStrings_es.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ payment.account.no=Número de cuenta
payment.account.name=Nombre de cuenta
payment.account.userName=Nombre de usuario
payment.account.phoneNr=Número de teléfono
payment.account.owner=Nombre completo del propietario de la cuenta
payment.account.owner.fullname=Nombre completo del propietario de la cuenta
payment.account.owner.ask=[Ask trader to provide account name if needed]
payment.account.owner.sbp=Account owner name (first, middle, and initial of last name)
payment.account.fullName=Nombre completo
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/resources/i18n/displayStrings_fa.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2945,7 +2945,7 @@ payment.account.no=شماره حساب
payment.account.name=نام حساب
payment.account.userName=User name
payment.account.phoneNr=Phone number
payment.account.owner=نام کامل مالک حساب
payment.account.owner.fullname=نام کامل مالک حساب
payment.account.owner.ask=[Ask trader to provide account name if needed]
payment.account.owner.sbp=Account owner name (first, middle, and initial of last name)
payment.account.fullName=نام کامل (اول، وسط، آخر)
Expand Down
Loading

0 comments on commit d2566dc

Please sign in to comment.