Git Product home page Git Product logo

pypayments's Introduction

Install/run

in a Python3 virtualenv

pip install -r requirements.txt

Run the tests:

py.test

Run the server:

hug -f payments.py

There're 3 api endpoints:

http://localhost:8000/accounts

This will return all the accounts (with their name, email, balance)

http://localhost:8000/transactions?account_id=2

This will return all the transactions involving a single account

http://localhost:8000/pay?source=1&recipient=2&amount=1

This will make a payment, while respecting the constraints (source and recipient have to exist, no negative balance)

By accessing http://localhost:8000/index the Elm frontend can be used to interact with the api

To rebuild index.html simply run

elm-make frontend/Main.elm

pypayments's People

Contributors

berdario 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.