Skip to content

Commit

Permalink
payment: initial version using state machines
Browse files Browse the repository at this point in the history
This also:

* extracts the platform specific code
* adds DirectPaymentTransaction#getExternalKey, see #180
* fixes compilation errors with the latest Java client (PaymentMethodProperties has been renamed PluginProperty)
* allows override of payment method id, see #177
* exports payment plugin properties in direct payment resources, see #185
* cleans up credit and refund operations, see #187
* deprecates RefundInfoPlugin for PaymentInfoPlugin
* adds BUS events for all direct payments calls. Note that I have
re-used the existing events for now. It may be desirable to expose
more information in the future (like the type of transaction). Clients
do have the direct payment id though, so they can retrieve the information
if needed. See #179

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
  • Loading branch information
pierre committed Jun 18, 2014
1 parent 789ed9f commit f9b6bf5
Show file tree
Hide file tree
Showing 622 changed files with 13,447 additions and 22,616 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,3 +29,4 @@ killbill.h2.db
killbill.lock.db
killbill.trace.db
server/test.db
.idea/dictionaries/
14 changes: 5 additions & 9 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/copyright/apache.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 3 additions & 14 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 25 additions & 4 deletions account/pom.xml
Expand Up @@ -74,6 +74,25 @@
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-internal-api</artifactId>
</dependency>
<dependency>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-platform-api</artifactId>
</dependency>
<dependency>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-platform-base</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-platform-lifecycle</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-platform-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-util</artifactId>
Expand Down Expand Up @@ -109,13 +128,15 @@
<artifactId>killbill-queue</artifactId>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<groupId>org.kill-bill.commons</groupId>
<artifactId>killbill-queue</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skife.config</groupId>
<artifactId>config-magic</artifactId>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
@@ -1,7 +1,9 @@
/*
* Copyright 2010-2013 Ning, Inc.
* Copyright 2014 Groupon, Inc
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
Expand All @@ -16,8 +18,7 @@

package org.killbill.billing.account.glue;

import org.skife.config.ConfigSource;

import org.killbill.billing.account.api.AccountInternalApi;
import org.killbill.billing.account.api.AccountService;
import org.killbill.billing.account.api.AccountUserApi;
import org.killbill.billing.account.api.DefaultAccountService;
Expand All @@ -26,16 +27,13 @@
import org.killbill.billing.account.dao.AccountDao;
import org.killbill.billing.account.dao.DefaultAccountDao;
import org.killbill.billing.glue.AccountModule;
import org.killbill.billing.account.api.AccountInternalApi;

import com.google.inject.AbstractModule;

public class DefaultAccountModule extends AbstractModule implements AccountModule {
import org.killbill.billing.platform.api.KillbillConfigSource;
import org.killbill.billing.util.glue.KillBillModule;

protected final ConfigSource configSource;
public class DefaultAccountModule extends KillBillModule implements AccountModule {

public DefaultAccountModule(final ConfigSource configSource) {
this.configSource = configSource;
public DefaultAccountModule(final KillbillConfigSource configSource) {
super(configSource);
}

private void installConfig() {
Expand Down
@@ -1,7 +1,9 @@
/*
* Copyright 2010-2013 Ning, Inc.
* Copyright 2014 Groupon, Inc
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
Expand All @@ -16,9 +18,8 @@

package org.killbill.billing.account.glue;

import org.skife.config.ConfigSource;

import org.killbill.billing.mock.glue.MockSubscriptionModule;
import org.killbill.billing.platform.api.KillbillConfigSource;
import org.killbill.billing.util.glue.AuditModule;
import org.killbill.billing.util.glue.CacheModule;
import org.killbill.billing.util.glue.CallContextModule;
Expand All @@ -27,20 +28,20 @@

public class TestAccountModule extends DefaultAccountModule {

public TestAccountModule(final ConfigSource configSource) {
public TestAccountModule(final KillbillConfigSource configSource) {
super(configSource);
}

@Override
protected void configure() {
super.configure();

install(new AuditModule());
install(new AuditModule(configSource));
install(new CacheModule(configSource));
install(new CallContextModule());
install(new CustomFieldModule());
install(new CallContextModule(configSource));
install(new CustomFieldModule(configSource));
// Needed for Audit
install(new MockSubscriptionModule());
install(new TagStoreModule());
install(new MockSubscriptionModule(configSource));
install(new TagStoreModule(configSource));
}
}
@@ -1,7 +1,9 @@
/*
* Copyright 2010-2013 Ning, Inc.
* Copyright 2014 Groupon, Inc
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
Expand All @@ -16,17 +18,15 @@

package org.killbill.billing.account.glue;

import org.skife.config.ConfigSource;

import org.killbill.billing.GuicyKillbillTestNoDBModule;
import org.killbill.billing.account.dao.AccountDao;
import org.killbill.billing.account.dao.MockAccountDao;
import org.killbill.billing.mock.glue.MockNonEntityDaoModule;
import org.killbill.billing.util.bus.InMemoryBusModule;
import org.killbill.billing.platform.api.KillbillConfigSource;

public class TestAccountModuleNoDB extends TestAccountModule {

public TestAccountModuleNoDB(final ConfigSource configSource) {
public TestAccountModuleNoDB(final KillbillConfigSource configSource) {
super(configSource);
}

Expand All @@ -39,8 +39,7 @@ protected void installAccountDao() {
public void configure() {
super.configure();

install(new GuicyKillbillTestNoDBModule());
install(new MockNonEntityDaoModule());
install(new InMemoryBusModule(configSource));
install(new GuicyKillbillTestNoDBModule(configSource));
install(new MockNonEntityDaoModule(configSource));
}
}
@@ -1,7 +1,9 @@
/*
* Copyright 2010-2013 Ning, Inc.
* Copyright 2014 Groupon, Inc
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
Expand All @@ -16,26 +18,21 @@

package org.killbill.billing.account.glue;

import org.skife.config.ConfigSource;

import org.killbill.billing.GuicyKillbillTestWithEmbeddedDBModule;
import org.killbill.billing.util.glue.BusModule;
import org.killbill.billing.util.glue.MetricsModule;
import org.killbill.billing.platform.api.KillbillConfigSource;
import org.killbill.billing.util.glue.NonEntityDaoModule;

public class TestAccountModuleWithEmbeddedDB extends TestAccountModule {

public TestAccountModuleWithEmbeddedDB(final ConfigSource configSource) {
public TestAccountModuleWithEmbeddedDB(final KillbillConfigSource configSource) {
super(configSource);
}

@Override
public void configure() {
super.configure();

install(new GuicyKillbillTestWithEmbeddedDBModule());
install(new NonEntityDaoModule());
install(new MetricsModule());
install(new BusModule(configSource));
install(new GuicyKillbillTestWithEmbeddedDBModule(configSource));
install(new NonEntityDaoModule(configSource));
}
}
6 changes: 5 additions & 1 deletion api/pom.xml
Expand Up @@ -24,7 +24,7 @@
</parent>
<artifactId>killbill-internal-api</artifactId>
<packaging>jar</packaging>
<name>Kill Bill internal apis</name>
<name>killbill-api</name>
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -44,6 +44,10 @@
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-api</artifactId>
</dependency>
<dependency>
<groupId>org.kill-bill.billing</groupId>
<artifactId>killbill-platform-api</artifactId>
</dependency>
<dependency>
<groupId>org.kill-bill.billing.plugin</groupId>
<artifactId>killbill-plugin-api-payment</artifactId>
Expand Down
@@ -1,7 +1,9 @@
/*
* Copyright 2010-2013 Ning, Inc.
* Copyright 2014 Groupon, Inc
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
Expand All @@ -16,13 +18,12 @@

package org.killbill.billing.account.api;

import org.killbill.billing.lifecycle.KillbillService;
import org.killbill.billing.platform.api.KillbillService;

/**
* The interface {@code AccountService} is a {@code KillbillService} required to handle account operations
*
* @see KillbillService
*/
public interface AccountService extends KillbillService {

}
@@ -1,7 +1,9 @@
/*
* Copyright 2010-2013 Ning, Inc.
* Copyright 2014 Groupon, Inc
* Copyright 2014 The Billing Project, LLC
*
* Ning licenses this file to you under the Apache License, version 2.0
* The Billing Project licenses this file to you under the Apache License, version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
Expand All @@ -16,11 +18,10 @@

package org.killbill.billing.beatrix.bus.api;

import org.killbill.billing.lifecycle.KillbillService;
import org.killbill.billing.platform.api.KillbillService;

/**
* The interface {@code BeatrixService} is a {@code KillbillService} required to manage the {@code ExternalBus}
*
*/
public interface BeatrixService extends KillbillService {
}

0 comments on commit f9b6bf5

Please sign in to comment.