com.ibm.commerce.payments.plugincontroller

Class Payment

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


    public class Payment
    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: approve/deposit/reverseApprove/reverseDeposit

    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static short AVS_COMPLETE_MATCH
      Address Verification Service Code: Street addresses and postal codes match.
      static short AVS_NO_MATCH
      Address Verification Service Code: Neither street addresses nor postal codes match.
      static short AVS_OTHER_RESPONSE
      Address Verification Service Code: Address Verification Service code cannot be mapped to the standard Address Verification Service codes.
      static short AVS_POSTALCODE_MATCH
      Address Verification Service Code: Postal codes match, but street addresses do not.
      static short AVS_STREET_ADDRES_MATCH
      Address Verification Service Code: Street addresses match, but postal codes do not.
      static short AVS_UNKNOWN
      Address Verification Service Code: Address Verification Service code has not been set yet.
      static java.lang.String COPYRIGHT
      The IBM copyright notice field.
      static short STATE_APPROVED
      State for payment when the approve request is successful.
      static short STATE_APPROVING
      State for payment when the approve request is pending.
      static short STATE_CANCELED
      state for payment when it has been cancelled/reversed.
      static short STATE_EXPIRED
      state for payment when the approval is expired.
      static short STATE_FAILED
      State for payment when operation failed.
      static short STATE_NEW
      State for payment when it has been created but not be operated.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Payment(Payment payment)
      This method constructs a Payment from an existing payment.
      Payment(java.lang.String localId, PaymentInstruction localPaymentInstruction)
      This method constructs a Payment with the unique identification and the associated Payment Instruction.
      Payment(java.lang.String localId, PaymentInstruction localPaymentInstruction, java.math.BigDecimal localExpectedAmount)
      This method constructs a uniquely identified and associated to a Payment Instruction with the requested approve amount.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.math.BigDecimal getApprovedAmount()
      This method returns the approvedAmount.
      java.math.BigDecimal getApprovingAmount()
      This method returns the approving amount.
      java.lang.String[] getAssociatedItems() 
      short getAvsCommonCode()
      This method returns the AVS common code.
      java.math.BigDecimal getCreditedAmount()
      This method returns the creditedAmount.
      java.math.BigDecimal getCreditingAmount()
      This method returns the creditingAmount.
      java.math.BigDecimal getDepositedAmount()
      This method returns the depositedAmount.
      java.math.BigDecimal getDepositingAmount()
      This method returns the depositingAmount.
      java.math.BigDecimal getExpectedAmount()
      This method returns the expected amount in the Payment object.
      java.lang.String getId()
      This method returns the unique identification of this payment object.
      PaymentInstruction getPaymentInstruction()
      This method returns the paymentInstruction.
      java.math.BigDecimal getReversingApprovedAmount()
      This method returns the reversing approved amount.
      java.math.BigDecimal getReversingDepositedAmount()
      This method returns the reversing deposited amount.
      short getState()
      This method returns the current status of the payment object.
      long getTimeCreated()
      This method returns the create time.
      long getTimeExpired()
      This method returns the expire time.
      long getTimeUpdated()
      This method returns the update time.
      boolean isExpired()
      This method checks If the approval of this payment is expired.
      boolean isPaymentRequiresAttention()
      This method checks if the approval of this payment requires attention though it is successful.
      void setApprovedAmount(java.math.BigDecimal localApprovedAmount)
      This method sets the approvedAmount.
      void setApprovingAmount(java.math.BigDecimal localApprovingAmount)
      This method sets the approvingAmount.
      void setAssociatedItems(java.lang.String[] localAssociatedItems)
      This method sets the associated items.
      void setAvsCommonCode(short localAvsCommonCode)
      This method sets the AVS common code.
      void setCreditedAmount(java.math.BigDecimal localCreditedAmount)
      This method sets the creditedAmount.
      void setCreditingAmount(java.math.BigDecimal localCreditingAmount)
      This method sets the creditingAmount.
      void setDepositedAmount(java.math.BigDecimal localDepositedAmount)
      This method sets the depositedAmount.
      void setDepositingAmount(java.math.BigDecimal localDepositingAmount)
      This method sets the depositingAmount.
      void setExpectedAmount(java.math.BigDecimal amount)
      This method sets the expected amount in the Payment object.
      void setExpired(boolean expired)
      This method sets if the approval of this payment is expired.
      void setPaymentInstruction(PaymentInstruction localPaymentInstruction)
      This method sets the paymentInstruction.
      void setPaymentRequiresAttention(boolean localPaymentRequiresAttention)
      This method sets if the approval of this payment requires attention though it is successful.
      void setReversingApprovedAmount(java.math.BigDecimal localReversingApprovedAmount)
      This method sets the reversing approved amount.
      void setReversingDepositedAmount(java.math.BigDecimal localReversingDepositedAmount)
      This method sets the reversing deposited amount.
      void setState(short localState)
      This method returns the current status of the payment object.
      void setTimeCreated(long localTimeCreated)
      This method sets the create time.
      void setTimeExpired(long localTimeExpired)
      This method sets the expire time.
      void setTimeUpdated(long localTimeUpdated)
      This method sets the update time.
      java.lang.String toString()
      This method returns a readable form of the Payment 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 payment when it has been created but not be operated.
        See Also:
        Constant Field Values
      • STATE_APPROVING

        public static final short STATE_APPROVING
        State for payment when the approve request is pending.
        See Also:
        Constant Field Values
      • STATE_APPROVED

        public static final short STATE_APPROVED
        State for payment when the approve request is successful.
        See Also:
        Constant Field Values
      • STATE_EXPIRED

        public static final short STATE_EXPIRED
        state for payment when the approval is expired.
        See Also:
        Constant Field Values
      • STATE_CANCELED

        public static final short STATE_CANCELED
        state for payment when it has been cancelled/reversed.
        See Also:
        Constant Field Values
      • STATE_FAILED

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

        public static final short AVS_UNKNOWN
        Address Verification Service Code: Address Verification Service code has not been set yet.
        See Also:
        Constant Field Values
      • AVS_COMPLETE_MATCH

        public static final short AVS_COMPLETE_MATCH
        Address Verification Service Code: Street addresses and postal codes match.
        See Also:
        Constant Field Values
      • AVS_STREET_ADDRES_MATCH

        public static final short AVS_STREET_ADDRES_MATCH
        Address Verification Service Code: Street addresses match, but postal codes do not.
        See Also:
        Constant Field Values
      • AVS_POSTALCODE_MATCH

        public static final short AVS_POSTALCODE_MATCH
        Address Verification Service Code: Postal codes match, but street addresses do not.
        See Also:
        Constant Field Values
      • AVS_NO_MATCH

        public static final short AVS_NO_MATCH
        Address Verification Service Code: Neither street addresses nor postal codes match.
        See Also:
        Constant Field Values
      • AVS_OTHER_RESPONSE

        public static final short AVS_OTHER_RESPONSE
        Address Verification Service Code: Address Verification Service code cannot be mapped to the standard Address Verification Service codes.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Payment

        public Payment(java.lang.String localId,
                       PaymentInstruction localPaymentInstruction)

        This method constructs a Payment with the unique identification and the associated Payment Instruction.

        Parameters:
        localId - A String that specifies the unique identification of the Payment.
        localPaymentInstruction - A PaymentInstruction that represents the paymentInstructions this Payment is associated to.
      • Payment

        public Payment(java.lang.String localId,
                       PaymentInstruction localPaymentInstruction,
                       java.math.BigDecimal localExpectedAmount)

        This method constructs a uniquely identified and associated to a Payment Instruction with the requested approve amount.

        Parameters:
        localId - A String that specifies the uniquely identifies the Payment.
        localPaymentInstruction - A PaymentInstruction that represents the paymentInstructions this Payment is associated to.
        localExpectedAmount - A BigDecimal that specifies the amount to be processed in the approve operation.
      • Payment

        public Payment(Payment payment)

        This method constructs a Payment from an existing payment.

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

      • setApprovedAmount

        public void setApprovedAmount(java.math.BigDecimal localApprovedAmount)

        This method sets the approvedAmount. This amount is set if the approve transaction is successful.

        Parameters:
        localApprovedAmount - A BigDecimal that specifies the amount approved by the back-end system.
      • getApprovedAmount

        public java.math.BigDecimal getApprovedAmount()

        This method returns the approvedAmount. This amount is set if the approve transaction is successful.

        Returns:
        A BigDecimal that specifies the amount approved by the back-end system.
      • setApprovingAmount

        public void setApprovingAmount(java.math.BigDecimal localApprovingAmount)

        This method sets the approvingAmount. This amount is set if the approve transaction is pending

        Parameters:
        localApprovingAmount - A BigDecimal that specifies the amount being approved by the back-end system.
      • getApprovingAmount

        public java.math.BigDecimal getApprovingAmount()

        This method returns the approving amount. This amount is set when the approve transaction is being processed or pending

        Returns:
        A BigDecimal that specifies the approving amount.
      • setAvsCommonCode

        public void setAvsCommonCode(short localAvsCommonCode)

        This method sets the AVS common code.

        Parameters:
        localAvsCommonCode - A short that specifies the AVS Common Code.
      • getAvsCommonCode

        public short getAvsCommonCode()

        This method returns the AVS common code.

        Returns:
        A short that specifies the AVS Common Code.
      • setDepositedAmount

        public void setDepositedAmount(java.math.BigDecimal localDepositedAmount)

        This method sets the depositedAmount. This amount is set on a successful transaction depositTransaction. If multiple deposits have been done against a Payment this will represent the total amount deposited of all the individual transactions.

        Parameters:
        localDepositedAmount - A BigDecimal that specifies the amount deposited by the backend.
      • getDepositedAmount

        public java.math.BigDecimal getDepositedAmount()

        This method returns the depositedAmount. This amount is set on a successful transaction depositTransaction. If multiple deposits have been done against a Payment this will represent the total amount deposited of all the individual transactions.

        Returns:
        A BigDecimal that specifies the amount deposited by the back-end system.
      • setDepositingAmount

        public void setDepositingAmount(java.math.BigDecimal localDepositingAmount)

        This method sets the depositingAmount. This amount is set on the pending transactions depositTransaction. If multiple pending deposits have been done against a Payment this will represent the total pending amount of all the individual transactions.

        Parameters:
        localDepositingAmount - A BigDecimal that specifies the depositing amount.
      • getDepositingAmount

        public java.math.BigDecimal getDepositingAmount()

        This method returns the depositingAmount. This amount is set on the pending transactions depositTransaction. If multiple pending deposits have been done against a Payment this will represent the total pending amount of all the individual transactions.

        Returns:
        A BigDecimal that specifies the depositing amount.
      • setCreditedAmount

        public void setCreditedAmount(java.math.BigDecimal localCreditedAmount)

        This method sets the creditedAmount. This amount is set on a successful transaction creditedTransaction. If multiple credits have been done against a Payment this will represent the total amount credited of all the individual transactions.

        Parameters:
        localCreditedAmount - A BigDecimal that specifies the amount credited by the backend.
      • getCreditedAmount

        public java.math.BigDecimal getCreditedAmount()

        This method returns the creditedAmount. This amount is set on a successful transaction creditTransaction. If multiple credits have been done against a Payment this will represent the total amount credited of all the individual transactions.

        Returns:
        A BigDecimal that specifies the amount credited by the back-end system.
      • setCreditingAmount

        public void setCreditingAmount(java.math.BigDecimal localCreditingAmount)

        This method sets the creditingAmount. This amount is set on the pending transactions creditTransaction. If multiple pending credits have been done against a Payment this will represent the total pending amount of all the individual transactions.

        Parameters:
        localCreditingAmount - A BigDecimal that specifies the crediting amount.
      • getCreditingAmount

        public java.math.BigDecimal getCreditingAmount()

        This method returns the creditingAmount. This amount is set on the pending transactions creditTransaction. If multiple pending credits have been done against a Payment this will represent the total pending amount of all the individual transactions.

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

        public void setExpectedAmount(java.math.BigDecimal amount)

        This method sets the expected amount in the Payment object.

        Parameters:
        amount - A BigDecimal that specifies the expected amount in the Payment object.
      • getExpectedAmount

        public java.math.BigDecimal getExpectedAmount()

        This method returns the expected amount in the Payment object.

        Returns:
        A BigDecimal that specifies the expected amount in the Payment object.
      • setExpired

        public void setExpired(boolean expired)

        This method sets if the approval of this payment is expired.

        Parameters:
        expired - A boolean that indicates if the payment approval is expired.
      • isExpired

        public boolean isExpired()

        This method checks If the approval of this payment is expired.

        Returns:
        A boolean that indicates if the approval of this payment is expired.
      • getId

        public java.lang.String getId()
        This method returns the unique identification of this payment object.
        Returns:
        A String that specifies the unique identification of this payment object.
      • setPaymentInstruction

        public void setPaymentInstruction(PaymentInstruction localPaymentInstruction)

        This method sets the paymentInstruction.

        Parameters:
        localPaymentInstruction - A PaymentInstruction that represents the payment instruction associated to the payment.
      • getPaymentInstruction

        public PaymentInstruction getPaymentInstruction()

        This method returns the paymentInstruction.

        Returns:
        A PaymentInstruction that represents the payment instruction associated to the payment.
      • setPaymentRequiresAttention

        public void setPaymentRequiresAttention(boolean localPaymentRequiresAttention)

        This method sets if the approval of this payment requires attention though it is successful.

        Parameters:
        localPaymentRequiresAttention - A boolean that indicates if the payment approval requires attention.
      • isPaymentRequiresAttention

        public boolean isPaymentRequiresAttention()

        This method checks if the approval of this payment requires attention though it is successful.

        Returns:
        A boolean that indicates if the approval of this payment requires attention though it is successful.
      • setReversingApprovedAmount

        public void setReversingApprovedAmount(java.math.BigDecimal localReversingApprovedAmount)

        This method sets the reversing approved amount. This amount is set on the pending transaction reverseApprovalTransaction. If multiple pending reverse has been done against a payment, this will represent the total pending amount of all the individual transactions.

        Parameters:
        localReversingApprovedAmount - A BigDecimal that specifies the reversing approved amount.
      • getReversingApprovedAmount

        public java.math.BigDecimal getReversingApprovedAmount()

        This method returns the reversing approved amount. This amount is set on the pending transaction reverseApprovalTransaction. If multiple pending reverse has been done against a payment, this will represent the total pending amount of all the individual transactions.

        Returns:
        A BigDecimal that specifies the reversing approved amount.
      • setReversingDepositedAmount

        public void setReversingDepositedAmount(java.math.BigDecimal localReversingDepositedAmount)

        This method sets the reversing deposited amount. This amount is set on the pending transaction reverseDepositTransaction. If multiple pending reverse has been done against a payment, this will represent the total pending amount of all the individual transactions.

        Parameters:
        localReversingDepositedAmount - A BigDecimal that specifies the reversing deposited amount.
      • getReversingDepositedAmount

        public java.math.BigDecimal getReversingDepositedAmount()

        This method returns the reversing deposited amount. This amount is set on the pending transaction reverseDepositTransaction. If multiple pending reverse has been done against a payment, this will represent the total pending amount of all the individual transactions.

        Returns:
        A BigDecimal that specifies the reversing deposited amount.
      • setState

        public void setState(short localState)

        This method returns the current status of the payment object.

        Parameters:
        localState - A short that indicates the current status of the payment object.
      • getState

        public short getState()

        This method returns the current status of the payment object.

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

        public void setTimeCreated(long localTimeCreated)

        This method sets the create time.

        Parameters:
        localTimeCreated - A long that specifies the create time.
      • getTimeCreated

        public long getTimeCreated()

        This method returns the create time.

        Returns:
        A long that specifies the create time.
      • setTimeExpired

        public void setTimeExpired(long localTimeExpired)

        This method sets the expire time.

        Parameters:
        localTimeExpired - A long that specifies the expire time.
      • getTimeExpired

        public long getTimeExpired()

        This method returns the expire time.

        Returns:
        A long that specifies the expire time.
      • setTimeUpdated

        public void setTimeUpdated(long localTimeUpdated)

        This method sets the update time.

        Parameters:
        localTimeUpdated - A long that specifies the update time.
      • getTimeUpdated

        public long getTimeUpdated()

        This method returns the update time.

        Returns:
        A long that specifies the update time.
      • getAssociatedItems

        public java.lang.String[] getAssociatedItems()
        Returns:
        Returns the associatedItems.
      • setAssociatedItems

        public void setAssociatedItems(java.lang.String[] localAssociatedItems)
        This method sets the associated items.
        Parameters:
        localAssociatedItems - The associatedItems to set.
      • toString

        public java.lang.String toString()

        This method returns a readable form of the Payment object.

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