interledger / receipt-verifier

Handles ILP STREAM receipts
Apache License 2.0
11 stars 2 forks source link

Receipt Verifier

Manages Interledger STREAM receipts

npm version

STREAM receipts allow recipients or third parties to verify received payments at the recipient's Interledger wallet.

The Receipt Verifier:

  1. pre-shares a secret key with the receiving wallet for generating receipts, by acting as a proxy for SPSP queries to the recipient's payment pointer
  2. verifies receipts

For Web Monetization, website visitors submit receipts to the website in monetizationprogress events. The website backend can send receipts to the Receipt Verifier to confirm the payment.

Run

npm install
npm run-script build
sudo docker run -p 6379:6379 -d redis
npm start

Environment Variables

PORT

RECEIPT_SEED

RECEIPT_TTL

REDIS_URI

SPSP_ENDPOINTS_URL

API Documentation

GET / Accept: application/spsp4+json

Adds receipt headers to SPSP request and proxies it to the receiver's SPSP endpoint.

If SPSP_ENDPOINTS_URL is configured, the request is proxied to the SPSP endpoint returned by the SPSP_ENDPOINTS_URL.

Otherwise, the SPSP query is proxied to the URL encoded payment pointer or SPSP endpoint in the path of the SPSP request URL.

POST /verify

Verifies receipt and returns value

Request Body:
Return Value:
Field Name Type Description
amount string Amount by which this receipt exceeds the previously verified receipt's totalReceived
id string OPTIONAL The URI decoded id that was used in the request to the SPSP_ENDPOINTS_URL
spspEndpoint string SPSP endpoint to which the payment was sent