Hi all! I need to create a payment module for Zen Cart. I'm using the latest version of Zen Cart. My bank offers a payment system with credit card, they need some information such as order id, total amount, etc. They also want two url, ok and ko page, that are the pages that are called after collecting the cc details (on their website) and checking for the payment. I tried looking at other paymen modules, but didn't find any info. Also, the payment page on the wiki is almost empty, not useful at all. Since the payment is performed by their system, I just need to know something: for example, is the order inserted in the db at checkout? This way I can be sure it's in the db, just in case something goes wrong in the payment process. After this, when the user selects "mypayment", I need to forward the user to the bank website, adding some variables in post such as order id etc. After the payment process, the system will call either the ok or ko page, where I can update the order statu, setting it to payed or to error. In case of error I could contact the user or something like that. Any help would be really appreciated.
Hi dionciel,
we both made some test and it is quite ready... It works fine from my site to gateway site, when the customer pay, it come back, but I have some problems with method "before_process" (in my module payment).
If you want some detailed information, you can contact me. We are speaking about to release a module when everything goes right.
I post this for who's looking for some information.
To develop a payment module for cc through a gateway, you can start from (i.e.) "dirbank.php".
We have to edit the method process_button(), before_process() and after_process(). Of course there are some other methods to change, but they are normally changed for every payment module (I mean install(), remove(), keys(), etc.).
First one is the one that send data to the gateway. Usually with POST method. The url of the gateway is store in "form_action_url" in the class creator.
Second one is called when a customer transaction went well. In this method we need to validate the information returned.
Last one is used to store some information in our db or whatever you want.
For more details you can search "keyclient" in the add ons (in this days I'll do this).
Anyway, every gateway has it's differences, so it's impossible to release a generic module. You must custom it for your needed.
Bye.
Moderation
Destination thread ID and reason are required when shown.
Report Post
Tell staff why this post should be reviewed.
Manage cookie preferences
Our cookie policy has been updated, so we need you to review your preferences and consent again.