diff --git a/payment/src/main/java/org/killbill/billing/payment/api/DefaultPaymentApi.java b/payment/src/main/java/org/killbill/billing/payment/api/DefaultPaymentApi.java
index e4b513f..9398a23 100644
--- a/payment/src/main/java/org/killbill/billing/payment/api/DefaultPaymentApi.java
+++ b/payment/src/main/java/org/killbill/billing/payment/api/DefaultPaymentApi.java
@@ -101,9 +101,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, paymentMethodId, paymentId, null, amount, currency, paymentExternalKey, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createAuthorization(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentMethodId, paymentId, amount, currency, effectiveDate, paymentExternalKey, paymentTransactionExternalKey,
null, null, SHOULD_LOCK_ACCOUNT, properties, callContext, internalCallContext);
@@ -149,9 +149,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, paymentMethodId, paymentId, null, amount, currency, paymentExternalKey, paymentTransactionExternalKey, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.createAuthorization(IS_API_PAYMENT, account, paymentMethodId, paymentId, amount, currency, effectiveDate, paymentExternalKey, paymentTransactionExternalKey,
properties, paymentControlPluginNames, callContext, internalCallContext);
@@ -194,9 +194,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, amount, currency, null, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createCapture(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentId, amount, currency, effectiveDate, paymentTransactionExternalKey,
null, SHOULD_LOCK_ACCOUNT, properties, callContext, internalCallContext);
@@ -241,9 +241,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, amount, currency, null, paymentTransactionExternalKey, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.createCapture(IS_API_PAYMENT, account, paymentId, amount, currency, effectiveDate, paymentTransactionExternalKey,
properties, paymentControlPluginNames, callContext, internalCallContext);
@@ -288,9 +288,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, paymentMethodId, paymentId, null, amount, currency, paymentExternalKey, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createPurchase(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentMethodId, paymentId, amount, currency, effectiveDate, paymentExternalKey, paymentTransactionExternalKey,
null, null, SHOULD_LOCK_ACCOUNT, properties, callContext, internalCallContext);
@@ -383,9 +383,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, null, null, null, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createVoid(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentId, effectiveDate, paymentTransactionExternalKey,
null, SHOULD_LOCK_ACCOUNT, properties, callContext, internalCallContext);
@@ -430,9 +430,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, null, null, null, paymentTransactionExternalKey, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.createVoid(IS_API_PAYMENT, account, paymentId, effectiveDate, paymentTransactionExternalKey,
properties, paymentControlPluginNames, callContext, internalCallContext);
@@ -475,9 +475,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, amount, currency, null, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createRefund(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentId, amount, currency, effectiveDate, paymentTransactionExternalKey,
null, SHOULD_LOCK_ACCOUNT, properties, callContext, internalCallContext);
@@ -522,9 +522,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, amount, currency, null, paymentTransactionExternalKey, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.createRefund(IS_API_PAYMENT, account, paymentId, amount, currency, effectiveDate, paymentTransactionExternalKey,
properties, paymentControlPluginNames, callContext, internalCallContext);
@@ -569,9 +569,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, paymentMethodId, paymentId, null, amount, currency, paymentExternalKey, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
final UUID nonNullPaymentMethodId = (paymentMethodId != null) ?
paymentMethodId :
paymentMethodProcessor.createOrGetExternalPaymentMethod(UUIDs.randomUUID().toString(), account, properties, callContext, internalCallContext);
@@ -620,9 +620,8 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
- logEnterAPICall(log, transactionType, account, paymentMethodId, paymentId, null, amount, currency, paymentExternalKey, paymentTransactionExternalKey, null, paymentControlPluginNames);
-
final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
+ logEnterAPICall(log, transactionType, account, paymentMethodId, paymentId, null, amount, currency, paymentExternalKey, paymentTransactionExternalKey, null, paymentControlPluginNames);
final UUID resolvedPaymentMethodId = (paymentMethodId == null && paymentOptions.isExternalPayment()) ?
paymentMethodProcessor.createOrGetExternalPaymentMethod(UUIDs.randomUUID().toString(), account, properties, callContext, internalCallContext) :
@@ -676,9 +675,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, null, paymentTransactionId, null, null, null, null, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.notifyPendingPaymentOfStateChanged(account, paymentTransactionId, isSuccess, callContext, internalCallContext);
paymentTransaction = Iterables.<PaymentTransaction>tryFind(payment.getTransactions(),
@@ -724,9 +723,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, null, paymentTransactionId, null, null, null, null, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.notifyPendingPaymentOfStateChanged(IS_API_PAYMENT, account, paymentTransactionId, isSuccess, paymentControlPluginNames, callContext, internalCallContext);
paymentTransaction = Iterables.<PaymentTransaction>tryFind(payment.getTransactions(),
@@ -770,9 +769,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, amount, currency, null, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createChargeback(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentId, paymentTransactionExternalKey, amount, currency, effectiveDate, null, true,
callContext, internalCallContext);
@@ -814,9 +813,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, amount, currency, null, paymentTransactionExternalKey, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.createChargeback(IS_API_PAYMENT, account, paymentId, paymentTransactionExternalKey, amount, currency, effectiveDate,
paymentControlPluginNames, callContext, internalCallContext);
@@ -854,9 +853,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, null, null, null, paymentTransactionExternalKey, null, null);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = paymentProcessor.createChargebackReversal(IS_API_PAYMENT, NULL_ATTEMPT_ID, account, paymentId, paymentTransactionExternalKey, null, null, effectiveDate, null, true, callContext, internalCallContext);
paymentTransaction = findPaymentTransaction(payment, paymentTransactionExternalKey);
@@ -898,9 +897,9 @@ public class DefaultPaymentApi extends DefaultApiBase implements PaymentApi {
PaymentTransaction paymentTransaction = null;
PaymentApiException exception = null;
try {
+ final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
logEnterAPICall(log, transactionType, account, null, paymentId, null, null, null, null, paymentTransactionExternalKey, null, paymentControlPluginNames);
- final InternalCallContext internalCallContext = internalCallContextFactory.createInternalCallContext(account.getId(), callContext);
payment = pluginControlPaymentProcessor.createChargebackReversal(IS_API_PAYMENT, account, paymentId, effectiveDate, paymentTransactionExternalKey, paymentControlPluginNames, callContext, internalCallContext);
// See https://github.com/killbill/killbill/issues/552