Skip to content

shkov/wallet-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wallet-service

This is RESTful API service that provides some abilities of making payments between accounts.

Installing

Run make run and compose will start the app with all dependencies(postgresql):

Usage examples:

  1. POST /api/v1/payments applies the new payment to accounts. Note: if there is no "from" account in the system, it is considered that it has a balance of 1000.
curl --request POST \
  --url http://127.0.0.1:80/api/v1/payments \
  --header 'Content-Type: application/json' \
  --data '{
	"Amount": "1000",
	"From": 1,
	"To": 2
}'
  1. GET /api/v1/accounts/{id} returns an account by the given id.
curl --request GET \
  --url http://127.0.0.1:80/api/v1/accounts/1
  1. GET /api/v1/payments/{accountId} returns all payments by the account id.
curl --request GET \
  --url http://127.0.0.1:80/api/v1/payments/1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors