mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Improve auto-naming of accounts
This commit is contained in:
parent
8dba40c3f0
commit
4db16760f0
9 changed files with 23 additions and 22 deletions
|
@ -52,7 +52,7 @@ public class BankUtil {
|
|||
case "BR":
|
||||
return "Bank name:";
|
||||
default:
|
||||
return "Bank name (optional):";
|
||||
return isBankNameRequired(countryCode) ? "Bank name:" : "Bank name (optional):";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ public class BankUtil {
|
|||
case "HK":
|
||||
return "Bank code:";
|
||||
default:
|
||||
return "Bank ID (e.g. BIC or SWIFT) (optional):";
|
||||
return isBankIdRequired(countryCode) ? "Bank ID (e.g. BIC or SWIFT):" : "Bank ID (e.g. BIC or SWIFT) (optional):";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class BankUtil {
|
|||
case "CA":
|
||||
return "Transit Number:";
|
||||
default:
|
||||
return "Branch nr. (optional):";
|
||||
return isBranchIdRequired(countryCode) ? "Branch nr.:" : "Branch nr. (optional):";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -73,9 +73,9 @@ public class AliPayForm extends PaymentMethodForm {
|
|||
protected void autoFillNameTextField() {
|
||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||
String accountNr = accountNrInputTextField.getText();
|
||||
accountNr = StringUtils.abbreviate(accountNr, 5);
|
||||
accountNr = StringUtils.abbreviate(accountNr, 9);
|
||||
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
|
||||
accountNameTextField.setText(method.concat(", ").concat(accountNr));
|
||||
accountNameTextField.setText(method.concat(": ").concat(accountNr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -470,27 +470,27 @@ abstract class BankForm extends PaymentMethodForm {
|
|||
countryCode = "";
|
||||
if (BankUtil.isBankIdRequired(countryCode)) {
|
||||
bankId = bankIdInputTextField.getText();
|
||||
if (bankId.length() > 6)
|
||||
if (bankId.length() > 9)
|
||||
bankId = StringUtils.abbreviate(bankId, 9);
|
||||
} else if (BankUtil.isBranchIdRequired(countryCode)) {
|
||||
bankId = branchIdInputTextField.getText();
|
||||
if (bankId.length() > 6)
|
||||
if (bankId.length() > 9)
|
||||
bankId = StringUtils.abbreviate(bankId, 9);
|
||||
} else if (BankUtil.isBankNameRequired(countryCode)) {
|
||||
bankId = bankNameInputTextField.getText();
|
||||
if (bankId.length() > 6)
|
||||
if (bankId.length() > 9)
|
||||
bankId = StringUtils.abbreviate(bankId, 9);
|
||||
}
|
||||
|
||||
String accountNr = accountNrInputTextField.getText();
|
||||
if (accountNr.length() > 6)
|
||||
if (accountNr.length() > 9)
|
||||
accountNr = StringUtils.abbreviate(accountNr, 9);
|
||||
|
||||
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
|
||||
if (bankId != null)
|
||||
accountNameTextField.setText(method.concat(", ").concat(bankId).concat(", ").concat(accountNr));
|
||||
if (bankId != null && !bankId.isEmpty())
|
||||
accountNameTextField.setText(method.concat(": ").concat(bankId).concat(", ").concat(accountNr));
|
||||
else
|
||||
accountNameTextField.setText(method.concat(", ").concat(accountNr));
|
||||
accountNameTextField.setText(method.concat(": ").concat(accountNr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ public class CryptoCurrencyForm extends PaymentMethodForm {
|
|||
String address = addressInputTextField.getText();
|
||||
address = StringUtils.abbreviate(address, 9);
|
||||
String currency = paymentAccount.getSingleTradeCurrency() != null ? paymentAccount.getSingleTradeCurrency().getCode() : "?";
|
||||
accountNameTextField.setText(method.concat(", ").concat(currency).concat(", ").concat(address));
|
||||
accountNameTextField.setText(currency.concat(": ").concat(address));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -117,9 +117,9 @@ public class OKPayForm extends PaymentMethodForm {
|
|||
protected void autoFillNameTextField() {
|
||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||
String accountNr = accountNrInputTextField.getText();
|
||||
accountNr = StringUtils.abbreviate(accountNr, 5);
|
||||
accountNr = StringUtils.abbreviate(accountNr, 9);
|
||||
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
|
||||
accountNameTextField.setText(method.concat(", ").concat(accountNr));
|
||||
accountNameTextField.setText(method.concat(": ").concat(accountNr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,9 +75,9 @@ public class PerfectMoneyForm extends PaymentMethodForm {
|
|||
protected void autoFillNameTextField() {
|
||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||
String accountNr = accountNrInputTextField.getText();
|
||||
accountNr = StringUtils.abbreviate(accountNr, 5);
|
||||
accountNr = StringUtils.abbreviate(accountNr, 9);
|
||||
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
|
||||
accountNameTextField.setText(method.concat(", ").concat(accountNr));
|
||||
accountNameTextField.setText(method.concat(": ").concat(accountNr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -280,12 +280,12 @@ public class SepaForm extends PaymentMethodForm {
|
|||
protected void autoFillNameTextField() {
|
||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||
String iban = ibanInputTextField.getText();
|
||||
if (iban.length() > 5)
|
||||
iban = StringUtils.abbreviate(iban, 5);
|
||||
if (iban.length() > 9)
|
||||
iban = StringUtils.abbreviate(iban, 9);
|
||||
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
|
||||
String country = ((CountryBasedPaymentAccount) paymentAccount).getCountry() != null ? ((CountryBasedPaymentAccount) paymentAccount).getCountry().code : "?";
|
||||
String currency = paymentAccount.getSingleTradeCurrency() != null ? paymentAccount.getSingleTradeCurrency().getCode() : "?";
|
||||
accountNameTextField.setText(method.concat(", ").concat(currency).concat(", ").concat(country).concat(", ").concat(iban));
|
||||
accountNameTextField.setText(method.concat(" (").concat(currency).concat("/").concat(country).concat("): ").concat(iban));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -82,9 +82,9 @@ public class SwishForm extends PaymentMethodForm {
|
|||
protected void autoFillNameTextField() {
|
||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||
String mobileNr = mobileNrInputTextField.getText();
|
||||
mobileNr = StringUtils.abbreviate(mobileNr, 5);
|
||||
mobileNr = StringUtils.abbreviate(mobileNr, 9);
|
||||
String method = BSResources.get(paymentAccount.getPaymentMethod().getId());
|
||||
accountNameTextField.setText(method.concat(", ").concat(mobileNr));
|
||||
accountNameTextField.setText(method.concat(": ").concat(mobileNr));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -763,6 +763,7 @@ public class CreateOfferView extends ActivatableViewAndModel<AnchorPane, CreateO
|
|||
|
||||
paymentAccountsComboBox = addLabelComboBox(gridPane, gridRow, "Payment account:", Layout.FIRST_ROW_DISTANCE).second;
|
||||
paymentAccountsComboBox.setPromptText("Select payment account");
|
||||
paymentAccountsComboBox.setMinWidth(300);
|
||||
editOfferElements.add(paymentAccountsComboBox);
|
||||
|
||||
// we display either currencyComboBox (multi currency account) or currencyTextField (single)
|
||||
|
|
Loading…
Add table
Reference in a new issue