In file /home/eternity/Source/Bank/PayManager/H/payManager.h:

class PayManager : public Debugable, public SixOffspring

Payment Manager

Inheritance:

PayManager < Debugable

PayManager < SixOffspring


Public Methods

GMessage* PayManager::AnswerFromEso (GMessage *inMsg)
Reacts to an answer from Eso
GMessage* PayManager::CreateCommonMsg (Err succ, Char *reason, ID *payId)
Create Common Message
Err PayManager::CreatePayments ()
Create Payments Table
Err PayManager::DeleteRecsInTable (Table *t, Char *whichId, ID id)
Deletes all records in the table
Record* PayManager::FindInTable (Table *t, Char *whichId, ID id)
Finds record in the table
GMessage* PayManager::MoneyFromClient (GMessage *inMsg)
Reacts to message from client
PayManager::PayManager (LogFile *logFile, Bank *bank)
PayManager constructor
GMessage* PayManager::RequestFromEso (GMessage *inMsg)
Reacts to a request for payment from Eso
Long PayManager::StorePayments (Table *fromClient, ACID myACID)
Stores Payments
PayManager::~PayManager ()
PayManager destructor

Public

methods
GMessage* MoneyFromClient (GMessage *inMsg)
reacts to message from client
GMessage* RequestFromEso (GMessage *inMsg)
reacts to a request for payment from Eso (prepares challenge for it)
GMessage* AnswerFromEso (GMessage *inMsg)
reacts to an answer from Eso

Protected

attributes
Table* payments
PayManager's persistent table of payments
methods
Long StorePayments (Table *fromClient, ACID myACID)
stores PayPlan from given table to payments table
GMessage* CreateCommonMsg (Err succ, Char *reason=NULL, ID *payId=NULL)
creates outMsg with fields Success, Reson-Of-Fail and Paymet-ID

Inherited from Debugable:

Public Methods

string* Debugable::CreateString(char *firstStr, int firstInt, int secondInt)
Debugable::Debugable(LogFile * debugLogFile)
int Debugable::SetDebugOptions(int newLogOptions)
void Debugable::SetLogFile(LogFile *aLogFile)
void Debugable::WriteString(LogLevel debugLevel, char * format, ...)
Debugable::~Debugable()

Inherited from SixOffspring:

Public Methods

SixOffspring::SixOffspring(Six * aSix)

Documentation

Payment Manager. A class which manages everything about payments in Bank: 1) stores payment plan sent by client (and transfer money) 2) reacts to eso's request for payment - if everything is OK transfer money to it's account
attributes

Table* payments
PayManager's persistent table of payments

methods

Long StorePayments(Table *fromClient, ACID myACID)
stores PayPlan from given table to payments table

GMessage* CreateCommonMsg(Err succ, Char *reason=NULL, ID *payId=NULL)
creates outMsg with fields Success, Reson-Of-Fail and Paymet-ID

methods

GMessage* MoneyFromClient(GMessage *inMsg)
reacts to message from client

GMessage* RequestFromEso(GMessage *inMsg)
reacts to a request for payment from Eso (prepares challenge for it)

GMessage* AnswerFromEso(GMessage *inMsg)
reacts to an answer from Eso

GMessage* PayManager::AnswerFromEso(GMessage *inMsg)
Reacts to an answer from Eso. If it finds the payment record and MAC and SAuth are OK, transfers money to Eso's account.
Returns:
message (answer) for eso
Parameters:
inMsg - message (response to challenge) from eso
Author:
Ivana
See Also:
Majordomo::DRCAnswerFromEso()

GMessage* PayManager::CreateCommonMsg(Err succ, Char *reason, ID *payId)
Create Common Message. Creates part of message common to all outgoing messages. If parametr payId is not specified, does not set it.
Returns:
created message
Parameters:
succ - value of succes field
reason - value of reason field
payId - value of paymentId field
Author:
Ivana
See Also:
MoneyFromClient(), RequestFromEso(), AnswerFromEso()

Err PayManager::CreatePayments()
Create Payments Table. Creates table Payments - a persistent PayManager's table.
Returns:
error code
Author:
Ivana
See Also:
PayManager()

Err PayManager::DeleteRecsInTable(Table *t, Char *whichId, ID id)
Deletes all records in the table. Deletes all records in the table with given ID. If whichId is not specified (NULL), clears given table.
Returns:
error code
Parameters:
t - table in which we will delete
whichId - specifies ID, that is used for deleting
id - a value of the ID
Author:
Ivana
See Also:
AnswerFromEso()

Record* PayManager::FindInTable(Table *t, Char *whichId, ID id)
Finds record in the table. Finds record in the table with given ID.
Returns:
found record or NULL
Parameters:
t - table in which we will search
whichId - specifies ID, that is used for searching
id - a value of the ID
Author:
Ivana
See Also:
RequestFromEso()

GMessage* PayManager::MoneyFromClient(GMessage *inMsg)
Reacts to message from client. It first generate temporary table of sent PaymentPlan. Then stores modified (with unsealed SAuths) table to PayManager's payments table, transfer money from client account and generate message for him.
Returns:
message (answer) for client
Parameters:
inMsg - message from client
Author:
Ivana
See Also:
Majordomo::DRCMoneyFromClient()

PayManager::PayManager(LogFile *logFile, Bank *bank)
PayManager constructor. Creates PayManager's persistent table.
Parameters:
logFile - pointer to log file
bank - pointer to main class bank
Author:
Ivana
See Also:
Bank

GMessage* PayManager::RequestFromEso(GMessage *inMsg)
Reacts to a request for payment from Eso. If it finds the payment record, the Eso ask for, and time of it is OK, sends to Eso OAuth (to be able to compute MAC).
Returns:
message (challenge) for eso
Parameters:
inMsg - message from eso
Author:
Ivana
See Also:
Majordomo::DRCRequestFromEso()

Long PayManager::StorePayments(Table *fromClient, ACID myACID)
Stores Payments. Stores payments from given table. For each record first unseal SAuth and then stores all useful information to 'payments' table. If something goes wrong, returns -1 instead of sum.
Returns:
total sum of money from client
Parameters:
fromClient - table, from which payments are taken
myACID - ID of bank's ac, which used for encrypting sAuth
Author:
Ivana
See Also:
MoneyFromClient()

PayManager::~PayManager()
PayManager destructor. Destructor deletes PayManager's persistent table.
Author:
Ivana
See Also:
Bank


This class has no child classes.
Author:
Ivana see Bank

alphabetic index hierarchy of classes


generated by doc++