killbill-aplcache

payment: revisit PaymentBusEventHandler handling ErrorCode.PAYMENT_NULL_INVOICE

6/28/2016 6:22:54 PM

Details

diff --git a/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java b/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java
index 45f8ba0..36f3382 100644
--- a/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java
+++ b/payment/src/main/java/org/killbill/billing/payment/bus/PaymentBusEventHandler.java
@@ -101,10 +101,9 @@ public class PaymentBusEventHandler {
         } catch (final AccountApiException e) {
             log.warn("Failed to process invoice payment", e);
         } catch (final PaymentApiException e) {
-            // Log as error unless:
-            if (e.getCode() != ErrorCode.PAYMENT_NULL_INVOICE.getCode() /* Nothing left to be paid */ &&
-                e.getCode() != ErrorCode.PAYMENT_CREATE_PAYMENT.getCode() /* User payment error */) {
-                log.error("Failed to process invoice payment {}", e.toString());
+            // Log as warn unless nothing left to be paid
+            if (e.getCode() != ErrorCode.PAYMENT_PLUGIN_API_ABORTED.getCode()) {
+                log.warn("Failed to process invoice payment {}", e.toString());
             }
         }
     }