From 4993dc8a1fbc8738307361d5f49ede3738eb8bd3 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 5 Jun 2023 10:37:06 -0400 Subject: [PATCH] show payment details of australian payid and cash by atm show terms and conditions prompt on cash by atm --- .../resources/i18n/displayStrings.properties | 4 +--- .../paymentmethods/CashByAtmForm.java | 6 ----- .../main/offer/takeoffer/TakeOfferView.java | 22 +++++++++++++++++-- .../steps/buyer/BuyerStep2View.java | 8 +++++++ 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 920925b5fd..6aa7045df7 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -2948,7 +2948,7 @@ Country you are located (eg France); \n\ Countries / regions you would accept trades from (eg France, EU, or any European country); \n\ Any special terms/conditions; \n\ Any other details. -payment.payByMail.tradingRestrictions=Please review the maker's terms and conditions.\n\ +payment.tradingRestrictions=Please review the maker's terms and conditions.\n\ If you do not meet the requirements do not take this trade. payment.cashByAtm.info=Cash at ATM: Cardless withdraw at ATM using code\n\n\ 1. List your accepted banks, regions, or other terms.\n\n\ @@ -2958,8 +2958,6 @@ payment.cashByAtm.extraInfo.prompt=Please state on your offers: \n\n\ Your accepted banks / locations; \n\ Any special terms/conditions; \n\ Any other details. -payment.payByMail.tradingRestrictions=Please review the maker's terms and conditions.\n\ - If you do not meet the requirements do not take this trade. payment.f2f.contact=Contact info payment.f2f.contact.prompt=How would you like to be contacted by the trading peer? (email address, phone number,...) payment.f2f.city=City for 'Face to face' meeting diff --git a/desktop/src/main/java/haveno/desktop/components/paymentmethods/CashByAtmForm.java b/desktop/src/main/java/haveno/desktop/components/paymentmethods/CashByAtmForm.java index b4ea6b9327..d6280e2483 100644 --- a/desktop/src/main/java/haveno/desktop/components/paymentmethods/CashByAtmForm.java +++ b/desktop/src/main/java/haveno/desktop/components/paymentmethods/CashByAtmForm.java @@ -28,7 +28,6 @@ import haveno.core.payment.payload.CashByAtmAccountPayload; import haveno.core.payment.payload.PaymentAccountPayload; import haveno.core.util.coin.CoinFormatter; import haveno.core.util.validation.InputValidator; -import haveno.desktop.util.Layout; import javafx.collections.FXCollections; import javafx.scene.control.TextArea; import javafx.scene.layout.GridPane; @@ -36,7 +35,6 @@ import javafx.scene.layout.GridPane; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextArea; import static haveno.desktop.util.FormBuilder.addCompactTopLabelTextField; import static haveno.desktop.util.FormBuilder.addTopLabelTextArea; -import static haveno.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class CashByAtmForm extends PaymentMethodForm { private final CashByAtmAccount cashByAtmAccount; @@ -44,10 +42,6 @@ public class CashByAtmForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { CashByAtmAccountPayload cbm = (CashByAtmAccountPayload) paymentAccountPayload; - addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, - Res.get("payment.shared.extraInfo"), - cbm.getExtraInfo(), - Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE); TextArea textExtraInfo = addCompactTopLabelTextArea(gridPane, gridRow, 1, Res.get("payment.shared.extraInfo"), "").second; textExtraInfo.setMinHeight(70); diff --git a/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java b/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java index e77c8165cb..07622a775e 100644 --- a/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java +++ b/desktop/src/main/java/haveno/desktop/main/offer/takeoffer/TakeOfferView.java @@ -160,7 +160,7 @@ public class TakeOfferView extends ActivatableViewAndModel paymentAccountWarningDisplayed = new HashMap<>(); private boolean offerDetailsWindowDisplayed, zelleWarningDisplayed, fasterPaymentsWarningDisplayed, - takeOfferFromUnsignedAccountWarningDisplayed, payByMailWarningDisplayed; + takeOfferFromUnsignedAccountWarningDisplayed, payByMailWarningDisplayed, cashByAtmWarningDisplayed; private SimpleBooleanProperty errorPopupDisplayed; private ChangeListener amountFocusedListener, getShowWalletFundedNotificationListener; @@ -268,6 +268,7 @@ public class TakeOfferView extends ActivatableViewAndModel { new GenericMessageWindow() - .preamble(Res.get("payment.payByMail.tradingRestrictions")) + .preamble(Res.get("payment.tradingRestrictions")) + .instruction(offer.getExtraInfo()) + .actionButtonText(Res.get("shared.iConfirm")) + .closeButtonText(Res.get("shared.close")) + .width(Layout.INITIAL_WINDOW_WIDTH) + .onClose(() -> close(false)) + .show(); + }, 500, TimeUnit.MILLISECONDS); + } + } + + private void maybeShowCashByAtmWarning(PaymentAccount paymentAccount, Offer offer) { + if (paymentAccount.getPaymentMethod().getId().equals(PaymentMethod.CASH_BY_ATM_ID) && + !cashByAtmWarningDisplayed && !offer.getExtraInfo().isEmpty()) { + cashByAtmWarningDisplayed = true; + UserThread.runAfter(() -> { + new GenericMessageWindow() + .preamble(Res.get("payment.tradingRestrictions")) .instruction(offer.getExtraInfo()) .actionButtonText(Res.get("shared.iConfirm")) .closeButtonText(Res.get("shared.close")) diff --git a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java index 6c3182c0e0..a4acc38a88 100644 --- a/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java +++ b/desktop/src/main/java/haveno/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java @@ -49,8 +49,10 @@ import haveno.desktop.components.paymentmethods.AdvancedCashForm; import haveno.desktop.components.paymentmethods.AliPayForm; import haveno.desktop.components.paymentmethods.AmazonGiftCardForm; import haveno.desktop.components.paymentmethods.AssetsForm; +import haveno.desktop.components.paymentmethods.AustraliaPayidForm; import haveno.desktop.components.paymentmethods.BizumForm; import haveno.desktop.components.paymentmethods.CapitualForm; +import haveno.desktop.components.paymentmethods.CashByAtmForm; import haveno.desktop.components.paymentmethods.PayByMailForm; import haveno.desktop.components.paymentmethods.CashDepositForm; import haveno.desktop.components.paymentmethods.CelPayForm; @@ -259,6 +261,9 @@ public class BuyerStep2View extends TradeStepView { case PaymentMethod.NATIONAL_BANK_ID: gridRow = NationalBankForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); break; + case PaymentMethod.AUSTRALIA_PAYID_ID: + gridRow = AustraliaPayidForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); + break; case PaymentMethod.SAME_BANK_ID: gridRow = SameBankForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); break; @@ -295,6 +300,9 @@ public class BuyerStep2View extends TradeStepView { case PaymentMethod.PAY_BY_MAIL_ID: gridRow = PayByMailForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); break; + case PaymentMethod.CASH_BY_ATM_ID: + gridRow = CashByAtmForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); + break; case PaymentMethod.MONEY_GRAM_ID: gridRow = MoneyGramForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); break;