A simple app that implements the SALE transaction It includes Luhn card PAN for validation
https://www.youtube.com/playlist?list=PLR1_kFCzdgsXmWhS-8S2-GGysLTitpXRJ
1) Card Holder Name must be 20 characters minimum and 24 characters maximum .
2) Card Expiry Date must be in form MM/YY.
3) Primary Account Number must be 16 characters minimum and 19 characters maximum.
1) Transaction Date must be in form DD/MM/YYYY.
2) Transaction Amount must be a positive non-zero value.
3) Terminal Max Amount must be set as an initialization for the Terminal.
**to enter test mode you need to uncomment the preproccessor directive for each function in the module header file **
Card Module
void getCardHolderNameTest(void)
first u need to define NAME_TEST in header file to get the test case from a global var not asking the user to input the name
void getCardExpiryDateTest(void)
define EXP_TEST
void getCardPANTest(void)
define PAN_TEST
Terminal Module
- `void getTransactionDateTest(void)`
void isCardExpriedTest(void)
void getTransactionAmountTest(void)
void isBelowMaxAmountTest(void)
void setMaxAmountTest(void)
void isValidCardPANTest(void)
This function use luhn algoritm to validate the PAN
Server Module
- `void recieveTransactionDataTest(void)`
void isValidAccountTest(void)
void isBlockedAccountTest(void)
void isAmountAvailableTest(void)
void saveTransactionTest(void)
void listSavedTransactionsTest(void)
**First u need to comment the preprocessor directives in card.h & terminal.h to exit test mode **
- Transaction is approved and my account balance is reduced by the withdrawn amount. the AccountDB on the right is before the transaction made