
Posted by Lawrence
All payment gateways fit into one of two categories, identifying which yours fits into will help decide how to integrate with it.
Without getting into the specifics of any particular gateway, payment gateways follow two basic methodologies, reail-time and non-real-time.
1. Real time (Authorize Net and PayFlo Pro for example)
These process the transaction in-line. ColdFusion processes code from top to bottom. When it reaches the gateway code, usually a custom tag call, gateway is processed, while this is happening the application waits, After the gateway responds CF Server continues processing the rest of the page code, which can through the use of "if" statements be based on the response received back from the gateway.
With real time gateways we can write the customer data and order data to database or not, based on the results of transaction that is provided by the gateway.
2. Non real-time (PayPal, 2CheckOut for example)
These process the transaction in a completely separate space from the application. The page code, including gateway code, is processed all at once. The parameters are passed to the gateway either via FROM submittal or HTTP Post and the page is finished without regard to what happens at the gateway/payment processor.
With non-real-time gateways, we must write the data to the database, and mark it as "pending" Then either program a response page for the gateway to post transaction results to with a "call back" or "post, or manually mark the order as paid after receiving the transaction results from the gateway via email.
Best thing to do is determine which category the gateway you are considering falls into. You will then be better equipped to figure out how to work integrate it into your site. You can use the existing gateway custom tags for Authorize Net and PayPal (available on the Macromedia Exchange) as examples on how to work with the different gateway types. These will at least give you a good staring point.