l402-pay
Confirm a pending L402 payment and store credentials so subsequent requests succeed. Polls the payment server for settlement, then caches the credential for future use.
Instructions
Confirm payment and store credentials. Call this after l402-fetch returns a 402 with a paymentHash — polls the payment server for settlement (up to 30s for human wallet), then stores the credential so the next l402-fetch succeeds. For human wallets, call this immediately after showing the payment URL to the user.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | Payment method override. Defaults to wallet priority: NWC > Cashu > LNURLcash > human. | |
| invoice | No | BOLT-11 invoice to pay. Optional if paymentHash matches a cached challenge from l402-discover. | |
| macaroon | No | Macaroon from the L402 challenge. Optional if paymentHash matches a cached challenge. | |
| paymentHash | No | Payment hash to look up cached challenge from l402-discover. |