22 Prepaid order reconciliation
procedure
(storage-scope-journal storage subject-id offer-id) → list? storage : commerce-storage? subject-id : string? offer-id : string?
Returns ordered journal records for one subject/Offer, with a 10,000-record
operator bound. Records contain private payment evidence; never log them.
The issuer re-authenticates every contributing record.
For calendar-duration policies, storage-complete-issuance-work! also accepts #:prepaid-records and #:effective-action. Both must be supplied together. SQLite compares the records against the current scope inside the completion transaction, refuses 'prepaid-snapshot-stale on change, and records an append-only coverage checkpoint beside the signed revision. The resulting action may retain a grant after another order’s full refund; the triggering outbox action is unchanged. See ADR-0026 for migration and refund-before-payment behavior. No automatic recurring debit is introduced.
procedure
(storage-prepaid-revision? storage entitlement-id revision) → boolean? storage : commerce-storage? entitlement-id : string? revision : exact-nonnegative-integer?
Recognizes an append-only prepaid reconciliation checkpoint. It is workflow
metadata, never payment evidence. Hosted proof uses it to exclude the exact
expiry instant for the half-open prepaid service interval.