Server API - AbdelrahmanAbdelrazek/Banking-System GitHub Wiki
Client==>Server
Login
LOG:username, password //LOG:abdelrahman, 1234
Logout
LGO:
Deposit
DEP:amount //DEP:600
Withdraw
WTD:amount //WTD:600
Transfer
TRF: RecievingBankName, ToAccountId, ammount //TRF: Alahly, 1200, 500
Get Account Info
INF:
Get Transaction History
HST:numberSkippedRaws
HST:5 //get transaction history skip first 5 rows //first record is 1
==================================================================
Server==>Client (Server Responses)
Login
LOG:0 //login sucess
LOG:1 //login failed
Deposite
DEP:0 //Deposit ok
DEP:1 //Deposit failed
Withdraw
WTD:0 //Withdrow ok
WTD:1 //Withdraw failed
WTD:2 //Not enough balance
Transfer
TRF:0 //Transfer OK
TRF:1 //Transfer Failed
TRF:2 //not enough balance
TRF:3 //bank not found
TRF:4 //account not found
Getting Account Info
INF: AccountNumber,firstName,lastName,username,email,balance
INF:25487,abdelrahman,abdelrazik,limbo,[email protected],5480
Getting Transaction History
HST is limited to 5 rows per request
HST:timestamp,DEP,100000,100000
#timestamp+1,WTD,20000,80000
#timestamp,TRFOUT,bank 2,52458,5000,85000 //timestamp,TRFOUT,bankName,accountNumber,amount,balance //outgoing transfer
#timestamp,TRFIN,bank 1, 21458,6000,91000 //timestamp,TRFIN,bankName,accountNumber,amount,balance //incoming transfer
If response is less than 5 append keyword end
HST:timestamp,DEP,100000,100000
#timestamp+1,WTD,20000,80000
#timestamp,TRFOUT,bank 2,52458,5000,85000
#end