Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 38 ยท Payment Concepts and Security

How Card Payments Work Behind the Scenes

Follow a card payment from authorization to capture, settlement and payout. Learn interchange fees, decline codes, holds, chargebacks and what Stripe's fee really covers.

When a customer presses Pay, the page usually says "Processing..." for a second or two. In that moment a lot happens. Knowing the steps explains behaviours that otherwise look like bugs: why a pending charge disappears from a statement, why money arrives days after a sale, why a refund takes a week to show up, and why a declined card sometimes works on the second try.

The four stages

A card payment has four stages, and they happen at different times.

  1. Authorization: your processor asks the customer's bank (the issuer) "can this card pay $20?" The issuer checks funds, fraud signals and card status, then approves or declines. If approved, it places a hold on that amount. No money has moved yet.
  2. Capture: you tell the processor to actually collect the authorized amount. With Stripe's default behaviour authorization and capture happen together. You can separate them (authorize now, capture when you ship) for up to about seven days on most cards.
  3. Settlement (clearing): card networks batch captured payments and move the money from issuers to the acquirer, usually within a day or two.
  4. Payout: Stripe transfers your balance to your bank account on your payout schedule, typically two to seven business days after the charge, depending on country and account age.
flowchart LR
  A["Authorization<br/>hold placed"] --> B["Capture<br/>amount confirmed"]
  B --> C["Settlement<br/>networks move funds"]
  C --> D["Payout<br/>to your bank"]
  A -. "not captured in time" .-> E["Hold released"]

A hold is a promise, not a payment. An uncaptured authorization simply expires.

Simulating the lifecycle

This stand-in models a charge as a small state machine, so you can see which transitions are legal. It is not Stripe, but the states mirror the idea.

Node.js A card charge state machine (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

What a payment costs

Each card payment carries fees, and it helps to know who gets what.

  • Interchange: paid to the issuer. It depends on card type (debit, credit, premium rewards), region and sometimes whether the card was present.
  • Scheme (network) fees: paid to Visa or Mastercard.
  • Processor margin: Stripe's share.

Stripe usually bundles these into one headline price, a percentage plus a fixed amount per successful charge (the exact numbers depend on country and plan, so always read your own pricing page). Some businesses negotiate "interchange-plus" pricing that shows the three parts separately. Fees matter for design: a fixed fee per charge makes very small payments expensive, which is why some sellers set a minimum order or bundle micro-purchases.

This stand-in computes the net amount you receive. The percentage and fixed fee below are made up for the exercise; use your real pricing.

Node.js Net amount after fees (stand-in)

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with node:readline or process.stdin), it gets the next line from this box.

Watch the feeShare column: on a $1 sale the fixed part dominates, on a $1,000 sale it nearly vanishes.

Why payments fail

A decline is not always "no money". The issuer returns a decline code, and Stripe groups them into a few categories:

Reason Example code Can the customer fix it?
Insufficient funds insufficient_funds Use another card
Card details wrong incorrect_cvc, expired_card Re-enter details
Bank suspicion do_not_honor, fraudulent Call the bank
Needs authentication authentication_required Complete 3D Secure
Technical processing_error Try again

Never tell the customer more than the safe message Stripe provides, and never reveal whether the cause was fraud. Show "Your card was declined. Try another payment method." and offer other methods.

Refunds and chargebacks

A refund is you returning money. It reaches the customer's statement in roughly five to ten business days depending on their bank. A chargeback (dispute) is the customer asking their bank to take money back. You can fight it with evidence, and you pay a dispute fee either way. Disputes hurt: too many can lead to higher fees or loss of the account. The dedicated lesson Refunds, Disputes and Payouts goes deeper.

What this means for your code

  • Treat succeeded from Stripe as the moment to fulfil the order, not the browser redirect.
  • Design for hold expiry if you use manual capture.
  • Store amounts as integers, and remember the net you receive is less than the gross you charge.
  • Never promise instant refunds.

Next, the rules about how money is written down in code: Amounts and Currencies.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. After authorization but before capture, has money moved from the customer to you?

    Authorization reserves funds. Capture collects them. An uncaptured authorization expires and the hold is released.
  2. 2. Which stage sends the balance to your bank account?

    Payouts transfer your Stripe balance to your bank on a schedule.
  3. 3. Why are very small payments proportionally expensive?

    A percentage plus fixed fee means the fixed part dominates low amounts.
  4. 4. What should you show a customer whose card was declined for suspected fraud?

    Reveal as little as possible. Explaining fraud reasons helps attackers testing stolen cards.

Summary

  • Four stages: authorization (hold), capture, settlement, payout.
  • Approval is a promise; capture collects; payout arrives days later.
  • Fees combine interchange, network fees and processor margin; fixed fees hurt small payments.
  • Decline codes guide what the customer can do, but show generic messages.
  • Fulfil orders on Stripe's confirmed status, not on the browser redirect.

Next: Amounts and Currencies