I’m working on a project, using CodeIgniter, that will have to process credit card payments, both for one-off purchases and also for recurring payments. I stumbled across Sparks and the codeigniter-payments spark yesterday. I got Sparks and the code-igniter spark installed, but then discovered there were no config files in the directory the documentation said they should be in – not even a sample config.
After emailing the author, he explained that I needed to get the latest version from github using the –recursive switch, which I promptly did (and am thoroughly appreciative of his response). However, it turns out that the project has become PHP-Payments, which is independent of the Sparks framework.
The usage information in the PHP-Payments documentation advises to use an include statement:
include('/path/to/payments/payments.php');
As far as I know, this will not work in CodeIgniter. Has anyone else got experience using PHP-Payments in their CodeIgniter project? If so, where in the CodeIgniter directory structure do you recommend I put the PHP-Payments files? Did you use an include statement as suggested by Calvin? Or did you use the typical CodeIgniter syntax of:
$this->load->
Thank you in advance, as I’ve never used a third-party plug-in in CodeIgniter before.
Also, I checked the version of PHP my host is running and it is v5.2.17. I am aware the PHP-Payments project relies on late static bindings and that this feature is not available in PHP versions earlier than 5.3.0. So, I’ve contacted my host about getting PHP upgraded to a newer version and, if they are unwilling or unable to do this, then I’ll move my project to a host that is running a version >=5.3.0.
You need to use sparks (it will go in your sparks folder, not libraries):
php tools/spark install -v0.1.4 codeigniter-payments
Once you’ve installed, follow the instructions in the sparks link.
Other alternatives: