Documentation
¶
Overview ¶
Package commerce provides the main application framework for Hanzo Commerce.
Commerce is a multi-tenant e-commerce platform that runs as a standalone binary with embedded SQLite for per-user/org data and optional analytics via ClickHouse.
Architecture:
┌─────────────────────────────────────────────────────────────┐ │ Commerce App │ ├─────────────────────────────────────────────────────────────┤ │ HTTP Server (Gin) │ Hooks System │ Background Tasks │ ├─────────────────────────────────────────────────────────────┤ │ User SQLite │ Org SQLite │ Analytics (CH) │ │ + sqlite-vec │ + sqlite-vec │ (parallel queries) │ └─────────────────────────────────────────────────────────────┘
Package commerce (pkg/commerce) is the embedded Commerce server. One backend, one HTTP handler. Mirrors pkg/tasks/embed.go shape:
cfg := commerce.EmbedConfig{DataDir: "/var/lib/commerce", HTTPAddr: ":8090"}
srv, err := commerce.Embed(ctx, cfg)
defer srv.Stop(ctx)
The legacy App in commerce.go is the bootstrap — server.go wires it into commerced/main.go cleanly. The /v1/commerce/* surface stays behind hanzoai/gateway and is gated by COMMERCED_REQUIRE_IDENTITY.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Version = "1.49.21" GitCommit = "dev" BuildTime = "unknown" )
Version, GitCommit, and BuildTime are set via -ldflags at build time. Version's default is the source-of-record release; CI overrides it with the immutable image tag (-X github.com/hanzoai/commerce.Version=<tag>) so the running binary's /healthz version always equals its deployed tag.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// Root command
RootCmd *cobra.Command
// Database manager
DB *db.Manager
// Infrastructure manager
Infra *infra.Manager
// Hook system
Hooks *hooks.Registry
// Events client (sends to analytics-collector via HTTP)
Events *events.Client
// Publisher sends commerce events to NATS/JetStream
Publisher *events.Publisher
// KMS client for secret management
KMS *kms.CachedClient
// ZAP node for inter-service vector operations
ZAP *infra.ZAPNode
// HTTP router — the native zip app (zap-proto/fiber underneath).
Router *zip.App
// CommerceStore is the hanzo/base-backed persistence seam. When set it
// provides the authoritative tenants + hostname-claims collections;
// handlers that have migrated off the legacy resolver use this directly.
// Initialized in Bootstrap from COMMERCE_DATA_DIR / COMMERCE_BASE_URL.
CommerceStore *commercestore.Store
// contains filtered or unexported fields
}
App is the main Commerce application
func NewWithConfig ¶
NewWithConfig creates a new Commerce application with the given configuration
func (*App) Serve ¶
Serve starts the HTTP listener(s) — zip.Listen on the native transport (zero net/http). The legacy standalone-TLS path uses the documented fiber escape hatch; production terminates TLS at the gateway.
type Config ¶
type Config struct {
// DataDir is the base directory for all data
DataDir string
// Dev enables development mode
Dev bool
// RequireIdentity makes the identity boundary (auth.Gin) reject any
// request that arrives without X-Org-Id/X-User-Id. Sourced from
// COMMERCED_REQUIRE_IDENTITY. It is OFF by default and MUST stay off
// wherever the cloud-api -> commerce per-org billing path runs: that
// path authenticates with a Bearer service token + X-Org-Id and
// carries NO X-Org-Id, so a require-identity gate would 401 the money
// path. The anti-spoofing boundary is EdgeAuth (always mounted), not
// this gate.
RequireIdentity bool
// Secret for encryption and sessions
Secret string
// HTTP server address
HTTPAddr string
// HTTPS server address (optional)
HTTPSAddr string
// TLS certificate paths
TLSCert string
TLSKey string
// CORS allowed origins
AllowedOrigins []string
// co-residence contract (HIP-0106): Bootstrap registers commerce's routes
// directly on it (one router, one specificity space) and setupRoutes
// skips the standalone-only surfaces (/healthz, legacy /admin SPA, the
// checkout SPA catch-all). Serve refuses — the host listens.
SharedApp *zip.App
// Database configuration
Database db.Config
// Analytics collector endpoint (optional)
AnalyticsEndpoint string
// Analytics DSN (optional, for direct ClickHouse queries)
DatastoreDSN string
// Infrastructure configuration
Infra infra.Config
// Query timeout
QueryTimeout time.Duration
// KMS configuration for secret management
KMS kms.Config
// IAM configuration for hanzo.id JWT validation
IAM struct {
Enabled bool `json:"enabled"`
Issuer string `json:"issuer"`
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
AcceptedAudiences []string `json:"acceptedAudiences"`
AcceptedIssuers []string `json:"acceptedIssuers"`
JwksURI string `json:"jwksUri"`
} `json:"iam"`
}
Config holds application configuration
type EmbedConfig ¶ added in v1.42.5
type EmbedConfig struct {
DataDir string // "" → COMMERCE_DIR or ./commerce_data
HTTPAddr string // "" → COMMERCE_HTTP or 127.0.0.1:8090
Dev bool // dev mode — reload-friendly logging
RequireIdentity bool // gateway trust: refuse requests without X-Org-Id/X-User-Id
Logger *slog.Logger // nil → slog.Default()
AllowedOrigins []string // CORS — usually ["*"] behind gateway
// App is the NATIVE co-residence contract: when set, commerce registers
// its routes directly on this shared zip app (one router, one specificity
// space — no handler adaptation, no second engine) and skips the
// standalone-only surfaces (/healthz, the legacy /admin SPA, the checkout
// SPA root catch-all, Listen). nil → commerce builds its own app and
// serves standalone.
App *zip.App
// Ledger is the host-injected double-entry credit ledger. When the cloud
// binary embeds commerce it passes a ledger-backed impl here, so
// POST /v1/billing/credit and GET /v1/billing/balance route to the SAME
// per-org account the AI spend-gate reads (one ledger, no split). nil →
// commerce falls back to its own datastore (standalone-safe).
Ledger creditledger.CreditLedger
}
EmbedConfig configures the in-process Commerce server. Empty values fall through to commerce.DefaultConfig (env-based) so commerced binds the same env contract the legacy commerce binary did.
type Embedded ¶ added in v1.42.5
type Embedded struct {
// contains filtered or unexported fields
}
Embedded is the handle to a running in-process Commerce server. The underlying *App owns the heavy lifting (DB, infra, KMS, hooks, cron) — Embedded wraps it for clean Stop/Zip access.
func Embed ¶ added in v1.42.5
func Embed(ctx context.Context, cfg EmbedConfig) (*Embedded, error)
Embed bootstraps the Commerce app and returns a handle. Call Stop before the process exits.
func (*Embedded) App ¶ added in v1.42.5
App exposes the underlying App for tests and hook registration.
type Store ¶ added in v1.42.5
type Store struct {
// contains filtered or unexported fields
}
Store is the per-request, org-scoped data layer. Each request lands on its own *db.DB shard keyed by the gateway-supplied X-Org-Id, so two orgs can never see each other's rows even if a handler bug forgets to scope its query.
func NewStore ¶ added in v1.42.5
NewStore wraps a db.Manager. The returned Store has no org binding — call WithOrg to land on a specific shard.
func (*Store) DB ¶ added in v1.42.5
DB returns the per-org *db.DB shard. The value it returns holds no handle — it borrows the org's store from the tenant registry for each operation — so two requests on the same org share one open SQLite handle (with its own connection pool) while it is resident, and holding this Store costs no file descriptor once it is not.
func (*Store) FromContext ¶ added in v1.42.5
FromContext returns a Store bound to the org id attached by pkg/auth.Gin (or pkg/auth.RequireIdentity). Empty org → unscoped "system" shard, which is the legacy default for unauthenticated dev requests. A request that asks for tenant data without an org must have failed the gateway-trust gate already.
Directories
¶
| Path | Synopsis |
|---|---|
|
account
Package account — login deprecated.
|
Package account — login deprecated. |
|
b2b
Package b2b wires the B2B commerce HTTP surface: companies, employees (with their spending headroom), quotes (accept/reject + message thread), and spend-approvals.
|
Package b2b wires the B2B commerce HTTP surface: companies, employees (with their spending headroom), quotes (accept/reject + message thread), and spend-approvals. |
|
catalog
Package catalog is the HTTP surface for the platform product catalog — the CMS source-of-truth for a brand's OWN products (Models, Vector, KMS, …) that docs.<brand>, the console sidebar, and pricing derive from.
|
Package catalog is the HTTP surface for the platform product catalog — the CMS source-of-truth for a brand's OWN products (Models, Vector, KMS, …) that docs.<brand>, the console sidebar, and pricing derive from. |
|
claim
Package claim wires the order-claim HTTP surface: CRUD on claims (with their claimed lines) plus the accept / reject decisions.
|
Package claim wires the order-claim HTTP surface: CRUD on claims (with their claimed lines) plus the accept / reject decisions. |
|
costs
Package costs is commerce's vendor-cost / COGS surface — the mirror of the revenue/usage billing package.
|
Package costs is commerce's vendor-cost / COGS surface — the mirror of the revenue/usage billing package. |
|
currency
Package currency is the HTTP surface for the currency reference table: admin CRUD (generic REST) plus a public GET list.
|
Package currency is the HTTP surface for the currency reference table: admin CRUD (generic REST) plus a public GET list. |
|
dashv2
Package dashv2 — login deprecated.
|
Package dashv2 — login deprecated. |
|
draftorder
Package draftorder wires the admin order-builder HTTP surface: CRUD on draft orders and their line items, plus the complete action that converts a draft into a REAL order (models/order) with the same items and total.
|
Package draftorder wires the admin order-builder HTTP surface: CRUD on draft orders and their line items, plus the complete action that converts a draft into a REAL order (models/order) with the same items and total. |
|
exchange
Package exchange wires the order-exchange HTTP surface: CRUD on exchanges plus confirm/cancel transitions.
|
Package exchange wires the order-exchange HTTP surface: CRUD on exchanges plus confirm/cancel transitions. |
|
giftcard
Package giftcard is the HTTP surface for gift cards: base CRUD via rest plus money actions (redeem / balance / void).
|
Package giftcard is the HTTP surface for gift cards: base CRUD via rest plus money actions (redeem / balance / void). |
|
invite
Package invite exposes the commerce paywall's invite-code HTTP surface:
|
Package invite exposes the commerce paywall's invite-code HTTP surface: |
|
metrics
Package metrics is the platform SaaS-operations god-view: the whole business's money, computed IN commerce (the system of record for subscriptions + the usage ledger) so admin.hanzo.ai only renders — never re-aggregates client-side and never calls Stripe directly.
|
Package metrics is the platform SaaS-operations god-view: the whole business's money, computed IN commerce (the system of record for subscriptions + the usage ledger) so admin.hanzo.ai only renders — never re-aggregates client-side and never calls Stripe directly. |
|
plan
Package plan is the SuperAdmin HTTP surface for the platform subscription/DNS plan authority (models/plan) — the editable runtime source of truth for subscription + DNS pricing that admin.hanzo.ai governs.
|
Package plan is the SuperAdmin HTTP surface for the platform subscription/DNS plan authority (models/plan) — the editable runtime source of truth for subscription + DNS pricing that admin.hanzo.ai governs. |
|
producttaxonomy
Package producttaxonomy is the HTTP surface for the product-builder taxonomy: options (+values), categories (hierarchical), tags, types, and the return/refund reason lookups.
|
Package producttaxonomy is the HTTP surface for the product-builder taxonomy: options (+values), categories (hierarchical), tags, types, and the return/refund reason lookups. |
|
promo
Package promo is the platform PLAN promo — the admin-controlled "50% off for a limited time" offer, composed on the existing Promotion model (NOT a parallel model) so the discount that a customer sees on GET /v1/billing/plans is SuperAdmin-configured, never hardcoded in the catalog.
|
Package promo is the platform PLAN promo — the admin-controlled "50% off for a limited time" offer, composed on the existing Promotion model (NOT a parallel model) so the discount that a customer sees on GET /v1/billing/plans is SuperAdmin-configured, never hardcoded in the catalog. |
|
upload
Package upload is the admin surface for merchant asset uploads (product images).
|
Package upload is the admin surface for merchant asset uploads (product images). |
|
Package auth provides authentication utilities including IAM OAuth2/OIDC integration.
|
Package auth provides authentication utilities including IAM OAuth2/OIDC integration. |
|
Package billing embeds the Next.js-built billing admin SPA into the commerce binary.
|
Package billing embeds the Next.js-built billing admin SPA into the commerce binary. |
|
allotment
Package allotment grants a plan's recurring monthly included-usage credit to a tenant's prepaid balance.
|
Package allotment grants a plan's recurring monthly included-usage credit to a tenant's prepaid balance. |
|
bucket
Package bucket is the ONE place that classifies commerce ledger transactions into the three money buckets the console + GPU policy read, and derives the per-bucket balances from the REAL tagged ledger — never a fabricated split.
|
Package bucket is the ONE place that classifies commerce ledger transactions into the three money buckets the console + GPU policy read, and derives the per-bucket balances from the REAL tagged ledger — never a fabricated split. |
|
credit
Package credit holds the canonical starter/welcome-credit policy VALUES.
|
Package credit holds the canonical starter/welcome-credit policy VALUES. |
|
creditledger
Package creditledger is the injection seam for the ONE double-entry credit ledger commerce's billing writes to.
|
Package creditledger is the injection seam for the ONE double-entry credit ledger commerce's billing writes to. |
|
engine
Package engine provides core billing business logic: usage aggregation, payment collection, and subscription lifecycle management.
|
Package engine provides core billing business logic: usage aggregation, payment collection, and subscription lifecycle management. |
|
grant
Package grant implements manual subscription grants — used for gifting Pro subscriptions, comp'ing beta users, and admin overrides.
|
Package grant implements manual subscription grants — used for gifting Pro subscriptions, comp'ing beta users, and admin overrides. |
|
husdindex
Package husdindex is Step 3 of the chain-backed credit ledger: it makes the on-chain HUSD balance the source of truth and the commerce DB a cache.
|
Package husdindex is Step 3 of the chain-backed credit ledger: it makes the on-chain HUSD balance the source of truth and the commerce DB a cache. |
|
husdledger
Package husdledger wires the chain-backed credit ledger (treasury mint service + husdindex projector, Steps 2-3) to commerce's production per-org SQLite stores, and exposes the ONE mint entrypoint (Service.MintCredit) the billing handlers call in place of a direct DB credit write (Step 4).
|
Package husdledger wires the chain-backed credit ledger (treasury mint service + husdindex projector, Steps 2-3) to commerce's production per-org SQLite stores, and exposes the ONE mint entrypoint (Service.MintCredit) the billing handlers call in place of a direct DB credit write (Step 4). |
|
invite
Package invite is the commerce paywall's invite-code engine: a platform-minted code that grants ONE org subscription-free access to the commerce admin.
|
Package invite is the commerce paywall's invite-code engine: a platform-minted code that grants ONE org subscription-free access to the commerce admin. |
|
ledger
Package ledger implements a double-entry accounting ledger for the billing engine.
|
Package ledger implements a double-entry accounting ledger for the billing engine. |
|
paywall
Package paywall is the commerce admin subscription gate.
|
Package paywall is the commerce admin subscription gate. |
|
tier
Package tier defines the tiered credit system for Hanzo billing.
|
Package tier defines the tiered credit system for Hanzo billing. |
|
trial
Package trial implements the new-signup on-ramp: a trialing subscription of the $20/mo entry plan funded with a single unified trial credit.
|
Package trial implements the new-signup on-ramp: a trialing subscription of the $20/mo entry plan funded with a single unified trial credit. |
|
workflows
Package workflows provides Temporal workflow definitions for automated recurring billing, subscription lifecycle management, and dunning retry logic.
|
Package workflows provides Temporal workflow definitions for automated recurring billing, subscription lifecycle management, and dunning retry logic. |
|
Package checkout — admin tenant handlers backed by the hanzo/base store.
|
Package checkout — admin tenant handlers backed by the hanzo/base store. |
|
cmd
|
|
|
api
command
|
|
|
backfill-events
command
Command backfill-events replays commerce's EXISTING subscriptions, invoices, and api-usage transactions into the analytics collector (commerce.events) as lifecycle events — so admin.hanzo.ai's warehouse-backed billing views show real HISTORY, not just events emitted from now on.
|
Command backfill-events replays commerce's EXISTING subscriptions, invoices, and api-usage transactions into the analytics collector (commerce.events) as lifecycle events — so admin.hanzo.ai's warehouse-backed billing views show real HISTORY, not just events emitted from now on. |
|
commerce
command
|
|
|
commerce-encrypt-dbs
command
Command commerce-encrypt-dbs converts commerce's PLAINTEXT per-tenant SQLite stores (users/<id>/data.db, orgs/<id>/data.db) to the ENVELOPED, SQLCipher- encrypted layout the daemon opens under COMMERCE_KMS_MASTER_KEY.
|
Command commerce-encrypt-dbs converts commerce's PLAINTEXT per-tenant SQLite stores (users/<id>/data.db, orgs/<id>/data.db) to the ENVELOPED, SQLCipher- encrypted layout the daemon opens under COMMERCE_KMS_MASTER_KEY. |
|
commerced
command
Tracing bootstrap — this is the ONE way a Hanzo Go daemon emits spans: one call, one service name, so the console's per-product Monitoring tab (which filters by service name) lights up for this product.
|
Tracing bootstrap — this is the ONE way a Hanzo Go daemon emits spans: one call, one service name, so the console's per-product Monitoring tab (which filters by service name) lights up for this product. |
|
grant
command
Package main implements commerce-grant — a CLI for manually granting subscriptions to users (e.g.
|
Package main implements commerce-grant — a CLI for manually granting subscriptions to users (e.g. |
|
sbom-scan
command
Command sbom-scan clones Hanzo GitHub repos, runs git blame analysis, and produces SBOMEntry + Contributor records for OSS revenue sharing payouts.
|
Command sbom-scan clones Hanzo GitHub repos, runs git blame analysis, and produces SBOMEntry + Contributor records for OSS revenue sharing payouts. |
|
development
command
|
|
|
production
command
|
|
|
sandbox
command
|
|
|
staging
command
|
|
|
test
command
|
|
|
cron
|
|
|
payout/contributor
Package contributor executes the OSS contributor revenue sharing payouts.
|
Package contributor executes the OSS contributor revenue sharing payouts. |
|
Package db provides a multi-layer database abstraction supporting: - User-level SQLite with sqlite-vec for personal data and vector search - Organization-level SQLite for shared tenant data - Hanzo Datastore (DATASTORE_URL) for deep analytics and parallel queries
|
Package db provides a multi-layer database abstraction supporting: - User-level SQLite with sqlite-vec for personal data and vector search - Organization-level SQLite for shared tenant data - Hanzo Datastore (DATASTORE_URL) for deep analytics and parallel queries |
|
Package delay provides a task queue abstraction for background job execution.
|
Package delay provides a task queue abstraction for background job execution. |
|
demo
|
|
|
Package events provides a thin HTTP client for the analytics collector.
|
Package events provides a thin HTTP client for the analytics collector. |
|
Package hooks provides event types for the hook system.
|
Package hooks provides event types for the hook system. |
|
Package infra provides unified infrastructure clients for Commerce.
|
Package infra provides unified infrastructure clients for Commerce. |
|
metering
module
|
|
|
deploy
module
|
|
|
proxy
module
|
|
|
Package middleware provides HTTP middleware for the Commerce API.
|
Package middleware provides HTTP middleware for the Commerce API. |
|
iammiddleware
Package iammiddleware is the gateway-trust shim for legacy call sites.
|
Package iammiddleware is the gateway-trust shim for legacy call sites. |
|
Package mintauth is the ONE structural money-mint invariant for the commerce ledger: a write that MINTS spendable balance (credits the gateway-honored IAM-user wallet without a funded source) is refused unless its persistence context is authorized to mint.
|
Package mintauth is the ONE structural money-mint invariant for the commerce ledger: a write that MINTS spendable balance (credits the gateway-honored IAM-user wallet without a funded source) is refused unless its persistence context is authorized to mint. |
|
models
|
|
|
approval
Package approval is the B2B spend-approval domain: before a company's (models/company) cart converts to an order, it can require sign-off from an admin or sales manager.
|
Package approval is the B2B spend-approval domain: before a company's (models/company) cart converts to an order, it can require sign-off from an admin or sales manager. |
|
catalogentry
Package catalogentry is the CMS source-of-truth for the platform product catalog — the single list docs.<brand>, the console sidebar, and pricing all derive from.
|
Package catalogentry is the CMS source-of-truth for the platform product catalog — the single list docs.<brand>, the console sidebar, and pricing all derive from. |
|
claim
Package claim is the order-claim domain (Medusa v2 core parity: order claims): a customer reports a problem with delivered items (damaged, wrong, missing) and the merchant resolves it with either a refund or a replacement order.
|
Package claim is the order-claim domain (Medusa v2 core parity: order claims): a customer reports a problem with delivered items (damaged, wrong, missing) and the merchant resolves it with either a refund or a replacement order. |
|
claimitem
Package claimitem is a single claimed line of an order claim: it references one order line item (by ItemId — the order LineItem.Id(), i.e.
|
Package claimitem is a single claimed line of an order claim: it references one order line item (by ItemId — the order LineItem.Id(), i.e. |
|
company
Package company is the B2B company domain: a customer organization that buys through the store.
|
Package company is the B2B company domain: a customer organization that buys through the store. |
|
couponredemption
Package couponredemption is the once-per-user redemption guard for coupons.
|
Package couponredemption is the once-per-user redemption guard for coupons. |
|
currency
Package currency is the currency entity domain: the reference table of the currencies a store accepts, addressable by ISO-4217 Code.
|
Package currency is the currency entity domain: the reference table of the currencies a store accepts, addressable by ISO-4217 Code. |
|
draftorder
Package draftorder is the admin order-builder domain (Medusa v2 parity: admin/draft-orders).
|
Package draftorder is the admin order-builder domain (Medusa v2 parity: admin/draft-orders). |
|
draftorderitem
Package draftorderitem is one line of a draft order (Medusa v2 parity: admin/draft-orders items).
|
Package draftorderitem is one line of a draft order (Medusa v2 parity: admin/draft-orders items). |
|
employee
Package employee is the B2B buyer domain: a person who purchases on behalf of a company (models/company).
|
Package employee is the B2B buyer domain: a person who purchases on behalf of a company (models/company). |
|
exchange
Package exchange is the order-exchange domain (Medusa v2 core parity): an exchange pairs a return of inbound items on an order with outbound replacement items.
|
Package exchange is the order-exchange domain (Medusa v2 core parity): an exchange pairs a return of inbound items on an order with outbound replacement items. |
|
giftcard
Package giftcard is the gift-card domain: a prepaid, code-addressable balance an org issues and a customer redeems against orders.
|
Package giftcard is the gift-card domain: a prepaid, code-addressable balance an org issues and a customer redeems against orders. |
|
giftcardredemption
Package giftcardredemption is the append-only debit ledger for gift cards.
|
Package giftcardredemption is the append-only debit ledger for gift cards. |
|
husdcursor
Package husdcursor persists the HUSD indexer's scan position: the last block fully projected into the ledger, per chain.
|
Package husdcursor persists the HUSD indexer's scan position: the last block fully projected into the ledger, per chain. |
|
husdissuance
Package husdissuance is the durable, idempotent record of ONE treasury HUSD mint in the chain-backed credit ledger.
|
Package husdissuance is the durable, idempotent record of ONE treasury HUSD mint in the chain-backed credit ledger. |
|
husdsettlement
Package husdsettlement is the audit record of ONE org→treasury HUSD settlement: the on-chain sweep that reconciles an org's on-chain balance back down to its off-chain ledger balance after metered usage (and reclaimed/expired grants) drew it down.
|
Package husdsettlement is the audit record of ONE org→treasury HUSD settlement: the on-chain sweep that reconciles an org's on-chain balance back down to its off-chain ledger balance after metered usage (and reclaimed/expired grants) drew it down. |
|
idempotencykey
Package idempotencykey is a reusable idempotency guard for money-moving HTTP requests (refunds, captures, payouts).
|
Package idempotencykey is a reusable idempotency guard for money-moving HTTP requests (refunds, captures, payouts). |
|
order
Package order provides the Order model with support for the new db.DB interface.
|
Package order provides the Order model with support for the new db.DB interface. |
|
ossaccrual
Package ossaccrual is the payout-accrual ledger for the SBOM-driven OSS developer payout system.
|
Package ossaccrual is the payout-accrual ledger for the SBOM-driven OSS developer payout system. |
|
product
Package product provides model initialization and query helpers for the v2 Product model.
|
Package product provides model initialization and query helpers for the v2 Product model. |
|
productcategory
Package productcategory is the hierarchical product category tree (Medusa v2 parity: product-category).
|
Package productcategory is the hierarchical product category tree (Medusa v2 parity: product-category). |
|
productoption
Package productoption is a product's option axis (e.g.
|
Package productoption is a product's option axis (e.g. |
|
productoptionvalue
Package productoptionvalue is one value of a product option (e.g.
|
Package productoptionvalue is one value of a product option (e.g. |
|
producttag
Package producttag is a free-form product tag (Medusa v2 parity: product-tag).
|
Package producttag is a free-form product tag (Medusa v2 parity: product-tag). |
|
producttype
Package producttype is a product type classification (Medusa v2 parity: product-type).
|
Package producttype is a product type classification (Medusa v2 parity: product-type). |
|
quote
Package quote is the B2B request-for-quote domain: a company (models/company) negotiates the price of a draft order with the merchant.
|
Package quote is the B2B request-for-quote domain: a company (models/company) negotiates the price of a draft order with the merchant. |
|
refundreason
Package refundreason is the refund-reason lookup (Medusa v2 parity: refund-reason) — the categorized reason a payment was refunded.
|
Package refundreason is the refund-reason lookup (Medusa v2 parity: refund-reason) — the categorized reason a payment was refunded. |
|
returnreason
Package returnreason is the return-reason lookup (Medusa v2 parity: return-reason) — the categorized reason a customer returns an item.
|
Package returnreason is the return-reason lookup (Medusa v2 parity: return-reason) — the categorized reason a customer returns an item. |
|
sbomrecord
Package sbomrecord stores the Software Bill of Materials emitted for a deployed image.
|
Package sbomrecord stores the Software Bill of Materials emitted for a deployed image. |
|
user/v2
Package user provides the User model using the new db.DB interface.
|
Package user provides the User model using the new db.DB interface. |
|
Package ossattr is the pure, deterministic attribution core of the SBOM-driven OSS-developer payout system.
|
Package ossattr is the pure, deterministic attribution core of the SBOM-driven OSS-developer payout system. |
|
Package ossfunding resolves an OSS package (by PURL) to a payout target — where the money for that package should go.
|
Package ossfunding resolves an OSS package (by PURL) to a payout target — where the money for that package should go. |
|
Package payment provides per-org payment processor configuration.
|
Package payment provides per-org payment processor configuration. |
|
providers
Package providers is a convenience package that imports all payment provider packages, ensuring they are available for the processor registry.
|
Package providers is a convenience package that imports all payment provider packages, ensuring they are available for the processor registry. |
|
providers/bitpay
Package bitpay implements the BitPay payment processor for Commerce.
|
Package bitpay implements the BitPay payment processor for Commerce. |
|
providers/circle
Package circle implements the Circle Payments API processor for Commerce.
|
Package circle implements the Circle Payments API processor for Commerce. |
|
providers/coinbase_commerce
Package coinbase_commerce implements the Coinbase Commerce payment processor for Commerce.
|
Package coinbase_commerce implements the Coinbase Commerce payment processor for Commerce. |
|
providers/moonpay
Package moonpay implements the MoonPay on-ramp processor for Commerce.
|
Package moonpay implements the MoonPay on-ramp processor for Commerce. |
|
providers/opennode
Package opennode implements the OpenNode (Lightning) payment processor for Commerce.
|
Package opennode implements the OpenNode (Lightning) payment processor for Commerce. |
|
providers/solanapay
Package solanapay implements the Solana Pay payment processor for Commerce.
|
Package solanapay implements the Solana Pay payment processor for Commerce. |
|
providers/square
Package square is the unified Square payment provider.
|
Package square is the unified Square payment provider. |
|
providers/stripe
Package stripe — catalog (Products and Prices) helpers used by the plan seeder.
|
Package stripe — catalog (Products and Prices) helpers used by the plan seeder. |
|
router
Package router provides an intelligent multi-processor payment routing layer.
|
Package router provides an intelligent multi-processor payment routing layer. |
|
x402
Package x402 implements the x402 Payment Protocol (LP-3028) for HTTP-native crypto payments using the 402 Payment Required status code.
|
Package x402 implements the x402 Payment Protocol (LP-3028) for HTTP-native crypto payments using the 402 Payment Required status code. |
|
pkg
|
|
|
auth
Package auth wires gateway-supplied identity headers (X-Org-Id, X-User-Id, X-User-Email) into request context.
|
Package auth wires gateway-supplied identity headers (X-Org-Id, X-User-Id, X-User-Email) into request context. |
|
org
Package org resolves — and memoizes — the organization a request acts on behalf of.
|
Package org resolves — and memoizes — the organization a request acts on behalf of. |
|
husd-treasury-addr
command
Command husd-treasury-addr prints the EVM address of the HUSD treasury key (env HUSD_TREASURY_KEY).
|
Command husd-treasury-addr prints the EVM address of the HUSD treasury key (env HUSD_TREASURY_KEY). |
|
Package secret recognizes strings that are credentials rather than identifiers.
|
Package secret recognizes strings that are credentials rather than identifiers. |
|
Package seed wires @hanzo/plans entries to payment-processor catalogs.
|
Package seed wires @hanzo/plans entries to payment-processor catalogs. |
|
Package store — hanzo/base seam entry point.
|
Package store — hanzo/base seam entry point. |
|
migrations
Package migrations — commerce-owned base migrations.
|
Package migrations — commerce-owned base migrations. |
|
test
|
|
|
test-integration
|
|
|
thirdparty
|
|
|
cloudflare
Package cloudflare provides a Cloudflare API v4 client for Commerce.
|
Package cloudflare provides a Cloudflare API v4 client for Commerce. |
|
kms
Package kms provides a thin HTTP client for Hanzo KMS secret management.
|
Package kms provides a thin HTTP client for Hanzo KMS secret management. |
|
mercury
Package mercury provides types and utilities for integrating with the Mercury bank API and webhook events.
|
Package mercury provides types and utilities for integrating with the Mercury bank API and webhook events. |
|
paypal/ipn
Reference: https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/
|
Reference: https://developer.paypal.com/webapps/developer/docs/classic/ipn/integration-guide/IPNIntro/ |
|
ethereum
module
|
|
|
Package treasury is the chain-backed credit ledger's mint authority boundary.
|
Package treasury is the chain-backed credit ledger's mint authority boundary. |
|
datastorestore
Package datastorestore is the production treasury.IssuanceStore: it persists HUSD mint issuances to the per-org SQLite ledger via models/husdissuance.
|
Package datastorestore is the production treasury.IssuanceStore: it persists HUSD mint issuances to the per-org SQLite ledger via models/husdissuance. |
|
Package ui exposes the built admin-commerce (Hanzo GUI v7) bundle as an embedded filesystem.
|
Package ui exposes the built admin-commerce (Hanzo GUI v7) bundle as an embedded filesystem. |
|
util
|
|
|
cache
Package cache (memcache.go) provides a caching abstraction layer that can work with different backends (in-memory, Redis, etc.) to replace appengine/memcache.
|
Package cache (memcache.go) provides a caching abstraction layer that can work with different backends (in-memory, Redis, etc.) to replace appengine/memcache. |
|
husd
Package husd is the ONE place that configures on-chain HUSD (Hanzo USD stablecoin, ERC-20 on the Hanzo EVM) operations and converts USD cents to and from the token's base units.
|
Package husd is the ONE place that configures on-chain HUSD (Hanzo USD stablecoin, ERC-20 on the Hanzo EVM) operations and converts USD cents to and from the token's base units. |
|
nscontext
Package nscontext provides namespace context functionality that replaces google.golang.org/appengine.Namespace.
|
Package nscontext provides namespace context functionality that replaces google.golang.org/appengine.Namespace. |
|
search
Package search provides a search abstraction layer with pluggable backends.
|
Package search provides a search abstraction layer with pluggable backends. |
|
slug
Package slug transforms strings into a normalized form well suited for use in URLs.
|
Package slug transforms strings into a normalized form well suited for use in URLs. |