bill99 Posted December 5, 2006 Posted December 5, 2006 Hi All, I would like to find out how to go about developing a custom payment module. Our requirements are to collect the payment information ( in the same way as the CC module does) and then make a URL call to our payment gateway provider to actually authorise the payment. My problem is that I've been unable to find any doccumentation about creating payment modules. I'd appreciate any help on this. One thought is to clone the existing CC module and start from there but how would I go about that to ensure that all of the relevant files are updated / copied / renamed or whatever is needed. Thanks, Bill
kgt Posted December 5, 2006 Posted December 5, 2006 There's no documentation that I know of. You normally need only one file for a payment module - the file you create in includes/modules/payment. You can choose to use supporting functions or classes if needed, and so you would have additional files. Start with a simple payment module, like cod.php to see how it works. Then look at one of the other modules for a payment gateway. Contributions Discount Coupon Codes Donations
bill99 Posted December 5, 2006 Author Posted December 5, 2006 There's no documentation that I know of. You normally need only one file for a payment module - the file you create in includes/modules/payment. You can choose to use supporting functions or classes if needed, and so you would have additional files. Start with a simple payment module, like cod.php to see how it works. Then look at one of the other modules for a payment gateway. Thanks for the Reply. I'll look at the COD and CC modules and see what I can make of them. I think the problem is going to be understanding how any changes might impact on other parts of the system. We shall see I suppose :D
kgt Posted December 5, 2006 Posted December 5, 2006 The payment modules are intended to work like modules, so that they can be added or deleted without affecting the rest of the shop. During the checkout process, certain functions of the class payment module are called, such as before_process(), after_process(), etc. These functions are expected to return certain values - for example, javascript_validation() is expected to return a string containing any javascript that should be run on the checkout_payment.php screen to validate form fields for this module. Start by following the model of cod.php: make your payment gateway form fields display in the checkout_payment.php screen. Once you get that far, the way payment modules work should be starting to become clear to you. The take a look at how the payment gateway modules work to get a better idea of when to make the API call, etc. Contributions Discount Coupon Codes Donations
Recommended Posts
Archived
This topic is now archived and is closed to further replies.