payment: use correct payment method id across transactions

This is the second part of a087f68425f55af28eb12cf14425db8a01a9f345.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: fix compilation warnings

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: allow processor to bypass account locking

This will be used by the retry state machine.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: export payment plugin properties in direct payment resources

This fixes #185.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: cleanup credit and refund operations

See https://github.com/killbill/killbill/issues/187.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
server: fix TestDirectPayment to issue refunds

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: relocate PaymentStates.xml

Cleanup as well the xml (remove chargebacks which don't have
state machines and remove invalid state transitions).

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: update to latest API

Deprecate RefundInfoPlugin for PaymentInfoPlugin.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: update to latest API

Add stub for notifyPaymentOfChargeback.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: fix compilation errors

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: fix DirectTransactionSqlDao

Store processedAmount and processedCurrency.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: add tests for DirectPaymentEnteringStateCallback

This fixes some discovered bugs too.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: add tests for DirectPaymentAutomatonDAOHelper

Simplify a bit the code as well.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: add test for DirectPaymentLeavingStateCallback

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: add tests for PluginOperation

This also fixes a bug in handling RuntimeException.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: add tests for DirectPaymentOperation

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
payment: add top-level tests for DirectPaymentProcessor

This fixes the following discovered bugs:

* Use only successful transactions to compute payment amounts
* Auth amount computation was wrong for multi-step 3DS
* Add missing state transition AUTH_SUCCESS - AUTH_INIT for 3DS

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Merge remote-tracking branch 'origin/state-machines' into state-machines2

Conflicts:
	payment/src/main/java/org/killbill/billing/payment/core/DirectPaymentProcessor.java
	payment/src/main/java/org/killbill/billing/payment/core/sm/DirectPaymentOperation.java
	payment/src/main/java/org/killbill/billing/payment/core/sm/DirectPaymentStateContext.java
	payment/src/main/java/org/killbill/billing/payment/core/sm/PluginOperation.java
	payment/src/main/java/org/killbill/billing/payment/dao/DirectTransactionSqlDao.java
	payment/src/main/java/org/killbill/billing/payment/dispatcher/PluginDispatcher.java