com.ibm.commerce.payment.beans

Class PaymentTCInfo

  • All Implemented Interfaces:
    java.lang.Cloneable


    public class PaymentTCInfo
    extends PaymentPolicyInfo
    The class PaymentTCInfo is a data holder. It is used by the UsablePaymentTCListDataBean to hold information about the PaymentTC and the Payment Policy specified by the PaymentTC.
    • Constructor Detail

      • PaymentTCInfo

        public PaymentTCInfo(PaymentPolicyInfo policyInfo)
        PaymentTCInfo constructor from a PaymentPolicyInfo object.
        Parameters:
        policyInfo - the PaymentPolicyInfo object from which the PaymentTCInfo bean is to be created.
        See Also:
        PaymentPolicyInfo
      • PaymentTCInfo

        public PaymentTCInfo(java.lang.String astrTCId,
                             java.lang.String astrTCSubType,
                             java.lang.String astrDisplayName,
                             java.lang.String astrBillToAddrId,
                             BusinessPolicyAccessBean abPolicy,
                             java.lang.String astrPolicyId,
                             java.lang.String astrPolicyName,
                             java.lang.String astrStoreEntityId)
        PaymentTCInfo constructor.
        Parameters:
        astrTCId - the ID of this PaymentTC. May be an empty string.
        astrTCSubType - the PaymentTC subtype. For PaymentTC, the subtype is "PaymentTC".
        astrDisplayName - the display name of this PaymentTC.
        astrBillToAddrId - the ID of the bill to Address. May be an empty string if there is no bill to address specified.
        abPolicy - the BusinessPolicyAccessBean representing the payment business policy that this PaymentTC is based on.
        astrPolicyId - the ID of the payment business policy.
        astrPolicyName - the name of the payment business policy.
        astrStoreEntityId - the Store Entity ID of the payment business policy.
    • Method Detail

      • compatibleWith

        public boolean compatibleWith(java.util.Vector vecPaymentTCInfo)
        Check if this PaymentTCInfo is compatible with at least one of the PaymentTCInfo object in the specified Vector of PaymentTCInfo objects.
        Parameters:
        vecPaymentTCInfo - a Vector of PaymentTCInfo objects
        Returns:
        true if this PaymentTCInfo is compatible with at least one; otherwise, returns false.
      • createPaymentTCInfoFromAB

        public static PaymentTCInfo createPaymentTCInfoFromAB(TermConditionAccessBean abTC)
                                                       throws ECException
        Creates a PaymentTCInfo object from a PaymentTC AccessBean.
        Parameters:
        abTC - the PaymentTCAccessBean from which the PaymentTCInfo bean is to be created.
        Returns:
        the newly created PaymentTCInfo object
        Throws:
        ECException
      • createPaymentTCInfoFromAB

        public static PaymentTCInfo createPaymentTCInfoFromAB(TermConditionAccessBean abTC,
                                                              java.lang.Integer nLangId)
                                                       throws ECException
        Creates a PaymentTCInfo object from a PaymentTC AccessBean and sets all the other fields from the Payment Policy associated with the PaymentTC.
        Parameters:
        abTC - the PaymentTCAccessBean from which the PaymentTCInfo bean is to be created.
        nLangId - the language ID that identifies the language to be used for language-specific fields.
        Returns:
        the newly created PaymentTCInfo object.
        Throws:
        ECException
      • findCommonPaymentTCInfo

        public static java.util.Vector findCommonPaymentTCInfo(java.util.Hashtable hshPaymentTCInfoByTradingId,
                                                               boolean bExcludePoliciesThatRequireExplicitTC)
                                                        throws ECException
        Helper method that returns a Vector of common PaymentTCInfo beans from a Hashtable of Vectors of PaymentTCInfo bean keyed by Trading Agreement ID.

        A Payment Terms and Conditions is common if the same terms and conditions appear in each the Vector of PaymentTCInfo Beans.

        Parameters:
        hshPaymentTCInfoByTradingId - the input Hashtable
        bExcludePoliciesThatRequireExplicitTC - true to exclude payment policies that require explicit payment terms and conditions
        Returns:
        a Vector of common PaymentTCInfo objects representing common Payment Terms and Conditions for all specified Trading Agreements
        Throws:
        ECException.
        ECException
      • getAttributesFromTC

        public static TypedProperty getAttributesFromTC(TermConditionAccessBean abTC)
                                                 throws ECException
        Gets all the Attributes for the specified Payment Terms and Conditions. Assumption: All payment attribute values are Strings.
        Parameters:
        abTC - the TermConditionAccessBean representing the Payment Terms and Conditions
        Returns:
        a TypedProperty object containing the names and values of the attributes.
        Throws:
        ECException.
        ECException
      • getAttrStringFromTC

        public static java.lang.String getAttrStringFromTC(TermConditionAccessBean abTC)
                                                    throws ECException
        Utility method for obtaining the Attributes of the Payment Terms and Conditions in String form (for example, n1=v1&n2=v2&n3=v3......).
        Parameters:
        abTC - the PaymentTCAccessBean representing the Payment Terms and Conditions
        Returns:
        the attributes in String form.
        Throws:
        ECException.
        ECException
      • getAttrStringFromTypedProperty

        public static java.lang.String getAttrStringFromTypedProperty(TypedProperty prop)
        Gets the Payment Attributes in a single String in alphabetical order of the attribute name (for example, n1=v1&n2=v2&n3=v3.....) and separated by '&'.

        Note: Attributes with empty value are dropped.

        Parameters:
        prop - the TypedProperty containing the names and values of the Payment Attributes.
        Returns:
        the Attribute-String
      • getBillToAddressId

        public java.lang.String getBillToAddressId()
        Returns the ID of the billToAddress specified with this PaymentTC. This method returns an empty String if no billTo address is specified.
        Returns:
        the ID of the billTo address in String form or an empty String.
      • getBillToAddrIdFromTC

        public static java.lang.String getBillToAddrIdFromTC(TermConditionAccessBean abTC)
                                                      throws ECException
        Helper methods that returns ID of the billTo address specified with a Payment Terms and Conditions. This method reruns an empty String if no billTo address is specified with the Payment Terms and Conditions.
        Parameters:
        abTC - the PaymentTCAccessBean representing the Payment Terms and Conditions
        Returns:
        the ID of the billTo address in String form or an empty String if no billTo address is specified.
        Throws:
        ECException.
        ECException
      • getBusinessPolicy

        public BusinessPolicyAccessBean getBusinessPolicy()
        Returns the business policy that this Payment Terms and Conditions is based on.
        Returns:
        the BusinessPolicyAccessBean of the business policy
      • getTCAttrString

        public java.lang.String getTCAttrString()
        Returns the Attributes of this PaymentTC in String form with each name-value pair separated by '&'. For example, n1=v1&n2=v2&n3=v3......
        Returns:
        the attributes String
      • getTCDisplayName

        public java.lang.String getTCDisplayName()
        Returns the display name of this PaymentTC.
        Returns:
        the display name
      • getTCId

        public java.lang.String getTCId()
        Returns the internal ID of this PaymentTC in String.
        Returns:
        the PaymentTC ID
      • getTCSubType

        public java.lang.String getTCSubType()
        Returns the TCSubtype of this PaymentTC. For PaymentTC, the subtype is simply "PaymentTC", same as the TCType.
        Returns:
        the TC Subtype ID
      • isSupportedByPaymentPolicy

        public boolean isSupportedByPaymentPolicy(java.util.Vector paymentPolicyInfo)
        Checks if the PaymentTC represented by this PaymentTCInfo bean is supported by the Payment Policies represented by the specified Vector of PaymentPolicyInfo beans.

        Assumption: PaymentPolicyInfo Beans of the Vector are all from the same payment cassette

        Parameters:
        paymentPolicyInfo - a Vector of PaymentPolicyInfo beans representing Payment Policies of the same cassette.
        Returns:
        true if the any of the Payment Policies specify the same brand or offlineMethod. This method also returns true if the Payment Policies in question does not specify brand or offlineMethod.
      • setFieldsFromPolicyAB

        public void setFieldsFromPolicyAB(BusinessPolicyAccessBean abPolicy,
                                          java.lang.Integer nLanguageId)
                                   throws ECException
        Sets the other fields of the bean from the BusinessPolicyAccessBean that represents the Payment Policy object. These fields include the various properties in the Policy Properties field and the descriptions (both long and short) of the Policy in the specified language. If the PaymentTCInfo bean has a non-empty brand property it will be appended to the end of the descriptions and separated by a hyphen character ("-").

        Overrides:
        setFieldsFromPolicyAB in class PaymentPolicyInfo
        Parameters:
        abPolicy - the BusinessPolicyAccessBean representing the Payment Policy object.
        nLanguageId - the language ID that identifies the language to be used for language-specific fields.
        Throws:
        ECException
      • setTCAttrString

        public void setTCAttrString(java.lang.String strAttributes)
        Sets the TC Attribute-String.
        Parameters:
        strAttributes - the TC Attributes in name-value pairs separated by '&'. For example, n1=v1&n2=v2&n3=v3......
      • getAccountNumber

        public java.lang.String getAccountNumber()
        Returns the account number stored in the accountNumber payment attribute
        Returns:
        the account number
      • getCardNumber

        public java.lang.String getCardNumber()
        Returns the card number stored in the cardNumber payment attribute
        Returns:
        the account number
      • getCardExpiryMonth

        public java.lang.String getCardExpiryMonth()
        Returns the card Expiry Month stored in the cardExpiryMonth payment attribute
        Returns:
        the account number
      • getCardExpiryYear

        public java.lang.String getCardExpiryYear()
        Returns the card Expiry Year stored in the cardExpiryYear payment attribute
        Returns:
        the account number
      • getCheckingAccountNumber

        public java.lang.String getCheckingAccountNumber()
        Returns the checking account number stored in the checkingAccountNumber payment attribute
        Returns:
        the checking account number
      • getCheckRoutingNumber

        public java.lang.String getCheckRoutingNumber()
        Returns the check routing number stored in the checkRoutingNumber payment attribute
        Returns:
        the check routing number
      • getPaymentMethodDisplayName

        public java.lang.String getPaymentMethodDisplayName()
        Gets the payment method name that should be displayed
        Returns:
        String
      • toString

        public java.lang.String toString()

        Method toString - creates a String representation of the object.

        Overrides:
        toString in class PaymentPolicyInfo
        Returns:
        the String representation