Question

Which is the right approach to implement a new payment method in Jigoshop. Looking into the code I’ve seen the folder where all the implementations can be found, but I’d like to implement it in the right way (upgrade-safe), I’ve been searching in the documentation, but can’t find any clues.

Answer

Admittedly, there isn’t much for documentation. You can certainly take our PayPal gateway as a ‘model’ … but as you note, that gateway depends on being where it is.

You need to make it a WordPress Plugin that stands on its own in the plugins folder. That’s generally not more than needing a proper ‘header’ in the file and placing it in a newly created folder in the plugins folder. I’ve enclosed a sample gateway plugin zip file.

If you install this as a plugin on your site, it will appear within the Jigoshop settings on the Gateways tab … and do not much else.

It has some documentation in the main plugin file, enough to get you started. The plugin has a main plugin file, a languages folder for translations (without any at the moment), and a required readme file.

From here, add options and functions to get the gateway to actually do something using our PayPal gateway as a model.

 
Jigoshop