[bisq-network/bisq] Display "Payment Method" column in Open Offers view (#4193)

dmos62 notifications at github.com
Thu May 14 16:00:07 UTC 2020


@dmos62 commented on this pull request.



> @@ -118,6 +121,23 @@ String getMarketLabel(OpenOfferListItem item) {
         return CurrencyUtil.getCurrencyPair(item.getOffer().getCurrencyCode());
     }
 
+    String getPaymentMethod(OpenOfferListItem item) {
+        String result = "";
+        if (item != null) {
+            Offer offer = item.getOffer();
+            checkNotNull(offer);
+            checkNotNull(offer.getPaymentMethod());
+            String method = Res.get(offer.getPaymentMethod().getId() + "_SHORT");

It would be a good to move this duplicating logic to [`PaymentMethod`](https://github.com/bisq-network/bisq/blob/master/core/src/main/java/bisq/core/payment/payload/PaymentMethod.java) itself (`PaymentMethod.getShortName()` or something better). Put in a try-catch in that method for `java.util.MissingResourceException` (that's what `Res.get` might throw) and use an Option return type to distinguish whether or not the translation was found (again, since we can't guarantee (I presume) that someone won't forget to put in a translation when adding a new payment method).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4193#discussion_r425250142
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200514/722ec432/attachment.html>


More information about the bisq-github mailing list