com.ibm.commerce.payments.plugincontroller

Class Result

  • java.lang.Object
    • com.ibm.commerce.payments.plugincontroller.Result
  • All Implemented Interfaces:
    java.io.Serializable


    public class Result
    extends java.lang.Object
    implements java.io.Serializable

    This class stores information of a transaction in a payment backend system.

    Payment backend implementation providers are free to extend this default implementation, but not required.

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
      static int STATUS_FAILED
      The status of the Result object for a failed transaction.
      static int STATUS_PENDING
      The status of the Result object for a pending transaction.
      static int STATUS_SUCCESS
      The status of the Result object for a successful transaction.
      static int STATUS_UNKNOWN
      Unknown status of the Result object for a transaction.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Result(Credit credit, FinancialTransaction transaction, int status, java.lang.String reasonCode)
      This method creates a new Results object with a Credit, a FinancialTransaction, the status and the reason code
      Result(Credit credit, int status, java.lang.String reasonCode)
      This method creates a new Results object with a Credit, the status and the reason code.
      Result(Payment payment, FinancialTransaction transaction, int status, java.lang.String reasonCode)
      This method creates a new Results object with a Payment, a FinancialTransaction, the status and the reason code
      Result(PaymentInstruction paymentInstruction, int status, java.lang.String reasonCode)
      This method creates a new Results object with a PaymentInstruction, the status and the reason code.
      Result(Payment payment, int status, java.lang.String reasonCode)
      This method creates a new Results object with a Payment, the status and the reason code.
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright notice field.
        See Also:
        Constant Field Values
      • STATUS_UNKNOWN

        public static final int STATUS_UNKNOWN
        Unknown status of the Result object for a transaction.
        See Also:
        Constant Field Values
      • STATUS_SUCCESS

        public static final int STATUS_SUCCESS
        The status of the Result object for a successful transaction.
        See Also:
        Constant Field Values
      • STATUS_PENDING

        public static final int STATUS_PENDING
        The status of the Result object for a pending transaction. Notice that the actual operation is not identified; so the actual backend state could be approving, depositing, and so on.
        See Also:
        Constant Field Values
      • STATUS_FAILED

        public static final int STATUS_FAILED
        The status of the Result object for a failed transaction.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Result

        public Result(PaymentInstruction paymentInstruction,
                      int status,
                      java.lang.String reasonCode)

        This method creates a new Results object with a PaymentInstruction, the status and the reason code.

        Parameters:
        paymentInstruction - The PaymentInstruction needs to be put into the result.
        status - The status of the result.
        reasonCode - The reasonCode received from the backend for the just processed transaction.
      • Result

        public Result(Payment payment,
                      int status,
                      java.lang.String reasonCode)

        This method creates a new Results object with a Payment, the status and the reason code.

        Parameters:
        payment - The Payment need to be put into the result.
        status - The status of the result.
        reasonCode - The reasonCode received from the backend for the just processed transaction.
      • Result

        public Result(Payment payment,
                      FinancialTransaction transaction,
                      int status,
                      java.lang.String reasonCode)
        This method creates a new Results object with a Payment, a FinancialTransaction, the status and the reason code
        Parameters:
        payment - the Payment need to be put into the result
        transaction - the FinancialTransaction need to be put into the result
        status - the status of the result
        reasonCode - The reasonCode received from the backend for the just processed transaction
      • Result

        public Result(Credit credit,
                      int status,
                      java.lang.String reasonCode)

        This method creates a new Results object with a Credit, the status and the reason code.

        Parameters:
        credit - The Credit need to be put into the result.
        status - The status of the result.
        reasonCode - The reasonCode received from the backend for the just processed transaction.
      • Result

        public Result(Credit credit,
                      FinancialTransaction transaction,
                      int status,
                      java.lang.String reasonCode)

        This method creates a new Results object with a Credit, a FinancialTransaction, the status and the reason code

        Parameters:
        credit - The Credit need to be put into the result
        transaction - the FinancialTransaction need to be put into the result
        status - The status of the result
        reasonCode - The reasonCode received from the backend for the just processed transaction
    • Method Detail

      • getCredit

        public Credit getCredit()
        This method gets the credit value object contained by this Result.
        Returns:
        The credit to get.
      • getPayment

        public Payment getPayment()
        This method gets the payment value object contained by this Result.
        Returns:
        The payment.
      • getPaymentInstruction

        public PaymentInstruction getPaymentInstruction()
        This method gets the PaymentInstruction value object contained by this Result.
        Returns:
        The payment instruction.
      • setPaymentRequiresAttention

        public void setPaymentRequiresAttention(boolean paymentRequiresAttention)
        This method marks if the payment requires attention though it is successful.
        Parameters:
        paymentRequiresAttention - The flag to indicate if the payment requires attention.
      • isPaymentRequiresAttention

        public boolean isPaymentRequiresAttention()
        This method checks if the Payment requires attention though it is successful.
        Returns:
        If the Payment requires attention though it is successful.
      • setPluginException

        public void setPluginException(PluginException exception)
        This method sets the plugin exception.
        Parameters:
        exception - The plugin exception.
      • getPluginException

        public PluginException getPluginException()
        This method gets the plugin exception.
        Returns:
        The plugin exception.
      • getReasonCode

        public java.lang.String getReasonCode()
        This method gets the backend return code.
        Returns:
        The reason code.
      • setReasonMessage

        public void setReasonMessage(java.lang.String reasonMessage)
        This method sets the detail reason message related to the reason code.
        Parameters:
        reasonMessage - The detail message to be set.
      • getReasonMessage

        public java.lang.String getReasonMessage()
        This method gets the reason message related the reason code.
        Returns:
        The reason message.
      • setRecoverable

        public void setRecoverable(boolean paraIsRecoverable)
        This method gets marks if the related PaymentInstruction is recoverable.
        Parameters:
        paraIsRecoverable - The flag to indicate if the related PaymentInstruction is recoverable.
      • isRecoverable

        public boolean isRecoverable()
        This method gets checks if the related PaymentInstruction is recoverable.
        Returns:
        If the related PaymentInstruction is recoverable.
      • getStatus

        public int getStatus()
        This method returns the status of the Result.
        Returns:
        The status of the Result.
      • getStatusAsString

        public java.lang.String getStatusAsString()
        This method gets the non-localized human-readable status.
        Returns:
        A non-localized human-readable status.
      • toString

        public java.lang.String toString()

        This method gets a readable form of the Result object.

        Warning: not localized, for debugging purposes only!
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string format of the Result object.
      • getFianancialTransaction

        public FinancialTransaction getFianancialTransaction()
        This method returns the FinancialTransaction object of this result.
        Returns:
        the FinancialTransaction object of this result
      • setFianancialTransaction

        public void setFianancialTransaction(FinancialTransaction transaction)
        This method sets the FinancialTransaction object of this result.
        Parameters:
        transaction - the FinancialTransaction object of this result