com.ibm.commerce.payment.actions.commands

Class EditPaymentInstructionCompatiblePolicyCmdImpl

  • All Implemented Interfaces:
    BusinessPolicyCommand, com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, EditPaymentInstructionPolicyCmd, 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


    public class EditPaymentInstructionCompatiblePolicyCmdImpl
    extends BusinessPolicyCommandImpl
    implements EditPaymentInstructionPolicyCmd
    The EditPaymentInstructionPolicyCmd implementation class for existing policy commands in classical payments. The existing payment policy commands are not allowed to use together with payment plug-in controller or other payment processing system for the same order. The reason is that these payment policies commands are always designed with the assumption that only one payment instruction is allowed for one order. And every payment actions are executed against the order total amount.

    This command edit payment instruction stored in the table ORDPAYINFO and ORDPAYMTHD. When payment rules component edits the payment instruction in payment rules related tables. It then calls this command to edit the payment instruction in the two tables above.

    This class is used with Classical Payments.

    See Also:
    Serialized Form
    • Constructor Detail

      • EditPaymentInstructionCompatiblePolicyCmdImpl

        public EditPaymentInstructionCompatiblePolicyCmdImpl()
    • Method Detail

      • getPaymentActionData

        public PaymentActionData getPaymentActionData()
        This method gets the payment action data that contains the necessary information for the payment instruction edit action. The payment action data is determined by payment rules component.
        Returns:
        payActionData The payment action data to be used in the edit payment action.
      • getActionResults

        public ActionResults getActionResults()
        This method gets the action results after the corresponding edit action is executed.
        Specified by:
        getActionResults in interface EditPaymentInstructionPolicyCmd
        Returns:
        policyActionResults The action results after the edit action is executed.
      • performExecute

        public void performExecute()
                            throws ECException
        This method performs the actions edit payment instruction through calling the commands that edit the records in ORDPAYINFO and ORDPAYMETHOD by per action data type.

        This method is called by the commands of payment rules component. It's called when they decide to execute the actions edit the payment instructions in the table ORDPAYINFO and ORDPAYMETHOD.

        There is the payment action data contains the necessary information for the payment instruction edit action that is passed to this command. Then this command execute the create/update/cancel operation according to the action name in the payment action data.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException - If something goes wrong
      • isCardExpiryDateValid

        public static boolean isCardExpiryDateValid(int expiryMonth,
                                                    int expiryYear)
        This method checks if the specified expiry date (expiryMonth and expiryYear) is valid.
        Parameters:
        expiryMonth - The calender month of the expiry date (1 for January, 2 for February, and so on.)
        expiryYear - The calender year of the expiry date
        Returns:
        true If the expiry date is valid.
      • setPaymentActionData

        public void setPaymentActionData(PaymentActionData data)
        This method sets the payment action data that contains the necessary information for the payment instruction edit action. The payment action data is determined by payment rules component.
        Specified by:
        setPaymentActionData in interface EditPaymentInstructionPolicyCmd
        Parameters:
        data - The payment action data to be used in the edit payment action.
      • getOrderChannel

        public java.lang.String getOrderChannel()
        This method gets the current order channel.
        Returns:
        orderChannel The current order channel.
      • getPaymentGroupId

        public java.lang.String getPaymentGroupId()
        This method gets the current payment group id.
        Returns:
        paymentGroupId The current payment group id.
      • setLocale

        public void setLocale(java.util.Locale localLocale)
        This method sets the current locale.
        Specified by:
        setLocale in interface EditPaymentInstructionPolicyCmd
        Parameters:
        localLocale - The current locale.
      • setOrderChannel

        public void setOrderChannel(java.lang.String string)
        This method sets the current order channel.
        Specified by:
        setOrderChannel in interface EditPaymentInstructionPolicyCmd
        Parameters:
        string - The current order channel.
      • setPaymentGroupId

        public void setPaymentGroupId(java.lang.String string)
        This method sets the current payment group id.
        Specified by:
        setPaymentGroupId in interface EditPaymentInstructionPolicyCmd
        Parameters:
        string - The current payment group id.
      • setStoreId

        public void setStoreId(java.lang.Integer integer)
        This method sets the current store id.
        Specified by:
        setStoreId in interface EditPaymentInstructionPolicyCmd
        Parameters:
        integer - The current store id.
      • removeSpaceAndHyphenFromString

        public static java.lang.String removeSpaceAndHyphenFromString(java.lang.String aCardNumber)
        This method returns a new string that is free of any spaces and hyphenated characters. If the supplied string is already free of spaces and hyphens the same string may be returned.
        Parameters:
        aCardNumber - The card number to be examined and stripped
        Returns:
        String A string free of spaces and hyphenated characters ('-')
      • reset

        public void reset()
        Description copied from class: AbstractECTargetableCommand
        This method is called after a command has been executed. It is used to reset its states variables. After the call to reset, the command should be able to be executed again.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
        See Also:
        Command.reset()