mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 02:12:00 +01:00
Complete F2F payment method
This commit is contained in:
parent
46342663ab
commit
792371e126
@ -29,6 +29,7 @@ import bisq.core.locale.FiatCurrency;
|
||||
import bisq.core.locale.Region;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.locale.TradeCurrency;
|
||||
import bisq.core.offer.Offer;
|
||||
import bisq.core.payment.AccountAgeWitnessService;
|
||||
import bisq.core.payment.CountryBasedPaymentAccount;
|
||||
import bisq.core.payment.F2FAccount;
|
||||
@ -60,19 +61,19 @@ public class F2FForm extends PaymentMethodForm {
|
||||
private InputTextField cityInputTextField;
|
||||
|
||||
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||
PaymentAccountPayload paymentAccountPayload) {
|
||||
PaymentAccountPayload paymentAccountPayload, Offer offer) {
|
||||
F2FAccountPayload f2fAccountPayload = (F2FAccountPayload) paymentAccountPayload;
|
||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"),
|
||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("shared.country"),
|
||||
CountryUtil.getNameAndCode(f2fAccountPayload.getCountryCode()));
|
||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.f2f.contact"),
|
||||
f2fAccountPayload.getContact());
|
||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("payment.f2f.city"),
|
||||
f2fAccountPayload.getContact());
|
||||
TextArea textArea = addLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra"), "").second;
|
||||
offer.getF2FCity());
|
||||
TextArea textArea = addLabelTextArea(gridPane, ++gridRow, Res.getWithCol("payment.f2f.extra"), "").second;
|
||||
textArea.setPrefHeight(60);
|
||||
textArea.setEditable(false);
|
||||
textArea.setId("text-area-disabled");
|
||||
textArea.setText(f2fAccountPayload.getExtraInfo());
|
||||
textArea.setText(offer.getF2FExtraInfo());
|
||||
return gridRow;
|
||||
}
|
||||
|
||||
@ -192,15 +193,16 @@ public class F2FForm extends PaymentMethodForm {
|
||||
|
||||
cityInputTextField = addLabelInputTextField(gridPane, ++gridRow,
|
||||
Res.getWithCol("payment.f2f.city")).second;
|
||||
cityInputTextField.setPromptText(Res.get("payment.f2f.city.prompt"));
|
||||
cityInputTextField.setValidator(f2fValidator);
|
||||
|
||||
cityInputTextField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
f2fAccount.setCity(newValue);
|
||||
updateFromInputs();
|
||||
});
|
||||
|
||||
extraTextArea = addLabelTextArea(gridPane, ++gridRow,
|
||||
Res.getWithCol("payment.f2f.extra"), "").second;
|
||||
Res.getWithCol("payment.f2f.optionalExtra"), "").second;
|
||||
extraTextArea.setPromptText(Res.get("payment.f2f.extra.prompt"));
|
||||
extraTextArea.setPrefHeight(60);
|
||||
//extraTextArea.setValidator(f2fValidator);
|
||||
extraTextArea.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
@ -239,7 +241,7 @@ public class F2FForm extends PaymentMethodForm {
|
||||
f2fAccount.getContact());
|
||||
addLabelTextField(gridPane, ++gridRow, Res.getWithCol("payment.f2f.city", f2fAccount.getCity()),
|
||||
f2fAccount.getCity());
|
||||
TextArea textArea = addLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra", f2fAccount.getExtraInfo()), "").second;
|
||||
TextArea textArea = addLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra"), "").second;
|
||||
textArea.setText(f2fAccount.getExtraInfo());
|
||||
textArea.setPrefHeight(60);
|
||||
textArea.setEditable(false);
|
||||
|
@ -50,6 +50,7 @@ import bisq.desktop.components.paymentmethods.WeChatPayForm;
|
||||
import bisq.desktop.components.paymentmethods.WesternUnionForm;
|
||||
import bisq.desktop.main.overlays.popups.Popup;
|
||||
import bisq.desktop.util.FormBuilder;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
import bisq.desktop.util.ImageUtil;
|
||||
import bisq.desktop.util.Layout;
|
||||
import bisq.desktop.util.validation.AliPayValidator;
|
||||
@ -75,6 +76,7 @@ import bisq.core.app.BisqEnvironment;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.payment.AccountAgeWitnessService;
|
||||
import bisq.core.payment.ClearXchangeAccount;
|
||||
import bisq.core.payment.F2FAccount;
|
||||
import bisq.core.payment.MoneyGramAccount;
|
||||
import bisq.core.payment.PaymentAccount;
|
||||
import bisq.core.payment.PaymentAccountFactory;
|
||||
@ -236,41 +238,51 @@ public class FiatAccountsView extends ActivatableViewAndModel<GridPane, FiatAcco
|
||||
Coin maxTradeLimitAsCoin = paymentAccount.getPaymentMethod().getMaxTradeLimitAsCoin("USD");
|
||||
Coin maxTradeLimitSecondMonth = maxTradeLimitAsCoin.divide(2L);
|
||||
Coin maxTradeLimitFirstMonth = maxTradeLimitAsCoin.divide(4L);
|
||||
new Popup<>().information(Res.get("payment.limits.info",
|
||||
formatter.formatCoinWithCode(maxTradeLimitFirstMonth),
|
||||
formatter.formatCoinWithCode(maxTradeLimitSecondMonth),
|
||||
formatter.formatCoinWithCode(maxTradeLimitAsCoin)))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> {
|
||||
final String currencyName = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyName();
|
||||
if (paymentAccount instanceof ClearXchangeAccount) {
|
||||
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();
|
||||
} else if (paymentAccount instanceof WesternUnionAccount) {
|
||||
new Popup<>().information(Res.get("payment.westernUnion.info"))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||
.show();
|
||||
} else if (paymentAccount instanceof MoneyGramAccount) {
|
||||
new Popup<>().information(Res.get("payment.moneyGram.info"))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||
.show();
|
||||
} else {
|
||||
doSaveNewAccount(paymentAccount);
|
||||
}
|
||||
})
|
||||
.show();
|
||||
if (paymentAccount instanceof F2FAccount) {
|
||||
new Popup<>().information(Res.get("payment.f2f.info"))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("payment.f2f.info.openURL"))
|
||||
.onClose(() -> GUIUtil.openWebPage("https://docs.bisq.network/#f2f"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||
.show();
|
||||
} else {
|
||||
new Popup<>().information(Res.get("payment.limits.info",
|
||||
formatter.formatCoinWithCode(maxTradeLimitFirstMonth),
|
||||
formatter.formatCoinWithCode(maxTradeLimitSecondMonth),
|
||||
formatter.formatCoinWithCode(maxTradeLimitAsCoin)))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> {
|
||||
final String currencyName = BisqEnvironment.getBaseCurrencyNetwork().getCurrencyName();
|
||||
if (paymentAccount instanceof ClearXchangeAccount) {
|
||||
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();
|
||||
} else if (paymentAccount instanceof WesternUnionAccount) {
|
||||
new Popup<>().information(Res.get("payment.westernUnion.info"))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||
.show();
|
||||
} else if (paymentAccount instanceof MoneyGramAccount) {
|
||||
new Popup<>().information(Res.get("payment.moneyGram.info"))
|
||||
.width(700)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||
.show();
|
||||
} else {
|
||||
doSaveNewAccount(paymentAccount);
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
}
|
||||
|
||||
private void doSaveNewAccount(PaymentAccount paymentAccount) {
|
||||
|
@ -39,6 +39,7 @@ import bisq.core.offer.OpenOfferManager;
|
||||
import bisq.core.payment.AccountAgeWitnessService;
|
||||
import bisq.core.payment.BankAccount;
|
||||
import bisq.core.payment.CountryBasedPaymentAccount;
|
||||
import bisq.core.payment.F2FAccount;
|
||||
import bisq.core.payment.PaymentAccount;
|
||||
import bisq.core.payment.SameBankAccount;
|
||||
import bisq.core.payment.SepaAccount;
|
||||
@ -369,6 +370,13 @@ public abstract class MutableOfferDataModel extends OfferDataModel implements Bs
|
||||
extraDataMap.put(OfferPayload.REFERRAL_ID, referralIdService.getOptionalReferralId().get());
|
||||
}
|
||||
|
||||
if (paymentAccount instanceof F2FAccount) {
|
||||
if (extraDataMap == null)
|
||||
extraDataMap = new HashMap<>();
|
||||
extraDataMap.put(OfferPayload.F2F_CITY, ((F2FAccount) paymentAccount).getCity());
|
||||
extraDataMap.put(OfferPayload.F2F_EXTRA_INFO, ((F2FAccount) paymentAccount).getExtraInfo());
|
||||
}
|
||||
|
||||
Coin buyerSecurityDepositAsCoin = buyerSecurityDeposit.get();
|
||||
checkArgument(buyerSecurityDepositAsCoin.compareTo(Restrictions.getMaxBuyerSecurityDeposit()) <= 0,
|
||||
"securityDeposit must be not exceed " +
|
||||
|
@ -404,11 +404,15 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||
Offer offer = item.getOffer();
|
||||
String method = Res.get(offer.getPaymentMethod().getId() + "_SHORT");
|
||||
String methodCountryCode = offer.getCountryCode();
|
||||
if (isF2F(offer)) {
|
||||
result = method + " (" + methodCountryCode + ", " + offer.getF2FCity() + ")";
|
||||
} else {
|
||||
if (methodCountryCode != null)
|
||||
result = method + " (" + methodCountryCode + ")";
|
||||
else
|
||||
result = method;
|
||||
}
|
||||
|
||||
if (methodCountryCode != null)
|
||||
result = method + " (" + methodCountryCode + ")";
|
||||
else
|
||||
result = method;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -420,37 +424,50 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||
result = Res.getWithCol("shared.paymentMethod") + " " + Res.get(offer.getPaymentMethod().getId());
|
||||
result += "\n" + Res.getWithCol("shared.currency") + " " + CurrencyUtil.getNameAndCode(offer.getCurrencyCode());
|
||||
|
||||
String methodCountryCode = offer.getCountryCode();
|
||||
if (methodCountryCode != null) {
|
||||
String bankId = offer.getBankId();
|
||||
if (bankId != null && !bankId.equals("null")) {
|
||||
if (BankUtil.isBankIdRequired(methodCountryCode))
|
||||
result += "\n" + Res.get("offerbook.offerersBankId", bankId);
|
||||
else if (BankUtil.isBankNameRequired(methodCountryCode))
|
||||
result += "\n" + Res.get("offerbook.offerersBankName", bankId);
|
||||
String countryCode = offer.getCountryCode();
|
||||
if (isF2F(offer)) {
|
||||
if (countryCode != null) {
|
||||
result += "\n" + Res.get("payment.f2f.offerbook.tooltip.countryAndCity",
|
||||
CountryUtil.getNameByCode(countryCode), offer.getF2FCity());
|
||||
|
||||
result += "\n" + Res.get("payment.f2f.offerbook.tooltip.extra", offer.getF2FExtraInfo());
|
||||
}
|
||||
} else {
|
||||
if (countryCode != null) {
|
||||
String bankId = offer.getBankId();
|
||||
if (bankId != null && !bankId.equals("null")) {
|
||||
if (BankUtil.isBankIdRequired(countryCode))
|
||||
result += "\n" + Res.get("offerbook.offerersBankId", bankId);
|
||||
else if (BankUtil.isBankNameRequired(countryCode))
|
||||
result += "\n" + Res.get("offerbook.offerersBankName", bankId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (methodCountryCode != null)
|
||||
result += "\n" + Res.get("offerbook.offerersBankSeat", CountryUtil.getNameByCode(methodCountryCode));
|
||||
if (countryCode != null)
|
||||
result += "\n" + Res.get("offerbook.offerersBankSeat", CountryUtil.getNameByCode(countryCode));
|
||||
|
||||
List<String> acceptedCountryCodes = offer.getAcceptedCountryCodes();
|
||||
List<String> acceptedBanks = offer.getAcceptedBankIds();
|
||||
if (acceptedCountryCodes != null && !acceptedCountryCodes.isEmpty()) {
|
||||
if (CountryUtil.containsAllSepaEuroCountries(acceptedCountryCodes))
|
||||
result += "\n" + Res.get("offerbook.offerersAcceptedBankSeatsEuro");
|
||||
else
|
||||
result += "\n" + Res.get("offerbook.offerersAcceptedBankSeats", CountryUtil.getNamesByCodesString(acceptedCountryCodes));
|
||||
} else if (acceptedBanks != null && !acceptedBanks.isEmpty()) {
|
||||
if (offer.getPaymentMethod().equals(PaymentMethod.SAME_BANK))
|
||||
result += "\n" + Res.getWithCol("shared.bankName") + " " + acceptedBanks.get(0);
|
||||
else if (offer.getPaymentMethod().equals(PaymentMethod.SPECIFIC_BANKS))
|
||||
result += "\n" + Res.getWithCol("shared.acceptedBanks") + " " + Joiner.on(", ").join(acceptedBanks);
|
||||
List<String> acceptedCountryCodes = offer.getAcceptedCountryCodes();
|
||||
List<String> acceptedBanks = offer.getAcceptedBankIds();
|
||||
if (acceptedCountryCodes != null && !acceptedCountryCodes.isEmpty()) {
|
||||
if (CountryUtil.containsAllSepaEuroCountries(acceptedCountryCodes))
|
||||
result += "\n" + Res.get("offerbook.offerersAcceptedBankSeatsEuro");
|
||||
else
|
||||
result += "\n" + Res.get("offerbook.offerersAcceptedBankSeats", CountryUtil.getNamesByCodesString(acceptedCountryCodes));
|
||||
} else if (acceptedBanks != null && !acceptedBanks.isEmpty()) {
|
||||
if (offer.getPaymentMethod().equals(PaymentMethod.SAME_BANK))
|
||||
result += "\n" + Res.getWithCol("shared.bankName") + " " + acceptedBanks.get(0);
|
||||
else if (offer.getPaymentMethod().equals(PaymentMethod.SPECIFIC_BANKS))
|
||||
result += "\n" + Res.getWithCol("shared.acceptedBanks") + " " + Joiner.on(", ").join(acceptedBanks);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private boolean isF2F(Offer offer) {
|
||||
return offer.getPaymentMethod().equals(PaymentMethod.F2F);
|
||||
}
|
||||
|
||||
String getDirectionLabelTooltip(Offer offer) {
|
||||
return formatter.getDirectionWithCodeDetailed(offer.getMirroredDirection(), offer.getCurrencyCode());
|
||||
}
|
||||
|
@ -49,6 +49,7 @@ import com.google.common.base.Joiner;
|
||||
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.TextArea;
|
||||
import javafx.scene.control.TextField;
|
||||
import javafx.scene.control.Tooltip;
|
||||
import javafx.scene.image.ImageView;
|
||||
@ -143,18 +144,19 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||
|
||||
private void addContent() {
|
||||
int rows = 5;
|
||||
|
||||
List<String> acceptedBanks = offer.getAcceptedBankIds();
|
||||
boolean showAcceptedBanks = acceptedBanks != null && !acceptedBanks.isEmpty();
|
||||
List<String> acceptedCountryCodes = offer.getAcceptedCountryCodes();
|
||||
boolean showAcceptedCountryCodes = acceptedCountryCodes != null && !acceptedCountryCodes.isEmpty();
|
||||
|
||||
boolean isF2F = offer.getPaymentMethod().equals(PaymentMethod.F2F);
|
||||
if (!takeOfferHandlerOptional.isPresent())
|
||||
rows++;
|
||||
if (showAcceptedBanks)
|
||||
rows++;
|
||||
if (showAcceptedCountryCodes)
|
||||
rows++;
|
||||
if (isF2F)
|
||||
rows += 2;
|
||||
|
||||
addTitledGroupBg(gridPane, ++rowIndex, rows, Res.get("shared.Offer"));
|
||||
|
||||
@ -214,8 +216,6 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||
}
|
||||
}
|
||||
final PaymentMethod paymentMethod = offer.getPaymentMethod();
|
||||
final String makerPaymentAccountId = offer.getMakerPaymentAccountId();
|
||||
final PaymentAccount paymentAccount = user.getPaymentAccount(makerPaymentAccountId);
|
||||
String bankId = offer.getBankId();
|
||||
if (bankId == null || bankId.equals("null"))
|
||||
bankId = "";
|
||||
@ -224,8 +224,10 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||
final boolean isSpecificBanks = paymentMethod.equals(PaymentMethod.SPECIFIC_BANKS);
|
||||
final boolean isNationalBanks = paymentMethod.equals(PaymentMethod.NATIONAL_BANK);
|
||||
final boolean isSepa = paymentMethod.equals(PaymentMethod.SEPA);
|
||||
if (offer.isMyOffer(keyRing) && makerPaymentAccountId != null && paymentAccount != null) {
|
||||
addLabelTextField(gridPane, ++rowIndex, Res.get("offerDetailsWindow.myTradingAccount"), paymentAccount.getAccountName());
|
||||
final String makerPaymentAccountId = offer.getMakerPaymentAccountId();
|
||||
final PaymentAccount myPaymentAccount = user.getPaymentAccount(makerPaymentAccountId);
|
||||
if (offer.isMyOffer(keyRing) && makerPaymentAccountId != null && myPaymentAccount != null) {
|
||||
addLabelTextField(gridPane, ++rowIndex, Res.get("offerDetailsWindow.myTradingAccount"), myPaymentAccount.getAccountName());
|
||||
} else {
|
||||
final String method = Res.get(paymentMethod.getId());
|
||||
String methodWithBankId = method + bankId;
|
||||
@ -282,12 +284,23 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||
}
|
||||
}
|
||||
|
||||
rows = 5;
|
||||
if (isF2F) {
|
||||
addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("payment.f2f.city"), offer.getF2FCity());
|
||||
TextArea textArea = addLabelTextArea(gridPane, ++rowIndex, Res.getWithCol("payment.f2f.extra"), "").second;
|
||||
textArea.setText(offer.getF2FExtraInfo());
|
||||
textArea.setMinHeight(33);
|
||||
textArea.setMaxHeight(textArea.getMinHeight());
|
||||
textArea.setEditable(false);
|
||||
}
|
||||
|
||||
rows = 4;
|
||||
String paymentMethodCountryCode = offer.getCountryCode();
|
||||
if (paymentMethodCountryCode != null)
|
||||
rows++;
|
||||
if (offer.getOfferFeePaymentTxId() != null)
|
||||
rows++;
|
||||
if (!isF2F)
|
||||
rows++;
|
||||
|
||||
addTitledGroupBg(gridPane, ++rowIndex, rows, Res.get("shared.details"), Layout.GROUP_DISTANCE);
|
||||
addLabelTextFieldWithCopyIcon(gridPane, rowIndex, Res.getWithCol("shared.offerId"), offer.getId(),
|
||||
@ -305,7 +318,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
||||
formatter.formatCoinWithCode(offer.getSellerSecurityDeposit());
|
||||
addLabelTextField(gridPane, ++rowIndex, Res.getWithCol("shared.securityDeposit"), value);
|
||||
|
||||
if (paymentMethodCountryCode != null)
|
||||
if (paymentMethodCountryCode != null && !isF2F)
|
||||
addLabelTextField(gridPane, ++rowIndex, Res.get("offerDetailsWindow.countryBank"),
|
||||
CountryUtil.getNameAndCode(paymentMethodCountryCode));
|
||||
|
||||
|
@ -56,6 +56,7 @@ import bisq.core.locale.Res;
|
||||
import bisq.core.network.MessageState;
|
||||
import bisq.core.payment.payload.CashDepositAccountPayload;
|
||||
import bisq.core.payment.payload.CryptoCurrencyAccountPayload;
|
||||
import bisq.core.payment.payload.F2FAccountPayload;
|
||||
import bisq.core.payment.payload.MoneyGramAccountPayload;
|
||||
import bisq.core.payment.payload.PaymentAccountPayload;
|
||||
import bisq.core.payment.payload.PaymentMethod;
|
||||
@ -76,6 +77,8 @@ import javafx.scene.layout.GridPane;
|
||||
import org.fxmisc.easybind.EasyBind;
|
||||
import org.fxmisc.easybind.Subscription;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class BuyerStep2View extends TradeStepView {
|
||||
|
||||
private Button confirmButton;
|
||||
@ -259,7 +262,8 @@ public class BuyerStep2View extends TradeStepView {
|
||||
gridRow = WesternUnionForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
case PaymentMethod.F2F_ID:
|
||||
gridRow = F2FForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
checkNotNull(model.dataModel.getTrade().getOffer(), "model.dataModel.getTrade().getOffer() must not be null");
|
||||
gridRow = F2FForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload, model.dataModel.getTrade().getOffer());
|
||||
break;
|
||||
case PaymentMethod.BLOCK_CHAINS_ID:
|
||||
String labelTitle = Res.get("portfolio.pending.step2_buyer.sellersAddress",
|
||||
@ -270,7 +274,8 @@ public class BuyerStep2View extends TradeStepView {
|
||||
log.error("Not supported PaymentMethod: " + paymentMethodId);
|
||||
}
|
||||
|
||||
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload))
|
||||
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload) &&
|
||||
!(paymentAccountPayload instanceof F2FAccountPayload))
|
||||
FormBuilder.addLabelTextFieldWithCopyIcon(gridPane, ++gridRow,
|
||||
Res.getWithCol("shared.reasonForPayment"), model.dataModel.getReference());
|
||||
|
||||
@ -447,7 +452,7 @@ public class BuyerStep2View extends TradeStepView {
|
||||
message += Res.get("portfolio.pending.step2_buyer.cash",
|
||||
amount) +
|
||||
accountDetails +
|
||||
paymentDetailsForTradePopup + ".\n" +
|
||||
paymentDetailsForTradePopup + ".\n\n" +
|
||||
copyPaste + "\n\n" +
|
||||
tradeId + paddedId +
|
||||
assign +
|
||||
@ -460,7 +465,7 @@ public class BuyerStep2View extends TradeStepView {
|
||||
message += Res.get("portfolio.pending.step2_buyer.westernUnion",
|
||||
amount) +
|
||||
accountDetails +
|
||||
paymentDetailsForTradePopup + ".\n" +
|
||||
paymentDetailsForTradePopup + ".\n\n" +
|
||||
copyPaste + "\n\n" +
|
||||
extra;
|
||||
} else if (paymentAccountPayload instanceof MoneyGramAccountPayload) {
|
||||
@ -469,23 +474,29 @@ public class BuyerStep2View extends TradeStepView {
|
||||
message += Res.get("portfolio.pending.step2_buyer.moneyGram",
|
||||
amount) +
|
||||
accountDetails +
|
||||
paymentDetailsForTradePopup + ".\n" +
|
||||
paymentDetailsForTradePopup + ".\n\n" +
|
||||
copyPaste + "\n\n" +
|
||||
extra;
|
||||
} else if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload) {
|
||||
//noinspection UnusedAssignment
|
||||
message += Res.get("portfolio.pending.step2_buyer.postal", amount) +
|
||||
accountDetails +
|
||||
paymentDetailsForTradePopup + ".\n" +
|
||||
paymentDetailsForTradePopup + ".\n\n" +
|
||||
copyPaste + "\n\n" +
|
||||
tradeId + paddedId +
|
||||
assign +
|
||||
refTextWarn;
|
||||
} else if (paymentAccountPayload instanceof F2FAccountPayload) {
|
||||
//noinspection UnusedAssignment
|
||||
message += Res.get("portfolio.pending.step2_buyer.f2f", amount) +
|
||||
accountDetails +
|
||||
paymentDetailsForTradePopup + "\n\n" +
|
||||
copyPaste;
|
||||
} else {
|
||||
//noinspection UnusedAssignment
|
||||
message += Res.get("portfolio.pending.step2_buyer.bank", amount) +
|
||||
accountDetails +
|
||||
paymentDetailsForTradePopup + ".\n" +
|
||||
paymentDetailsForTradePopup + ".\n\n" +
|
||||
copyPaste + "\n\n" +
|
||||
tradeId + paddedId +
|
||||
assign +
|
||||
|
@ -30,8 +30,10 @@ import bisq.core.locale.Res;
|
||||
import bisq.core.payment.payload.BankAccountPayload;
|
||||
import bisq.core.payment.payload.CashDepositAccountPayload;
|
||||
import bisq.core.payment.payload.CryptoCurrencyAccountPayload;
|
||||
import bisq.core.payment.payload.F2FAccountPayload;
|
||||
import bisq.core.payment.payload.MoneyGramAccountPayload;
|
||||
import bisq.core.payment.payload.PaymentAccountPayload;
|
||||
import bisq.core.payment.payload.PaymentMethod;
|
||||
import bisq.core.payment.payload.SepaAccountPayload;
|
||||
import bisq.core.payment.payload.SepaInstantAccountPayload;
|
||||
import bisq.core.payment.payload.USPostalMoneyOrderAccountPayload;
|
||||
@ -194,7 +196,7 @@ public class SellerStep3View extends TradeStepView {
|
||||
peersPaymentDetailsTextField.setMouseTransparent(false);
|
||||
peersPaymentDetailsTextField.setTooltip(new Tooltip(peersPaymentDetails));
|
||||
|
||||
if (!isBlockChain) {
|
||||
if (!isBlockChain && !trade.getOffer().getPaymentMethod().equals(PaymentMethod.F2F)) {
|
||||
addLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("shared.reasonForPayment"), model.dataModel.getReference());
|
||||
GridPane.setRowSpan(titledGroupBg, 4);
|
||||
}
|
||||
@ -266,8 +268,10 @@ public class SellerStep3View extends TradeStepView {
|
||||
PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload();
|
||||
String message = Res.get("portfolio.pending.step3_seller.onPaymentReceived.part1", CurrencyUtil.getNameByCode(model.dataModel.getCurrencyCode()));
|
||||
if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload)) {
|
||||
if (!(paymentAccountPayload instanceof WesternUnionAccountPayload))
|
||||
if (!(paymentAccountPayload instanceof WesternUnionAccountPayload) &&
|
||||
!(paymentAccountPayload instanceof F2FAccountPayload)) {
|
||||
message += Res.get("portfolio.pending.step3_seller.onPaymentReceived.fiat", trade.getShortId());
|
||||
}
|
||||
|
||||
Optional<String> optionalHolderName = getOptionalHolderName();
|
||||
if (optionalHolderName.isPresent()) {
|
||||
@ -306,18 +310,22 @@ public class SellerStep3View extends TradeStepView {
|
||||
//noinspection UnusedAssignment
|
||||
message = Res.get("portfolio.pending.step3_seller.altcoin", part1, currencyName, address, tradeVolumeWithCode, currencyName);
|
||||
} else {
|
||||
if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload)
|
||||
if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload) {
|
||||
message = Res.get("portfolio.pending.step3_seller.postal", part1, tradeVolumeWithCode, id);
|
||||
else if (!(paymentAccountPayload instanceof WesternUnionAccountPayload))
|
||||
} else if (!(paymentAccountPayload instanceof WesternUnionAccountPayload) &&
|
||||
!(paymentAccountPayload instanceof F2FAccountPayload)) {
|
||||
message = Res.get("portfolio.pending.step3_seller.bank", currencyName, tradeVolumeWithCode, id);
|
||||
}
|
||||
|
||||
String part = Res.get("portfolio.pending.step3_seller.openDispute");
|
||||
if (paymentAccountPayload instanceof CashDepositAccountPayload)
|
||||
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);
|
||||
message = message + Res.get("portfolio.pending.step3_seller.westernUnion");
|
||||
else if (paymentAccountPayload instanceof MoneyGramAccountPayload)
|
||||
message = message + Res.get("portfolio.pending.step3_seller.moneyGram", part);
|
||||
message = message + Res.get("portfolio.pending.step3_seller.moneyGram");
|
||||
else if (paymentAccountPayload instanceof F2FAccountPayload)
|
||||
message = part1;
|
||||
|
||||
Optional<String> optionalHolderName = getOptionalHolderName();
|
||||
if (optionalHolderName.isPresent()) {
|
||||
@ -365,9 +373,9 @@ public class SellerStep3View extends TradeStepView {
|
||||
else if (paymentAccountPayload instanceof SepaInstantAccountPayload)
|
||||
return Optional.of(((SepaInstantAccountPayload) paymentAccountPayload).getHolderName());
|
||||
else
|
||||
return Optional.<String>empty();
|
||||
return Optional.empty();
|
||||
} else {
|
||||
return Optional.<String>empty();
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user