com.ibm.commerce.payments.plugincontroller

Class Credit

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


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

    This class is the value object in Payment Plugin Controller interface which PDP can gets and sets Credit related information. This object means to be used by subsequent operations: credit/reverseCredit

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
      static short STATE_CANCELED
      State for credit when it has been cancelled/reversed.
      static short STATE_CREDITED
      State for credit when the credit request is successful.
      static short STATE_CREDITING
      State for credit when the credit request is pending.
      static short STATE_FAILED
      State for credit when operation failed.
      static short STATE_NEW
      State for credit when it has been created but not be operated.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Credit(Credit credit)
      This method constructs from an existing credit.
      Credit(java.lang.String id, PaymentInstruction paymentInstruction, java.math.BigDecimal expectedAmount)
      This method constructs a credit associated to a PaymentInstructions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.math.BigDecimal getCreditedAmount()
      This method returns the credited amount of this credit.
      java.math.BigDecimal getCreditingAmount()
      This method returns the crediting amount of this credit.
      java.math.BigDecimal getExpectedAmount()
      This method returns the expected amount of this credit, which is the maximum amount that will be credited under this object.
      java.lang.String getId()
      This method returns the unique identification of this credit.
      PaymentInstruction getPaymentInstruction()
      This method gets the paymentInstruction.
      java.math.BigDecimal getReversingCreditedAmount()
      This method returns the reversing credited amount of this credit.
      short getState()
      This method returns the current status of this credit object.
      long getTimeCreated()
      This method returns the create time of this credit.
      long getTimeUpdated()
      This method returns the update time of this credit.
      boolean isCreditRequiresAttention()
      This method checks if this credit requires attention though it is successful.
      void setCreditedAmount(java.math.BigDecimal creditedAmount)
      This method sets the credited amount of this credit.
      void setCreditingAmount(java.math.BigDecimal creditingAmount)
      This method sets the crediting amount of this credit.
      void setCreditRequiresAttention(boolean creditRequiresAttention)
      This method sets if this credit requires attention though it is successful.
      void setExpectedAmount(java.math.BigDecimal expectedAmount)
      This method sets the expected amount of this credit, which is the maximum amount that will be credited under this object.
      void setPaymentInstruction(PaymentInstruction paymentInstruction)
      This method sets the paymentInstruction.
      void setReversingCreditedAmount(java.math.BigDecimal reversingCreditedAmount)
      This method sets the reversing credited amount of this credit.
      void setState(short state)
      This method sets the status of this credit object.
      void setTimeCreated(long timeCreated)
      This method sets the create time of this credit.
      void setTimeUpdated(long timeUpdated)
      This method sets the update time of this credit.
      java.lang.String toString()
      This method returns a readable form of the Credit object.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

        public static final short STATE_NEW
        State for credit when it has been created but not be operated.
        See Also:
        Constant Field Values
      • STATE_CREDITING

        public static final short STATE_CREDITING
        State for credit when the credit request is pending.
        See Also:
        Constant Field Values
      • STATE_CREDITED

        public static final short STATE_CREDITED
        State for credit when the credit request is successful.
        See Also:
        Constant Field Values
      • STATE_FAILED

        public static final short STATE_FAILED
        State for credit when operation failed.
        See Also:
        Constant Field Values
      • STATE_CANCELED

        public static final short STATE_CANCELED
        State for credit when it has been cancelled/reversed.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Credit

        public Credit(java.lang.String id,
                      PaymentInstruction paymentInstruction,
                      java.math.BigDecimal expectedAmount)

        This method constructs a credit associated to a PaymentInstructions.

        Parameters:
        id - A String that specifies the uniquely identification of the credit.
        paymentInstruction - The specified paymentInstruction which the credit is associated with.
        expectedAmount - A BigDecimal that specifies the maximum amount that will be credited under this object.
      • Credit

        public Credit(Credit credit)

        This method constructs from an existing credit.

        Parameters:
        credit - A Credit that contains all the information associated to a credit.
    • Method Detail

      • setCreditRequiresAttention

        public void setCreditRequiresAttention(boolean creditRequiresAttention)

        This method sets if this credit requires attention though it is successful.

        Parameters:
        creditRequiresAttention - A boolean indicating if the credit requires attention.
      • isCreditRequiresAttention

        public boolean isCreditRequiresAttention()

        This method checks if this credit requires attention though it is successful.

        Returns:
        A boolean indicating if this credit requires attention though it is successful.
      • setCreditedAmount

        public void setCreditedAmount(java.math.BigDecimal creditedAmount)

        This method sets the credited amount of this credit.

        Parameters:
        creditedAmount - A BigDecimal that specifies the credited amount of this credit.
      • getCreditedAmount

        public java.math.BigDecimal getCreditedAmount()

        This method returns the credited amount of this credit.

        Returns:
        A BigDecimal that specifies the credited amount of this credit.
      • setCreditingAmount

        public void setCreditingAmount(java.math.BigDecimal creditingAmount)

        This method sets the crediting amount of this credit.

        Parameters:
        creditingAmount - A BigDecimal that specifies the crediting amount of this credit.
      • getCreditingAmount

        public java.math.BigDecimal getCreditingAmount()

        This method returns the crediting amount of this credit.

        Returns:
        A BigDecimal that specifies the crediting amount of this credit.
      • setExpectedAmount

        public void setExpectedAmount(java.math.BigDecimal expectedAmount)

        This method sets the expected amount of this credit, which is the maximum amount that will be credited under this object.

        Parameters:
        expectedAmount - A BigDecimal that specifies the expected amount of this credit.
      • getExpectedAmount

        public java.math.BigDecimal getExpectedAmount()

        This method returns the expected amount of this credit, which is the maximum amount that will be credited under this object.

        Returns:
        A BigDecimal that specifies the expected amount of this credit.
      • getId

        public java.lang.String getId()

        This method returns the unique identification of this credit.

        Returns:
        A String that specifies the unique identification of this credit.
      • setPaymentInstruction

        public void setPaymentInstruction(PaymentInstruction paymentInstruction)

        This method sets the paymentInstruction.

        Parameters:
        paymentInstruction - The PaymentInstruction which this credit is associated with.
      • getPaymentInstruction

        public PaymentInstruction getPaymentInstruction()

        This method gets the paymentInstruction.

        Returns:
        The PaymentInstruction which this credit is associated with.
      • setReversingCreditedAmount

        public void setReversingCreditedAmount(java.math.BigDecimal reversingCreditedAmount)

        This method sets the reversing credited amount of this credit.

        Parameters:
        reversingCreditedAmount - A BigDecimal that specifies the reversing credited amount of this credit.
      • getReversingCreditedAmount

        public java.math.BigDecimal getReversingCreditedAmount()

        This method returns the reversing credited amount of this credit.

        Returns:
        A BigDecimal that specifies the reversing credited amount of this credit.
      • setState

        public void setState(short state)

        This method sets the status of this credit object.

        Parameters:
        state - A short that indicates the current status.
      • getState

        public short getState()

        This method returns the current status of this credit object.

        Returns:
        A short that indicates the current status.
      • setTimeCreated

        public void setTimeCreated(long timeCreated)

        This method sets the create time of this credit.

        Parameters:
        timeCreated - The long value of the time when this credit was created.
      • getTimeCreated

        public long getTimeCreated()

        This method returns the create time of this credit.

        Returns:
        A long that specifies the create time of this credit.
      • setTimeUpdated

        public void setTimeUpdated(long timeUpdated)

        This method sets the update time of this credit.

        Parameters:
        timeUpdated - The long value of the time when this credit was created.
      • getTimeUpdated

        public long getTimeUpdated()

        This method returns the update time of this credit.

        Returns:
        A long that specifies the update time of this credit.
      • toString

        public java.lang.String toString()

        This method returns a readable form of the Credit object.

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