Skip to content

[Phase 5] Credits, orders, entitlements and paid launch #37

Description

@mrgoonie

Depends on

Objective

Attach commerce to an already-proven package delivery and entitlement system.

Delivery/security depends on Phase 4. Payment-provider approval work may run earlier, in parallel with Phases 2-4.

Scope

  • Append-only buyer credit ledger.
  • Top-up with verified provider events.
  • Quotes/orders.
  • Atomic debit + entitlement grant.
  • Refund/chargeback.
  • Agent-safe transaction confirmation.
  • Provider/business-model approval gate.

Implementation tasks

  • Add credit ledger entries and balance projection.
  • Add top-up records.
  • Add webhook inbox/dedup.
  • Verify provider signatures and paid-state semantics.
  • Add quote model + expiry.
  • Add orders/order items.
  • Add idempotent purchase command/API.
  • Atomically debit + order + entitlement grant.
  • Add already-owned handling.
  • Add refund compensating entries.
  • Add chargeback account/entitlement policy.
  • Add seller payable placeholder accounting separate from credits.
  • Add quote via CLI/MCP.
  • Add transaction-specific confirmation contract.
  • Test duplicate webhooks.
  • Test duplicate purchase retries.
  • Test concurrent debit/overspend.
  • Document approved payment architecture.

Acceptance criteria

  • No double-mint/double-debit.
  • Concurrent purchase cannot create negative usable balance.
  • Entitlement is traceable to grant/order.
  • Every public representation still protects paid payload.
  • Payment provider has approved the actual business model.

Milestone: paid launch.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions