diff --git a/common/src/main/java/io/bisq/common/locale/BankUtil.java b/common/src/main/java/io/bisq/common/locale/BankUtil.java
index ccdc1e7c55..ba85fb1b61 100644
--- a/common/src/main/java/io/bisq/common/locale/BankUtil.java
+++ b/common/src/main/java/io/bisq/common/locale/BankUtil.java
@@ -39,7 +39,7 @@ public class BankUtil {
case "CA":
case "SE":
case "HK":
- // We show always the bank name as it is needed in specific banks.
+ // We show always the bank name as it is needed in specific banks.
// Though that handling should be optimized in futures.
return true;
// return false;
@@ -250,4 +250,18 @@ public class BankUtil {
return false;
}
}
+
+ public static boolean isStateRequired(String countryCode) {
+ switch (countryCode) {
+ case "US":
+ case "CA":
+ case "AU":
+ case "MY":
+ case "MX":
+ case "CN":
+ return true;
+ default:
+ return false;
+ }
+ }
}
diff --git a/common/src/main/proto/pb.proto b/common/src/main/proto/pb.proto
index bd43aa9a79..119966255b 100644
--- a/common/src/main/proto/pb.proto
+++ b/common/src/main/proto/pb.proto
@@ -829,6 +829,7 @@ message CountryBasedPaymentAccountPayload {
BankAccountPayload bank_account_payload = 2;
CashDepositAccountPayload cash_deposit_account_payload = 3;
SepaAccountPayload sepa_account_payload = 4;
+ WesternUnionAccountPayload western_union_account_payload = 5;
}
}
@@ -870,6 +871,13 @@ message CashDepositAccountPayload {
string holder_tax_id = 9;
}
+message WesternUnionAccountPayload {
+ string holder_name = 1;
+ string city = 2;
+ string state = 3;
+ string email = 4;
+}
+
message SepaAccountPayload {
string holder_name = 1;
string iban = 2;
diff --git a/common/src/main/resources/i18n/displayStrings.properties b/common/src/main/resources/i18n/displayStrings.properties
index 3c64a56fac..1f69e55bfe 100644
--- a/common/src/main/resources/i18n/displayStrings.properties
+++ b/common/src/main/resources/i18n/displayStrings.properties
@@ -465,7 +465,7 @@ portfolio.pending.step2.confReached=Your trade has reached at least one blockcha
portfolio.pending.step2_buyer.copyPaste=(You can copy & paste the values from the main screen after closing that popup.)
portfolio.pending.step2_buyer.refTextWarn=DO NOT use any additional notice in the \"reason for payment\" text like Bitcoin, BTC or Bisq.
# suppress inspection "TrailingSpacesInProperty"
-portfolio.pending.step2_buyer.accountDetails=Here are the trading account details of the BTC seller:\n
+portfolio.pending.step2_buyer.accountDetails=Here are the trade account details of the BTC seller:\n
portfolio.pending.step2_buyer.tradeId=Please don't forget to add the trade ID
# suppress inspection "TrailingSpacesInProperty"
portfolio.pending.step2_buyer.assign= as \"reason for payment\" so the receiver can assign your payment to this trade.\n\n
@@ -475,6 +475,9 @@ portfolio.pending.step2_buyer.altcoin=Please transfer from your external {0} wal
# suppress inspection "TrailingSpacesInProperty"
portfolio.pending.step2_buyer.cash=Please go to a bank and pay {0} to the BTC seller.\n\n
portfolio.pending.step2_buyer.cash.extra=IMPORTANT REQUIREMENT:\nAfter you have done the payment write on the paper receipt: NO REFUNDS.\nThen tear it in 2 parts, make a photo and send it to the BTC seller's email address.
+portfolio.pending.step2_buyer.westernUnion=Please pay {0} to the BTC seller by using Western Union.\n\n
+portfolio.pending.step2_buyer.westernUnion.extra=IMPORTANT REQUIREMENT:\nAfter you have done the payment send the MTCN (tracking number) to the seller by email. The seller''s email is: {0}.
+
# suppress inspection "TrailingSpacesInProperty"
portfolio.pending.step2_buyer.postal=Please send {0} by \"US Postal Money Order\" to the BTC seller.\n\n
# suppress inspection "TrailingSpacesInProperty"
@@ -489,6 +492,10 @@ portfolio.pending.step2_buyer.paperReceipt.headline=Did you sent the paper recei
portfolio.pending.step2_buyer.paperReceipt.msg=Remember:\n\
You need to write on the paper receipt: NO REFUNDS.\n\
Then tear it in 2 parts, make a photo and send it to the BTC seller's email address.
+portfolio.pending.step2_buyer.westernUnionMTCNInfo.headline=Send tracking number
+portfolio.pending.step2_buyer.westernUnionMTCNInfo.msg=You need to send the MTCN (tracking number) to the BTC seller by email. The seller''s email is: {0}.\n\n\
+ Did you sent the MTCN already to the seller?
+
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.yes=Yes, I have started the payment
@@ -518,6 +525,9 @@ The trade ID (\"reason for payment\" text) of the transaction is: \"{2}\"
portfolio.pending.step3_seller.cash=\n\nBecause the payment is done via Cash Deposit the BTC buyer has to write \"NO REFUND\" on the paper receipt, tear it in 2 parts and send you a photo by email.\n\n\
To avoid chargeback risk, only confirm if you received the email and if you are sure the paper receipt is valid.\n\
If you are not sure, {0}
+portfolio.pending.step3_seller.westernUnion=The buyer has to sent you the MTCN (tracking number) by email. Please check your email if you received the MTCN.\n\n\
+ After closing that popup you will see the BTC buyer's name and address for picking up the money from Western Union.
+
portfolio.pending.step3_seller.bankCheck=\n\nPlease also verify that the sender's name in your bank statement matches that one from the trade contract:\nSender's name: {0}\n\n\
If the name is not the same as the one displayed here, {1}
portfolio.pending.step3_seller.openDispute=please don't confirm but open a dispute by entering \"alt + o\" or \"option + o\".
@@ -1536,6 +1546,9 @@ seed.restore.error=An error occurred when restoring the wallets with seed words.
payment.account.no=Account no.:
payment.account.name=Account name:
payment.account.owner=Account owner full name
+payment.account.fullName=Full name (first, middle, last)
+payment.account.state=State/Province/Region:
+payment.account.city=City:
payment.bank.country=Country of bank:
payment.account.name.email=Account owner full name / email
payment.account.name.emailAndHolderId=Account owner full name / email / {0}
@@ -1614,11 +1627,7 @@ If you have not fulfilled the above requirements you will lose your security dep
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.
-popup.info.revertIdCheckRequirement=With this version we remove the requirement introduced in version 0.5.0 for verifying the peers ID by email when payment methods \
- with bank transfer or Faster Payment was used.\n\n\
- The email address is not exposed anymore in Sepa, Faster Payment and national bank transfer payment methods.\n\n\
- Please see the discussion on the Bisq Forum for further background:\n\
- https://forum.bisq.network/t/new-requirement-for-payment-accounts-with-charge-back-risk/2376
+payment.westernUnion.info=When using Western Union the BTC buyer has to send the MTCN (tracking number) by email to the BTC seller after the money is sent. You will get instructed in the trade process.
# We use constants from the code so we do not use our normal naming convention
# dynamic values are not recognized by IntelliJ
@@ -1629,6 +1638,7 @@ SAME_BANK=Transfer with same bank
SPECIFIC_BANKS=Transfers with specific banks
US_POSTAL_MONEY_ORDER=US Postal Money Order
CASH_DEPOSIT=Cash Deposit
+WESTERN_UNION=Western Union
# suppress inspection "UnusedProperty"
NATIONAL_BANK_SHORT=National banks
@@ -1640,6 +1650,7 @@ SPECIFIC_BANKS_SHORT=Specific banks
US_POSTAL_MONEY_ORDER_SHORT=US Money Order
# suppress inspection "UnusedProperty"
CASH_DEPOSIT_SHORT=Cash Deposit
+WESTERN_UNION_SHORT=Western Union
# Do not translate brand names
OK_PAY=OKPay
diff --git a/core/src/main/java/io/bisq/core/offer/OfferPayload.java b/core/src/main/java/io/bisq/core/offer/OfferPayload.java
index a96c932790..a5606e9439 100644
--- a/core/src/main/java/io/bisq/core/offer/OfferPayload.java
+++ b/core/src/main/java/io/bisq/core/offer/OfferPayload.java
@@ -23,8 +23,8 @@ import io.bisq.common.proto.ProtoUtil;
import io.bisq.common.util.JsonExclude;
import io.bisq.generated.protobuffer.PB;
import io.bisq.network.p2p.NodeAddress;
-import io.bisq.network.p2p.storage.payload.RequiresOwnerIsOnlinePayload;
import io.bisq.network.p2p.storage.payload.ProtectedStoragePayload;
+import io.bisq.network.p2p.storage.payload.RequiresOwnerIsOnlinePayload;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
diff --git a/core/src/main/java/io/bisq/core/payment/PaymentAccountFactory.java b/core/src/main/java/io/bisq/core/payment/PaymentAccountFactory.java
index 96bf300ae6..4651e10839 100644
--- a/core/src/main/java/io/bisq/core/payment/PaymentAccountFactory.java
+++ b/core/src/main/java/io/bisq/core/payment/PaymentAccountFactory.java
@@ -52,6 +52,8 @@ public class PaymentAccountFactory {
return new CashDepositAccount();
case PaymentMethod.BLOCK_CHAINS_ID:
return new CryptoCurrencyAccount();
+ case PaymentMethod.WESTERN_UNION_ID:
+ return new WesternUnionAccount();
default:
throw new RuntimeException("Not supported PaymentMethod: " + paymentMethod);
}
diff --git a/core/src/main/java/io/bisq/core/payment/WesternUnionAccount.java b/core/src/main/java/io/bisq/core/payment/WesternUnionAccount.java
new file mode 100644
index 0000000000..823cb2a87e
--- /dev/null
+++ b/core/src/main/java/io/bisq/core/payment/WesternUnionAccount.java
@@ -0,0 +1,65 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package io.bisq.core.payment;
+
+import io.bisq.core.payment.payload.PaymentAccountPayload;
+import io.bisq.core.payment.payload.PaymentMethod;
+import io.bisq.core.payment.payload.WesternUnionAccountPayload;
+
+public final class WesternUnionAccount extends CountryBasedPaymentAccount {
+ public WesternUnionAccount() {
+ super(PaymentMethod.WESTERN_UNION);
+ }
+
+ @Override
+ protected PaymentAccountPayload createPayload() {
+ return new WesternUnionAccountPayload(paymentMethod.getId(), id);
+ }
+
+ public String getEmail() {
+ return ((WesternUnionAccountPayload) paymentAccountPayload).getEmail();
+ }
+
+ public void setEmail(String email) {
+ ((WesternUnionAccountPayload) paymentAccountPayload).setEmail(email);
+ }
+
+ public String getFullName() {
+ return ((WesternUnionAccountPayload) paymentAccountPayload).getHolderName();
+ }
+
+ public void setFullName(String email) {
+ ((WesternUnionAccountPayload) paymentAccountPayload).setHolderName(email);
+ }
+
+ public String getCity() {
+ return ((WesternUnionAccountPayload) paymentAccountPayload).getCity();
+ }
+
+ public void setCity(String email) {
+ ((WesternUnionAccountPayload) paymentAccountPayload).setCity(email);
+ }
+
+ public String getState() {
+ return ((WesternUnionAccountPayload) paymentAccountPayload).getState();
+ }
+
+ public void setState(String email) {
+ ((WesternUnionAccountPayload) paymentAccountPayload).setState(email);
+ }
+}
diff --git a/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java b/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java
index dcd717ce39..438a9ad55f 100644
--- a/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java
+++ b/core/src/main/java/io/bisq/core/payment/payload/PaymentMethod.java
@@ -60,6 +60,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable {
public static final String INTERAC_E_TRANSFER_ID = "INTERAC_E_TRANSFER";
public static final String US_POSTAL_MONEY_ORDER_ID = "US_POSTAL_MONEY_ORDER";
public static final String CASH_DEPOSIT_ID = "CASH_DEPOSIT";
+ public static final String WESTERN_UNION_ID = "WESTERN_UNION";
public static final String BLOCK_CHAINS_ID = "BLOCK_CHAINS";
public static PaymentMethod OK_PAY;
@@ -76,6 +77,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable {
public static PaymentMethod INTERAC_E_TRANSFER;
public static PaymentMethod US_POSTAL_MONEY_ORDER;
public static PaymentMethod CASH_DEPOSIT;
+ public static PaymentMethod WESTERN_UNION;
public static PaymentMethod BLOCK_CHAINS;
private static List ALL_VALUES;
@@ -171,6 +173,7 @@ public final class PaymentMethod implements PersistablePayload, Comparable {
// Global
CASH_DEPOSIT = new PaymentMethod(CASH_DEPOSIT_ID, 4 * DAY, maxTradeLimitMidRisk),
+ WESTERN_UNION = new PaymentMethod(WESTERN_UNION_ID, 4 * DAY, maxTradeLimitMidRisk),
NATIONAL_BANK = new PaymentMethod(NATIONAL_BANK_ID, 4 * DAY, maxTradeLimitMidRisk),
SAME_BANK = new PaymentMethod(SAME_BANK_ID, 2 * DAY, maxTradeLimitMidRisk),
SPECIFIC_BANKS = new PaymentMethod(SPECIFIC_BANKS_ID, 4 * DAY, maxTradeLimitMidRisk),
diff --git a/core/src/main/java/io/bisq/core/payment/payload/WesternUnionAccountPayload.java b/core/src/main/java/io/bisq/core/payment/payload/WesternUnionAccountPayload.java
new file mode 100644
index 0000000000..c6ca8abbf1
--- /dev/null
+++ b/core/src/main/java/io/bisq/core/payment/payload/WesternUnionAccountPayload.java
@@ -0,0 +1,134 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package io.bisq.core.payment.payload;
+
+import com.google.protobuf.Message;
+import io.bisq.common.locale.BankUtil;
+import io.bisq.common.locale.CountryUtil;
+import io.bisq.generated.protobuffer.PB;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.util.CollectionUtils;
+
+import javax.annotation.Nullable;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
+
+@EqualsAndHashCode(callSuper = true)
+@ToString
+@Setter
+@Getter
+@Slf4j
+public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayload {
+ private String holderName;
+ private String city;
+ private String state = ""; // is optional. we don't use @Nullable because it would makes UI code more complex.
+ private String email;
+
+ public WesternUnionAccountPayload(String paymentMethod, String id) {
+ super(paymentMethod, id);
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////
+ // PROTO BUFFER
+ ///////////////////////////////////////////////////////////////////////////////////////////
+
+ private WesternUnionAccountPayload(String paymentMethodName,
+ String id,
+ String countryCode,
+ String holderName,
+ String city,
+ String state,
+ String email,
+ long maxTradePeriod,
+ @Nullable Map excludeFromJsonDataMap) {
+ super(paymentMethodName,
+ id,
+ countryCode,
+ maxTradePeriod,
+ excludeFromJsonDataMap);
+ this.holderName = holderName;
+ this.city = city;
+ this.state = state;
+ this.email = email;
+ }
+
+ @Override
+ public Message toProtoMessage() {
+ PB.WesternUnionAccountPayload.Builder builder =
+ PB.WesternUnionAccountPayload.newBuilder()
+ .setHolderName(holderName)
+ .setCity(city)
+ .setState(state)
+ .setEmail(email);
+
+ final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
+ .getCountryBasedPaymentAccountPayloadBuilder()
+ .setWesternUnionAccountPayload(builder);
+ return getPaymentAccountPayloadBuilder()
+ .setCountryBasedPaymentAccountPayload(countryBasedPaymentAccountPayload)
+ .build();
+ }
+
+ public static PaymentAccountPayload fromProto(PB.PaymentAccountPayload proto) {
+ PB.CountryBasedPaymentAccountPayload countryBasedPaymentAccountPayload = proto.getCountryBasedPaymentAccountPayload();
+ PB.WesternUnionAccountPayload westernUnionAccountPayload = countryBasedPaymentAccountPayload.getWesternUnionAccountPayload();
+ return new WesternUnionAccountPayload(proto.getPaymentMethodId(),
+ proto.getId(),
+ countryBasedPaymentAccountPayload.getCountryCode(),
+ westernUnionAccountPayload.getHolderName(),
+ westernUnionAccountPayload.getCity(),
+ westernUnionAccountPayload.getState(),
+ westernUnionAccountPayload.getEmail(),
+ proto.getMaxTradePeriod(),
+ CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////
+ // API
+ ///////////////////////////////////////////////////////////////////////////////////////////
+
+ @Override
+ public String getPaymentDetails() {
+ return "Western Union - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
+ }
+
+ @Override
+ public String getPaymentDetailsForTradePopup() {
+ String cityState = BankUtil.isStateRequired(countryCode) ? ("City / State: " + city + " / " + state + "\n")
+ : ("City: " + city + "\n");
+ return "Full name: " + holderName + "\n" +
+ cityState +
+ "County: " + CountryUtil.getNameByCode(countryCode) + "\n" +
+ "Email: " + email;
+ }
+
+ @Override
+ public byte[] getAgeWitnessInputData() {
+ String all = this.countryCode +
+ this.holderName +
+ this.email;
+ return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
+ }
+}
diff --git a/core/src/main/java/io/bisq/core/proto/CoreProtoResolver.java b/core/src/main/java/io/bisq/core/proto/CoreProtoResolver.java
index d706e4def7..673edd1f5e 100644
--- a/core/src/main/java/io/bisq/core/proto/CoreProtoResolver.java
+++ b/core/src/main/java/io/bisq/core/proto/CoreProtoResolver.java
@@ -35,6 +35,8 @@ public class CoreProtoResolver implements ProtoResolver {
"(PB.PaymentAccountPayload.CountryBasedPaymentAccountPayload.BankAccountPayload). " +
"messageCase=" + proto.getMessageCase());
}
+ case WESTERN_UNION_ACCOUNT_PAYLOAD:
+ return WesternUnionAccountPayload.fromProto(proto);
case CASH_DEPOSIT_ACCOUNT_PAYLOAD:
return CashDepositAccountPayload.fromProto(proto);
case SEPA_ACCOUNT_PAYLOAD:
@@ -81,4 +83,4 @@ public class CoreProtoResolver implements ProtoResolver {
throw new ProtobufferException("PB.PersistableNetworkPayload is null");
}
}
-}
\ No newline at end of file
+}
diff --git a/gui/src/main/java/io/bisq/gui/components/paymentmethods/WesternUnionForm.java b/gui/src/main/java/io/bisq/gui/components/paymentmethods/WesternUnionForm.java
new file mode 100644
index 0000000000..0f64236f7e
--- /dev/null
+++ b/gui/src/main/java/io/bisq/gui/components/paymentmethods/WesternUnionForm.java
@@ -0,0 +1,270 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package io.bisq.gui.components.paymentmethods;
+
+import io.bisq.common.locale.*;
+import io.bisq.common.util.Tuple2;
+import io.bisq.common.util.Tuple3;
+import io.bisq.core.payment.AccountAgeWitnessService;
+import io.bisq.core.payment.CountryBasedPaymentAccount;
+import io.bisq.core.payment.PaymentAccount;
+import io.bisq.core.payment.payload.PaymentAccountPayload;
+import io.bisq.core.payment.payload.WesternUnionAccountPayload;
+import io.bisq.gui.components.InputTextField;
+import io.bisq.gui.main.overlays.popups.Popup;
+import io.bisq.gui.util.BSFormatter;
+import io.bisq.gui.util.FormBuilder;
+import io.bisq.gui.util.Layout;
+import io.bisq.gui.util.validation.EmailValidator;
+import io.bisq.gui.util.validation.InputValidator;
+import javafx.collections.FXCollections;
+import javafx.scene.control.ComboBox;
+import javafx.scene.control.Label;
+import javafx.scene.layout.GridPane;
+import javafx.util.StringConverter;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+
+import static io.bisq.gui.util.FormBuilder.addLabelTextFieldWithCopyIcon;
+
+@Slf4j
+public class WesternUnionForm extends PaymentMethodForm {
+
+ public static int addFormForBuyer(GridPane gridPane, int gridRow,
+ PaymentAccountPayload paymentAccountPayload) {
+ final WesternUnionAccountPayload payload = (WesternUnionAccountPayload) paymentAccountPayload;
+ addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.fullName"),
+ payload.getHolderName());
+ addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.city"),
+ payload.getCity());
+ if (BankUtil.isStateRequired(payload.getCountryCode()))
+ addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.state"),
+ payload.getState());
+ addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.email"),
+ payload.getEmail());
+
+ return gridRow;
+ }
+
+ protected final WesternUnionAccountPayload westernUnionAccountPayload;
+ protected InputTextField holderNameInputTextField, emailInputTextField, cityInputTextField, stateInputTextField;
+ private Label stateLabel;
+ private ComboBox currencyComboBox;
+ private final EmailValidator emailValidator;
+
+ public WesternUnionForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
+ GridPane gridPane, int gridRow, BSFormatter formatter) {
+ super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
+ this.westernUnionAccountPayload = (WesternUnionAccountPayload) paymentAccount.paymentAccountPayload;
+
+ emailValidator = new EmailValidator();
+ }
+
+ @Override
+ public void addFormForDisplayAccount() {
+ gridRowFrom = gridRow;
+ String countryCode = westernUnionAccountPayload.getCountryCode();
+
+ FormBuilder.addLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.paymentMethod"),
+ Res.get(paymentAccount.getPaymentMethod().getId()));
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.country"),
+ getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : "");
+ TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
+ String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"),
+ nameAndCode);
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.fullName"),
+ westernUnionAccountPayload.getHolderName());
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.account.city"),
+ westernUnionAccountPayload.getCity()).second.setMouseTransparent(false);
+ if (BankUtil.isStateRequired(westernUnionAccountPayload.getCountryCode()))
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.account.state"),
+ westernUnionAccountPayload.getState()).second.setMouseTransparent(false);
+ FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
+ westernUnionAccountPayload.getEmail());
+ addLimitations();
+ }
+
+ @Override
+ public void addFormForAddAccount() {
+ gridRowFrom = gridRow + 1;
+
+ Tuple3