1. Download the X-Payments distribution package x-payments-x.y.z.tgz from the File Area section of your X-Cart Account (x, y and x stand for the X-Payments version).
2. Decompress the archive to a web accessible directory on your server or your hosting account.
3. Make sure file permissions are adjusted correctly: X-Payments:Setting up file permissions for X-Payments
4. Create a copy of the file config.ini-dist.php with the name config.ini.php and open the file config.ini.php in a text editor.
5. In config.ini.php, set values for the following variables:
- server="DNS name or IP address of your MySQL server" (for example, localhost or 127.0.0.1)
- port="MySQL server port (optional)"
- unix_socket="MySQL server socket (optional)" (for example, /tmp/mysql-5.0.51.sock)
- dbname="MySQL database name"
- user="MySQL server username"
- password="MySQL server password"
- from="Email address for the field "From""
- host="SMTP server, e.g. mail.localhost or ssl://yourmailserver.domain for TSL/SSL SMTP support"
- port="SMTP port, e.g. 25"
- user="SMTP username"
- password="SMPT password"
- auth="LOGIN/CRAM-MD5/DIGEST-MD5" (SMTP authentication must have one of the following values: LOGIN , CRAM-MD5, DIGEST-MD5)
- timeout="10" (SMTP server timeout in seconds)
- web="URL (including the end-line slash) to where X-Payments is installed, e.g. https://www.example.com/xp/"
- proxy="Proxy server to send http/https requests (used by cURL)"
6. Make sure the file config.ini.php is not writable by web scripts.
7. Using a web browser, run the installation script install.php, e.g. https://www.example.com/xp/install.php, and follow the instructions on the screen.
8. IMPORTANT. Default codes contained in <lib/XPay/Model/Codebook.php> must be changed after the installation is done. Use maintenance script regen-codebook.php to generate a new codebook.
Running the cron.php script
X-Payments provides a script cron.php which must be executed from the command line. You can use this script to launch execution of periodic service tasks required for the correct operation of X-Payments. For example, this script removes cardholder data for orders that no longer need to be stored. It is recommended to launch this script using your favorite scheduling program (for example | cron daemon in Unix/Linux systems) once a day.
Recommended setup for running the cron.php script via crontab:
0 0 * * * cd /full/path/to/xpayments ; /path/to/php/bin -f /full/path/to/xpayments/cron.php
- 0 0 * * * - to run the script every day
- cd /full/path/to/xpayments - to change dir to X-Payments folder on your server
- /path/to/php/bin - path to PHP 5.3 CLI binary on your server
- -f - to execute /full/path/to/xpayments/cron.php script