Skip to content
/ TradePro Public

RESTful web service consuming and analyzing data from trade transactions.

Notifications You must be signed in to change notification settings

tutak/TradePro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TradePro

TradePro is a Message Trade Processor which consists of four components:

  • RESTful web service - consumer_ws.php
  • Message processor - processor.php
  • Database component - database.php
  • Frontend component - frontend.php

Message data, in JSON format, is POSTed to the web service, which after initial controls passes the data to the message processor. The message processor validates the data and inserts it in the MySQL database using the database component. The frontend uses Google charts to give a glimpse of the data in the database. Data is passed to the frontend using the database component.

How to call the web service

Regardless of how the web service is called, the JSON must have the following structure.

JSON format:

{"userId": "INTEGER", "currencyFrom": "CURRENCY_CODE", "currencyTo": "CURRENCY_CODE", "amountSell":INTEGER, "amountBuy": DECIMAL, "rate": INTEGER, "timePlaced" : "D-M-Y H:M:S", "originatingCountry" : "COUNTRY_CODE"}

  1. Using cURL

JSON_DATA is the JSON having the above structure.

curl -X POST -H "application/json" -d 'JSON_DATA' http://146.148.123.175/consumer_ws.php

Example: curl -X POST -H "application/json" -d '{"userId": "5", "currencyFrom": "JPY", "currencyTo": "EUR", "amountSell": 1000, "amountBuy": 37.10, "rate": 14, "timePlaced" : "21-FEB-13 10:27:44", "originatingCountry" : "IE"}' http://146.148.123.175/consumer_ws.php

  1. Using the URL

Simply POST to http://146.148.123.175/consumer_ws.php using the above structure for JSON.

About

RESTful web service consuming and analyzing data from trade transactions.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published