package com.commercetools.payments;

import io.sphere.sdk.payments.Transaction;

import javax.annotation.Nonnull;

/**
 * This interface is implemented to support migrating from default
 * {@link io.sphere.sdk.payments.TransactionState#PENDING} to default
 * {@link io.sphere.sdk.payments.TransactionState#INITIAL}.
 *
 * @see <a href="http://dev.commercetools.com/release-notes.html#release-notes---commercetools-platform---version-release-29-september-2017">
 *     Release Notes - commercetools platform - Version Release 29 September 2017</a>
 */
public interface TransactionStateResolver {

    /**
     * Verify that transaction is still expected to be in initial phase, e.g. not processed by payment provider.
     * During migration mode this "initial" phase expected to be {@link io.sphere.sdk.payments.TransactionState#PENDING}
     * or {@link io.sphere.sdk.payments.TransactionState#INITIAL}.
     * @param transaction transaction to verify
     * @return <b>true</b> if the transaction is in pending or initial state.
     */
    boolean isNotCompletedTransaction(@Nonnull Transaction transaction);
}

@@ -313,11 +313,221 @@
 L%7D.%0A
+ * %3Cp%3E%0A * TODO: When full platform and customers migration is done - we should simplify or remove resolver method%0A * and accept only %3Ci%3EInitial%3C/i%3E state as unprocessed, fixing respective tests and test mocks.%0A
  *%0A
-
  * @
@@ -668,14 +668,10 @@
 7%22%3E%0A
+
  *
-    
  Rel
@@ -1104,16 +1104,23 @@
 ITIAL%7D.%0A
+     *%0A
      * @

update comment