How Does a Payment Gateway Work? Step-by-Step Explanation
Ecommerce and online business owners setting up payments on their website for the first time often ask: how does a payment gateway work? Step by step, it captures card details at checkout, gets approval from the customer's bank, and moves the money to the business bank account.
September 14, 2026
Related solutions:
In a typical payment gateway flow, the details of a card go from the payment gateway on the checkout page to the processor, acquiring bank, card network and then to the cardholder’s bank and back in seconds. Funds are transferred to the merchant bank days later after capture, clearing, settlement and payout.
Key takeaways
A payment gateway captures and secures card details at checkout, sends them for approval, and returns the result to your website in a few seconds.
An approved authorization only holds funds on the customer's card. The money moves later, after capture, clearing and settlement.
Your checkout integration sets your security workload: a hosted payment page or iFrame keeps card data off your servers and your PCI scope small.
Fraud checks and 3D Secure run before approval, and in Europe PSD2 requires Strong Customer Authentication for most online payments.
What reaches your bank account is the sale total minus fees, reserves and chargebacks.
In a typical payment gateway flow, the details of a card go from the payment gateway on the checkout page to the processor, acquiring bank, card network and then to the cardholder’s bank and back in seconds. Funds are transferred to the merchant bank days later after capture, clearing, settlement and payout.
What is a payment gateway?
A payment gateway is a secure system that takes the card details at checkout and transmits them to the banks and card networks to authorize the transaction. It then returns the result to the merchant.
A payment gateway links the merchant to the payment system behind the card and wallet transactions. Without a payment gateway there is no secure way to take a card transaction and return a response to the merchant.
Who is involved in an online card payment
There are a number of parties in a card transaction:
Party
Cardholder
Merchant
Payment gateway
Payment processor
Acquiring bank (acquirer)
Card network (such as Visa or Mastercard)
Issuing bank (issuer)
Role in the transaction
Makes the transaction
Provides a product or service to the cardholder
Captures card details and transmits them to the other parties involved
Transmits the transaction data between the parties
Holds a merchant account and receives card transactions on behalf of the merchant
Links acquirers to issuing banks globally
Issued the card to the cardholder and will authorize or not authorize the transaction
The gateway, processing and acquiring all have different roles. The gateway takes the card details from the checkout page. The payment processor transmits transaction data between the parties. The acquiring bank then receives the funds on behalf of the merchant.
When a new merchant is implementing card payments there are three service providers involved, resulting in three contracts and three integrations. Many payment service providers offer the gateway, processing and acquiring in one solution. To accept card payments on your own website without signing separate gateway and acquiring contracts, DECTA Payment Acquiring gives merchants the complete technology stack for online payment acceptance, managed through a single point of contact.
Accept card payments on your website with one provider
DECTA Payment Acquiring gives you the complete technology stack for online payment acceptance, in 50+ currencies, with a single point of contact.
The online payment processing steps fall into two parts. Authorization takes place at checkout and takes a few seconds. Capture, clearing and settlement happen after authorization and can take several days until funds are transferred to the merchant’s bank.
Step 1: The customer enters payment details at checkout
When a cardholder fills in card details at checkout the payment gateway process starts. There are four ways that card details can be captured:
Hosted payment page (or redirect): the cardholder is redirected to a payment page hosted by the payment gateway.
Embedded iFrame: the payment gateway’s payment form is embedded into the merchant’s checkout page.
Direct post: card details are sent directly from the merchant’s form to the payment gateway.
Direct API integration: card details are captured by the merchant’s systems and then transmitted to the payment gateway.
The level of security responsibility varies depending on the method used for card detail capture. All businesses that take card payments must comply with PCI DSS, the security standard for card transactions. PCI scope is how much of a business’s setup must comply with the standard.
Using a hosted payment page or an embedded iFrame, card details are not passed to the merchant’s servers which keeps the PCI scope small and allows the gateway to take on a larger amount of security responsibility. With direct API integration the merchant can control the look and feel of the checkout experience but card details are also passed through to the merchant’s systems increasing their PCI DSS compliance responsibilities.
For a new merchant a hosted payment page or an embedded iFrame is a common implementation start. If your store runs on an ecommerce platform, connecting it to DECTA Payment Acquiring is done by updating a dedicated key set in your website’s backend.
Step 2: Payment data is encrypted and tokenized
Once the cardholder clicks “pay,” card details are encrypted and tokenized immediately.
Firstly the card details are encrypted as they travel from the customer’s browser to the gateway using TLS (the same technology behind the padlock icon in your web browser). Interception of card details will show only encrypted data and not the actual card number.
Secondly the card number is also replaced with a token. A token is a random string of characters that has no value outside the payment system. A token can be used for repeat transactions while the actual card details will not be on the merchant’s systems.
Wallets such as Google Pay and Apple Pay work the same way. Instead of passing the card number, they pass a token.
Step 3: Fraud screening and 3D Secure authentication
Once the card details have been encrypted and tokenized, risk checks are performed before the transaction is authorized:
Velocity checks can be used to identify high risk transactions such as an excessive number of transactions in a short period of time. These high risk transactions could indicate the use of stolen card numbers.
Device fingerprinting can also be used to identify the device being used for the transaction. Devices that have previously been used in a high risk transaction can be flagged.
Gateway risk rules can be implemented by a merchant and allow for additional checks such as only authorizing transactions within a certain country or below a certain amount.
Transactions that are flagged as high risk can be blocked or require merchant review.
3D Secure adds an additional level of authentication. During this step the cardholder authenticates their payment with their card-issuing bank. This authentication can be done via one time code or via a banking app.
In Europe, due to PSD2 (the EU’s revised Payment Services Directive), Strong Customer Authentication (SCA) must be performed for most online transactions. 3D Secure 2 is how merchants implement SCA. A successfully authenticated payment also generally shifts liability for fraud-related chargebacks from the merchant to the issuing bank, which is why 3D Secure matters to merchants beyond compliance.
Not all transactions require additional authentication. There are exemptions to 3D Secure 2 that allow low risk and low value transactions to avoid additional authentication.
Step 4: The authorization request is routed
Once a transaction has passed risk checks, an authorization request is sent. The authorization request goes from the gateway to the processor and then to the acquiring bank. From there the request goes to the card network and finally to the cardholder’s issuing bank.
For wallets and other payment methods the path can vary but the purpose is the same. The request is transmitted to the cardholder’s issuing bank.
The path that a transaction takes can vary. If more than one acquiring bank is linked to the gateway by a merchant, the gateway can select an acquiring bank based on card type, currency or cost. The gateway can also select a backup acquiring bank in the event of a primary acquiring bank failure.
Payment providers that run on the DECTA White Label Payment Gateway can route transactions through DECTA acquiring, third-party acquirers or both at once, so they and their merchants are not locked into a single acquirer.
Step 5: The issuing bank checks the transaction
Once the request has been transmitted to the cardholder’s issuing bank they will authorize or not authorize the transaction. They will check if the cardholder has sufficient funds or credit available. They will also check whether the card has been reported lost or stolen.
They will also check if all the information has been provided correctly. The CVV will be compared against the three digit number on the card. AVS (Address Verification Service) will be used to check if the cardholder has provided the correct billing address.
The issuing bank will also run its own checks on the cardholder’s transaction activity.
Step 6: The authorization response travels back to your checkout
The result of the authorization then makes its way back again via the same path: from the card network, acquirer, processor and finally gateway to your checkout. This typically takes a few seconds. In addition to an approval or rejection code and a brief text a risk assessment may also be returned such as the results of the CVV and AVS checks.
The reasons for rejection are often quite generic when they reach the checkout. While the card networks provide fairly detailed information all the intermediaries convert these into their own more generic format. A reason such as “a specific limit has been reached” may become “something went wrong” or “do not honor”.
However the merchant can make a decision based on the code received. For example a reason such as “insufficient funds” may allow the customer to try another card. A reason such as “stolen card” would indicate the transaction should not be processed. A temporary error may allow a retry.
Step 7: The payment is captured
An authorization does not result in any funds being transferred. Instead it holds funds on the customer’s card. Capture is the process of requesting the actual transfer of these funds.
Capture may occur immediately or at a later date. Immediate capture is used where the product or service is provided immediately. Delayed capture is used with physical goods and capture occurs when the order ships.
If capture occurs too early it can cause issues such as charges for cancelled or out of stock items which will result in disputes and refunds. If capture occurs too late the authorization can expire (typically within days, depending on the card network) which will cause a failure of the transaction. In addition there can be issues if the amount captured does not match the goods shipped during reconciliation.
Step 8: Clearing, batching, and settlement
Captures are not made individually. Instead they are batched by the processor or gateway and typically once a day sent to be cleared. During clearing the acquirer, card network and the issuer exchange information about the transaction and confirm who is liable for what.
Settlement then occurs where the issuer transfers funds via the card network to the acquirer who in turn deposits these funds into your merchant account. These funds will be less than the total of the transaction by all applicable fees, an amount held by the acquirer as a safety buffer (a reserve, such as a rolling reserve) and any chargebacks, which are payments reversed after a cardholder disputes them.
Settlement typically occurs either on a T+1 or T+2 basis. This means the funds will be transferred one or two business days after the transaction depending on an agreement with your gateway/processor. Some gateways/processors will also agree on bespoke settlement times.
Step 9: Funds are paid out to your business bank account
Finally, funds are transferred from your merchant account to your business account. The timing of when this occurs depends on your gateway/processor and agreement. This can occur on a daily or weekly basis.
If you operate across multiple currencies conversion may occur automatically unless you require transfer in each currency. If you sell to customers in other countries, DECTA Payment Acquiring lets you accept payments in 50+ currencies, so customers can pay in their local currency.
The amount of funds received will be less than the total by all fees, conversion fees, reserves and chargebacks.
Common pitfalls to avoid when setting up a payment gateway
Capturing funds prior to completion of fraud checks can be expensive. If a fraudulent transaction is captured and shipped, the real cardholder will dispute it. This results in a chargeback for the merchant, a loss of goods and a fee.
Treating an authorization as received funds can also cause issues. An authorization is a hold on funds rather than receipt of funds. If the authorization expires or if the capture fails then funds are not received even though the transaction may have appeared to have been paid. A merchant who only ships on authorization can suffer from lost revenue and cash flow problems.
Failure to adequately test a payment solution is also a common issue. Most gateways provide a test environment often referred to as a sandbox. Within this environment payments can be simulated including retries, 3D Secure and declines prior to going live. Failure to do this can result in non-functional retries or confusing errors shown to live customers, resulting in lost sales.
Security and compliance issues can result in lost transactions and data breaches. For example storing card data in a merchant system, using a method of integration that can result in an unneeded expansion of the scope of PCI compliance or using an outdated implementation of 3D Secure may all put data at risk and can also result in payment failures.
Failure to have a backup path to an alternative acquirer is also a problem that is often overlooked by new merchants. If this path should fail or the current acquirer should start rejecting more transactions then sales will cease. A gateway that can connect to more than one acquirer will allow transactions to continue should one path fail.
Setting up online payments for the first time?
Talk to the DECTA team about the checkout, acquiring and settlement setup that fits your online business.