mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-23 23:06:39 +01:00
Add missing parts for WU support
This commit is contained in:
parent
8b72eba1e0
commit
6f0a7e7036
12 changed files with 278 additions and 342 deletions
|
@ -39,7 +39,7 @@ public class BankUtil {
|
||||||
case "CA":
|
case "CA":
|
||||||
case "SE":
|
case "SE":
|
||||||
case "HK":
|
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.
|
// Though that handling should be optimized in futures.
|
||||||
return true;
|
return true;
|
||||||
// return false;
|
// return false;
|
||||||
|
@ -250,4 +250,18 @@ public class BankUtil {
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -873,14 +873,9 @@ message CashDepositAccountPayload {
|
||||||
|
|
||||||
message WesternUnionAccountPayload {
|
message WesternUnionAccountPayload {
|
||||||
string holder_name = 1;
|
string holder_name = 1;
|
||||||
string holder_email = 2;
|
string city = 2;
|
||||||
string bank_name = 3;
|
string state = 3;
|
||||||
string bank_id = 4;
|
string email = 4;
|
||||||
string branch_id = 5;
|
|
||||||
string account_nr = 6;
|
|
||||||
string account_type = 7;
|
|
||||||
string requirements = 8;
|
|
||||||
string holder_tax_id = 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message SepaAccountPayload {
|
message SepaAccountPayload {
|
||||||
|
|
|
@ -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.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.
|
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"
|
# 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
|
portfolio.pending.step2_buyer.tradeId=Please don't forget to add the trade ID
|
||||||
# suppress inspection "TrailingSpacesInProperty"
|
# suppress inspection "TrailingSpacesInProperty"
|
||||||
portfolio.pending.step2_buyer.assign= as \"reason for payment\" so the receiver can assign your payment to this trade.\n\n
|
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"
|
# 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=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.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"
|
# suppress inspection "TrailingSpacesInProperty"
|
||||||
portfolio.pending.step2_buyer.postal=Please send {0} by \"US Postal Money Order\" to the BTC seller.\n\n
|
portfolio.pending.step2_buyer.postal=Please send {0} by \"US Postal Money Order\" to the BTC seller.\n\n
|
||||||
# suppress inspection "TrailingSpacesInProperty"
|
# 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\
|
portfolio.pending.step2_buyer.paperReceipt.msg=Remember:\n\
|
||||||
You need to write on the paper receipt: NO REFUNDS.\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.
|
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.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
|
||||||
|
@ -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\
|
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\
|
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}
|
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\
|
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}
|
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\".
|
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.no=Account no.:
|
||||||
payment.account.name=Account name:
|
payment.account.name=Account name:
|
||||||
payment.account.owner=Account owner full 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.bank.country=Country of bank:
|
||||||
payment.account.name.email=Account owner full name / email
|
payment.account.name.email=Account owner full name / email
|
||||||
payment.account.name.emailAndHolderId=Account owner full name / email / {0}
|
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 \
|
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.
|
||||||
|
|
||||||
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 \
|
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.
|
||||||
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
|
|
||||||
|
|
||||||
# We use constants from the code so we do not use our normal naming convention
|
# We use constants from the code so we do not use our normal naming convention
|
||||||
# dynamic values are not recognized by IntelliJ
|
# dynamic values are not recognized by IntelliJ
|
||||||
|
|
|
@ -23,8 +23,8 @@ import io.bisq.common.proto.ProtoUtil;
|
||||||
import io.bisq.common.util.JsonExclude;
|
import io.bisq.common.util.JsonExclude;
|
||||||
import io.bisq.generated.protobuffer.PB;
|
import io.bisq.generated.protobuffer.PB;
|
||||||
import io.bisq.network.p2p.NodeAddress;
|
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.ProtectedStoragePayload;
|
||||||
|
import io.bisq.network.p2p.storage.payload.RequiresOwnerIsOnlinePayload;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
|
@ -17,13 +17,11 @@
|
||||||
|
|
||||||
package io.bisq.core.payment;
|
package io.bisq.core.payment;
|
||||||
|
|
||||||
import io.bisq.core.payment.payload.WesternUnionAccountPayload;
|
|
||||||
import io.bisq.core.payment.payload.PaymentAccountPayload;
|
import io.bisq.core.payment.payload.PaymentAccountPayload;
|
||||||
import io.bisq.core.payment.payload.PaymentMethod;
|
import io.bisq.core.payment.payload.PaymentMethod;
|
||||||
|
import io.bisq.core.payment.payload.WesternUnionAccountPayload;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
public final class WesternUnionAccount extends CountryBasedPaymentAccount {
|
||||||
|
|
||||||
public final class WesternUnionAccount extends CountryBasedPaymentAccount implements SameCountryRestrictedBankAccount {
|
|
||||||
public WesternUnionAccount() {
|
public WesternUnionAccount() {
|
||||||
super(PaymentMethod.WESTERN_UNION);
|
super(PaymentMethod.WESTERN_UNION);
|
||||||
}
|
}
|
||||||
|
@ -33,22 +31,35 @@ public final class WesternUnionAccount extends CountryBasedPaymentAccount implem
|
||||||
return new WesternUnionAccountPayload(paymentMethod.getId(), id);
|
return new WesternUnionAccountPayload(paymentMethod.getId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public String getEmail() {
|
||||||
public String getBankId() {
|
return ((WesternUnionAccountPayload) paymentAccountPayload).getEmail();
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public void setEmail(String email) {
|
||||||
public String getCountryCode() {
|
((WesternUnionAccountPayload) paymentAccountPayload).setEmail(email);
|
||||||
return getCountry() != null ? getCountry().code : "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nullable
|
public String getFullName() {
|
||||||
public String getRequirements() {
|
return ((WesternUnionAccountPayload) paymentAccountPayload).getHolderName();
|
||||||
return ((WesternUnionAccountPayload) paymentAccountPayload).getRequirements();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRequirements(String requirements) {
|
public void setFullName(String email) {
|
||||||
((WesternUnionAccountPayload) paymentAccountPayload).setRequirements(requirements);
|
((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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,6 @@ package io.bisq.core.payment.payload;
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
import io.bisq.common.locale.BankUtil;
|
import io.bisq.common.locale.BankUtil;
|
||||||
import io.bisq.common.locale.CountryUtil;
|
import io.bisq.common.locale.CountryUtil;
|
||||||
import io.bisq.common.locale.Res;
|
|
||||||
import io.bisq.generated.protobuffer.PB;
|
import io.bisq.generated.protobuffer.PB;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
@ -33,7 +32,6 @@ import javax.annotation.Nullable;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@ToString
|
@ToString
|
||||||
|
@ -41,9 +39,10 @@ import java.util.Optional;
|
||||||
@Getter
|
@Getter
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayload {
|
public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayload {
|
||||||
private String holderName="";
|
private String holderName;
|
||||||
@Nullable
|
private String city;
|
||||||
private String requirements;
|
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) {
|
public WesternUnionAccountPayload(String paymentMethod, String id) {
|
||||||
super(paymentMethod, id);
|
super(paymentMethod, id);
|
||||||
|
@ -55,27 +54,33 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
private WesternUnionAccountPayload(String paymentMethodName,
|
private WesternUnionAccountPayload(String paymentMethodName,
|
||||||
String id,
|
String id,
|
||||||
String countryCode,
|
String countryCode,
|
||||||
String holderName,
|
String holderName,
|
||||||
@Nullable String requirements,
|
String city,
|
||||||
long maxTradePeriod,
|
String state,
|
||||||
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
String email,
|
||||||
|
long maxTradePeriod,
|
||||||
|
@Nullable Map<String, String> excludeFromJsonDataMap) {
|
||||||
super(paymentMethodName,
|
super(paymentMethodName,
|
||||||
id,
|
id,
|
||||||
countryCode,
|
countryCode,
|
||||||
maxTradePeriod,
|
maxTradePeriod,
|
||||||
excludeFromJsonDataMap);
|
excludeFromJsonDataMap);
|
||||||
this.holderName = holderName;
|
this.holderName = holderName;
|
||||||
this.requirements = requirements;
|
this.city = city;
|
||||||
|
this.state = state;
|
||||||
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Message toProtoMessage() {
|
public Message toProtoMessage() {
|
||||||
PB.WesternUnionAccountPayload.Builder builder =
|
PB.WesternUnionAccountPayload.Builder builder =
|
||||||
PB.WesternUnionAccountPayload.newBuilder()
|
PB.WesternUnionAccountPayload.newBuilder()
|
||||||
.setHolderName(holderName);
|
.setHolderName(holderName)
|
||||||
Optional.ofNullable(requirements).ifPresent(builder::setRequirements);
|
.setCity(city)
|
||||||
|
.setState(state)
|
||||||
|
.setEmail(email);
|
||||||
|
|
||||||
final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
final PB.CountryBasedPaymentAccountPayload.Builder countryBasedPaymentAccountPayload = getPaymentAccountPayloadBuilder()
|
||||||
.getCountryBasedPaymentAccountPayloadBuilder()
|
.getCountryBasedPaymentAccountPayloadBuilder()
|
||||||
|
@ -92,7 +97,9 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
proto.getId(),
|
proto.getId(),
|
||||||
countryBasedPaymentAccountPayload.getCountryCode(),
|
countryBasedPaymentAccountPayload.getCountryCode(),
|
||||||
westernUnionAccountPayload.getHolderName(),
|
westernUnionAccountPayload.getHolderName(),
|
||||||
westernUnionAccountPayload.getRequirements().isEmpty() ? null : westernUnionAccountPayload.getRequirements(),
|
westernUnionAccountPayload.getCity(),
|
||||||
|
westernUnionAccountPayload.getState(),
|
||||||
|
westernUnionAccountPayload.getEmail(),
|
||||||
proto.getMaxTradePeriod(),
|
proto.getMaxTradePeriod(),
|
||||||
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
CollectionUtils.isEmpty(proto.getExcludeFromJsonDataMap()) ? null : new HashMap<>(proto.getExcludeFromJsonDataMap()));
|
||||||
}
|
}
|
||||||
|
@ -104,30 +111,24 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetails() {
|
public String getPaymentDetails() {
|
||||||
return "WU deposit - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
|
return "Western Union - " + getPaymentDetailsForTradePopup().replace("\n", ", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getPaymentDetailsForTradePopup() {
|
public String getPaymentDetailsForTradePopup() {
|
||||||
String requirementsString = requirements != null && !requirements.isEmpty() ?
|
String cityState = BankUtil.isStateRequired(countryCode) ? ("City / State: " + city + " / " + state + "\n")
|
||||||
("Extra requirements: " + requirements + "\n") : "";
|
: ("City: " + city + "\n");
|
||||||
|
return "Full name: " + holderName + "\n" +
|
||||||
return "Holder name: " + holderName + "\n" +
|
cityState +
|
||||||
requirementsString +
|
"County: " + CountryUtil.getNameByCode(countryCode) + "\n" +
|
||||||
CountryUtil.getNameByCode(countryCode);
|
"Email: " + email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getAgeWitnessInputData() {
|
public byte[] getAgeWitnessInputData() {
|
||||||
|
|
||||||
// We don't add holderName and holderEmail 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)
|
|
||||||
|
|
||||||
String all = this.countryCode +
|
String all = this.countryCode +
|
||||||
this.holderName +
|
this.holderName +
|
||||||
this.requirements;
|
this.email;
|
||||||
|
|
||||||
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
return super.getAgeWitnessInputData(all.getBytes(Charset.forName("UTF-8")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,141 +20,59 @@ package io.bisq.gui.components.paymentmethods;
|
||||||
import io.bisq.common.locale.*;
|
import io.bisq.common.locale.*;
|
||||||
import io.bisq.common.util.Tuple2;
|
import io.bisq.common.util.Tuple2;
|
||||||
import io.bisq.common.util.Tuple3;
|
import io.bisq.common.util.Tuple3;
|
||||||
import io.bisq.common.util.Tuple4;
|
|
||||||
import io.bisq.core.payment.AccountAgeWitnessService;
|
import io.bisq.core.payment.AccountAgeWitnessService;
|
||||||
import io.bisq.core.payment.CountryBasedPaymentAccount;
|
import io.bisq.core.payment.CountryBasedPaymentAccount;
|
||||||
import io.bisq.core.payment.PaymentAccount;
|
import io.bisq.core.payment.PaymentAccount;
|
||||||
import io.bisq.core.payment.payload.WesternUnionAccountPayload;
|
|
||||||
import io.bisq.core.payment.payload.PaymentAccountPayload;
|
import io.bisq.core.payment.payload.PaymentAccountPayload;
|
||||||
|
import io.bisq.core.payment.payload.WesternUnionAccountPayload;
|
||||||
import io.bisq.gui.components.InputTextField;
|
import io.bisq.gui.components.InputTextField;
|
||||||
import io.bisq.gui.main.overlays.popups.Popup;
|
import io.bisq.gui.main.overlays.popups.Popup;
|
||||||
import io.bisq.gui.util.BSFormatter;
|
import io.bisq.gui.util.BSFormatter;
|
||||||
import io.bisq.gui.util.FormBuilder;
|
import io.bisq.gui.util.FormBuilder;
|
||||||
import io.bisq.gui.util.Layout;
|
import io.bisq.gui.util.Layout;
|
||||||
import io.bisq.gui.util.validation.*;
|
import io.bisq.gui.util.validation.EmailValidator;
|
||||||
|
import io.bisq.gui.util.validation.InputValidator;
|
||||||
import javafx.collections.FXCollections;
|
import javafx.collections.FXCollections;
|
||||||
import javafx.scene.control.ComboBox;
|
import javafx.scene.control.ComboBox;
|
||||||
import javafx.scene.control.Label;
|
import javafx.scene.control.Label;
|
||||||
import javafx.scene.control.TextArea;
|
|
||||||
import javafx.scene.control.TextField;
|
|
||||||
import javafx.scene.layout.GridPane;
|
import javafx.scene.layout.GridPane;
|
||||||
import javafx.util.StringConverter;
|
import javafx.util.StringConverter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
|
import static io.bisq.gui.util.FormBuilder.addLabelTextFieldWithCopyIcon;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class WesternUnionForm extends PaymentMethodForm {
|
public class WesternUnionForm extends PaymentMethodForm {
|
||||||
private static final Logger log = LoggerFactory.getLogger(WesternUnionForm.class);
|
|
||||||
|
|
||||||
public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) {
|
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||||
WesternUnionAccountPayload data = (WesternUnionAccountPayload) paymentAccountPayload;
|
PaymentAccountPayload paymentAccountPayload) {
|
||||||
String holderName = data.getHolderName();
|
final WesternUnionAccountPayload payload = (WesternUnionAccountPayload) paymentAccountPayload;
|
||||||
String countryCode = data.getCountryCode();
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.fullName"),
|
||||||
String requirements = data.getRequirements();
|
payload.getHolderName());
|
||||||
boolean showRequirements = requirements != null && !requirements.isEmpty();
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.city"),
|
||||||
|
payload.getCity());
|
||||||
FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"),
|
if (BankUtil.isStateRequired(payload.getCountryCode()))
|
||||||
data.getHolderName());
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.account.state"),
|
||||||
|
payload.getState());
|
||||||
if (!showRequirements)
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.email"),
|
||||||
FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.country"),
|
payload.getEmail());
|
||||||
CountryUtil.getNameAndCode(countryCode));
|
|
||||||
else
|
|
||||||
requirements += "\n" + Res.get("payment.country") + " " + CountryUtil.getNameAndCode(countryCode);
|
|
||||||
|
|
||||||
// We don't want to display more than 6 rows to avoid scrolling, so if we get too many fields we combine them horizontally
|
|
||||||
int nrRows = 0;
|
|
||||||
/* if (BankUtil.isBankNameRequired(countryCode)) */
|
|
||||||
/* nrRows++; */
|
|
||||||
/* if (BankUtil.isBankIdRequired(countryCode)) */
|
|
||||||
/* nrRows++; */
|
|
||||||
/* if (BankUtil.isBranchIdRequired(countryCode)) */
|
|
||||||
/* nrRows++; */
|
|
||||||
/* if (BankUtil.isAccountNrRequired(countryCode)) */
|
|
||||||
/* nrRows++; */
|
|
||||||
/* if (BankUtil.isAccountTypeRequired(countryCode)) */
|
|
||||||
/* nrRows++; */
|
|
||||||
|
|
||||||
/* String bankNameLabel = BankUtil.getBankNameLabel(countryCode); */
|
|
||||||
/* String bankIdLabel = BankUtil.getBankIdLabel(countryCode); */
|
|
||||||
/* String branchIdLabel = BankUtil.getBranchIdLabel(countryCode); */
|
|
||||||
/* String accountNrLabel = BankUtil.getAccountNrLabel(countryCode); */
|
|
||||||
/* String accountTypeLabel = BankUtil.getAccountTypeLabel(countryCode); */
|
|
||||||
|
|
||||||
/* boolean accountNrAccountTypeCombined = false; */
|
|
||||||
/* boolean bankNameBankIdCombined = false; */
|
|
||||||
/* boolean bankIdBranchIdCombined = false; */
|
|
||||||
/* boolean bankNameBranchIdCombined = false; */
|
|
||||||
/* boolean branchIdAccountNrCombined = false; */
|
|
||||||
/* if (nrRows > 2) { */
|
|
||||||
/* // Try combine AccountNr + AccountType */
|
|
||||||
/* accountNrAccountTypeCombined = BankUtil.isAccountNrRequired(countryCode) && BankUtil.isAccountTypeRequired(countryCode); */
|
|
||||||
/* if (accountNrAccountTypeCombined) */
|
|
||||||
/* nrRows--; */
|
|
||||||
|
|
||||||
/* if (nrRows > 2) { */
|
|
||||||
/* // Next we try BankName + BankId */
|
|
||||||
/* bankNameBankIdCombined = BankUtil.isBankNameRequired(countryCode) && BankUtil.isBankIdRequired(countryCode); */
|
|
||||||
/* if (bankNameBankIdCombined) */
|
|
||||||
/* nrRows--; */
|
|
||||||
|
|
||||||
/* if (nrRows > 2) { */
|
|
||||||
/* // Next we try BankId + BranchId */
|
|
||||||
/* bankIdBranchIdCombined = !bankNameBankIdCombined && BankUtil.isBankIdRequired(countryCode) && */
|
|
||||||
/* BankUtil.isBranchIdRequired(countryCode); */
|
|
||||||
/* if (bankIdBranchIdCombined) */
|
|
||||||
/* nrRows--; */
|
|
||||||
|
|
||||||
/* if (nrRows > 2) { */
|
|
||||||
/* // Next we try BankId + BranchId */
|
|
||||||
/* bankNameBranchIdCombined = !bankNameBankIdCombined && !bankIdBranchIdCombined && */
|
|
||||||
/* BankUtil.isBankNameRequired(countryCode) && BankUtil.isBranchIdRequired(countryCode); */
|
|
||||||
/* if (bankNameBranchIdCombined) */
|
|
||||||
/* nrRows--; */
|
|
||||||
|
|
||||||
/* if (nrRows > 2) { */
|
|
||||||
/* branchIdAccountNrCombined = !bankNameBranchIdCombined && !bankIdBranchIdCombined && */
|
|
||||||
/* !accountNrAccountTypeCombined && */
|
|
||||||
/* BankUtil.isBranchIdRequired(countryCode) && BankUtil.isAccountNrRequired(countryCode); */
|
|
||||||
/* if (branchIdAccountNrCombined) */
|
|
||||||
/* nrRows--; */
|
|
||||||
|
|
||||||
/* if (nrRows > 2) */
|
|
||||||
/* log.warn("We still have too many rows...."); */
|
|
||||||
/* } */
|
|
||||||
/* } */
|
|
||||||
/* } */
|
|
||||||
/* } */
|
|
||||||
/* } */
|
|
||||||
|
|
||||||
if (showRequirements) {
|
|
||||||
TextArea textArea = FormBuilder.addLabelTextArea(gridPane, ++gridRow, Res.get("payment.extras"), "").second;
|
|
||||||
textArea.setMinHeight(45);
|
|
||||||
textArea.setMaxHeight(45);
|
|
||||||
textArea.setEditable(false);
|
|
||||||
textArea.setId("text-area-disabled");
|
|
||||||
textArea.setText(requirements);
|
|
||||||
}
|
|
||||||
|
|
||||||
return gridRow;
|
return gridRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected final WesternUnionAccountPayload westernUnionAccountPayload;
|
protected final WesternUnionAccountPayload westernUnionAccountPayload;
|
||||||
private Label holderIdLabel;
|
protected InputTextField holderNameInputTextField, emailInputTextField, cityInputTextField, stateInputTextField;
|
||||||
protected InputTextField holderNameInputTextField;
|
private Label stateLabel;
|
||||||
private Tuple2<Label, InputTextField> accountNrTuple;
|
|
||||||
private Tuple2<Label, ComboBox> accountTypeTuple;
|
|
||||||
private Label accountTypeLabel;
|
|
||||||
private ComboBox<String> accountTypeComboBox;
|
|
||||||
private boolean validatorsApplied;
|
|
||||||
private ComboBox<TradeCurrency> currencyComboBox;
|
private ComboBox<TradeCurrency> currencyComboBox;
|
||||||
|
private final EmailValidator emailValidator;
|
||||||
|
|
||||||
public WesternUnionForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
|
public WesternUnionForm(PaymentAccount paymentAccount, AccountAgeWitnessService accountAgeWitnessService, InputValidator inputValidator,
|
||||||
GridPane gridPane, int gridRow, BSFormatter formatter) {
|
GridPane gridPane, int gridRow, BSFormatter formatter) {
|
||||||
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
||||||
this.westernUnionAccountPayload = (WesternUnionAccountPayload) paymentAccount.paymentAccountPayload;
|
this.westernUnionAccountPayload = (WesternUnionAccountPayload) paymentAccount.paymentAccountPayload;
|
||||||
|
|
||||||
|
emailValidator = new EmailValidator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -171,19 +89,15 @@ public class WesternUnionForm extends PaymentMethodForm {
|
||||||
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
|
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
|
||||||
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"),
|
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.currency"),
|
||||||
nameAndCode);
|
nameAndCode);
|
||||||
addHolderNameAndIdForDisplayAccount();
|
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.fullName"),
|
||||||
|
westernUnionAccountPayload.getHolderName());
|
||||||
String requirements = westernUnionAccountPayload.getRequirements();
|
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.account.city"),
|
||||||
boolean showRequirements = requirements != null && !requirements.isEmpty();
|
westernUnionAccountPayload.getCity()).second.setMouseTransparent(false);
|
||||||
if (showRequirements) {
|
if (BankUtil.isStateRequired(westernUnionAccountPayload.getCountryCode()))
|
||||||
TextArea textArea = FormBuilder.addLabelTextArea(gridPane, ++gridRow, Res.get("payment.extras"), "").second;
|
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.account.state"),
|
||||||
textArea.setMinHeight(30);
|
westernUnionAccountPayload.getState()).second.setMouseTransparent(false);
|
||||||
textArea.setMaxHeight(30);
|
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
|
||||||
textArea.setEditable(false);
|
westernUnionAccountPayload.getEmail());
|
||||||
textArea.setId("text-area-disabled");
|
|
||||||
textArea.setText(requirements);
|
|
||||||
}
|
|
||||||
|
|
||||||
addLimitations();
|
addLimitations();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,12 +148,10 @@ public class WesternUnionForm extends PaymentMethodForm {
|
||||||
paymentAccount.setSingleTradeCurrency(currency);
|
paymentAccount.setSingleTradeCurrency(currency);
|
||||||
currencyComboBox.setDisable(false);
|
currencyComboBox.setDisable(false);
|
||||||
currencyComboBox.getSelectionModel().select(currency);
|
currencyComboBox.getSelectionModel().select(currency);
|
||||||
|
|
||||||
holderNameInputTextField.resetValidation();
|
|
||||||
|
|
||||||
updateFromInputs();
|
updateFromInputs();
|
||||||
|
applyIsStateRequired();
|
||||||
onCountryChanged();
|
cityInputTextField.setText("");
|
||||||
|
stateInputTextField.setText("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -286,15 +198,37 @@ public class WesternUnionForm extends PaymentMethodForm {
|
||||||
});
|
});
|
||||||
currencyComboBox.setDisable(true);
|
currencyComboBox.setDisable(true);
|
||||||
|
|
||||||
addHolderNameAndId();
|
holderNameInputTextField = FormBuilder.addLabelInputTextField(gridPane,
|
||||||
|
++gridRow, Res.getWithCol("payment.account.fullName")).second;
|
||||||
TextArea requirementsTextArea = FormBuilder.addLabelTextArea(gridPane, ++gridRow, Res.get("payment.extras"), "").second;
|
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
requirementsTextArea.setMinHeight(30);
|
westernUnionAccountPayload.setHolderName(newValue);
|
||||||
requirementsTextArea.setMaxHeight(30);
|
|
||||||
requirementsTextArea.textProperty().addListener((ov, oldValue, newValue) -> {
|
|
||||||
westernUnionAccountPayload.setRequirements(newValue);
|
|
||||||
updateFromInputs();
|
updateFromInputs();
|
||||||
});
|
});
|
||||||
|
holderNameInputTextField.setValidator(inputValidator);
|
||||||
|
|
||||||
|
cityInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.account.city")).second;
|
||||||
|
cityInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
|
westernUnionAccountPayload.setCity(newValue);
|
||||||
|
updateFromInputs();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
final Tuple2<Label, InputTextField> tuple2 = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.account.state"));
|
||||||
|
stateLabel = tuple2.first;
|
||||||
|
stateInputTextField = tuple2.second;
|
||||||
|
stateInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
|
westernUnionAccountPayload.setState(newValue);
|
||||||
|
updateFromInputs();
|
||||||
|
|
||||||
|
});
|
||||||
|
applyIsStateRequired();
|
||||||
|
|
||||||
|
emailInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.email")).second;
|
||||||
|
emailInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||||
|
westernUnionAccountPayload.setEmail(newValue);
|
||||||
|
updateFromInputs();
|
||||||
|
});
|
||||||
|
emailInputTextField.setValidator(emailValidator);
|
||||||
|
|
||||||
addLimitations();
|
addLimitations();
|
||||||
addAccountNameTextFieldWithAutoFillCheckBox();
|
addAccountNameTextFieldWithAutoFillCheckBox();
|
||||||
|
@ -302,44 +236,24 @@ public class WesternUnionForm extends PaymentMethodForm {
|
||||||
updateFromInputs();
|
updateFromInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void applyIsStateRequired() {
|
||||||
|
final boolean stateRequired = BankUtil.isStateRequired(westernUnionAccountPayload.getCountryCode());
|
||||||
|
stateLabel.setManaged(stateRequired);
|
||||||
|
stateLabel.setVisible(stateRequired);
|
||||||
|
stateInputTextField.setManaged(stateRequired);
|
||||||
|
stateInputTextField.setVisible(stateRequired);
|
||||||
|
}
|
||||||
|
|
||||||
private CountryBasedPaymentAccount getCountryBasedPaymentAccount() {
|
private CountryBasedPaymentAccount getCountryBasedPaymentAccount() {
|
||||||
return (CountryBasedPaymentAccount) this.paymentAccount;
|
return (CountryBasedPaymentAccount) this.paymentAccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void onCountryChanged() {
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void addHolderNameAndId() {
|
|
||||||
Tuple2<Label, InputTextField> tuple = FormBuilder.addLabelInputTextField(gridPane,
|
|
||||||
++gridRow, Res.getWithCol("payment.account.owner"));
|
|
||||||
holderNameInputTextField = tuple.second;
|
|
||||||
holderNameInputTextField.setMinWidth(300);
|
|
||||||
holderNameInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
|
||||||
westernUnionAccountPayload.setHolderName(newValue);
|
|
||||||
updateFromInputs();
|
|
||||||
});
|
|
||||||
holderNameInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty());
|
|
||||||
holderNameInputTextField.setValidator(inputValidator);
|
|
||||||
|
|
||||||
/* emailInputTextField = FormBuilder.addLabelInputTextField(gridPane, ++gridRow, Res.get("payment.email")).second; */
|
|
||||||
/* emailInputTextField.textProperty().addListener((ov, oldValue, newValue) -> { */
|
|
||||||
/* westernUnionAccountPayload.setHolderEmail(newValue); */
|
|
||||||
/* updateFromInputs(); */
|
|
||||||
/* }); */
|
|
||||||
/* emailInputTextField.minWidthProperty().bind(currencyComboBox.widthProperty()); */
|
|
||||||
/* emailInputTextField.setValidator(emailValidator); */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void autoFillNameTextField() {
|
protected void autoFillNameTextField() {
|
||||||
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
if (useCustomAccountNameCheckBox != null && !useCustomAccountNameCheckBox.isSelected()) {
|
||||||
String bankId = null;
|
accountNameTextField.setText(Res.get(paymentAccount.getPaymentMethod().getId())
|
||||||
String countryCode = westernUnionAccountPayload.getCountryCode();
|
.concat(": ")
|
||||||
if (countryCode == null)
|
.concat(StringUtils.abbreviate(holderNameInputTextField.getText(), 9)));
|
||||||
countryCode = "";
|
|
||||||
|
|
||||||
String method = Res.get(paymentAccount.getPaymentMethod().getId());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,22 +262,9 @@ public class WesternUnionForm extends PaymentMethodForm {
|
||||||
boolean result = isAccountNameValid()
|
boolean result = isAccountNameValid()
|
||||||
&& paymentAccount.getSingleTradeCurrency() != null
|
&& paymentAccount.getSingleTradeCurrency() != null
|
||||||
&& getCountryBasedPaymentAccount().getCountry() != null
|
&& getCountryBasedPaymentAccount().getCountry() != null
|
||||||
&& holderNameInputTextField.getValidator().validate(westernUnionAccountPayload.getHolderName()).isValid;
|
&& inputValidator.validate(westernUnionAccountPayload.getHolderName()).isValid
|
||||||
|
&& inputValidator.validate(westernUnionAccountPayload.getCity()).isValid
|
||||||
String countryCode = westernUnionAccountPayload.getCountryCode();
|
&& emailValidator.validate(westernUnionAccountPayload.getEmail()).isValid;
|
||||||
allInputsValid.set(result);
|
allInputsValid.set(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addHolderNameAndIdForDisplayAccount() {
|
|
||||||
String countryCode = westernUnionAccountPayload.getCountryCode();
|
|
||||||
|
|
||||||
FormBuilder.addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.account.owner"),
|
|
||||||
westernUnionAccountPayload.getHolderName());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void addAcceptedBanksForAddAccount() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addAcceptedBanksForDisplayAccount() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,10 +22,7 @@ import io.bisq.common.locale.Res;
|
||||||
import io.bisq.common.util.Tuple2;
|
import io.bisq.common.util.Tuple2;
|
||||||
import io.bisq.common.util.Tuple3;
|
import io.bisq.common.util.Tuple3;
|
||||||
import io.bisq.core.app.BisqEnvironment;
|
import io.bisq.core.app.BisqEnvironment;
|
||||||
import io.bisq.core.payment.AccountAgeWitnessService;
|
import io.bisq.core.payment.*;
|
||||||
import io.bisq.core.payment.ClearXchangeAccount;
|
|
||||||
import io.bisq.core.payment.PaymentAccount;
|
|
||||||
import io.bisq.core.payment.PaymentAccountFactory;
|
|
||||||
import io.bisq.core.payment.payload.PaymentMethod;
|
import io.bisq.core.payment.payload.PaymentMethod;
|
||||||
import io.bisq.gui.common.view.ActivatableViewAndModel;
|
import io.bisq.gui.common.view.ActivatableViewAndModel;
|
||||||
import io.bisq.gui.common.view.FxmlView;
|
import io.bisq.gui.common.view.FxmlView;
|
||||||
|
@ -157,38 +154,16 @@ public class FiatAccountsView extends ActivatableViewAndModel<GridPane, FiatAcco
|
||||||
.actionButtonText(Res.get("shared.iConfirm"))
|
.actionButtonText(Res.get("shared.iConfirm"))
|
||||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else if (paymentAccount instanceof WesternUnionAccount) {
|
||||||
doSaveNewAccount(paymentAccount);
|
new Popup<>().information(Res.get("payment.westernUnion.info", currencyName, currencyName))
|
||||||
}
|
.width(700)
|
||||||
|
|
||||||
/* if (paymentAccount instanceof SepaAccount ||
|
|
||||||
paymentAccount instanceof BankAccount ||
|
|
||||||
paymentAccount instanceof ClearXchangeAccount ||
|
|
||||||
paymentAccount instanceof FasterPaymentsAccount ||
|
|
||||||
paymentAccount instanceof ChaseQuickPayAccount ||
|
|
||||||
paymentAccount instanceof InteracETransferAccount) {
|
|
||||||
new Popup<>().information(Res.get("payment.chargeback.info", currencyName))
|
|
||||||
.width(800)
|
|
||||||
.closeButtonText(Res.get("shared.cancel"))
|
.closeButtonText(Res.get("shared.cancel"))
|
||||||
.actionButtonText(Res.get("shared.iConfirm"))
|
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||||
.onAction(() -> {
|
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||||
if (paymentAccount instanceof ClearXchangeAccount) {
|
|
||||||
UserThread.runAfter(() -> {
|
|
||||||
new Popup<>().information(Res.get("payment.clearXchange.info", currencyName, currencyName))
|
|
||||||
.width(900)
|
|
||||||
.closeButtonText(Res.get("shared.cancel"))
|
|
||||||
.actionButtonText(Res.get("shared.iConfirm"))
|
|
||||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
|
||||||
.show();
|
|
||||||
}, 1);
|
|
||||||
} else {
|
|
||||||
doSaveNewAccount(paymentAccount);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
doSaveNewAccount(paymentAccount);
|
doSaveNewAccount(paymentAccount);
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doSaveNewAccount(PaymentAccount paymentAccount) {
|
private void doSaveNewAccount(PaymentAccount paymentAccount) {
|
||||||
|
|
|
@ -226,15 +226,15 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||||
final String method = Res.get(paymentMethod.getId());
|
final String method = Res.get(paymentMethod.getId());
|
||||||
String paymentMethodLabel = Res.getWithCol("shared.paymentMethod");
|
String paymentMethodLabel = Res.getWithCol("shared.paymentMethod");
|
||||||
if (isNationalBanks || isSpecificBanks || isSepa) {
|
if (isNationalBanks || isSpecificBanks || isSepa) {
|
||||||
String mathodWithBankId = method + bankId;
|
String methodWithBankId = method + bankId;
|
||||||
if (BankUtil.isBankIdRequired(offer.getCountryCode()))
|
if (BankUtil.isBankIdRequired(offer.getCountryCode()))
|
||||||
addLabelTextField(gridPane, ++rowIndex,
|
addLabelTextField(gridPane, ++rowIndex,
|
||||||
paymentMethodLabel + " " + Res.get("offerDetailsWindow.offererBankId"),
|
paymentMethodLabel + " " + Res.get("offerDetailsWindow.offererBankId"),
|
||||||
mathodWithBankId);
|
methodWithBankId);
|
||||||
else if (BankUtil.isBankNameRequired(offer.getCountryCode()))
|
else if (BankUtil.isBankNameRequired(offer.getCountryCode()))
|
||||||
addLabelTextField(gridPane, ++rowIndex,
|
addLabelTextField(gridPane, ++rowIndex,
|
||||||
paymentMethodLabel + " " + Res.get("offerDetailsWindow.offerersBankName"),
|
paymentMethodLabel + " " + Res.get("offerDetailsWindow.offerersBankName"),
|
||||||
mathodWithBankId);
|
methodWithBankId);
|
||||||
} else {
|
} else {
|
||||||
addLabelTextField(gridPane, ++rowIndex, paymentMethodLabel, method);
|
addLabelTextField(gridPane, ++rowIndex, paymentMethodLabel, method);
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,11 +146,11 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
||||||
String paymentMethodId = paymentAccountPayload != null ? paymentAccountPayload.getPaymentMethodId() : "";
|
String paymentMethodId = paymentAccountPayload != null ? paymentAccountPayload.getPaymentMethodId() : "";
|
||||||
TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1,
|
TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1,
|
||||||
Res.get("portfolio.pending.step2_buyer.startPaymentUsing", Res.get(paymentMethodId)),
|
Res.get("portfolio.pending.step2_buyer.startPaymentUsing", Res.get(paymentMethodId)),
|
||||||
Layout.GROUP_DISTANCE);
|
Layout.GROUP_DISTANCE);
|
||||||
TextFieldWithCopyIcon field = addLabelTextFieldWithCopyIcon(gridPane, gridRow, Res.get("portfolio.pending.step2_buyer.amountToTransfer"),
|
TextFieldWithCopyIcon field = addLabelTextFieldWithCopyIcon(gridPane, gridRow, Res.get("portfolio.pending.step2_buyer.amountToTransfer"),
|
||||||
model.getFiatVolume(),
|
model.getFiatVolume(),
|
||||||
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
|
Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
|
||||||
field.setCopyWithoutCurrencyPostFix(true);
|
field.setCopyWithoutCurrencyPostFix(true);
|
||||||
|
|
||||||
switch (paymentMethodId) {
|
switch (paymentMethodId) {
|
||||||
|
@ -201,7 +201,7 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
break;
|
break;
|
||||||
case PaymentMethod.BLOCK_CHAINS_ID:
|
case PaymentMethod.BLOCK_CHAINS_ID:
|
||||||
String labelTitle = Res.get("portfolio.pending.step2_buyer.sellersAddress",
|
String labelTitle = Res.get("portfolio.pending.step2_buyer.sellersAddress",
|
||||||
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()));
|
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()));
|
||||||
gridRow = CryptoCurrencyForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload, labelTitle);
|
gridRow = CryptoCurrencyForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload, labelTitle);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -210,12 +210,12 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
|
|
||||||
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload))
|
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload))
|
||||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow,
|
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow,
|
||||||
Res.getWithCol("shared.reasonForPayment"), model.dataModel.getReference());
|
Res.getWithCol("shared.reasonForPayment"), model.dataModel.getReference());
|
||||||
|
|
||||||
GridPane.setRowSpan(accountTitledGroupBg, gridRow - 3);
|
GridPane.setRowSpan(accountTitledGroupBg, gridRow - 3);
|
||||||
|
|
||||||
Tuple3<Button, BusyAnimation, Label> tuple3 = addButtonBusyAnimationLabelAfterGroup(gridPane, ++gridRow,
|
Tuple3<Button, BusyAnimation, Label> tuple3 = addButtonBusyAnimationLabelAfterGroup(gridPane, ++gridRow,
|
||||||
Res.get("portfolio.pending.step2_buyer.paymentStarted"));
|
Res.get("portfolio.pending.step2_buyer.paymentStarted"));
|
||||||
confirmButton = tuple3.first;
|
confirmButton = tuple3.first;
|
||||||
confirmButton.setOnAction(e -> onPaymentStarted());
|
confirmButton.setOnAction(e -> onPaymentStarted());
|
||||||
busyAnimation = tuple3.second;
|
busyAnimation = tuple3.second;
|
||||||
|
@ -231,8 +231,8 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
protected String getWarningText() {
|
protected String getWarningText() {
|
||||||
setWarningHeadline();
|
setWarningHeadline();
|
||||||
return Res.get("portfolio.pending.step2_buyer.warn",
|
return Res.get("portfolio.pending.step2_buyer.warn",
|
||||||
model.dataModel.getCurrencyCode(),
|
model.dataModel.getCurrencyCode(),
|
||||||
model.getDateForOpenDispute());
|
model.getDateForOpenDispute());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -265,12 +265,30 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||||
Popup popup = new Popup<>();
|
Popup popup = new Popup<>();
|
||||||
popup.headLine(Res.get("portfolio.pending.step2_buyer.paperReceipt.headline"))
|
popup.headLine(Res.get("portfolio.pending.step2_buyer.paperReceipt.headline"))
|
||||||
.feedback(Res.get("portfolio.pending.step2_buyer.paperReceipt.msg"))
|
.feedback(Res.get("portfolio.pending.step2_buyer.paperReceipt.msg"))
|
||||||
.onAction(this::showConfirmPaymentStartedPopup)
|
.onAction(this::showConfirmPaymentStartedPopup)
|
||||||
.closeButtonText(Res.get("shared.no"))
|
.closeButtonText(Res.get("shared.no"))
|
||||||
.onClose(popup::hide)
|
.onClose(popup::hide)
|
||||||
.dontShowAgainId(key)
|
.dontShowAgainId(key)
|
||||||
.show();
|
.show();
|
||||||
|
} else {
|
||||||
|
showConfirmPaymentStartedPopup();
|
||||||
|
}
|
||||||
|
} else if (model.dataModel.getSellersPaymentAccountPayload() instanceof WesternUnionAccountPayload) {
|
||||||
|
//noinspection UnusedAssignment
|
||||||
|
//noinspection ConstantConditions
|
||||||
|
String key = "westernUnionMTCNSent";
|
||||||
|
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||||
|
Popup popup = new Popup<>();
|
||||||
|
popup.headLine(Res.get("portfolio.pending.step2_buyer.westernUnionMTCNInfo.headline"))
|
||||||
|
.feedback(Res.get("portfolio.pending.step2_buyer.westernUnionMTCNInfo.msg",
|
||||||
|
((WesternUnionAccountPayload) model.dataModel.getSellersPaymentAccountPayload()).getEmail()))
|
||||||
|
.onAction(this::showConfirmPaymentStartedPopup)
|
||||||
|
.actionButtonText(Res.get("shared.yes"))
|
||||||
|
.closeButtonText(Res.get("shared.no"))
|
||||||
|
.onClose(popup::hide)
|
||||||
|
.dontShowAgainId(key)
|
||||||
|
.show();
|
||||||
} else {
|
} else {
|
||||||
showConfirmPaymentStartedPopup();
|
showConfirmPaymentStartedPopup();
|
||||||
}
|
}
|
||||||
|
@ -290,15 +308,15 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||||
Popup popup = new Popup<>();
|
Popup popup = new Popup<>();
|
||||||
popup.headLine(Res.get("portfolio.pending.step2_buyer.confirmStart.headline"))
|
popup.headLine(Res.get("portfolio.pending.step2_buyer.confirmStart.headline"))
|
||||||
.confirmation(Res.get("portfolio.pending.step2_buyer.confirmStart.msg",
|
.confirmation(Res.get("portfolio.pending.step2_buyer.confirmStart.msg",
|
||||||
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode())))
|
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode())))
|
||||||
.width(700)
|
.width(700)
|
||||||
.actionButtonText(Res.get("portfolio.pending.step2_buyer.confirmStart.yes"))
|
.actionButtonText(Res.get("portfolio.pending.step2_buyer.confirmStart.yes"))
|
||||||
.onAction(this::confirmPaymentStarted)
|
.onAction(this::confirmPaymentStarted)
|
||||||
.closeButtonText(Res.get("shared.no"))
|
.closeButtonText(Res.get("shared.no"))
|
||||||
.onClose(popup::hide)
|
.onClose(popup::hide)
|
||||||
.dontShowAgainId(key)
|
.dontShowAgainId(key)
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
confirmPaymentStarted();
|
confirmPaymentStarted();
|
||||||
}
|
}
|
||||||
|
@ -342,42 +360,51 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
if (paymentAccountPayload instanceof CryptoCurrencyAccountPayload)
|
if (paymentAccountPayload instanceof CryptoCurrencyAccountPayload)
|
||||||
//noinspection UnusedAssignment
|
//noinspection UnusedAssignment
|
||||||
message += Res.get("portfolio.pending.step2_buyer.altcoin",
|
message += Res.get("portfolio.pending.step2_buyer.altcoin",
|
||||||
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()),
|
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()),
|
||||||
amount) +
|
amount) +
|
||||||
accountDetails +
|
accountDetails +
|
||||||
paymentDetailsForTradePopup + ".\n\n" +
|
paymentDetailsForTradePopup + ".\n\n" +
|
||||||
copyPaste;
|
copyPaste;
|
||||||
else if (paymentAccountPayload instanceof CashDepositAccountPayload)
|
else if (paymentAccountPayload instanceof CashDepositAccountPayload)
|
||||||
//noinspection UnusedAssignment
|
//noinspection UnusedAssignment
|
||||||
message += Res.get("portfolio.pending.step2_buyer.cash",
|
message += Res.get("portfolio.pending.step2_buyer.cash",
|
||||||
amount) +
|
amount) +
|
||||||
accountDetails +
|
accountDetails +
|
||||||
paymentDetailsForTradePopup + ".\n" +
|
paymentDetailsForTradePopup + ".\n" +
|
||||||
copyPaste + "\n\n" +
|
copyPaste + "\n\n" +
|
||||||
tradeId + paddedId +
|
tradeId + paddedId +
|
||||||
assign +
|
assign +
|
||||||
refTextWarn + "\n\n" +
|
refTextWarn + "\n\n" +
|
||||||
fees + "\n\n" +
|
fees + "\n\n" +
|
||||||
Res.get("portfolio.pending.step2_buyer.cash.extra");
|
Res.get("portfolio.pending.step2_buyer.cash.extra");
|
||||||
|
else if (paymentAccountPayload instanceof WesternUnionAccountPayload)
|
||||||
|
//noinspection UnusedAssignment
|
||||||
|
message += Res.get("portfolio.pending.step2_buyer.westernUnion",
|
||||||
|
amount) +
|
||||||
|
accountDetails +
|
||||||
|
paymentDetailsForTradePopup + ".\n" +
|
||||||
|
copyPaste + "\n\n" +
|
||||||
|
Res.get("portfolio.pending.step2_buyer.westernUnion.extra",
|
||||||
|
((WesternUnionAccountPayload) paymentAccountPayload).getEmail());
|
||||||
else if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload)
|
else if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload)
|
||||||
//noinspection UnusedAssignment
|
//noinspection UnusedAssignment
|
||||||
message += Res.get("portfolio.pending.step2_buyer.postal", amount) +
|
message += Res.get("portfolio.pending.step2_buyer.postal", amount) +
|
||||||
accountDetails +
|
accountDetails +
|
||||||
paymentDetailsForTradePopup + ".\n" +
|
paymentDetailsForTradePopup + ".\n" +
|
||||||
copyPaste + "\n\n" +
|
copyPaste + "\n\n" +
|
||||||
tradeId + paddedId +
|
tradeId + paddedId +
|
||||||
assign +
|
assign +
|
||||||
refTextWarn;
|
refTextWarn;
|
||||||
else
|
else
|
||||||
//noinspection UnusedAssignment
|
//noinspection UnusedAssignment
|
||||||
message += Res.get("portfolio.pending.step2_buyer.bank", amount) +
|
message += Res.get("portfolio.pending.step2_buyer.bank", amount) +
|
||||||
accountDetails +
|
accountDetails +
|
||||||
paymentDetailsForTradePopup + ".\n" +
|
paymentDetailsForTradePopup + ".\n" +
|
||||||
copyPaste + "\n\n" +
|
copyPaste + "\n\n" +
|
||||||
tradeId + paddedId +
|
tradeId + paddedId +
|
||||||
assign +
|
assign +
|
||||||
refTextWarn + "\n\n" +
|
refTextWarn + "\n\n" +
|
||||||
fees;
|
fees;
|
||||||
|
|
||||||
//noinspection ConstantConditions,UnusedAssignment
|
//noinspection ConstantConditions,UnusedAssignment
|
||||||
String key = "startPayment" + trade.getId();
|
String key = "startPayment" + trade.getId();
|
||||||
|
@ -385,8 +412,8 @@ public class BuyerStep2View extends TradeStepView {
|
||||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||||
DontShowAgainLookup.dontShowAgain(key, true);
|
DontShowAgainLookup.dontShowAgain(key, true);
|
||||||
new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id))
|
new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id))
|
||||||
.attention(message)
|
.attention(message)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class SellerStep3View extends TradeStepView {
|
||||||
TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 3, Res.get("portfolio.pending.step3_seller.confirmPaymentReceipt"), Layout.GROUP_DISTANCE);
|
TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 3, Res.get("portfolio.pending.step3_seller.confirmPaymentReceipt"), Layout.GROUP_DISTANCE);
|
||||||
|
|
||||||
TextFieldWithCopyIcon field = addLabelTextFieldWithCopyIcon(gridPane, gridRow, Res.get("portfolio.pending.step3_seller.amountToReceive"),
|
TextFieldWithCopyIcon field = addLabelTextFieldWithCopyIcon(gridPane, gridRow, Res.get("portfolio.pending.step3_seller.amountToReceive"),
|
||||||
model.getFiatVolume(), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
|
model.getFiatVolume(), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
|
||||||
field.setCopyWithoutCurrencyPostFix(true);
|
field.setCopyWithoutCurrencyPostFix(true);
|
||||||
|
|
||||||
String myPaymentDetails = "";
|
String myPaymentDetails = "";
|
||||||
|
@ -219,8 +219,8 @@ public class SellerStep3View extends TradeStepView {
|
||||||
protected String getWarningText() {
|
protected String getWarningText() {
|
||||||
setWarningHeadline();
|
setWarningHeadline();
|
||||||
String substitute = model.isBlockChainMethod() ?
|
String substitute = model.isBlockChainMethod() ?
|
||||||
Res.get("portfolio.pending.step3_seller.warn.part1a", model.dataModel.getCurrencyCode()) :
|
Res.get("portfolio.pending.step3_seller.warn.part1a", model.dataModel.getCurrencyCode()) :
|
||||||
Res.get("portfolio.pending.step3_seller.warn.part1b");
|
Res.get("portfolio.pending.step3_seller.warn.part1b");
|
||||||
return Res.get("portfolio.pending.step3_seller.warn.part2", substitute, model.getDateForOpenDispute());
|
return Res.get("portfolio.pending.step3_seller.warn.part2", substitute, model.getDateForOpenDispute());
|
||||||
|
|
||||||
|
|
||||||
|
@ -257,7 +257,8 @@ public class SellerStep3View extends TradeStepView {
|
||||||
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
||||||
String message = Res.get("portfolio.pending.step3_seller.onPaymentReceived.part1", CurrencyUtil.getNameByCode(model.dataModel.getCurrencyCode()));
|
String message = Res.get("portfolio.pending.step3_seller.onPaymentReceived.part1", CurrencyUtil.getNameByCode(model.dataModel.getCurrencyCode()));
|
||||||
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload)) {
|
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload)) {
|
||||||
message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.fiat", trade.getShortId());
|
if (!(paymentAccountPayload instanceof WesternUnionAccountPayload))
|
||||||
|
message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.fiat", trade.getShortId());
|
||||||
|
|
||||||
Optional<String> optionalHolderName = getOptionalHolderName();
|
Optional<String> optionalHolderName = getOptionalHolderName();
|
||||||
if (optionalHolderName.isPresent()) {
|
if (optionalHolderName.isPresent()) {
|
||||||
|
@ -266,13 +267,13 @@ public class SellerStep3View extends TradeStepView {
|
||||||
}
|
}
|
||||||
message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.note");
|
message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.note");
|
||||||
new Popup<>()
|
new Popup<>()
|
||||||
.headLine(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.headline"))
|
.headLine(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.headline"))
|
||||||
.confirmation(message)
|
.confirmation(message)
|
||||||
.width(700)
|
.width(700)
|
||||||
.actionButtonText(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.yes"))
|
.actionButtonText(Res.get("portfolio.pending.step3_seller.onPaymentReceived.confirm.yes"))
|
||||||
.onAction(this::confirmPaymentReceived)
|
.onAction(this::confirmPaymentReceived)
|
||||||
.closeButtonText(Res.get("shared.cancel"))
|
.closeButtonText(Res.get("shared.cancel"))
|
||||||
.show();
|
.show();
|
||||||
} else {
|
} else {
|
||||||
confirmPaymentReceived();
|
confirmPaymentReceived();
|
||||||
}
|
}
|
||||||
|
@ -287,7 +288,7 @@ public class SellerStep3View extends TradeStepView {
|
||||||
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
||||||
//noinspection UnusedAssignment
|
//noinspection UnusedAssignment
|
||||||
String key = "confirmPayment" + trade.getId();
|
String key = "confirmPayment" + trade.getId();
|
||||||
String message;
|
String message = "";
|
||||||
String tradeVolumeWithCode = model.btcFormatter.formatVolumeWithCode(trade.getTradeVolume());
|
String tradeVolumeWithCode = model.btcFormatter.formatVolumeWithCode(trade.getTradeVolume());
|
||||||
String currencyName = CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode());
|
String currencyName = CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode());
|
||||||
String part1 = Res.get("portfolio.pending.step3_seller.part", currencyName);
|
String part1 = Res.get("portfolio.pending.step3_seller.part", currencyName);
|
||||||
|
@ -299,12 +300,14 @@ public class SellerStep3View extends TradeStepView {
|
||||||
} else {
|
} else {
|
||||||
if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload)
|
if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload)
|
||||||
message = Res.get("portfolio.pending.step3_seller.postal", part1, tradeVolumeWithCode, id);
|
message = Res.get("portfolio.pending.step3_seller.postal", part1, tradeVolumeWithCode, id);
|
||||||
else
|
else if (!(paymentAccountPayload instanceof WesternUnionAccountPayload))
|
||||||
message = Res.get("portfolio.pending.step3_seller.bank", currencyName, tradeVolumeWithCode, id);
|
message = Res.get("portfolio.pending.step3_seller.bank", currencyName, tradeVolumeWithCode, id);
|
||||||
|
|
||||||
String part = Res.get("portfolio.pending.step3_seller.openDispute");
|
String part = Res.get("portfolio.pending.step3_seller.openDispute");
|
||||||
if (paymentAccountPayload instanceof CashDepositAccountPayload)
|
if (paymentAccountPayload instanceof CashDepositAccountPayload)
|
||||||
message = message + Res.get("portfolio.pending.step3_seller.cash", part);
|
message = message + Res.get("portfolio.pending.step3_seller.cash", part);
|
||||||
|
else if (paymentAccountPayload instanceof WesternUnionAccountPayload)
|
||||||
|
message = message + Res.get("portfolio.pending.step3_seller.westernUnion", part);
|
||||||
|
|
||||||
Optional<String> optionalHolderName = getOptionalHolderName();
|
Optional<String> optionalHolderName = getOptionalHolderName();
|
||||||
if (optionalHolderName.isPresent()) {
|
if (optionalHolderName.isPresent()) {
|
||||||
|
@ -316,8 +319,8 @@ public class SellerStep3View extends TradeStepView {
|
||||||
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
|
||||||
DontShowAgainLookup.dontShowAgain(key, true);
|
DontShowAgainLookup.dontShowAgain(key, true);
|
||||||
new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id))
|
new Popup<>().headLine(Res.get("popup.attention.forTradeWithId", id))
|
||||||
.attention(message)
|
.attention(message)
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,7 @@ public class BSFormatter {
|
||||||
|
|
||||||
public String formatVolumeLabel(String currencyCode, String postFix) {
|
public String formatVolumeLabel(String currencyCode, String postFix) {
|
||||||
return Res.get("formatter.formatVolumeLabel",
|
return Res.get("formatter.formatVolumeLabel",
|
||||||
CurrencyUtil.getNameByCode(currencyCode), postFix);
|
currencyCode, postFix);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String formatMinVolumeAndVolume(Offer offer) {
|
public String formatMinVolumeAndVolume(Offer offer) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue