Dependent credit

HCL Commerce 6.0.0.3 introduced payment rules and policies to support dependent credit.

Dependent credits are transactions associated with a PaymentInstruction where deposits have already taken place. For example, after a deposit of $100 U.S. dollars, a credit up to $100.00 would be considered a dependent credit.

To support dependent credit implementations, there is a new implementation class RefundWithDependentSupportPolicyCmdImpl of the RefundByMethodPolicyCmd policy command registered for this policy. This policy command generates the value objects of refund instructions for the current RMA (Return Merchandise Authorization).

There is a new optional attribute in the PaymentMethodConfigurations.xml file for each payment method configuration: dependentCreditRequired. If it is not configured in this XML file, the default value of dependentCreditRequired is false. When dependentCreditRequired is set to true, credit transactions against this payment method are required to be dependent credits. When dependentCreditRequired is set to false, credit transactions against this payment method are not required to be dependent credits. That is, independent credit is supported by this payment method.

Primarily, this implementation class performs the following actions:
  1. Applies the refund amount specified in the current RMA to those payment methods for which RefundAllowed=true.
    1. For those payment methods where dependentCreditRequired=true, a dependent refund instruction is created. For each dependent refund instruction value object, a new attribute linkedPaymentInstruction is introduced which associates the refund instruction with the original payment instruction.
    2. For those payment methods where dependentCreditRequired=false, or is not configured, an independent refund instruction is created.
    If the refund amount cannot be totally applied to those qualified payment methods, an exception is thrown to report this error situation.