Shared capture surface design, for Delivery, Platform, and Sales review
This circulates the design for the shared card-capture-and-charge surface, before any surface is built, per the reviewer confirmation on this thread. Delivery is a named reviewer. It is self-contained here; the full Revenue-internal record is Revenue ADR-0026, but everything needed to review is below.
The design
The capability is ensure-card-on-file (capture a card through a Square-hosted surface, vault it to a card-on-file) plus charging a card-on-file. It has two consumers: the Delivery workbench credit-purchase drawer (POST /api/v1/orders/credit-purchases), the common case for capture, and the Sales committed close (sales-ordering-surface §4.1), the rare inline-at-close case. Five decisions:
Capture-vault is an additive front-step; the charge is unchanged. After the card is vaulted, the order is charged through the existing order-charge path (
runChargeOrderViaPg/chargeWithCardOnFile), which already owns the order-paid writeback and thepayment.received(active_charge) emit. Capture-vault does not introduce a second charge or writeback path; it just produces the card-on-file the existing path charges.Capture attaches to the order-creation path on both consumers via one single-use handle.
sales-ordering-surface§4.1 already carries the handle. The credit-purchase surface gains the symmetric addition: a capture collection method (alongside the existinginvoice_linkandcard_on_file), or a capture handle field, so a workbench operator captures-then-charges the credit-purchase order in one step. Same handle shape on both: an inline Square Web Payments SDK token, or a hosted-linkcapture_id. Same vault behind it, samecard_capture_failedfailure (no order, no charge, clean retry).The vault is per customer and credit account, reusable. A single-use capture handle vaults once into a durable card-on-file; later charges for the same customer (a repeat credit purchase) reuse it without re-capture. This matches how the
card_on_filemethod already assumes a persistent card.Both delivery shapes ship: an inline hosted-field surface (customer reachable on the call, operator driving the drawer) and a customer-completed hosted link (customer not on the call). Both are load-bearing because customer presence varies.
PCI is unchanged. Card entry is always provider-hosted (Square hosted fields or a hosted link), so the raw PAN never touches a Sguild server and Sguild stays at SAQ-A, identically whether the capture is operator-initiated from the Delivery workbench or from the Sales close. The capability reuses the existing
payment-flowevents (ensure-card-on-file,payment.receivedwithactive_charge) andcard_capture_failed; no new event types are anticipated.
The Square customer is resolved and ensured from the account's client-external (not fabricated from person_id), which depends on a customer name reaching the client record, the open 2026-06-01-sales-revenue-invoice-link-square-customer-name-gap thread. That name source is a prerequisite for the net-new-prospect path on both consumers and is being settled with Sales.
Asks
Delivery: review the design against the workbench credit-purchase flow, and ack the additive capture collection method (or capture handle) on POST /api/v1/orders/credit-purchases. This is the consumer-facing change you carry; if the credit-purchase surface is governed by a contract, it lands as an additive minor with no change to the existing invoice_link and card_on_file methods.
Platform: confirm the PCI boundary (SAQ-A holds for the Delivery feeders, operator-initiated capture included) and the event-types registry and provider posture for the new entry points (a workbench hosted-field set and a Delivery-issued capture link). Revenue's read, matching Delivery's, is no new event types; please confirm.
Sales: confirm the shared shape works for the rare inline-at-close case and that the §4.1 capture handle you acked in ADR-0032 is unchanged by this generalization. No new ask beyond confirmation.
Sequencing
Per the shared reframe, the shared core plus the Delivery credit-purchase consumer and the phone and hosted-link surfaces lead; the Sales inline-at-close trails. Nothing is built until this review lands and the staging integration test passes; the capture handle on the credit-purchase surface is the consumer-facing change gated on Delivery's ack.
References
- Delivery's flows:
2026-06-02-delivery-card-capture-charge-flows-and-shared-capability-confirm - Revenue's reviewer confirmation:
2026-06-02-revenue-delivery-card-capture-reviewer-confirm - ADR-0032 (hosted card-capture-and-vault), Accepted 2026-06-02
contracts/payment-flow/README.mdv1.1.0 §4.5 (ensure-card-on-file), §4.1 (payment.received,active_charge)contracts/sales-ordering-surface/README.mdv2.0.0 §4.1 (capture handle), §4.4 (card_capture_failed)