The script needs to be run via crontab, which is your server's task scheduler, i.e. it'll run at say 4am every day as part of maintenance for your payment processing. Information provided in link below:
What is cron and how do I schedule scripts to run at a certain time?
Just looking at the script I don't see any special configuration within itself, so I assume you need an example of how to setup a cron job? If your webhost supplies a web GUI to configure cron, use it. Otherwise...
Following the help above and using 4am every day as an example, you'd do this via shell (command line Linux):
1) "crontab -e"
2) Using the editor insert a line similar to this (edit path and time):
Payment processor script, runs every day at 4:00am local server time...
0 4 * /path_to/php /path_to/rcharge.php
3) Save and exit
4) Check your work - use "crontab -l" to list the current cron scheduler.
Notes (Very Important):
You must have a command line version of PHP installed on the server (known as the CLI version). Most servers have this, some don't. To determine if you have it in Linux type in "which php" and use that path. If nothing comes back, compile and install the CLI version (consult webhost). Also, use full paths in cron setup to avoid alot of pitfalls. Finally, you can pass parameters to any script or daemon in cron. Looking at your script, nothing is obvious you need to do that, but of course it's your script so check docs.