Retries in AutoPay

The AutoPay system has an automatic retry mechanism designed to ensure the continuity of collections in the event of temporary connection failures or unavailability of external services. The workflow includes four key points that utilize this mechanism, which are detailed below.

Generation

In this workflow, the system identifies that a payment needs to be collected and prepares the information to generate it. This is where the balance inquiry is performed with the merchant's external service.

Balance Inquiry

The system determines whether to check the amount to be charged based on the charge type configured in AutoPay (See Charge Types Details).

The charges that require consultation are:

  • Total Balance (TOTAL_BALANCE): The total outstanding balance for the current period is checked with the merchant's service.
  • Minimum Balance (MINIMUM_BALANCE): The minimum balance required to maintain active service is checked, according to the merchant's report.

Retry Frequency

If an error occurs while trying to check the balance or register the payment for the first time, the system will execute up to two additional payment registration attempts, based on the following time intervals:

Retry
Interval (min)
1
5
2
10

Attempt Limit

If the payment cannot be registered after 3 attempts, the system will give up and the AutoPay will be marked as failed (FAILED).

Processing

Once the payment is generated with the corresponding amount, the transaction is processed against the payment method.

Retry Frequency

In the event of actionable rejections or technical communication errors with the gateway, the system will perform up to 2 retries at the following time intervals:

Retry
Interval (min)
1
1
2
3

Amount Consistency

During these new payment attempts, the balance is not checked again. This process is performed only during the installment registration stage to ensure consistency in the amount charged.

Attempt Limit

This flow currently has a maximum of 3 attempts. If this limit is reached without approval, the following actions will be executed:

  • The current payment and AutoPay change to failed status (FAILED).
  • If there are pending payments, their status will change to failed (FAILED).
  • The recurrence cycle stops.

Settlement

This process is executed only when a AutoPay payment has been approved. Its purpose is to inform the merchant's external service that the payment has been successfully completed.

Retry Frequency

If the merchant service does not respond or fails to confirm the settlement, the system will make up to 2 retries during the following time intervals:

Retry
Interval (min)
1
10
2
20

Settlement Failure

After exhausting the 3 attempts to use the external service, the Self-Pay system records a failure warning in the logs.

Notification

This flow is responsible for informing the merchant's system about the outcome of different events related to a AutoPay transaction.

Retry Frequency

If the merchant's server does not return a satisfactory response, the system will make up to 2 retries at the following time intervals:

Retry
Interval (min)
1
1
2
5

Delivery Failure

After exhausting the 3 notification attempts, the system stops automatic sending and generates an error log detailing the event that was not reported.

Retries per Flow

Flow
Retry Intervals (min)
Retry Limit
Total attempts
Check Balance?
Action after exhausting retries
Generation
5, 10
2
3
Yes
AuyoPay and suscription Failed
Processing
1, 3
2
3
No
AuyoPay, Billing and Subscription Failed
Settlement
10, 20
2
3
No
Warning Log (Audit)
Notification
1, 5
2
3
No
Error Log (Delivery Failure)