Payment rules engine

The Payment rules engine determines which action to take based on the payment instruction, payment method and the payment event.

The following example shows the steps completed by the Payment rules engine when a customer pays for an order using a Visa credit card.

  1. Determines the payment action rule.

    The Payment rules engine reads the Payment system mapping (PaymentMappings.xml) file.

    <Mapping paymentMethod="VISA"	 
    paymentActionRule="Early Approval"/>
    The payment method name as defined in the POLICY table.
    The payment method is associated to a payment back-end system as defined in PaymentMethodConfigurations.xml file.
    The payment actions behavior for the payment method as defined in PaymentRules.xml file.
  2. Determines the target state.
    The Payment rules engine reads from the PaymentRules.xml file. This is a read-only file that configures the payment rules for a store or store group. Each entry defines the target state of the relevant payment amount for each payment event in the order.
    <PaymentRule name="Early Approval">
         <PrimePaymentEvent targetState="APPROVED" />
         <ReservePaymentEvent targetState="APPROVED" />
         <FinalizePaymentEvent targetState="DEPOSITED" />
  3. Determines the actions.

    The Payment rules engine reads from the CorePaymentActions.xml file. This read-only file defines how the required target state of the payment is achieved in terms of payment actions defined by the payment back-end system.

              <Action name="Approve" amount="requested" target="new"/>
  4. Creates and raises an event for the actions. In this example, the event will consist of a single action: Approve.