Custom Built Shopping Cart Integration with a Merchant Account
Hi all,
I am gonna to start building a shopping cart that will obviously be integrated to a processing gateway when finished, and am wondering whether I might come across any problems when attempting to integrate the shopping cart and processing gatway together.
Do I have to consider any incompatibily problems that may arise through the merchant processing gateway?
Each Gateway has their own API that needs to be addressed. If you plan you work with only one Gateway, you can custom write your software to work with it specifically. If you plan to support all of the major gateways, and more, you'll need to write your code modularly so you can accomodate the gateway being used.
But each/any shopping cart will only really be passing a set of parameters to gateway, so as long as I ensure that these parameters are passed to a gateway my shopping cart should be fine with most gateways, shouldn't it?
So should I find out what gateway provider I shall be using and what format they expect parameters before I actually start implementing the shopping cart?
Not a bad idea. You'll need to know it at some point but it won't actually come into play until you actually write the transaction portion of the cart. It couldn't hurt to start reading up on it now so by the time you get that far you'll already have a game plan.
You would want the part of the shopping cart that interacts with the gateway to be pretty modular. I don't know what language you'll use to do this, but I'm assuming PHP since that's what everybody uses now. Except me I don't know if PHP has the concept of interfaces, but you would want to do something like that.
Come up with an API of your own, that is contained within your application. authenticate_user(), sendCCDetails(), etc, whatever you need. Just make those methods skeleton code - an output in each statement would be fine. Build the sytem to use this API, so it's not reliant upon the underlying gateway. Then you can create a new class for each gateway and substitute it in appropriately. This would let you sell the shopping cart later on, hyping the fact that it's compatible with all the major gateways, and extensible so you can add support for the rest if customers need. It will also help simplify your application code, as well as provide all the other benefits of good, modularized program design.
pergesu - yeah, I will be programming the shopping cart in PHP. I will be programming in PHP 4.2.3, but am not sure exactly how it handles 'interfaces'.
Tryst, you might want to check out oscommerce & their contributions to the gateway for examples. Stymie is correct, each gateway has its own name for each input. (I am just waiting for the US government to get involved & make it standard like they did with healthcare )
Bookmarks