Files
kits/packages/paykit/package.json
CatoandClaude 0474c3a887 paykit 0.7.0: prepaid credit, top-ups, auto top-up and per-key limits (#31)
Pay as you go beside the subscriptions, the way OpenRouter charges:

- ./credits: append-only CreditLedger with idempotency keys and an
  in-memory ledger; balance, FIFO lots and debt; charge refused with 402
  below the app's floor or over a spending key's daily/weekly/monthly
  limit; hold then settle or release; top-up quotes with a fee per rail
  in integer arithmetic; refund eligibility (window, fee kept, rails that
  never refund); expiry of old lots; auto top-up decision with backoff
  and a failure cap; credit events applied idempotently; top-ups through
  any PaymentProvider (OrangeCat: sats, never refundable).
- ./stripe: stripeCredits — top-up Checkout Session (saves the method
  off-session when auto top-up is on), off-session PaymentIntent with an
  Idempotency-Key, refunds, and webhook mapping for
  checkout.session.completed, payment_intent.succeeded/payment_failed
  and charge.refunded. The pass provider ignores top-up sessions.
- ./react: CreditBalance, TopUp, AutoTopUp, CreditActivity; PickerTier
  gains optional rates for a pay-as-you-go tier.

No price, fee or threshold is built in; all are the app's config.


Claude-Session: https://claude.ai/code/session_019MDtmtfseicWGK2CMC2U5r

Co-authored-by: Claude <noreply@anthropic.com>
2026-12-03 13:07:29 +01:00

99 lines
2.6 KiB
JSON

{
"name": "@bitbaum/paykit",
"version": "0.7.0",
"description": "Let a website get paid without holding the money. Say what is offered at what price and keep a waitlist until it can be bought; sell time-boxed passes, renewing subscriptions and prepaid credit (top-ups, auto top-up, per-key limits) through a payment provider (Bitcoin through an OrangeCat account; cards, TWINT and wallets through a Stripe account), classify a pasted Bitcoin receive string, and record a shown code (Twint, another currency) the visitor pays in their own app. Ships the plan screens as React components (`@bitbaum/paykit/react`).",
"license": "MIT",
"author": "Mao Nakamoto",
"homepage": "https://bitbaum.orangecat.ch/packages/paykit/",
"repository": {
"type": "git",
"url": "git+https://github.com/bitbaum/paykit.git"
},
"bugs": {
"url": "https://github.com/bitbaum/paykit/issues"
},
"keywords": [
"bitcoin",
"lightning",
"payments",
"headless",
"checkout",
"webhook",
"orangecat",
"stripe",
"twint",
"pricing",
"waitlist",
"subscription",
"credits",
"react"
],
"type": "module",
"sideEffects": [
"*.css"
],
"packageManager": "pnpm@11.25.0",
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public"
},
"files": [
"dist",
"styles.css"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./checkout": {
"types": "./dist/checkout/index.d.ts",
"default": "./dist/checkout/index.js"
},
"./plans": {
"types": "./dist/plans/index.d.ts",
"default": "./dist/plans/index.js"
},
"./credits": {
"types": "./dist/credits/index.d.ts",
"default": "./dist/credits/index.js"
},
"./orangecat": {
"types": "./dist/orangecat/index.d.ts",
"default": "./dist/orangecat/index.js"
},
"./stripe": {
"types": "./dist/stripe/index.d.ts",
"default": "./dist/stripe/index.js"
},
"./react": {
"types": "./dist/react/index.d.ts",
"default": "./dist/react/index.js"
},
"./styles.css": "./styles.css"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "node --test test/*.test.js",
"verify": "pnpm run typecheck && pnpm run build && pnpm test"
},
"peerDependencies": {
"react": ">=18"
},
"peerDependenciesMeta": {
"react": {
"optional": true
}
},
"devDependencies": {
"@types/node": "^26.4.1",
"typescript": "^6.0.3",
"@types/react": "^19.2.18",
"react": "^19.2.8",
"react-dom": "^19.2.8"
}
}