Scheduled Tasks

Sana Commerce 9.3
Your connector

Sync Payment Statuses between Sana and ERP

When a customer creates an order and pays for it using a credit or a debit card, it takes some time between the moment the customer pays for the order and the merchant receives the payment. Credit card payment processing is automatically done on behalf of the merchant by the payment provider.

When a customer pays for an order, a payment goes through different stages. These stages define the status of each payment transaction.

For more information about different payment types supported by Sana, their logic and payment statuses, see "Payments".

The task Sync payment statuses between Sana and ERP checks payment statuses of the sales orders in the Sana database and updates them in the ERP system, if necessary. This is needed, if Sana cannot update the payment status of the sales order in ERP right away. For example, Sana receives confirmation from the payment service provider that the order has been successfully paid by the customer and updates the payment status. For some reason, connection to the ERP system is not available at this moment and Sana cannot update the payment status of the order in ERP. Therefore, it is stored in the Sana database.

You can set up the task Sync payment statuses between Sana and ERP and it will check the latest payment statuses of the sales orders in the Sana database and update them in your ERP system.

Set up the "Sync payment statuses between Sana and ERP" task

To set up the task Sync payment statuses between Sana and ERP, click Edit.

The table below provides the description of the Sync payment statuses between Sana and ERP task settings:

Settings  Description
Run on schedule  Use this option to enable automatic running of the Sync payment statuses between Sana and ERP task according to the configured schedule or disable it to allow only manual start of the task.

If you enable Run on schedule, you should enter either the interval in minutes when the task should run automatically or the fixed time. 

Run interval (in minutes)  Enter the time interval in minutes when the task should run automatically.
Run time  Enter the fixed time when the task should run automatically. For the fixed time, the time of the server is used. 
Send e-mail to administrator when task has failed

Use this option to enable or disable e-mail notifications when a scheduled task fails.

If the scheduled task has failed, the webstore administrator receives an e-mail with the name of the task that failed, the name of the webstore, which is useful in case you have several webstores, when the task failed, and the error message. Thanks to this, the webstore administrator can quickly respond to problems with data synchronization.

Maximum archived log files  Enter the maximum number of log files to store. If this number exceeds, the oldest log file will be removed and the new one will be created.
Count of days before sending error notification If a payment status of a transaction cannot be updated in the ERP system during the specified number of days for some reason, an e-mail will be sent to a Sana administrator.

The "Error notification" (TechnicalAdminErrorNotification) e-mail template is used for such e-mails.

These e-mails are sent to the e-mail address specified in the field "Administrator notifications addresses" at the following location in Sana Admin: Setup > Basics > Store information.

The Sana administrator should manually handle such situations and check why it is not possible to update the payment status of a certain transaction in ERP.