Skip to content
How Money Actually Moves

01.05 · Concept

Every State a Payment Can Be In

Draw the state machine a single payment moves through, and say why pending is not a failure and why failed is not always final.

A payment is a stateful workflow, not an instant result. Created, submitted, pending, authorised, captured, settled, failed, cancelled, refunded, disputed and retried states can all appear depending on the method and processor. Correct handling means storing transitions, waiting on external events, and treating failure as sometimes recoverable.

What this lesson answers

  • what states can a payment be in
  • is pending payment status a failure
  • when is a failed payment retryable

Notes

A payment is not a single instant where money magically moves. It is a workflow with states: created, submitted, pending, authorized, captured or settled, failed, canceled, refunded, disputed, and sometimes retried. Different payment methods and processors use different names, but the important idea is that a payment has a current state, events move it forward, and your system must record those transitions instead of assuming success or failure immediately.

The mental model is a state machine. Your application asks for a payment, the payment processor accepts the request, banks or networks…

Common questions

Why should payments be modelled as a state machine?
A payment changes as your application, the customer, the processor, and banking networks act on it. A state machine makes those changes explicit, so fulfilment, retries, customer prompts, cancellation, refunds, and disputes are driven by recorded transitions rather than assumptions from the first API response.
What does pending mean in a payment flow?
Pending means the final outcome is not known yet. An external system may still be checking funds, completing authentication, reviewing fraud risk, processing a bank transfer, or waiting for settlement. The application should show a clear intermediate status and wait for the next reliable event.
Can a failed payment become successful later?
Yes, some failures are recoverable. A temporary network problem, insufficient funds, expired authentication, or a customer needing another payment method can lead to a later retry or new attempt. Permanent failures, such as invalid payment details, should stop the flow or require corrected information.