RO Payments comes with a script that makes it possible to check the status of payments automatically. It can happen that a customer does not return to the website or the communication with the payment provider fails, in this case the payment status remains open. Through the Joomla CLI script these open payments, provided they have a transaction number, can be checked automatically.
Location of the script
The script is located in the folder named cli and is called joomla.php
Running the script
The script is started using the command:
/usr/bin/php /path/to/joomla/cli/joomla.php ropayments:status-update
The different parts of the command are:
- /usr/bin/php
This is the location of PHP on the server. This is just an example, check with your hosting provider what the exact location of PHP is - /path/to/joomla/cli/joomla.php
This is the full path to the location where the joomla.php script is. Replace /path/to/joomla with the exact location of where Joomla is on your server
Getting help from the script
The help page can be requested by using the -h switch:
/usr/bin/php /path/to/joomla/cli/joomla.php ropayments:status-update –h
Date filter
The default behaviour for the script to find the date filter is to check when it last ran. All transactions are taken from the last run time. It is possible to modify this by adding the lastrun argument in your command:
/usr/bin/php /path/to/joomla/cli/joomla.php ropayments:status-update --lastrun=2019-01-20
In this example all transactions since January 20th, 2019 are checked.
State filter
The default behaviour for the script is to check transactions that do not have a state set. Here it is also possible to change this behaviour by adding the status argument in your command:
/usr/bin/php /path/to/joomla/cli/joomla.php ropayments:status-update --status=expired,open
Requirements
- Cronjobs must be supported