mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-23 14:05:30 -04:00
change 'cash by mail' to 'pay by mail'
This commit is contained in:
parent
29706339ef
commit
1257072211
32 changed files with 200 additions and 200 deletions
|
@ -22,9 +22,9 @@ import haveno.core.account.witness.AccountAgeWitnessService;
|
|||
import haveno.core.locale.CurrencyUtil;
|
||||
import haveno.core.locale.Res;
|
||||
import haveno.core.locale.TradeCurrency;
|
||||
import haveno.core.payment.CashByMailAccount;
|
||||
import haveno.core.payment.PayByMailAccount;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.payload.CashByMailAccountPayload;
|
||||
import haveno.core.payment.payload.PayByMailAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.util.coin.CoinFormatter;
|
||||
import haveno.core.util.validation.InputValidator;
|
||||
|
@ -40,13 +40,13 @@ import static haveno.desktop.util.FormBuilder.addInputTextField;
|
|||
import static haveno.desktop.util.FormBuilder.addTopLabelTextArea;
|
||||
import static haveno.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon;
|
||||
|
||||
public class CashByMailForm extends PaymentMethodForm {
|
||||
private final CashByMailAccount cashByMailAccount;
|
||||
public class PayByMailForm extends PaymentMethodForm {
|
||||
private final PayByMailAccount payByMailAccount;
|
||||
private TextArea postalAddressTextArea;
|
||||
|
||||
public static int addFormForBuyer(GridPane gridPane, int gridRow,
|
||||
PaymentAccountPayload paymentAccountPayload) {
|
||||
CashByMailAccountPayload cbm = (CashByMailAccountPayload) paymentAccountPayload;
|
||||
PayByMailAccountPayload cbm = (PayByMailAccountPayload) paymentAccountPayload;
|
||||
addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1,
|
||||
Res.get("payment.account.owner"),
|
||||
cbm.getHolderName(),
|
||||
|
@ -64,11 +64,11 @@ public class CashByMailForm extends PaymentMethodForm {
|
|||
return gridRow;
|
||||
}
|
||||
|
||||
public CashByMailForm(PaymentAccount paymentAccount,
|
||||
public PayByMailForm(PaymentAccount paymentAccount,
|
||||
AccountAgeWitnessService accountAgeWitnessService,
|
||||
InputValidator inputValidator, GridPane gridPane, int gridRow, CoinFormatter formatter) {
|
||||
super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter);
|
||||
this.cashByMailAccount = (CashByMailAccount) paymentAccount;
|
||||
this.payByMailAccount = (PayByMailAccount) paymentAccount;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,11 +79,11 @@ public class CashByMailForm extends PaymentMethodForm {
|
|||
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getAllSortedTraditionalCurrencies()));
|
||||
|
||||
InputTextField contactField = addInputTextField(gridPane, ++gridRow,
|
||||
Res.get("payment.cashByMail.contact"));
|
||||
contactField.setPromptText(Res.get("payment.cashByMail.contact.prompt"));
|
||||
Res.get("payment.payByMail.contact"));
|
||||
contactField.setPromptText(Res.get("payment.payByMail.contact.prompt"));
|
||||
contactField.setValidator(inputValidator);
|
||||
contactField.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
cashByMailAccount.setContact(newValue);
|
||||
payByMailAccount.setContact(newValue);
|
||||
updateFromInputs();
|
||||
});
|
||||
|
||||
|
@ -91,16 +91,16 @@ public class CashByMailForm extends PaymentMethodForm {
|
|||
Res.get("payment.postal.address"), "").second;
|
||||
postalAddressTextArea.setMinHeight(70);
|
||||
postalAddressTextArea.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
cashByMailAccount.setPostalAddress(newValue);
|
||||
payByMailAccount.setPostalAddress(newValue);
|
||||
updateFromInputs();
|
||||
});
|
||||
|
||||
TextArea extraTextArea = addTopLabelTextArea(gridPane, ++gridRow,
|
||||
Res.get("payment.shared.optionalExtra"), Res.get("payment.cashByMail.extraInfo.prompt")).second;
|
||||
Res.get("payment.shared.optionalExtra"), Res.get("payment.payByMail.extraInfo.prompt")).second;
|
||||
extraTextArea.setMinHeight(70);
|
||||
((JFXTextArea) extraTextArea).setLabelFloat(false);
|
||||
extraTextArea.textProperty().addListener((ov, oldValue, newValue) -> {
|
||||
cashByMailAccount.setExtraInfo(newValue);
|
||||
payByMailAccount.setExtraInfo(newValue);
|
||||
updateFromInputs();
|
||||
});
|
||||
|
||||
|
@ -110,7 +110,7 @@ public class CashByMailForm extends PaymentMethodForm {
|
|||
|
||||
@Override
|
||||
protected void autoFillNameTextField() {
|
||||
setAccountNameWithString(cashByMailAccount.getContact());
|
||||
setAccountNameWithString(payByMailAccount.getContact());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -118,21 +118,21 @@ public class CashByMailForm extends PaymentMethodForm {
|
|||
gridRowFrom = gridRow;
|
||||
addAccountNameTextFieldWithAutoFillToggleButton();
|
||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
|
||||
Res.get(cashByMailAccount.getPaymentMethod().getId()));
|
||||
Res.get(payByMailAccount.getPaymentMethod().getId()));
|
||||
|
||||
TradeCurrency tradeCurrency = paymentAccount.getSingleTradeCurrency();
|
||||
String nameAndCode = tradeCurrency != null ? tradeCurrency.getNameAndCode() : "";
|
||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
|
||||
|
||||
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.contact"),
|
||||
cashByMailAccount.getContact());
|
||||
payByMailAccount.getContact());
|
||||
TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second;
|
||||
textArea.setText(cashByMailAccount.getPostalAddress());
|
||||
textArea.setText(payByMailAccount.getPostalAddress());
|
||||
textArea.setMinHeight(70);
|
||||
textArea.setEditable(false);
|
||||
|
||||
TextArea textAreaExtra = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.shared.extraInfo"), "").second;
|
||||
textAreaExtra.setText(cashByMailAccount.getExtraInfo());
|
||||
textAreaExtra.setText(payByMailAccount.getExtraInfo());
|
||||
textAreaExtra.setMinHeight(70);
|
||||
textAreaExtra.setEditable(false);
|
||||
|
||||
|
@ -142,8 +142,8 @@ public class CashByMailForm extends PaymentMethodForm {
|
|||
@Override
|
||||
public void updateAllInputsValid() {
|
||||
allInputsValid.set(isAccountNameValid()
|
||||
&& !cashByMailAccount.getPostalAddress().isEmpty()
|
||||
&& inputValidator.validate(cashByMailAccount.getContact()).isValid
|
||||
&& !payByMailAccount.getPostalAddress().isEmpty()
|
||||
&& inputValidator.validate(payByMailAccount.getContact()).isValid
|
||||
&& paymentAccount.getSingleTradeCurrency() != null);
|
||||
}
|
||||
}
|
|
@ -26,7 +26,7 @@ import haveno.core.locale.Res;
|
|||
import haveno.core.offer.OfferRestrictions;
|
||||
import haveno.core.payment.AmazonGiftCardAccount;
|
||||
import haveno.core.payment.AustraliaPayidAccount;
|
||||
import haveno.core.payment.CashByMailAccount;
|
||||
import haveno.core.payment.PayByMailAccount;
|
||||
import haveno.core.payment.CashDepositAccount;
|
||||
import haveno.core.payment.ZelleAccount;
|
||||
import haveno.core.payment.F2FAccount;
|
||||
|
@ -72,7 +72,7 @@ import haveno.desktop.components.paymentmethods.AmazonGiftCardForm;
|
|||
import haveno.desktop.components.paymentmethods.AustraliaPayidForm;
|
||||
import haveno.desktop.components.paymentmethods.BizumForm;
|
||||
import haveno.desktop.components.paymentmethods.CapitualForm;
|
||||
import haveno.desktop.components.paymentmethods.CashByMailForm;
|
||||
import haveno.desktop.components.paymentmethods.PayByMailForm;
|
||||
import haveno.desktop.components.paymentmethods.CashDepositForm;
|
||||
import haveno.desktop.components.paymentmethods.CelPayForm;
|
||||
import haveno.desktop.components.paymentmethods.ChaseQuickPayForm;
|
||||
|
@ -262,9 +262,9 @@ public class TraditionalAccountsView extends PaymentAccountsView<GridPane, Tradi
|
|||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
.onAction(() -> doSaveNewAccount(paymentAccount))
|
||||
.show();
|
||||
} else if (paymentAccount instanceof CashByMailAccount) {
|
||||
// CashByMail has no chargeback risk so we don't show the text from payment.limits.info.
|
||||
new Popup().information(Res.get("payment.cashByMail.info"))
|
||||
} else if (paymentAccount instanceof PayByMailAccount) {
|
||||
// PayByMail has no chargeback risk so we don't show the text from payment.limits.info.
|
||||
new Popup().information(Res.get("payment.payByMail.info"))
|
||||
.width(850)
|
||||
.closeButtonText(Res.get("shared.cancel"))
|
||||
.actionButtonText(Res.get("shared.iUnderstand"))
|
||||
|
@ -557,8 +557,8 @@ public class TraditionalAccountsView extends PaymentAccountsView<GridPane, Tradi
|
|||
return new WesternUnionForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.CASH_DEPOSIT_ID:
|
||||
return new CashDepositForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.CASH_BY_MAIL_ID:
|
||||
return new CashByMailForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.PAY_BY_MAIL_ID:
|
||||
return new PayByMailForm(paymentAccount, accountAgeWitnessService, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.HAL_CASH_ID:
|
||||
return new HalCashForm(paymentAccount, accountAgeWitnessService, halCashValidator, inputValidator, root, gridRow, formatter);
|
||||
case PaymentMethod.F2F_ID:
|
||||
|
|
|
@ -160,7 +160,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
private int gridRow = 0;
|
||||
private final HashMap<String, Boolean> paymentAccountWarningDisplayed = new HashMap<>();
|
||||
private boolean offerDetailsWindowDisplayed, zelleWarningDisplayed, fasterPaymentsWarningDisplayed,
|
||||
takeOfferFromUnsignedAccountWarningDisplayed, cashByMailWarningDisplayed;
|
||||
takeOfferFromUnsignedAccountWarningDisplayed, payByMailWarningDisplayed;
|
||||
private SimpleBooleanProperty errorPopupDisplayed;
|
||||
private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener;
|
||||
|
||||
|
@ -267,7 +267,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
maybeShowZelleWarning(lastPaymentAccount);
|
||||
maybeShowFasterPaymentsWarning(lastPaymentAccount);
|
||||
maybeShowAccountWarning(lastPaymentAccount, model.dataModel.isBuyOffer());
|
||||
maybeShowCashByMailWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||
maybeShowPayByMailWarning(lastPaymentAccount, model.dataModel.getOffer());
|
||||
|
||||
if (!model.isRange()) {
|
||||
nextButton.setVisible(false);
|
||||
|
@ -1118,13 +1118,13 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
|
|||
OfferViewUtil.showPaymentAccountWarning(msgKey, paymentAccountWarningDisplayed);
|
||||
}
|
||||
|
||||
private void maybeShowCashByMailWarning(PaymentAccount paymentAccount, Offer offer) {
|
||||
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.CASH_BY_MAIL_ID) &&
|
||||
!cashByMailWarningDisplayed && !offer.getExtraInfo().isEmpty()) {
|
||||
cashByMailWarningDisplayed = true;
|
||||
private void maybeShowPayByMailWarning(PaymentAccount paymentAccount, Offer offer) {
|
||||
if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.PAY_BY_MAIL_ID) &&
|
||||
!payByMailWarningDisplayed && !offer.getExtraInfo().isEmpty()) {
|
||||
payByMailWarningDisplayed = true;
|
||||
UserThread.runAfter(() -> {
|
||||
new GenericMessageWindow()
|
||||
.preamble(Res.get("payment.cashByMail.tradingRestrictions"))
|
||||
.preamble(Res.get("payment.payByMail.tradingRestrictions"))
|
||||
.instruction(offer.getExtraInfo())
|
||||
.actionButtonText(Res.get("shared.iConfirm"))
|
||||
.closeButtonText(Res.get("shared.close"))
|
||||
|
|
|
@ -174,7 +174,7 @@ public class OfferDetailsWindow extends Overlay<OfferDetailsWindow> {
|
|||
List<String> acceptedCountryCodes = offer.getAcceptedCountryCodes();
|
||||
boolean showAcceptedCountryCodes = acceptedCountryCodes != null && !acceptedCountryCodes.isEmpty();
|
||||
boolean isF2F = offer.getPaymentMethod().equals(PaymentMethod.F2F);
|
||||
boolean showExtraInfo = offer.getPaymentMethod().equals(PaymentMethod.F2F) || offer.getPaymentMethod().equals(PaymentMethod.CASH_BY_MAIL);
|
||||
boolean showExtraInfo = offer.getPaymentMethod().equals(PaymentMethod.F2F) || offer.getPaymentMethod().equals(PaymentMethod.PAY_BY_MAIL);
|
||||
if (!takeOfferHandlerOptional.isPresent())
|
||||
rows++;
|
||||
if (showAcceptedBanks)
|
||||
|
|
|
@ -27,12 +27,12 @@ import haveno.core.offer.Offer;
|
|||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.PaymentAccountUtil;
|
||||
import haveno.core.payment.payload.AssetAccountPayload;
|
||||
import haveno.core.payment.payload.CashByMailAccountPayload;
|
||||
import haveno.core.payment.payload.CashDepositAccountPayload;
|
||||
import haveno.core.payment.payload.F2FAccountPayload;
|
||||
import haveno.core.payment.payload.FasterPaymentsAccountPayload;
|
||||
import haveno.core.payment.payload.HalCashAccountPayload;
|
||||
import haveno.core.payment.payload.MoneyGramAccountPayload;
|
||||
import haveno.core.payment.payload.PayByMailAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentAccountPayload;
|
||||
import haveno.core.payment.payload.PaymentMethod;
|
||||
import haveno.core.payment.payload.SwiftAccountPayload;
|
||||
|
@ -51,7 +51,7 @@ import haveno.desktop.components.paymentmethods.AmazonGiftCardForm;
|
|||
import haveno.desktop.components.paymentmethods.AssetsForm;
|
||||
import haveno.desktop.components.paymentmethods.BizumForm;
|
||||
import haveno.desktop.components.paymentmethods.CapitualForm;
|
||||
import haveno.desktop.components.paymentmethods.CashByMailForm;
|
||||
import haveno.desktop.components.paymentmethods.PayByMailForm;
|
||||
import haveno.desktop.components.paymentmethods.CashDepositForm;
|
||||
import haveno.desktop.components.paymentmethods.CelPayForm;
|
||||
import haveno.desktop.components.paymentmethods.ChaseQuickPayForm;
|
||||
|
@ -292,8 +292,8 @@ public class BuyerStep2View extends TradeStepView {
|
|||
case PaymentMethod.CASH_DEPOSIT_ID:
|
||||
gridRow = CashDepositForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
case PaymentMethod.CASH_BY_MAIL_ID:
|
||||
gridRow = CashByMailForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
case PaymentMethod.PAY_BY_MAIL_ID:
|
||||
gridRow = PayByMailForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
break;
|
||||
case PaymentMethod.MONEY_GRAM_ID:
|
||||
gridRow = MoneyGramForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload);
|
||||
|
@ -617,7 +617,7 @@ public class BuyerStep2View extends TradeStepView {
|
|||
Res.get("portfolio.pending.step2_buyer.fasterPaymentsHolderNameInfo") + "\n\n" +
|
||||
refTextWarn + "\n\n" +
|
||||
fees;
|
||||
} else if (paymentAccountPayload instanceof CashByMailAccountPayload ||
|
||||
} else if (paymentAccountPayload instanceof PayByMailAccountPayload ||
|
||||
paymentAccountPayload instanceof HalCashAccountPayload) {
|
||||
message += Res.get("portfolio.pending.step2_buyer.pay", amount);
|
||||
} else if (paymentAccountPayload instanceof SwiftAccountPayload) {
|
||||
|
|
|
@ -28,7 +28,7 @@ import haveno.core.payment.PaymentAccountUtil;
|
|||
import haveno.core.payment.payload.AmazonGiftCardAccountPayload;
|
||||
import haveno.core.payment.payload.AssetAccountPayload;
|
||||
import haveno.core.payment.payload.BankAccountPayload;
|
||||
import haveno.core.payment.payload.CashByMailAccountPayload;
|
||||
import haveno.core.payment.payload.PayByMailAccountPayload;
|
||||
import haveno.core.payment.payload.CashDepositAccountPayload;
|
||||
import haveno.core.payment.payload.F2FAccountPayload;
|
||||
import haveno.core.payment.payload.HalCashAccountPayload;
|
||||
|
@ -400,8 +400,8 @@ public class SellerStep3View extends TradeStepView {
|
|||
} else {
|
||||
if (paymentAccountPayload instanceof USPostalMoneyOrderAccountPayload) {
|
||||
message = Res.get("portfolio.pending.step3_seller.postal", part1, tradeVolumeWithCode);
|
||||
} else if (paymentAccountPayload instanceof CashByMailAccountPayload) {
|
||||
message = Res.get("portfolio.pending.step3_seller.cashByMail", part1, tradeVolumeWithCode);
|
||||
} else if (paymentAccountPayload instanceof PayByMailAccountPayload) {
|
||||
message = Res.get("portfolio.pending.step3_seller.payByMail", part1, tradeVolumeWithCode);
|
||||
} else if (!(paymentAccountPayload instanceof WesternUnionAccountPayload) &&
|
||||
!(paymentAccountPayload instanceof HalCashAccountPayload) &&
|
||||
!(paymentAccountPayload instanceof F2FAccountPayload) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue