killbill-uncached

Details

diff --git a/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentMethodPlugin.java b/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentMethodPlugin.java
index c0aefd3..b500ee4 100644
--- a/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentMethodPlugin.java
+++ b/payment/src/main/java/com/ning/billing/payment/api/DefaultPaymentMethodPlugin.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * Copyright 2010-2011 Ning, Inc.
  *
  * Ning licenses this file to you under the Apache License, version 2.0
@@ -46,7 +46,11 @@ public class DefaultPaymentMethodPlugin implements PaymentMethodPlugin {
 
     @Override
     public String getValueString(final String key) {
-        throw new RuntimeException("Not implemented");
+        for (PaymentMethodKVInfo cur : properties) {
+            if (cur.getKey().equals(key)) {
+                return cur.getValue() != null ? cur.getValue().toString() : null;
+            }
+        }
+        return null;
     }
-
 }
diff --git a/payment/src/main/java/com/ning/billing/payment/bus/InvoiceHandler.java b/payment/src/main/java/com/ning/billing/payment/bus/InvoiceHandler.java
index 8cae63a..2006984 100644
--- a/payment/src/main/java/com/ning/billing/payment/bus/InvoiceHandler.java
+++ b/payment/src/main/java/com/ning/billing/payment/bus/InvoiceHandler.java
@@ -20,8 +20,6 @@ package com.ning.billing.payment.bus;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.eventbus.Subscribe;
-import com.google.inject.Inject;
 import com.ning.billing.ErrorCode;
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountApiException;
@@ -36,6 +34,9 @@ import com.ning.billing.util.callcontext.DefaultCallContext;
 import com.ning.billing.util.callcontext.UserType;
 import com.ning.billing.util.clock.Clock;
 
+import com.google.common.eventbus.Subscribe;
+import com.google.inject.Inject;
+
 
 public class InvoiceHandler {
 
@@ -74,7 +75,9 @@ public class InvoiceHandler {
         } catch (AccountApiException e) {
             log.error("Failed to process invoice payment", e);
         } catch (PaymentApiException e) {
-            if (e.getCode() != ErrorCode.PAYMENT_NULL_INVOICE.getCode()) {
+            // Log as error unless:
+            if (e.getCode() != ErrorCode.PAYMENT_NULL_INVOICE.getCode() /*  Nothing to left be paid*/ &&
+                    e.getCode() != ErrorCode.PAYMENT_CREATE_PAYMENT.getCode() /* User payment error */) {
                 log.error("Failed to process invoice payment {}", e.toString());
             }
         }
diff --git a/payment/src/main/java/com/ning/billing/payment/core/PaymentProcessor.java b/payment/src/main/java/com/ning/billing/payment/core/PaymentProcessor.java
index 241027b..b837f5e 100644
--- a/payment/src/main/java/com/ning/billing/payment/core/PaymentProcessor.java
+++ b/payment/src/main/java/com/ning/billing/payment/core/PaymentProcessor.java
@@ -33,9 +33,6 @@ import javax.inject.Inject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.base.Predicate;
-import com.google.common.collect.Collections2;
-import com.google.inject.name.Named;
 import com.ning.billing.ErrorCode;
 import com.ning.billing.account.api.Account;
 import com.ning.billing.account.api.AccountApiException;
@@ -73,6 +70,10 @@ import com.ning.billing.util.callcontext.UserType;
 import com.ning.billing.util.clock.Clock;
 import com.ning.billing.util.globallocker.GlobalLocker;
 
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import com.google.inject.name.Named;
+
 public class PaymentProcessor extends ProcessorBase {
 
     private final PaymentMethodProcessor paymentMethodProcessor;
@@ -461,7 +462,7 @@ public class PaymentProcessor extends ProcessorBase {
 
                 paymentDao.updateStatusForPaymentWithAttempt(paymentInput.getId(), paymentStatus, paymentPluginInfo.getGatewayErrorCode(),  paymentPluginInfo.getGatewayError(),null, null, attemptInput.getId(), context);
 
-                log.warn(String.format("Could not process payment for account %s, invoice %s, error = %s",
+                log.info(String.format("Could not process payment for account %s, invoice %s, error = %s",
                          account.getId(), invoice.getId(), paymentPluginInfo.getGatewayError()));
 
                 event = new DefaultPaymentErrorEvent(account.getId(), invoice.getId(), paymentInput.getId(), paymentPluginInfo.getGatewayError(), context.getUserToken());