Skip to content

Transaction

Lars Westermann edited this page Jan 30, 2020 · 3 revisions

Authentication

Authorize by bar-/qr-code

{
    "type": "barcode",
    "code": "0000000"
}

Authorize by nfc-card

{
    "type": "nfc",
    "id": "00-00-00-00:00-00-00-00-00-00"
}

Authorize by nfc-card with challenge-response

{
    "type": "nfc-secret",
    "id": "00-00-00-00:00-00-00-00-00-00",
    "challenge": "<<challenge from server>>",
    "response": "<<calculated response>>"
}

/api/v1/transaction/token

Request an auth token for a payment

POST

Request Body

{
    "amount": 420,
    "method": <<Authentication>>
}

Response body

Authroization successful

{
    "type": "authorized",
    "token": "<<auth token>>"
}

nfc card needs challenge-response authentication

{
    "type": "authentication-needed",
    "id": "00-00-00-00:00-00-00-00-00-00",
    "key": "<<encryption key for nfc card>>",
    "challenge": "<<challenge from server>>"
}

/api/v1/transaction/payment

Request a payment with the given auth token

POST

Request Body

{
    "amount": 420,
    "taken": "<<auth token>>",
    "products": {
        "<<product-id>>": 1
    }
}

Response body

{
    "account": <<Account>>,
    "transaction": <<Transaction>>
}