Code Monkey home page Code Monkey logo

go-pay-sea-cfx's Introduction

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"
}

go-pay-sea-cfx's People

Contributors

teukuamru avatar

Stargazers

Bryanza avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.