Module: ZeroClick::Sellers::Stateful

Defined in:
lib/zeroclick/sellers/stateful.rb,
lib/zeroclick/sellers/stateful/money.rb,
lib/zeroclick/sellers/stateful/verify.rb,
lib/zeroclick/sellers/stateful/dispatch.rb,
lib/zeroclick/sellers/stateful/contracts.rb,
lib/zeroclick/sellers/stateful/responses.rb,
lib/zeroclick/sellers/stateful/entitlement.rb

Overview

Helpers for STATEFUL sellers — those whose purchases provision a standing account (credits, subscriptions, API keys) rather than settling one call.

Opt-in via require "zeroclick/sellers/stateful": a pay-as-you-go seller never touches these, and the main entry point stays small.

Defined Under Namespace

Modules: Contracts, Dispatch, Entitlement, Money, Responses, Verify Classes: AccessPeriod, CreditMovement, CreditReplay, EntitlementPlan, MintConflict, MintInput, MintKey, MintKeyRequest, MintNotProvisioned, NoCreditDimension, ParseFailure, ParseOk, ParsedEntitlement, StoredCreditGrant, WriteInput, WriteResult

Constant Summary collapse

REMINT_POLICIES =
%w[additive rotating].freeze
MintUnknown =
Class.new
ACCESS_STATUSES =
%w[active suspended].freeze
ISO_DATETIME_RE =

zod v4's iso.datetime({offset: true}) grammar, transcribed verbatim — as the Python and Go SDKs also transcribe it. Seconds and the fraction are optional, the calendar is validated (leap years included), and the zone must be Z or ±HH:MM.

Copied rather than approximated on purpose: an SDK that accepts a timestamp ZeroClick rejects (or the reverse) turns a valid entitlement into a 400 nobody can reproduce.

/
  \A(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00
  |[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])
  |(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))
  T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?
  (?:Z|(?:[+-](?:[01]\d|2[0-3]):[0-5]\d)))\z
/x
ACCESS_LIFECYCLES =
%w[provisioning active].freeze

Class Method Summary collapse

Class Method Details

.handle_access_request(request, **options) ⇒ Object



225
226
227
# File 'lib/zeroclick/sellers/stateful/dispatch.rb', line 225

def self.handle_access_request(request, **options)
  Dispatch.handle_access_request(request, **options)
end