Git Product home page Git Product logo

transfer-api-service's Introduction

Funds Transfer Service API

Description

An online API for funds transfer service. User can retrieve balance and transactions, and send money to other user. Once the transfer processing interrupt, the transaction will be rollback.

Deployment

1.To run shell scripts to setup environment.

# Start mysql docker container and redis docker container, to inject SQL file into MySQLã€
cd Scripts/
sudo bash deployment.sh

2.Run main file to run service

go run main.go

API Reference

Retrieve Transactions

Description
  • User Retrieve Transactions Interface
Request URL
  • http://localhost:8080/api/user/transaction
HTTP Request Method
  • Get
Parameters
Parameter name Type Description Optional
uid string user name Not Null
auth string Authorization Not Null
bankCode string Bank Code Not Null
accountNo string Account Number Not Null
from string IP address Not Null
env string Device info(OS) Optional
page int Transaction Page Optional
Response Representations
  {
    "error_code": 0,
    "data": {
      "uid": <User name>,
	  "requestTime": <Request Time>,
	  "transactions":[
	   {
	   "accountNo": <Account Number>,
	   "targetAccountNo": <Target Account Number>,
	   "amount": <Amount>,
	   "time" : <TransactionsTime>,
	   "status": <Transactions Status>
	   },
	   {
	   "accountNo": <Account Number>,
	   "targetAccountNo": <Target Account Number>,
	   "amount": <Amount>,
	   "time" : <TransactionsTime>,
	   "status": <Transactions Status>
	   },
	   ...
	  ]
	  "transactionPage": 1
    }
  }

Retrieve Balance

Description
  • User Retrieve Balance Interface
Request URL
  • http://localhost:8080/api/user/balance
HTTP Request Method
  • Get
Parameters
Parameter name Type Description Optional
uid string user name Not Null
auth string Authorization Not Null
bankCode string Bank Code Not Null
accountNo string Account Number Not Null
from string IP address Not Null
env string Device info(OS) Optional
Response Representations
  {
    "error_code": 0,
    "data": {
      "uid": <User name>,
	  "accountNo": <Account Number>,
      "balance": <Balance>,
	  "requestTime": <Request Time>,
    }
  }
Property name Type Description
error_code int Error code
data - Response data
uid string User name
accountNo string Account number
balance decimal Account balance
requestTime date Request Time

Funds Transfer

Description
  • Funds Transfer Interface
Request URL
  • http://localhost:8080/api/user/transaction
HTTP Request Method
  • Post
Parameters
Parameter name Type Description Optional
uid string user id Not Null
auth string Authorization Not Null
srcCode string Source bank Code Not Null
accountNo string Source account Number Not Null
targetCode string Target bank Code Not Null
targetAccountNo string Target account Number Not Null
amount decimal Transaction money Not Null
from string IP address Not Null
env string Device info(OS) Optional
Response Representations
  {
    "error_code": 0,
    "data": {
      "responseTime": 100,
      "reqStatus": "success",
	  "src": {
		"serialNo":  <Transaction ID>,
		"srcCode": "BA001",
		"accountNo": <Source Card Number>,
		"targetCode": "BA002",
		"targetAccountNo": <Target Card Number>,
		"amount": <Amount>,
		"uid": <Userid>,
		"from": <Source IP>,
		"env": <Operating System Info>,
		"reqTime": <Request Time>,
	  }
    }
  }
Property name Type Description
error_code int Error code
data - Response data
responseTime int Service response time(ms)
requestStatus stirng Request status
src - Request data

transfer-api-service's People

Contributors

onewon avatar

Watchers

James Cloos avatar  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.