com.ibm.commerce.payment.ppc.commands

Class PPCAdhocCreditCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, PPCAdhocCreditCmd, Protectable, ECConstants, ToolsControllerCommand, ECToolsConstants, 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 PPCAdhocCreditCmdImpl
    extends ToolsControllerCommandImpl
    implements PPCAdhocCreditCmd, ECToolsConstants, ECConstants
    This is the implementation of the PPCAdhocCreditCmd tools controller command which supports the feature by executing refund action without return involved. This command directly calls the APIs of the Payment Plug-in Controller session bean facade to perform the credit transaction. This command supports both independent credit and dependent credit according to the configuration of the corresponding payment method.

    Input Parameters:

  • paymentInstructionId (Optional): The payment instruction ID in the PPCPAYINST table.
  • creditAmount (Required): The amount you would like to credit
  • paymentId (Optional): The payment ID in the PPCPAYMENT table. The credit will be against this payment object.
  • Business Logic:

  • For an independent credit payment method:
    • If you pass the paymentInstructionId parameter, this command does the following tasks:
      1. Retrieves all of the payment protocol data for the payment instruction object with the ID you passed in the request properties.
      2. It calls the API of Payment Plug-in Controller session bean facade to create a refund instruction object.
      3. It calls the API of Payment Plug-in Controller session bean facade to create an independent credit object. This is linked to the refund instruction object just created.
      4. Lastly, it calls the API of the Payment Plug-in Controller session bean to perform a credit transaction against this credit object. In this case, the paymentId parameter is unnecessary.
    • If you just pass the paymentId parameter, without passing the paymentInstructionId parameter, then this command does the following tasks:
      1. It locates the payment instruction object to which this payment object belongs.
      2. It retrieves all of the payment protocol data for the payment instruction object.
      3. It calls the API of Payment Plug-in Controller session bean facade to create an independent credit object. This is linked to the refund instruction object just created.
      4. Lastly, it calls the API of the Payment Plug-in Controller session bean to perform a credit transaction against this credit object.
    • If you are using a dependent credit payment method, pass the paymentInstructionId parameter. Passing only the paymentInstructionId parameter is not recommended.

  • For a dependent credit payment method:
    • If you just pass the paymentId parameter, then this command does the following tasks:
      1. It calls the API of the payment Plug-in Controller session bean facade to create a dependent credit object against the payment identified by the paymentID.
      2. It calls the API of the Payment Plug-in Controller session bean to perform a credit transaction against this credit object. In this case, the paymentInstructionId parameter is unnecessary.
    • If you just pass the paymentInstructionId parameter without passing the paymentId parameter, then this command does the following tasks:
    • It gets the available payment objects of the corresponding payment instruction object.
    • It calls the API of the payment Plug-in Controller session bean facade to create a dependent credit object against the payment.
    • It calls the API of the Payment Plug-in Controller session bean to perform a credit transaction against this credit object.
    • If you are using an independent credit payment method, pass the paymentInstructionId parameter. Passing only the paymentId parameter is not recommended.
See Also:
Serialized Form
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The internal copyright field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PPCAdhocCreditCmdImpl

        public PPCAdhocCreditCmdImpl()
    • Method Detail

      • getPaymentId

        public java.lang.String getPaymentId()
        This method returns the current paymentId. If the credit is independent way, the value is null.
        Returns:
        The current paymentId.
      • setPaymentId

        public void setPaymentId(java.lang.String pId)
        This method sets the current paymentId.
        Specified by:
        setPaymentId in interface PPCAdhocCreditCmd
        Parameters:
        pId - The current paymentId.
      • getPaymentInstructionId

        public java.lang.String getPaymentInstructionId()
        This method returns the current paymentInstructionId. If the credit is dependent way, the value is null.
        Returns:
        The current paymentInstructionId.
      • setPaymentInstructionId

        public void setPaymentInstructionId(java.lang.String piID)
        This method sets the current paymentInstructionId.
        Specified by:
        setPaymentInstructionId in interface PPCAdhocCreditCmd
        Parameters:
        piID - The current paymentInstructionId.
      • getRequestAmount

        public java.math.BigDecimal getRequestAmount()
        This method returns the current request amount.
        Returns:
        The current request amount.
      • setRequestAmount

        public void setRequestAmount(java.math.BigDecimal amount)
        This method sets the current request amount.
        Specified by:
        setRequestAmount in interface PPCAdhocCreditCmd
        Parameters:
        amount - The current request amount.
      • getPaymentInstructionData

        public com.ibm.commerce.edp.model.PaymentInstructionData getPaymentInstructionData()
        This method returns the PaymentInstructionData.
        Returns:
        Returns the paymentInstructionData.
      • setPaymentInstructionData

        public void setPaymentInstructionData(com.ibm.commerce.edp.model.PaymentInstructionData piData)
        This method sets the PaymentInstructionData.
        Parameters:
        piData - the PaymentInstructionData to set.
      • getPaymentConfigGroup

        public java.lang.String getPaymentConfigGroup()
        This method gets the payment configuration group.
        Returns:
        the payment configuration group
      • setPaymentConfigGroup

        public void setPaymentConfigGroup(java.lang.String payConfGroup)
        This method sets the payment configuration group.
        Parameters:
        payConfGroup - the payment configuration group to set