Payments & Billing
Payments & Billing is the domain that configures how money is collected, records what was charged or refunded on an order, and produces the billing documents that operators or customers can retrieve later.
This first pass treats the domain as five connected layers:
- gateway configuration and checkout entry
- order payment capture and reconciliation
- refunds and balance recovery
- billing documents and invoice outputs
- customer payment methods
Status
- [x] Domain overview written
- [x] Subdomains reviewed
- [x] Technical node pages linked
- [x] End-user concept pages linked
- [x] Task guides linked
Responsibility
This domain is responsible for:
- storing payment-gateway configuration and capability flags
- creating checkout URLs and card-session URLs for supported gateways
- recording order payments from Stripe, manual methods, credit-line flows, and synced external charges
- creating and tracking refund records tied to order payments
- generating invoice records and PDFs from fulfillments, returns, refunds, and order-level billing events
- exposing invoice download and saved-card management to the packaged storefront where those surfaces exist
Subdomains
Gateway Configuration And Checkout EntryPaymentGateway- Stripe checkout sessions
- customer card-session URLs
Order Payment Capture And ReconciliationOrderPayment- saved-card charges
- manual payments
- credit-line payments
- payment sync and transfer flows
Refunds And Balance RecoveryOrderRefund- refund-selected-items
- refund-and-cancel-order
Billing Documents And Invoice OutputsInvoice- invoice PDFs
- invoice emails
- consolidated invoice outputs
Customer Payment MethodsCustomerCard- My Account payment methods
- default-card and delete-card flows
Classification Decisions
Standalone technical pages
Standalone end-user pages
Standalone task guides
Folded into parent pages for now
CustomerCard- folded into
Payment GatewayandPayment Methodsbecause the shared package exposes it mainly through saved-card workflows rather than as a first-pass admin concept page
- folded into
InvoiceItem- folded into
Invoice
- folded into
InvoiceDiscountLine- folded into
Invoice
- folded into
InvoiceFeeLine- folded into
Invoice
- folded into
InvoiceShippingLine- folded into
Invoice
- folded into
- checkout-session and redirect controllers
- folded into
Payment GatewayandOrder Paymentbecause they are transport mechanics for payment collection rather than standalone business concepts
- folded into
- consolidated invoice PDF and email outputs
- folded into
Invoicebecause they summarize existing invoice records instead of representing a new billing record type
- folded into
Explicitly not getting standalone end-user concept pages in this pass
Payment GatewayOrder Refund
Gateway configuration is an internal configuration concept, and refund handling remains mostly operator- and email-driven rather than a shared shopper-facing destination.
Evidence Highlights
Framework ownership
packages/framework/src/Models/PaymentGateway.phppackages/framework/src/Models/OrderPayment.phppackages/framework/src/Models/OrderRefund.phppackages/framework/src/Models/Invoice.php
Admin and operations surfaces
packages/framework/routes/admin.phppackages/framework/src/Http/Controllers/Api/Admin/PaymentGatewaysController.phppackages/framework/src/Http/Controllers/Api/Admin/OrderPaymentsController.phppackages/framework/src/Http/Controllers/Api/Admin/OrderRefundsController.phppackages/framework/src/Http/Controllers/Api/Admin/InvoicesController.php
Storefront and shopper-visible surfaces
packages/storefront/routes/web.phppackages/storefront/src/Livewire/Storefront/MyAccount/PaymentMethodspackages/framework/src/Http/Controllers/Api/Storefront/OrdersController.phppackages/storefront/resources/views/components/my-account/orders/data-table/row/header.blade.php
Core behavior and automation
packages/framework/src/Actions/Stripe/CreateStripeCheckout.phppackages/framework/src/Actions/Stripe/ChargeStripeCustomerCard.phppackages/framework/src/Actions/Stripe/SyncStripeCheckoutToOrderPayment.phppackages/framework/src/Actions/OrderRefund/CreateOrderRefund.phppackages/framework/src/Actions/OrderRefund/RefundSelectedItems.phppackages/framework/src/Actions/Invoice/GenerateInvoices.phppackages/framework/src/Actions/Invoice/CreateInvoiceFromFulfillment.phppackages/framework/src/Actions/Invoice/CreateInvoiceFromOrderReturn.phppackages/framework/src/Actions/Invoice/CreateInvoiceFromRefund.php
Navigation Notes
Payment gateway typeandpayment method typeare not the same thing. Gateways are configuration records such asstripeormanual, while manual payment creation still asks for a method type such ascheckorcash.invoice_urlonOrderis misleadingly named in the Stripe checkout flow. In the shared package it stores the checkout URL returned by Stripe, not a generated invoice record.Refundis not the same thing asReturn.OrderRefundis payment-settlement machinery;OrderReturnis the operational return workflow documented under Order Lifecycle.Invoiceis not the same thing as a consolidated invoice email or PDF. Consolidated outputs summarize existing order invoices, whileInvoicerecords are generated from fulfillments, refunds, returns, or order discounts.