A typical credit card transaction would proceed as follows, with the entire process taking two to three seconds:

As a consumer you pass your card to a merchant to pay for a product or service or enter the card number yourself at your favorite website. At that moment your credit card information is captured.
 
Your information along with the transaction amount is transmitted to a gateway, where it is checked for authenticity. The card number is passed against a series of criteria: known fraudulent numbers lists, point of origin for high-risk countries, as well as a variety of merchant customizable parameters. If a problem is evident the transaction process stops here.
 
If the information seems to be correct and no fraud is apparent, the information is passed to a credit card processor. The credit card processor contacts the cardholder’s bank and “withdraws” authorizes funds for this purchase. The processor then “transfers” those funds to the merchants’ bank completing the electronic processing of funds. Once this action is completed the processor sends an authorization code to the gateway. If there is an insufficient credit line available, the transaction is declined
 
On an approved transaction the processor notifies the gateway of the authorization code, the gateway receives this code and forwards reflects this in communication to the merchant … purchase made. The total transaction will be completed later in the day during batch settlements between financial institutions.

A debit card or e-check transaction is processed in a very similar fashion, with the distinction being the evaluation of available funds versus credit line. In both cases digital information is captured, passed against fraud protection criteria, checked for available funds and accepted or declined …. in a matter of seconds.

Your gateway is the crucial link charged with authenticating information and accurately and smoothly passing all communication between the merchant and the processor … and back … selecting the correct one is crucial to your business.