Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Creating a payment gateway interface
  • I need to integrate a payment gateway into a Fuel project, but I'm probably going to use it again and whack on GitHub when it's up to standard - would this be counted as a package, or something else?
  • Yes ... the right way is to create a package
  • I believe calvinfroedge is already working on a payment package based on tihs CFPayments http://payments.calvinfroedge.com/
  • it's not yet finished etc, but you can try to look here; https://github.com/ninjarite/fuel-payments
  • Thanks for the pointers guys. I'm really struggling to understand how packages work at the moment, can't get the bloody thing to call from a Controller, just get "ErrorException [ Error ]: Class 'Gateway' not found" all the time.
  • Classes in packages are in their own namespace, so you should call them like \namespace\Gateway.
  • I tried that WanWizard, but couldn't seem to get anywhere. How do you call the config if you use that method?
  • If that doesn't work, you have made an error in defining the package classes. Have a look at my simplepie package as an example: https://github.com/WanWizard/fuel-simplepie All package related operations should be from within the package, to minimize the dependencies, loading a config should happen from the package class, just by using \Config::load(). Note that both the global config directories and the package directories are searched for a config file, in the sequence: APPPATH, package paths (in the order defined in config.php), COREPATH. So if you name your file config.php, it will never be loaded from the package, as there is a match on APPPATH for a config file by that name.
  • Thanks, that's a great help!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion