@nemild
In JS, it's one line of code:
app.use("/your-route", payMiddleware("$0.10", myAddress));
How it works:
- Client requests something
- Client gets a 402 response
- Client responds with a signed payment
- (Server does work and broadcasts transaction)
- Client gets response