From 2f322674f8e878a3f2cd89fb411de012d73cdb68 Mon Sep 17 00:00:00 2001 From: woodser Date: Mon, 13 Jan 2025 09:51:31 -0500 Subject: [PATCH] fix showing extra info in offer details --- core/src/main/java/haveno/core/offer/Offer.java | 2 ++ core/src/main/java/haveno/core/offer/OfferPayload.java | 1 + core/src/main/java/haveno/core/offer/OfferUtil.java | 6 ++++++ .../desktop/main/overlays/windows/OfferDetailsWindow.java | 5 +++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/haveno/core/offer/Offer.java b/core/src/main/java/haveno/core/offer/Offer.java index 3dc566b308..e84e4fa329 100644 --- a/core/src/main/java/haveno/core/offer/Offer.java +++ b/core/src/main/java/haveno/core/offer/Offer.java @@ -432,6 +432,8 @@ public class Offer implements NetworkPayload, PersistablePayload { return getExtraDataMap().get(OfferPayload.PAYPAL_EXTRA_INFO); else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.CASHAPP_EXTRA_INFO)) return getExtraDataMap().get(OfferPayload.CASHAPP_EXTRA_INFO); + else if (getExtraDataMap() != null && getExtraDataMap().containsKey(OfferPayload.CASH_AT_ATM_EXTRA_INFO)) + return getExtraDataMap().get(OfferPayload.CASH_AT_ATM_EXTRA_INFO); else return ""; } diff --git a/core/src/main/java/haveno/core/offer/OfferPayload.java b/core/src/main/java/haveno/core/offer/OfferPayload.java index 0dadf882ba..bd10719ec3 100644 --- a/core/src/main/java/haveno/core/offer/OfferPayload.java +++ b/core/src/main/java/haveno/core/offer/OfferPayload.java @@ -102,6 +102,7 @@ public final class OfferPayload implements ProtectedStoragePayload, ExpirablePay public static final String PAY_BY_MAIL_EXTRA_INFO = "payByMailExtraInfo"; public static final String AUSTRALIA_PAYID_EXTRA_INFO = "australiaPayidExtraInfo"; public static final String PAYPAL_EXTRA_INFO = "payPalExtraInfo"; + public static final String CASH_AT_ATM_EXTRA_INFO = "cashAtAtmExtraInfo"; // Comma separated list of ordinal of a haveno.common.app.Capability. E.g. ordinal of // Capability.SIGNED_ACCOUNT_AGE_WITNESS is 11 and Capability.MEDIATION is 12 so if we want to signal that maker diff --git a/core/src/main/java/haveno/core/offer/OfferUtil.java b/core/src/main/java/haveno/core/offer/OfferUtil.java index 3d4c1c376e..2e2644630a 100644 --- a/core/src/main/java/haveno/core/offer/OfferUtil.java +++ b/core/src/main/java/haveno/core/offer/OfferUtil.java @@ -37,6 +37,7 @@ import haveno.core.monetary.Volume; import static haveno.core.offer.OfferPayload.ACCOUNT_AGE_WITNESS_HASH; import static haveno.core.offer.OfferPayload.AUSTRALIA_PAYID_EXTRA_INFO; import static haveno.core.offer.OfferPayload.CAPABILITIES; +import static haveno.core.offer.OfferPayload.CASH_AT_ATM_EXTRA_INFO; import static haveno.core.offer.OfferPayload.CASHAPP_EXTRA_INFO; import static haveno.core.offer.OfferPayload.F2F_CITY; import static haveno.core.offer.OfferPayload.F2F_EXTRA_INFO; @@ -48,6 +49,7 @@ import static haveno.core.offer.OfferPayload.XMR_AUTO_CONF_ENABLED_VALUE; import haveno.core.payment.AustraliaPayidAccount; import haveno.core.payment.CashAppAccount; +import haveno.core.payment.CashAtAtmAccount; import haveno.core.payment.F2FAccount; import haveno.core.payment.PayByMailAccount; import haveno.core.payment.PayPalAccount; @@ -217,6 +219,10 @@ public class OfferUtil { extraDataMap.put(AUSTRALIA_PAYID_EXTRA_INFO, ((AustraliaPayidAccount) paymentAccount).getExtraInfo()); } + if (paymentAccount instanceof CashAtAtmAccount) { + extraDataMap.put(CASH_AT_ATM_EXTRA_INFO, ((CashAtAtmAccount) paymentAccount).getExtraInfo()); + } + extraDataMap.put(CAPABILITIES, Capabilities.app.toStringList()); if (currencyCode.equals("XMR") && direction == OfferDirection.SELL) { diff --git a/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java b/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java index adf841a147..7732b7b70d 100644 --- a/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java +++ b/desktop/src/main/java/haveno/desktop/main/overlays/windows/OfferDetailsWindow.java @@ -180,8 +180,9 @@ public class OfferDetailsWindow extends Overlay { boolean showExtraInfo = offer.getPaymentMethod().equals(PaymentMethod.F2F) || offer.getPaymentMethod().equals(PaymentMethod.PAY_BY_MAIL) || offer.getPaymentMethod().equals(PaymentMethod.AUSTRALIA_PAYID)|| - offer.getPaymentMethod().equals(PaymentMethod.PAYPAL_ID)|| - offer.getPaymentMethod().equals(PaymentMethod.CASH_APP_ID); + offer.getPaymentMethod().equals(PaymentMethod.PAYPAL)|| + offer.getPaymentMethod().equals(PaymentMethod.CASH_APP) || + offer.getPaymentMethod().equals(PaymentMethod.CASH_AT_ATM); if (!takeOfferHandlerOptional.isPresent()) rows++; if (showAcceptedBanks)