- install requirements
python3.7 -m venv /venv \
&& /venv/bin/pip install -U pip \
&& /venv/bin/pip install --no-cache-dir -r requirements.txt
- run application
/venv/bin/python3 run.py
- build image
docker build -t nuchall .
- run container
docker run -p 5000:5000 nuchall
HTTP Method | URI | Action |
---|---|---|
POST | /api/v1.0/authorize | authorize a transaction |
GET | /api/v1.0/healthcheck | return application status |
GET | /api/v1.0 | Retrieve api version |
POST /api/v1.0/authorize
{
"account": {
"cardIsActive": true,
"limit": "Number",
"denylist": ["string"]
},
"lasttransactions": [
{
"merchant": "String",
"amount": "Number",
"time": "string" // 2019-08-17T11:02:00.000000
}
],
"transaction": {
"merchant": "String",
"amount": "Number"
}
}
{
"approved": "Boolean",
"newLimit": "Number",
"deniedReasons": [
{
"reason": "description of rule"
}
]
}
status: 201 CREATED
GET /api/v1.0
{
"version": "nuchall - Beta API - v1.0"
}
status: 200 OK
GET /api/v1.0/healthcheck
{
"isHealthy": true
}
status: 200 OK
account
{
"cardIsActive": true,
"limit": "Number",
"denylist": ["String"]
}
Transaction
{
"merchant": "String",
"amount": "Number",
"time": "String"
}
LastTransactions
{
"lasttransactions": ["String"]
}
Output
{
"approved": "Boolean",
"newLimit": "Number",
"deniedReasons": ["String"]
}