All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.sphere.sdk.payments.commands.updateactions.ChangeTransactionState Maven / Gradle / Ivy

There is a newer version: 1.0.0-M26
Show newest version
package io.sphere.sdk.payments.commands.updateactions;

import io.sphere.sdk.commands.UpdateActionImpl;
import io.sphere.sdk.payments.Payment;
import io.sphere.sdk.payments.TransactionState;


/**
 * Changes state of a transaction. If a transaction has been executed asynchronously, it’s state can be updated. E.g. if a Refund was executed, the state can be set to Success.
 *
 * {@include.example io.sphere.sdk.payments.commands.PaymentUpdateCommandTest#changeTransactionState()}
 *
 */
public class ChangeTransactionState extends UpdateActionImpl {
    private final TransactionState state;
    private final String transactionId;

    private ChangeTransactionState(final TransactionState state, final String transactionId) {
        super("changeTransactionState");
        this.state = state;
        this.transactionId = transactionId;
    }

    public static ChangeTransactionState of(final TransactionState state, final String transactionId) {
        return new ChangeTransactionState(state, transactionId);
    }

    public TransactionState getState() {
        return state;
    }

    public String getTransactionId() {
        return transactionId;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy