Bassem-Yousry / Payment-App

A simple app that implements the SALE transaction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Payment-App

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

Flow Chart

{4ED04FED-06D2-44B9-89ED-2CDC35C720DC} png

Screenshots

  • folder structure

  • Card Module

Constraints

 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.

 png

  • Terminal Module

Constraints

 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.

{4ED04FED-06D2-44B9-89ED-2CDC35C720DC} png

  • Server Module

{4ED04FED-06D2-44B9-89ED-2CDC35C720DC} png

  • App Module

{4ED04FED-06D2-44B9-89ED-2CDC35C720DC} png

Testing Functions

**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)

Testing the application

**First u need to comment the preprocessor directives in card.h & terminal.h to exit test mode **

  1. Transaction is approved and my account balance is reduced by the withdrawn amount. the AccountDB on the right is before the transaction made

2) Exceed the maximum amount user story

3) Insufficient fund user story

4) Expired card user story

5) Stolen card user story

About

A simple app that implements the SALE transaction


Languages

Language:C 100.0%