diff --git a/core/src/main/java/bisq/core/payment/payload/JapanBankAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/JapanBankAccountPayload.java index d33a37150d1..ed49cb7a75a 100644 --- a/core/src/main/java/bisq/core/payment/payload/JapanBankAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/JapanBankAccountPayload.java @@ -34,9 +34,6 @@ import lombok.ToString; import lombok.extern.slf4j.Slf4j; -// Cannot be deleted as it would break old trade history entries -// Removed due too high chargeback risk -@Deprecated @EqualsAndHashCode(callSuper = true) @ToString @Setter @@ -132,10 +129,10 @@ public String getPaymentDetails() @Override public String getPaymentDetailsForTradePopup() { - return bankName + "(" + bankCode + ")\n" + - bankBranchName + "(" + bankBranchCode + ")\n" + - bankAccountType + ": " + bankAccountNumber + "\n" + - bankAccountName + "\n"; + return + Res.get("payment.japan.bank") + ": " + bankName + "(" + bankCode + ")\n" + + Res.get("payment.japan.branch") + ": " + bankBranchName + "(" + bankBranchCode + ")\n" + + Res.get("payment.japan.account") + ": " + bankAccountType + " " + bankAccountNumber + "\n" + Res.get("payment.japan.recipient") + ": " + bankAccountName; } diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 31b3c53e18b..338c1824d1f 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2804,6 +2804,11 @@ payment.f2f.info.openURL=Open web page payment.f2f.offerbook.tooltip.countryAndCity=Country and city: {0} / {1} payment.f2f.offerbook.tooltip.extra=Additional information: {0} +payment.japan.bank=Bank +payment.japan.branch=Branch +payment.japan.account=Account +payment.japan.recipient=Name + # We use constants from the code so we do not use our normal naming convention # dynamic values are not recognized by IntelliJ diff --git a/core/src/main/resources/i18n/displayStrings_ja.properties b/core/src/main/resources/i18n/displayStrings_ja.properties index 4efac724270..34bec44fbac 100644 --- a/core/src/main/resources/i18n/displayStrings_ja.properties +++ b/core/src/main/resources/i18n/displayStrings_ja.properties @@ -2304,6 +2304,10 @@ payment.f2f.info.openURL=Webページを開く payment.f2f.offerbook.tooltip.countryAndCity=国と市区町村: {0} / {1} payment.f2f.offerbook.tooltip.extra=追加情報: {0} +payment.japan.bank=銀行 +payment.japan.branch=支店 +payment.japan.account=口座 +payment.japan.recipient=名義 # We use constants from the code so we do not use our normal naming convention # dynamic values are not recognized by IntelliJ diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/JapanBankTransferForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/JapanBankTransferForm.java index 86074556a33..9cf82fdc387 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/JapanBankTransferForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/JapanBankTransferForm.java @@ -17,41 +17,41 @@ package bisq.desktop.components.paymentmethods; -import bisq.common.util.Tuple2; -import bisq.common.util.Tuple3; -import bisq.common.util.Tuple4; - -import bisq.desktop.components.InputTextField; import bisq.desktop.components.AutocompleteComboBox; -import bisq.desktop.util.FormBuilder; +import bisq.desktop.components.InputTextField; +import bisq.desktop.components.paymentmethods.data.JapanBankData; import bisq.desktop.util.Layout; -import bisq.desktop.util.validation.LengthValidator; -import bisq.desktop.util.validation.RegexValidator; -import bisq.desktop.util.validation.JapanBankTransferValidator; +import bisq.desktop.util.validation.JapanBankAccountNameValidator; +import bisq.desktop.util.validation.JapanBankAccountNumberValidator; import bisq.desktop.util.validation.JapanBankBranchCodeValidator; import bisq.desktop.util.validation.JapanBankBranchNameValidator; -import bisq.desktop.util.validation.JapanBankAccountNumberValidator; -import bisq.desktop.util.validation.JapanBankAccountNameValidator; -import bisq.desktop.components.paymentmethods.data.JapanBankData; +import bisq.desktop.util.validation.JapanBankTransferValidator; +import bisq.desktop.util.validation.LengthValidator; +import bisq.desktop.util.validation.RegexValidator; import bisq.core.account.witness.AccountAgeWitnessService; import bisq.core.locale.Res; import bisq.core.locale.TradeCurrency; -import bisq.core.payment.PaymentAccount; import bisq.core.payment.JapanBankAccount; -import bisq.core.payment.payload.PaymentAccountPayload; +import bisq.core.payment.PaymentAccount; import bisq.core.payment.payload.JapanBankAccountPayload; +import bisq.core.payment.payload.PaymentAccountPayload; import bisq.core.util.BSFormatter; import bisq.core.util.validation.InputValidator; +import bisq.common.util.Tuple2; +import bisq.common.util.Tuple3; +import bisq.common.util.Tuple4; + import org.apache.commons.lang3.StringUtils; -import javafx.scene.control.TextField; -import javafx.scene.layout.GridPane; -import javafx.scene.control.Label; import javafx.scene.control.ComboBox; -import javafx.scene.control.ToggleGroup; +import javafx.scene.control.Label; import javafx.scene.control.RadioButton; +import javafx.scene.control.TextField; +import javafx.scene.control.ToggleGroup; +import javafx.scene.layout.GridPane; + import javafx.util.StringConverter; import static bisq.desktop.util.FormBuilder.*; @@ -78,31 +78,23 @@ public static int addFormForBuyer(GridPane gridPane, int gridRow, // {{{ JapanBankAccountPayload japanBankAccount = ((JapanBankAccountPayload) paymentAccountPayload); addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - JapanBankData.getString("payment.account.owner"), + Res.get("payment.account.owner"), ((JapanBankAccountPayload) paymentAccountPayload).getBankName()); - TextField bankCodeTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("bank.code"), japanBankAccount.getBankCode()).second; - bankCodeTextField.setPrefWidth(30); - bankCodeTextField.setEditable(false); - - TextField bankNameTextField = addCompactTopLabelTextField(gridPane, gridRow, 1, JapanBankData.getString("bank.name"), japanBankAccount.getBankName()).second; - bankNameTextField.setPrefWidth(70); - bankNameTextField.setEditable(false); - - TextField branchCodeTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("branch.code"), japanBankAccount.getBankBranchCode()).second; - branchCodeTextField.setPrefWidth(30); - branchCodeTextField.setEditable(false); + String bankText = japanBankAccount.getBankCode() + " " + japanBankAccount.getBankName(); + TextField bankTextField = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.japan.bank"), bankText).second; + bankTextField.setEditable(false); - TextField branchNameTextField = addCompactTopLabelTextField(gridPane, ++gridRow, 1, JapanBankData.getString("branch.name"), japanBankAccount.getBankBranchName()).second; - branchNameTextField.setPrefWidth(70); - branchNameTextField.setEditable(false); + String branchText = japanBankAccount.getBankBranchCode() + " " + japanBankAccount.getBankBranchName(); + TextField branchTextField = addCompactTopLabelTextField(gridPane, gridRow, 1, Res.get("payment.japan.branch"), branchText).second; + branchTextField.setEditable(false); - TextField accountNumberTextField = addCompactTopLabelTextField(gridPane, ++gridRow, JapanBankData.getString("account.number"), japanBankAccount.getBankAccountNumber()).second; - accountNumberTextField.setPrefWidth(30); - accountNumberTextField.setEditable(false); + String accountText = japanBankAccount.getBankAccountType() + " " + japanBankAccount.getBankAccountNumber(); + TextField accountTextField = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.japan.account"), accountText).second; + accountTextField.setEditable(false); - TextField accountNameTextField = addCompactTopLabelTextField(gridPane, gridRow, 1, JapanBankData.getString("account.name"), japanBankAccount.getBankAccountName()).second; - accountNameTextField.setPrefWidth(70); + String accountNameText = japanBankAccount.getBankAccountName(); + TextField accountNameTextField = addCompactTopLabelTextField(gridPane, gridRow, 1, Res.get("payment.japan.recipient"), accountNameText).second; accountNameTextField.setEditable(false); return gridRow; @@ -193,8 +185,8 @@ private void addBankInput() // {{{ // Bank Code (readonly) TextField bankCodeField = tuple4.second; - bankCodeField.setPrefWidth(175); - bankCodeField.setMaxWidth(175); + bankCodeField.setPrefWidth(200); + bankCodeField.setMaxWidth(200); bankCodeField.setEditable(false); // Bank Selector @@ -215,8 +207,8 @@ public String fromString(String s) { }); ((AutocompleteComboBox) bankComboBox).setAutocompleteItems(JapanBankData.prettyPrintBankList()); - bankComboBox.setPrefWidth(425); - bankComboBox.setVisibleRowCount(425); + bankComboBox.setPrefWidth(430); + bankComboBox.setVisibleRowCount(430); ((AutocompleteComboBox) bankComboBox).setOnChangeConfirmed(e -> { // get selected value @@ -259,8 +251,8 @@ private void addBankBranchInput() // {{{ // branch code InputTextField bankBranchCodeInputTextField = tuple2.first; bankBranchCodeInputTextField.setValidator(japanBankBranchCodeValidator); - bankBranchCodeInputTextField.setPrefWidth(175); - bankBranchCodeInputTextField.setMaxWidth(175); + bankBranchCodeInputTextField.setPrefWidth(200); + bankBranchCodeInputTextField.setMaxWidth(200); bankBranchCodeInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { japanBankAccount.setBankBranchCode(newValue); updateFromInputs(); @@ -269,8 +261,8 @@ private void addBankBranchInput() // {{{ // branch name InputTextField bankBranchNameInputTextField = tuple2.second; bankBranchNameInputTextField.setValidator(japanBankBranchNameValidator); - bankBranchNameInputTextField.setPrefWidth(425); - bankBranchNameInputTextField.setMaxWidth(425); + bankBranchNameInputTextField.setPrefWidth(430); + bankBranchNameInputTextField.setMaxWidth(430); bankBranchNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { japanBankAccount.setBankBranchName(newValue); updateFromInputs(); @@ -284,8 +276,8 @@ private void addBankAccountInput() // {{{ // account number bankAccountNumberInputTextField = tuple2.first; bankAccountNumberInputTextField.setValidator(japanBankAccountNumberValidator); - bankAccountNumberInputTextField.setPrefWidth(175); - bankAccountNumberInputTextField.setMaxWidth(175); + bankAccountNumberInputTextField.setPrefWidth(200); + bankAccountNumberInputTextField.setMaxWidth(200); bankAccountNumberInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { japanBankAccount.setBankAccountNumber(newValue); updateFromInputs(); @@ -294,8 +286,8 @@ private void addBankAccountInput() // {{{ // account name InputTextField bankAccountNameInputTextField = tuple2.second; bankAccountNameInputTextField.setValidator(japanBankAccountNameValidator); - bankAccountNameInputTextField.setPrefWidth(425); - bankAccountNameInputTextField.setMaxWidth(425); + bankAccountNameInputTextField.setPrefWidth(430); + bankAccountNameInputTextField.setMaxWidth(430); bankAccountNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { japanBankAccount.setBankAccountName(newValue); updateFromInputs(); @@ -308,7 +300,7 @@ private void addBankAccountTypeInput() // {{{ TradeCurrency singleTradeCurrency = japanBankAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addCompactTopLabelTextField(gridPane, gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, gridRow, Res.get("shared.currency"), nameAndCode, 20); // account type gridRow++; diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/data/JapanBankData.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/data/JapanBankData.java index 89f0e4f0bae..43e37a6aeeb 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/data/JapanBankData.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/data/JapanBankData.java @@ -796,7 +796,7 @@ public static final String getString(String id) { case "bank": if (ja) return "銀行名 ・金融機関名"; - return "Japan Bank or Financial Institution"; + return "Bank or Financial Institution"; case "bank.select": if (ja) return "金融機関 ・銀行検索 (名称入力検索)"; return "Search for Bank or Financial Institution"; @@ -812,7 +812,7 @@ public static final String getString(String id) return "Bank Branch"; case "branch.code": if (ja) return "支店コード"; - return "Zengin Bank Branch Code"; + return "Zengin Branch Code"; case "branch.code.validation.error": if (ja) return "入力は3桁の支店コードでなければなりません"; return "Input must be a 3 digit branch code"; @@ -822,7 +822,7 @@ public static final String getString(String id) case "account": if (ja) return "銀行口座"; - return "Japan Bank Account"; + return "Bank Account"; case "account.type": if (ja) return "口座科目"; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java index cb71e6fcdc5..d58e09e76e3 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java @@ -30,6 +30,7 @@ import bisq.desktop.components.paymentmethods.FasterPaymentsForm; import bisq.desktop.components.paymentmethods.HalCashForm; import bisq.desktop.components.paymentmethods.InteracETransferForm; +import bisq.desktop.components.paymentmethods.JapanBankTransferForm; import bisq.desktop.components.paymentmethods.MoneyBeamForm; import bisq.desktop.components.paymentmethods.MoneyGramForm; import bisq.desktop.components.paymentmethods.NationalBankForm; @@ -267,6 +268,9 @@ protected void addContent() { case PaymentMethod.INTERAC_E_TRANSFER_ID: gridRow = InteracETransferForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); break; + case PaymentMethod.JAPAN_BANK_ID: + gridRow = JapanBankTransferForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); + break; case PaymentMethod.US_POSTAL_MONEY_ORDER_ID: gridRow = USPostalMoneyOrderForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); break;