> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slm.m1amdocs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Retry Rerouting

The **RetryNewProcessor** decision rules enables to modify the payment provider used for specific retry attempts. It can benefit capture success rates by allowing to retry the failed Transaction with a different payment provider, where chances for capture may be improved due to higher success rates for retries. These may not be the providers that merchants want to use for the bulk of their billing attempts due to fees and other reasons.

The **RetryNewProcessor** decision rule works alongside the merchant's defined routing rules and requires the relevant payment providers be defined by name\_value\_processor (22) method definition. See the [Before You Begin](#section_sp5_y1n_b1c) section for more details.

**Note:** The feature is only relevant when we have the full PAN or detokenized with the original payment provider.

## Before You Begin

Define the relevant payment provider Routing Rules as follows:

1. In Portal 1.0 Admin menu , select Merchant configuration.
2. Edit the merchant's configuration.
3. In Routing Rules section, add the relevant Providers and set the ordinals where higher ordinals will be selected first.
4. For Rule method, select **name\_value\_processor (22)** method.
5. For the value field, enter the identical spelling of the payment provider as the value.

<img src="https://mintcdn.com/amdocs-slm/ifa3y22T11JlqvtT/portal/vindiciaSubscribeAndNewRetain/subscribePaymentProviderIntegration/images/routingRulesForDecisionRouting.png?fit=max&auto=format&n=ifa3y22T11JlqvtT&q=85&s=14691bc6f0b980abbf4f0bab185fd834" alt="" width="1734" height="344" data-path="portal/vindiciaSubscribeAndNewRetain/subscribePaymentProviderIntegration/images/routingRulesForDecisionRouting.png" />

## Setting and Understanding the RetryNewProcessor Decision Rule

To understand decision rules, first read, [Configuration Method - Decision Rules](decisionRulesAbout).

The RetryNewProcessor decision rule will allow you to define routing to specific payment providers of specific retry attempts. The decision rule adds a Name-Value Pair to the retry Transaction, identifying the payment provider, the routing rule then receives the defined value (for the name\_value\_processor method) and routes the retry attempt accordingly. Division Numbers are also changed by the decision rule so that the payment provider can identify the merchant of the Transaction.

**Note:** Defining this rule will mean that a different payment provider will be used to attempt to capture. This may incur additional fees than the original provider but may be advised in order to retain the Transaction and customer.

Defining the rule uses the following elements:

* \*\*"@"\*\*uses **Transaction**
* "\_" data:
  * **transaction\_index** is the **TransactionBilling.soft\_error\_count**. The soft error count is used for the Transaction - this serves as a counter for retry attempts. You can define which attempt to route to a specific provider using this index.
  * **prior\_routing** is the original payment provider **name** to which the Transaction was routed prior to the NVPs added by the decision rule.
* **Note:** TransactionBilling::generate\_transaction sets a **NVP** for the selected payment\_provider on the **Tx** which is then used by the name\_value\_processor method routing rules to redirect the transaction retry.

| Example of rule | Description | | |
| - | - | - | - |
| IF \_.prior\_routing = 'CyberSource' THEN pp = (\&#123;'value' => 'CyberSource'\&#125;) STOP THEN pp = (\&#123;'1' => \&#123;'value' => 'Compass'\&#125;, '2' => \&#123;'value' => 'CyberSource'\&#125;\&#125;\&#123;\_.soft\_error\_count\&#125; \\ | \\ | null) STOP THEN pp = null STOP | The routing before using the decision rule was routed to Cybersource. With the rule, the first retry will be routed to Compass, the 2nd will be routed to Cybersource.**Note:** Cybersource is set as the final retry so that other defined providers are used. If it will be set first then the decision will stop. |
| IF \_.prior\_routing = 'CyberSource' THEN pp = (\&#123;'value' => 'CyberSource'\&#125;) STOP THEN pp = (\&#123;'1' => \&#123;'value' => 'Adyen'\&#125;, '2' => \&#123;'value' => 'Compass'\&#125;,'3' => \&#123;'value' => 'CyberSource'\&#125;\&#125;\&#123;\_.soft\_error\_count\&#125; \\ | \\ | null) STOP THEN pp = null STOP | The routing before using the decision rule was routed to Cybersource. With the rule, the first retry will be routed to Adyene, the 2nd will be rerouted to Compass, the 3rd will be rerouted back to Cybersource.**Note:** Cybersource is set as the final retry so that other defined providers are used. If it will be set first then the decision will stop. **Tip:** Remember that all these payment providers must be defined as name\_value\_processor method in routing rules. The decision rule adds the NVP to the transaction, and routing will performed accordingly |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.