Money Transfer Api
This is a starter application that has base setup of Play 2.6 with H2 as database. This repository will constantly updated on better changes.
Please see the documentation at https://www.playframework.com/documentation/latest/Home for more details.
Run this using sbt. If you downloaded this project then you’ll find a prepackaged version of sbt in the project directory:
sbt clean run
And then go to http://localhost:9000 to see the running web application.
1) Download the payment-api-1.0.tgz file available in the root of the project. If you clone this repo you will get inside the payment-api main directory.
2) Extract the tar file in a folder of your preference.
tar -xvzf /path/to/payment-api-1.0.tgz
3) You can either navigate to the extracted folder or execute the app from the folder you are.
payment-api-1.0/bin/payment-api -Dplay.http.secret.key=omjigupta
1) Download the payment-api-1.0.zip file available in the root of the project.
2) Extract the zip file in a folder of your preference.
unzip payment-api-1.0.zip
3) Navigate to the extracted folder or execute below command to run it
sh bin/payment-api
By running below command. You can check the test results in the terminal
sbt test
1) Java JDK 1.8
2) Scala SBT 1.2.8
1) Currently, Application is supporting only INR, USD and EUR.
2) Currency conversion values are hardcoded for now. Conversion rates added from exchange.
http://localhost:9000/about
By Hitting above request you will be redirected to my LinkedIn profile
http://localhost:9000/
By Hitting this request you can check application is running or not
http://localhost:9000/v1/accounts/424800/balance
http://localhost:9000/v1/accounts/1234/balance
http://localhost:9000/v1/transactions
{
“senderAccountId”:324800,
“receiverAccountId”:533000,
“amount”:10,
“currency”:”INR”
}
* HTTP Response:

### (POST) Transfers money between cross currency accounts
http://localhost:9000/v1/transactions
* HTTP Request:
```json
POST /v1/transactions HTTP/1.1
Accept: application/json
Host: localhost:9000
{
"senderAccountId":124800,
"receiverAccountId":533000,
"amount":1,
"currency":"EUR"
}
http://localhost:9000/v1/transactions
{
“senderAccountId”:124800,
“receiverAccountId”:533000,
“amount”:1,
“currency”:”USD”
}
* HTTP Response:
You can see selected part of image.

### (POST) Transfers money between cross currency accounts if Sender doesn't have enough fund
http://localhost:9000/v1/transactions
* HTTP Request:
```json
POST /v1/transactions HTTP/1.1
Accept: application/json
Host: localhost:9000
{
"senderAccountId":124800,
"receiverAccountId":533000,
"amount":15,
"currency":"EUR"
}
http://localhost:9000/v1/transactions
{
“senderAccountId”:124800,
“receiverAccountId”:533000,
“amount”:-1,
“currency”:”EUR”
}
* HTTP Response:

### (POST) Transfers Negative money between cross currency accounts
http://localhost:9000/v1/transactions
* HTTP Request:
```json
POST /v1/transactions HTTP/1.1
Accept: application/json
Host: localhost:9000
{
"senderAccountId":324800,
"receiverAccountId":533000,
"amount":10,
"currency":"YEN"
}
http://localhost:9000/v1/transactions
{
“senderAccountId”:3200,
“receiverAccountId”:533000,
“amount”:10,
“currency”:”USD”
}
```