Skip to content

feat: payment-gated resources with balance verification#242

Merged
melvincarvalho merged 1 commit intogh-pagesfrom
issue-241-payment-demo
Mar 26, 2026
Merged

feat: payment-gated resources with balance verification#242
melvincarvalho merged 1 commit intogh-pagesfrom
issue-241-payment-demo

Conversation

@melvincarvalho
Copy link
Copy Markdown
Contributor

Wire HTTP 402 payment conditions to the webledger balance system.

When an ACL contains a PaymentCondition, the server:

  1. Checks the agent's balance in the webledger
  2. If sufficient — deducts cost and grants access (200)
  3. If insufficient — returns 402 with payment details

Works with any agent URI (did:nostr, WebID). Includes demo script for testnet4 payment-gated article.

Builds on #240. Closes #241.

When a PaymentCondition is present in an ACL, the server now checks
the agent's balance in the webledger. If sufficient, deducts the cost
and grants access. If insufficient, returns 402 with payment details.

Works with any agent URI (did:nostr, WebID, etc).

Includes demo script for testnet4 payment-gated article.

Closes #241
@melvincarvalho melvincarvalho merged commit d8e4469 into gh-pages Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

demo: testnet4 payment-gated article

1 participant