l402_payment_verify
Verifies client-submitted L402 payment tokens by checking the preimage, HMAC signature, and caveats, returning whether the token is valid.
Instructions
Verify an L402 payment token submitted by a client. Checks three layers: 1) preimage proves payment (SHA-256), 2) HMAC signature proves authenticity, 3) caveats (expiry, resource) are satisfied. Returns valid: true/false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | No | L402 token in <macaroon>:<preimage> format (colon-separated) | |
| macaroon | No | base64url-encoded macaroon (alternative to token) | |
| preimage | No | 64-char hex preimage (alternative to token) | |
| resource | No | Expected resource identifier to check against the macaroon caveat |