killbill-aplcache
Details
beatrix/pom.xml 12(+11 -1)
diff --git a/beatrix/pom.xml b/beatrix/pom.xml
index ded6f0f..c964ba4 100644
--- a/beatrix/pom.xml
+++ b/beatrix/pom.xml
@@ -34,6 +34,10 @@
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
+ <artifactId>killbill-payment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.ning.billing</groupId>
<artifactId>killbill-catalog</artifactId>
</dependency>
<dependency>
@@ -47,7 +51,7 @@
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
- <version>3.0</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.skife.config</groupId>
@@ -58,6 +62,12 @@
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-payment</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>com.ning.jdbi</groupId>
<artifactId>jdbi-metrics</artifactId>
<scope>test</scope>
diff --git a/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java b/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java
index 9700450..892d424 100644
--- a/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java
+++ b/payment/src/main/java/com/ning/billing/payment/RequestProcessor.java
@@ -67,11 +67,7 @@ public class RequestProcessor {
}
else {
List<Either<PaymentError, PaymentInfo>> results = paymentApi.createPayment(account, Arrays.asList(event.getInvoiceId().toString()));
-
- if (results.isEmpty()) {
- eventBus.post(new PaymentError("unknown", "No payment processed"));
- }
- else {
+ if (!results.isEmpty()) {
Either<PaymentError, PaymentInfo> result = results.get(0);
eventBus.post(result.isLeft() ? result.getLeft() : result.getRight());
}
diff --git a/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java b/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java
index cbff01b..935b968 100644
--- a/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java
+++ b/payment/src/main/java/com/ning/billing/payment/setup/PaymentModule.java
@@ -24,6 +24,7 @@ import com.google.inject.AbstractModule;
import com.ning.billing.payment.RequestProcessor;
import com.ning.billing.payment.api.DefaultPaymentApi;
import com.ning.billing.payment.api.PaymentApi;
+import com.ning.billing.payment.api.PaymentService;
import com.ning.billing.payment.dao.DefaultPaymentDao;
import com.ning.billing.payment.dao.PaymentDao;
import com.ning.billing.payment.provider.PaymentProviderPluginRegistry;
@@ -55,7 +56,7 @@ public class PaymentModule extends AbstractModule {
bind(PaymentProviderPluginRegistry.class).asEagerSingleton();
bind(PaymentApi.class).to(DefaultPaymentApi.class).asEagerSingleton();
bind(RequestProcessor.class).asEagerSingleton();
- bind(PaymentService.class).asEagerSingleton();
+ bind(PaymentService.class).to(DefaultPaymentService.class).asEagerSingleton();
installPaymentProviderPlugins(paymentConfig);
installPaymentDao();
}
pom.xml 11(+11 -0)
diff --git a/pom.xml b/pom.xml
index d72a41e..dd142a7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,6 +84,17 @@
</dependency>
<dependency>
<groupId>com.ning.billing</groupId>
+ <artifactId>killbill-payment</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ning.billing</groupId>
+ <artifactId>killbill-payment</artifactId>
+ <version>${project.version}</version>
+ <type>test-jar</type>
+ </dependency>
+ <dependency>
+ <groupId>com.ning.billing</groupId>
<artifactId>killbill-catalog</artifactId>
<version>${project.version}</version>
</dependency>