Skip to content

Payments

Payment sessions, authorization, capture, refunds, and provider webhooks in EdgeCart.

The Payments module handles the money side of checkout: it creates a payment session, authorizes the shopper’s payment method, and later captures or refunds the money. EdgeCart supports Stripe and a manual provider.

Features

  • Payment collections and sessions — one collection per cart, with a session for the selected provider.
  • Authorization — confirm that the shopper’s payment method can cover the order.
  • Capture — move authorized money into the merchant account.
  • Refunds — full or partial refunds against a captured payment.
  • Provider webhooks — receive asynchronous payment and refund updates from the provider.
  • Reconciliation — keep the local payment state aligned with the provider.

Key concepts

Concept What it means
Payment collection The payment container for a cart or order.
Payment session A provider-specific attempt inside the collection.
Authorization A hold that reserves the amount before capture.
Capture The action that transfers authorized money.
Refund Returning captured money to the shopper.
Provider webhook An asynchronous event from Stripe or another provider that updates the payment state.
Manual provider A provider that records payments without an external gateway.

How it fits

  • Cart and checkout — checkout creates a payment collection and session for the cart. The storefront renders the provider’s payment element.
  • Orders — the order is created after payment authorization. The order page owns the capture and refund controls.
  • Order changes — return refunds are recorded separately; moving money still happens through the payment panel.
  • Observability — payment events (payment.captured, payment.refunded) are delivered through the outbox.

Common tasks

  • Merchant — capture or refund a payment from the order detail page. The payment panel shows the current state and the available actions.
  • Developer — browse the Storefront and Admin operations in the API reference. Webhook signatures and retry behavior are described in the API conventions.

Current boundaries

  • Stripe supports one capture per PaymentIntent; a partial capture releases the remainder. The manual provider supports cumulative captures.
  • Only pending and requires_action provider refunds wait for a later webhook; failed and canceled attempts are stored as audit rows.
  • A late refund success that would exceed the captured amount is rejected and acknowledged instead of retried forever.
  • Webhook URL validation is lexical; DNS rebinding cannot be detected inside the Workers runtime, so only subscribe endpoints you control.

See current limitations for the full list.

  • Orders — the order that owns the payment state.
  • Cart — the cart that creates the payment collection.
  • Order changes — returns and claims.
  • Observability — payment events and webhook delivery.

Type to search…

↑↓ navigate↵ selectEsc close