tollgate

TIP-03 - Http server

draft optional kind=21000 kind=1022 kind=10021


Minimal setup for allowing payments on LAN networks. Default port 2121

POST /

The Server MUST take a http POST request containing a valid Payment event in the request body.

If the TollGate accepts the provided payment it MUST return http 200 OK response where the body is a kind=1022 TollGate Session event.

If the payment is invalid, it MAY return a http 402 Payment Required status.

CURL Request Example (Successful Payment):

curl -X POST http://192.168.1.1:2121/ # TollGate IP
  -H "Content-Type: application/json" \
  -d '{
    "kind": 21000,
    ...
  }'

Response Example (Successful Payment):

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 456

{
  "kind": 1022,
  ...
}

Response Example (Invalid Payment):

HTTP/1.1 402 Payment Required
Content-Type: text/plain
Content-Length: 15

This mint is not accepted

GET /

A GET request on the root endpoint MAY return http 200 OK response where the body is a kind=10021 TollGate Discovery event.

CURL Request Example:

curl -X GET http://192.168.1.1:2121/ # TollGate IP

Response Example:

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 398

{
  "kind": 10021,
  ...
}