如何创建Zen Cart支付模块
I'm interested in writing a Zen Cart payment module for a certain payment-gateway for people to download and install in their ecommerce website. My experience with Zen Cart is minimal so I don't know where to start. I checked the FAQ section on Zen Cart's website and I only found completed modules, no code examples of how to write one from scratch, or how to deploy it. Could someone possibly give me some example code or teach me the basics involved?
我有兴趣为某个支付网关编写Zen Cart支付模块供人们下载和安装 他们的电子商务网站。 我对Zen Cart的体验很小,所以我不知道从哪里开始。 我查看了Zen Cart网站上的FAQ部分,我只找到了已完成的模块,没有代码示例,说明如何从头开始编写,或者如何部署它。 有人可能会给我一些示例代码或教我涉及的基础知识吗? p> div>
Your best bet is to download other payment modules (there is a list here) and see how they work. Developing payment modules is such a specialized task that I doubt anyone has written documentation for it. I am sure you can find a module with well-documented source code.
Your approach really depends on the API/interface the gateway provides. If you look at the built-in Linkpoint module, it just uses cURL to communicate with Linkpoint. If you look at Beanstream INTERAC (in free software add ons), it uses cURL but it also expects a couple of callback URLs to be provided. There are other models too - your best bet is to get an understanding of what the gateway wants, and then look for an existing module that also uses this communication model.