Skip to content

teukuamru/go-pay-sea-cfx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Account API List

Balance API List

Transaction API List

Create Account

URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/rest-auth/registration/

Example Request Body:

{
    "username": "compfestx",
    "password1": "admin12345",
    "password2": "admin12345"
}

Example Response Body:

{
    "key": "e4a218f4ea58b269762981694844521889d545c7"
}

Get Account Details

URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/accounts/<username>/

Example: https://go-pay-sea-cfx.herokuapp.com/api/accounts/compfest/

Example Response Body:

{
    "id": 2,
    "username": "compfest"
}

Login

URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/rest-auth/login/

Example Request Body:

{
    "username": "compfest",
    "password": "admin12345"
}

Example Response Body:

{
    "key": "e4a218f4ea58b269762981694844521889d545c7",
    "id": 1,
    "username": "compfest"
}

Create Balance

URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/accounts/<username>/balance/create/

Example: https://go-pay-sea-cfx.herokuapp.com/api/accounts/compfest/balance/create/

NO REQUEST BODY

Example Response Body:

{
    "id": 1,
    "go_pay_balance": 0,
    "user": "compfest"
}

Get Balance Details

URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/accounts/<username>/balance/

Example: https://go-pay-sea-cfx.herokuapp.com/api/accounts/compfest/balance/

Example Response Body:

{
    "id": 1,
    "go_pay_balance": 0,
    "user": "compfest"
}

Create Transaction

URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/transactions/

Example Request Body:

{
    "user": "compfest",
    "changed_balance": -10000,
    "description": "jalan jalan"
}

Example Response Body:

{
    "id": 1,
    "changed_balance": -10000,
    "description": "jalan jalan",
    "finished": false,
    "user": "compfest"
}

Get Transaction Details

URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/transactions/<transaction_id>/

Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/1/

Example Response Body:

{
    "id": 1,
    "changed_balance": 100000,
    "description": "top up",
    "finished": false,
    "user": "compfest"
}

Finish Transaction

URL: PUT - https://go-pay-sea-cfx.herokuapp.com/api/transactions/<transaction_id>/

Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/1/

Example Request Body:

{
    "finished": true
}

Example Response Body:

{
    "id": 1,
    "changed_balance": -10000,
    "description": "jalan jalan",
    "finished": true,
    "user": "compfest"
}

Cancel Transaction

URL: DELETE - https://go-pay-sea-cfx.herokuapp.com/api/transactions/<transaction_id>/

Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/1/

RETURN HTTP 204 No Content

List Transactions By Username

URL: GET - https://go-pay-sea-cfx.herokuapp.com/api/transactions/all/<username>/

Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/all/compfest/

Example Response Body:

[
    {
        "id": 2,
        "user": "compfest",
        "changed_balance": 20000,
        "description": "top up"
    },
    {
        "id": 1,
        "user": "compfest",
        "changed_balance": -10000,
        "description": "jalan jalan"
    }
]

Top Up Balance

URL: POST - https://go-pay-sea-cfx.herokuapp.com/api/transactions/top-up/<username>/

Example: https://go-pay-sea-cfx.herokuapp.com/api/transactions/top-up/compfest/

Example Request Body:

{
    "changed_balance": 10000,
    "description": "top up boy"
}

Example Response Body:

{
    "id": 3,
    "changed_balance": 10000,
    "description": "top up boy",
    "finished": true,
    "user": "compfest"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages