com.ibm.commerce.payment.commands

Class DoPaymentMPFCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, DoInventory, DoPaymentCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable

    Deprecated. 

    public class DoPaymentMPFCmdImpl
    extends TaskCommandImpl
    implements DoPaymentCmd, DoInventory
    Default DoPayment task command implementation.

    Parameters:

    Parameter Name Type Descriptions
    orderId Long The ID of the Order
    totalAmount BigDecimal The Total Amount to be authorized
    policyId Long The ID of the Payment Policy to use for the Purchase.
    tcId Long The ID of the Payment Term and Condition to use for the Purchase.
    paymentMethodId Integer Deprecated.The ID of the Cashier Profile to use, only for backward compatibility, This attribute will have no effect
    paymentAttributes TypedProperty The payment attributes (eor example,.g. all the name-value pairs from the OrderProcess command)

    Note: If any of the Trading Agreement used by Order Items of the Order has Payment Terms and Conditions, then tcId is mandatory. If tcId is specified, policyId is ignored. The UsablePaymentTCListDataBean may be used to return a list of PaymentTCInfo beans representing common Payment Terms and Conditions specified by Trading Agreements used. If the none of the Trading Agreement has Payment Terms and Conditions, the DataBean returns PaymentTCInfo beans with the tcId attributes set to the empty string. In that case, the PaymentTCInfo beans represent Payment Policies supported by the Store.

    Behavior:

    • First check if the ORDPAYMTHD for this order exist. If already exists, (processing back order) calls CheckPaymentAccept instead and skip the rest
      • If CheckPaymentAcceptCmd return YES, return orderState "C"
      • If CheckPaymentAcceptCmd return NO, return orderState "X"
      • If CheckPaymentAcceptCmd return WORKING, return orderState "M"
    • Checks if all the OrderItems of the Order have the same Trading Agreement. If the OrderItems have different Trading Agreements make sure all Trading Agreements have the same Account_id or the Account_id is null. This allows for mixing orderItems purchased under the store default contract (which has no account) with regular contracts with account.
    • In the process of doing this check, the command builds a vector containing references to all the OrderItemAccessBeans of the Order.
    • If the Account_id is not null, make sure the Account is still active.
    • Additionally, if any Purchase Order TC is specified in the Trading Agreement, the user must supply a PO Number with the purchase.
    • The command then calls the following Task Commands (specifying "DoPaymentErrorView" as the errorViewName for the commands):
      • Calls the AuthorizeAccountPayment Task command to see if the Account will accept the charges.
      • Calls the CheckTASpendingLimit Task command to see if Spending Amount exceeds Limit specified in the Trading Agreement. (Calls this Task Command regardless of the presence of RightToBuyTC by Amount in the Trading Agreement.)
      • Calls the ValidatePONumber Task command to validate the PO Number if buyerPONumber is specified as one of the paymentAttributes and the common Account ID (of the all the Trading Agreements) is not null.
      • Calls the CheckPOSpendingLimit Task command to see if the SpendingLimit specified in Limited PO will be exceeded (if a Limited PO is specified for the purchase).
      • Calls the DoPaymentPolicy command for the Payment Policy specified for the Purchase.
    • Sets the orderState, contentType and returnData attributes of the command with the respective attributes returned by the DoPayment Policy command.

    Returned Parameters:

    • String orderState,
    • byte[] returnData,
    • String contentType

    Error View Name:

    • DoPaymentErrorView

    ErrorCodes:

    • (Include error codes from the other subordinate commands)

    This command uses the following AccessBeans:

    This command calls the following TaskCommands:

    This command calls the following BusinessPolicyCommands:

    See Also:
    UsablePaymentTCListDataBean, Serialized Form
    • Field Detail

      • PRC_VALUE_ERROR

        public static final int PRC_VALUE_ERROR
        Deprecated. 
        The WebSphere Commerce Payments primary return code for a duplicate object error.
        See Also:
        Constant Field Values
      • PRC_DUPLICATE_OBJECT

        public static final int PRC_DUPLICATE_OBJECT
        Deprecated. 
        The WebSphere Commerce Payments primary return code for a duplicate object error.
        See Also:
        Constant Field Values
      • SRC_INITIALIZATION_MESSAGE

        public static final int SRC_INITIALIZATION_MESSAGE
        Deprecated. 
        The WebSphere Commerce Payments secondary return code indicating an initialization message is included in the response.
        See Also:
        Constant Field Values
      • SRC_ORDER

        public static final int SRC_ORDER
        Deprecated. 
        The WebSphere Commerce Payments secondary return code indicating the respnse refers to an order entity.
        See Also:
        Constant Field Values
      • SRC_CONNECTION_TO_PM_FAILED

        public static final int SRC_CONNECTION_TO_PM_FAILED
        Deprecated. 
        The WebSphere Commerce Payments secondary return code indicating that there was a communication failure.
        See Also:
        Constant Field Values
      • SRC_USER_NOT_AUTHORIZED

        public static final int SRC_USER_NOT_AUTHORIZED
        Deprecated. 
        The WebSphere Commerce Payments secondary return code indicating that the user is not authorized to perform the requested operation.
        See Also:
        Constant Field Values
      • SRC_AMOUNT

        public static final int SRC_AMOUNT
        Deprecated. 
        The WebSphere Commerce Payments secondary return code indicating that the error is referring to the amount field.
        See Also:
        Constant Field Values
      • PAYMTHD_SET

        public static final java.lang.String PAYMTHD_SET
        Deprecated. 
        Constant value once used by the predecessor product of WebSphere Commerce to populate the ORDPAYMTHD.PAYMETHOD field to indicate that the payment for the order was processed by the payment cassette for SET.
        See Also:
        Constant Field Values
      • PAYMTHD_PSRVR

        public static final java.lang.String PAYMTHD_PSRVR
        Deprecated. 
        Constant value used to populate the ORDPAYMTHD.PAYMETHOD field to indicate that the order has been submitted to WebSphere Commerce Payments for processing.
        See Also:
        Constant Field Values
      • BILLTO_FIRSTNAME

        public static final java.lang.String BILLTO_FIRSTNAME
        Deprecated. 
        Environment variable name for the first name of the recipient in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_MIDDLENAME

        public static final java.lang.String BILLTO_MIDDLENAME
        Deprecated. 
        Environment variable name for the middle name of the recipient in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_LASTNAME

        public static final java.lang.String BILLTO_LASTNAME
        Deprecated. 
        Environment variable name for the last name of the recipient in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_ADDRESS1

        public static final java.lang.String BILLTO_ADDRESS1
        Deprecated. 
        Environment variable name for the address line 1 field of the billto address.
        See Also:
        Constant Field Values
      • BILLTO_CITY

        public static final java.lang.String BILLTO_CITY
        Deprecated. 
        Environment variable name for the city field in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_STATE

        public static final java.lang.String BILLTO_STATE
        Deprecated. 
        Environment variable name for the state or province field in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_ZIPCODE

        public static final java.lang.String BILLTO_ZIPCODE
        Deprecated. 
        Environment variable name for the zip code or postal code field in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_COUNTRY

        public static final java.lang.String BILLTO_COUNTRY
        Deprecated. 
        Environment variable name for the country field in the billto address.
        See Also:
        Constant Field Values
      • BILLTO_COUNTRY_CODE

        public static final java.lang.String BILLTO_COUNTRY_CODE
        Deprecated. 
        Environment variable name for the country code field in the billto address. The country code is the ISO-3166 numeric country code.
        See Also:
        Constant Field Values
      • BILLTO_ADDRESS2

        public static final java.lang.String BILLTO_ADDRESS2
        Deprecated. 
        Environment variable name for the address line 2 field of the billto address.
        See Also:
        Constant Field Values
      • BILLTO_PHONE_NUMBER

        public static final java.lang.String BILLTO_PHONE_NUMBER
        Deprecated. 
        Environment variable name for the phone number field of the billto address.
        See Also:
        Constant Field Values
      • BILLTO_EMAIL_ADDR1

        public static final java.lang.String BILLTO_EMAIL_ADDR1
        Deprecated. 
        Environment variable name for the email address 1 field of the billto address.
        See Also:
        Constant Field Values
      • LANGUAGE_ENCODING

        public static final java.lang.String LANGUAGE_ENCODING
        Deprecated. 
        Environment variable name for the language encoding parameter.
        See Also:
        Constant Field Values
      • CURRENCY_FACTOR

        public static final java.lang.String CURRENCY_FACTOR
        Deprecated. 
        Environment variable name for the currency factor parameter.
        See Also:
        Constant Field Values
      • TOTAL_TAX_AMOUNT

        public static final java.lang.String TOTAL_TAX_AMOUNT
        Deprecated. 
        Environment variable name for the total tax amount parameter.
        See Also:
        Constant Field Values
      • TOTAL_SHIPPING_AMOUNT

        public static final java.lang.String TOTAL_SHIPPING_AMOUNT
        Deprecated. 
        Environment variable name for the total shipping amount parameter.
        See Also:
        Constant Field Values
      • CARD_NUMBER

        public static final java.lang.String CARD_NUMBER
        Deprecated. 
        Environment variable name for the card number parameter.
        See Also:
        Constant Field Values
      • CARD_EXPIRY

        public static final java.lang.String CARD_EXPIRY
        Deprecated. 
        Environment variable name for the card expiry date parameter.
        See Also:
        Constant Field Values
      • APPROVAL_AMOUNT

        public static final java.lang.String APPROVAL_AMOUNT
        Deprecated. 
        Environment variable name for the approval amount parameter.
        See Also:
        Constant Field Values
      • CURRENCY_ALPHA_CODE

        public static final java.lang.String CURRENCY_ALPHA_CODE
        Deprecated. 
        Environment variable name for the alpha currency code.
        See Also:
        Constant Field Values
      • BUYER_LANGUAGE_ID

        public static final java.lang.String BUYER_LANGUAGE_ID
        Deprecated. 
        Environment variable name for the buyer language ID.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DoPaymentMPFCmdImpl

        public DoPaymentMPFCmdImpl()
        Deprecated. 
    • Method Detail

      • getContentType

        public java.lang.String getContentType()
        Deprecated. 
        Returns the Content Type (or MIME type) of the return data, or null if the type is not known.
        Specified by:
        getContentType in interface DoPaymentCmd
        Returns:
        a String containing the name of the MIME type of the return data, or null if the type is not known
      • getOrderState

        public java.lang.String getOrderState()
        Deprecated. 
        Returns the single character String value that this command wants the Calling command to use to set the Status of the order. If the returned String is null, the Calling command will decide the value to use for the Status
        Specified by:
        getOrderState in interface DoPaymentCmd
        Returns:
        the preferred order state
      • getReturnData

        public byte[] getReturnData()
        Deprecated. 
        Returns the byte Array containing Return Data from the payment system.

        This method returns a zero length byte array if there is no return data from the payment system.

        Specified by:
        getReturnData in interface DoPaymentCmd
        Returns:
        the return data from the payment system
      • isReadyToCallExecute

        public boolean isReadyToCallExecute()
        Deprecated. 
        This method is called by the Command Framework to check if all basic mandatory parameters have been set for this command. This is done before the Framework calls the performExecute method of the command.
        Specified by:
        isReadyToCallExecute in interface com.ibm.websphere.command.Command
        Overrides:
        isReadyToCallExecute in class AbstractECTargetableCommand
        Returns:
        true if we can execute the command; false otherwise.
      • reset

        public void reset()
        Deprecated. 
        Resets the instance variables of the command. The reset() method will reset all instance variables. If the command includes any output values that are accessible via getters, then make sure those values are no longer needed before calling this method to reset the instance variables of the command.

        This is useful if the command instance is to be called multiple times with different command parameters.

        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • setOrderId

        public void setOrderId(java.lang.Long orderId)
        Deprecated. 
        Sets the orderId property of the command.
        Specified by:
        setOrderId in interface DoPaymentCmd
        Parameters:
        orderId - the order reference number of the Order for which payment is to be processed.
      • setPaymentAttributes

        public void setPaymentAttributes(TypedProperty paymentAttributes)
        Deprecated. 
        Sets the paymentAttributes property of the command.

        Some of the Payment Attributes that may be passed to the command are:

               Keyword                         Value
             ===========        ====================================
             tcId               ID of the Payment Term and Condition to use
             policyId           ID of the Payayment Policy to use.
             payMethodId        PayMthd_Id of the Cashier Profile to use
             PONumber           The purchase order number
             cardBrand          The credit card brand.
             cardNumber         The credit card number
             cardExpiryMonth    The credit card exipration month
             cardExpiryYear     The credit card exipration year
         

        The first three attributes (tcId, policyId and payMethodId) determines how the payment is to be processed. At least one of the three must be specified and tcId is mandatory if any of the Order items of the Order uses a Trading Agreement that includes Payment Terms and Conditions.

        If tcId is specified, policyId and payMethodId are ignored. If tcId is not specified, either policyId or payMethodId must be specified. If policyId is specified, payMethodId is ignored.

        The payMethodId attribute is for backward compatibility only. This attribute will only have effect if neither the icId and policyId attributes are present.

        The PONumber attribute is required if the Account associated with the trading agreements used for the order includes a Purchase Order Terms and Conditions.

        The cardBrand and cardNumber attributes, if specified, must both be present. Same is true for the cardExpiryMonth and the cardExpiryYear attributes.

        The cardBrand attribute must match the BrandID used to configure the Merchant Account if WebSphere Commerce Payments is used. The BrandID is case-sensitive.

        Note: other payment attributes may be specified dependent on the payment method used to process the payment.

        Specified by:
        setPaymentAttributes in interface DoPaymentCmd
        Parameters:
        paymentAttributes - the TypedProperty object containing all the parameters to be passed to this command.
        See Also:
        DoPaymentMPFCmdImpl
      • setPaymentMethodId

        public void setPaymentMethodId(java.lang.Integer nPayMthdId)
        Deprecated. DoPaymentMPFInternalCmd was removed, and policyId will be used for payment processing. This method will be useless, only for backward compatibility
        Sets the Payment Method Id
        Parameters:
        nPayMthdId - Integer
      • setPolicyId

        public void setPolicyId(java.lang.Long n)
        Deprecated. 
        Sets the policyId property of the command.
        Parameters:
        n - The ID of the Payment Policy to be used to process payment for this Order.
      • setTotalAmount

        public void setTotalAmount(java.math.BigDecimal totalAmount)
        Deprecated. 
        Sets the totalAmount property of the command.
        Specified by:
        setTotalAmount in interface DoPaymentCmd
        Parameters:
        totalAmount - the total price of the Order for which payment is to be processed.