Skip to main content

Autolaunched Flow

The essence of Smart Payment Routing is the logic that defines which gateway to use for each operation in Chargent according to the information in that operation. This logic is contained within the Autolaunched Flow that you as admin will create and configure based on the flow template that will be provided in the Chargent Package. Find this flow template by the Smart Payment routing Flow Template name in Setup > Flows.

spr flow template

The flow includes input variables such as "billingState", "amount", "cardType", among others, to facilitate the configuration of conditions and decisions for gateway selection. Additionally, it incorporates the constants 'gateway1Id' and 'gateway2Id', which should be customized with the IDs of the gateways you wish to use in the flow logic.

Below are the recommendations for proper usage and configuration of the Smart Payment Routing Flow.


  1. Modify the 'gateway1Id' and 'gateway2Id' constants

    • Modify the gatewayId1 and gatewayId2 with the gateways' id you wish to have as options to choose from within the Smart Payment Routing logic
  2. Save the Flow as a New Flow

    • When saving the flow, uncheck the "Template" option in to ensure you are saving it as a custom flow and not as a template.
    • Activete the flow, otherwise you will not be able to use it.
  3. Pay attention to the input and output variables

    • Do not modify or delete the input and output variables defined that already come in the flow, as they are referenced in Apex code.
    • Work exclusively with the 'gateway1Id' and 'gateway2Id' (and 'gateway3Id' if needed) constants to customize the flow logic as per your requirements.

You can create more than one autolaunched flow by cloning the template provided in the package. Only one flow may be assigned to Smart Payment Routing in the Payment Routing Wizard.