Sellers can turn on checkout tax in settings (label, own country and tax
ID, legal name, per-country rates, default rate, EU reverse charge).
Sessions add tax on top of the net price after any promo, so onchain
verification expects the tax-inclusive total. Buyers set billing country
and VAT ID via the API (billingCountry, vatId) or on the hosted checkout
until a payment is recorded; EU cross-border B2B with a VAT ID of the
right shape is zero-rated. Settled checkouts get a PDF receipt (pdfkit)
with the seller's tax ID, buyer country / VAT ID, tax rate and the
settlement transaction, linked from the success page, the receipt email
and the customer portal. packages/tax calculateTax is now used at
checkout.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coupons now reach checkout. POST /v1/checkout-sessions takes an optional
couponCode, payment links accept ?promo=CODE (a refused code falls back to
full price with a notice), and the hosted checkout gets a promo field
while the session is open and unpaid. The discounted total becomes the
session amount before network bindings, so onchain verification expects
the discounted amount and a locked Zcash quote is re-priced. Codes are
tenant-scoped, product-scoped codes discount only their products, and
free-trial or 100% codes are refused. The redemption is counted once
after the payment confirms (API confirm and hosted checkout).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- checkout: buyers connect Discord (OAuth2 identify + guilds.join) in the
delivery-fields step; the callback saves their user id on the session and
joins them to the product's server. After payment the bot adds the role via
PUT /guilds/{guild}/members/{user}/roles/{role}; the grant is recorded for
access-sync revocation. Without DISCORD_BOT_TOKEN the buyer sees
"pending setup" instead of a fake success.
- worker: discord-delivery-retry grants pending Discord entitlements once the
bot is configured (backoff per entitlement); DISCORD_BOT_TOKEN is optional.
- api: a configured bot delivers roles even before GitHub is set up;
checkout subscriptions pass the buyer's Discord / GitHub ids so subscription
delivery reaches the right accounts.
- dashboard: product settings explain server / role ids and link the bot invite.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Recurring checkouts (/c and /l links) offer Subscribe on the session's network:
smart-wallet spend permission, Permit2 capped allowance, Solana SPL delegate or
renewal invoices by email (HyperCore / Zcash). The page states the per-period
price, total cap and expiry before signing; the buyer's wallet (EIP-6963 /
Wallet Standard) sends prerequisite calls and signs the server-built grant,
and the API activates it, charges the first period and delivers access.
Buyers get a signed /s/<token> manage page with status, next charge, charges
with explorer links, cancel and an on-chain revoke. All billing calls go
server-side through /v1/onchain-billing with the service token.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The evm/payer route bound any address without proof, so anyone holding the
session URL could lock the buyer out. The buyer's wallet now personal_signs
a short-lived message naming the session, network and payer; the server
verifies it with viem (ECDSA locally, EIP-1271/6492 through the chain RPC
for smart wallets). Unsigned requests never bind or rebind a payer; a new
valid signature may rebind so the real buyer can always recover.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Any token (replaces the BridgePay/LocalAppKitSdk simulation, now deleted):
- lib/any-token.ts: Relay/LI.FI router from ROUTING_* env, per-session
destination (the token the verifier checks), policy-checked EXACT_OUTPUT
quotes stored as session.route, status polling that settles ONLY through
recordAndConfirm on the destination fill (routed fills skip the payer and
memo bindings, never payTo/amount/token/time); provider success without a
qualifying transfer is reported as unverified and stays unpaid
- routes [sessionId]/route/{quote,status} with the same-origin guard
- AnyTokenPay: origin chain + token picker, fees and quote TTL, EIP-6963
execution of the provider's transactions, deposit-address QR fallback,
progress, refund notice
- network changes are locked while a route moves funds; a payment confirmed
by the worker now completes and fulfils the session on the next confirm
HyperCore: runtime (HYPERCORE_*), usdSend params/submit/status routes,
HyperCorePay (wallet signs usdSend, manual hash fallback), verify-payment
case, network options, explorer links.
Tempo: evm params expose memoRequired; sessions with requireMemo only settle
with transferWithMemo(keccak256(sessionId)).
Per-network payment components are lazy-loaded; the Arc demo wallet is
labelled as a simulation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST [sessionId]/network switches between accepted, configured networks
only while open and unpaid; pins payTo per network, clears the payer,
adds a Solana reference and locks a ZEC quote (kept while live)
- GET evm/params (registry chain, public RPC for wallet_addEthereumChain,
exact base units, Tempo memo) and POST evm/payer (payer binding)
- POST zcash/uri (ZIP-321 request) and GET zcash/status (claimed txid or
cached address scan, confirming / review / paid)
- same-origin guard on state-changing routes; error bodies carry a code
- demo seed sessions accept every chain; the placeholder EVM address is
only offered on testnets, Solana/Zcash only with configured addresses
- tests: evm-confirm, zcash-confirm, network-select
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- POST solana/pay-url saves buyer fields, returns transfer-request QR
payload + transaction-request link bound to the session reference
- GET/POST solana/tx: Solana Pay transaction request; server builds the
unsigned USDC tx (ATA create-idempotent + TransferChecked + reference)
- GET solana/status: finds the payment by reference, verifies, confirms
and delivers once (idempotent, safe to poll)
- SolanaPay component: uqr QR, Wallet Standard connect +
solana:signAndSendTransaction, 2s polling, paid state with Solscan link
- checkout page renders SolanaPay for Solana sessions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- recordAndConfirm verifies every network on-chain (Solana via
@settlekit/solana, Arc via @settlekit/arc) and fails closed when a
network has no configured verifier; Solana requires the session
reference
- network-aware tx hash validation on the confirm route and form
- duplicate tx hash (lookup or unique violation) -> 409 conflict
- confirmFromReference finds Solana Pay payments by reference, idempotent
- fulfillment runs once per confirmed payment: entitlement row via
@settlekit/entitlements plus a real GitHub App invite
(grantGitHubRepoAccess); missing GitHub App env shows pending setup,
never a fabricated invite link
- receipts carry explorer links (Solscan for Solana)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>