https://github.com/fahdseddik/esnd-payment-application
Embedded Systems Professional Nanodegree Payment Application Project
https://github.com/fahdseddik/esnd-payment-application
c c-application credit-card egfwd luhn-algorithm luhn-validation payment-application project
Last synced: 6 months ago
JSON representation
Embedded Systems Professional Nanodegree Payment Application Project
- Host: GitHub
- URL: https://github.com/fahdseddik/esnd-payment-application
- Owner: FahdSeddik
- Created: 2022-08-06T09:05:39.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-11T18:23:45.000Z (over 3 years ago)
- Last Synced: 2024-12-28T11:17:06.061Z (over 1 year ago)
- Topics: c, c-application, credit-card, egfwd, luhn-algorithm, luhn-validation, payment-application, project
- Language: C
- Homepage:
- Size: 66.1 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Payment Application Simulation
This is a Payment Application Simulation project for the EgFWD Embedded Systems Professional NanoDegree Scholarship. This project was written in C. It includes a Luhn card PAN generation and validation.
## Program Flow Chart

## Functions
These are some of the functions I thought I should highlight:
- `appStart()` : this would be called in `Main.c` to start the application
- `getTransactionDate()` : asks for a date in the form `DD/MM/YYYY` or can retrieve `System Date` automatically
- `getCardPAN()` : this functions asks either to generate a Luhn valid card PAN or enter manually
* Uses `GenerateLuhn()` which essentially applies the Luhn algorithm to generate the card PAN
- `readAccountDB()` : this load the accounts database from the database file (*read [database](https://github.com/FahdSeddik/ESND-Payment-Application#databases) section*)
- `saveTransaction()` : saves APPROVED transactions with all details into the transactions database (*read [database](https://github.com/FahdSeddik/ESND-Payment-Application#databases) section*)
## Instructions
- You would find demonstrated test cases in the "Submission Files/User Stories" Folder.
- This demonstrates how someone would use the Simulator.
- The test cases describe different scenarios that would happen:
* `EXCEED_MAX_AMOUNT` : means that the user tried to make a transaction with more than specified max amount for card
* `DECLINED_STOLEN_CARD` & `INVALID_ACCOUNT` : the card number is not present in the account database for the bank
* `DECLINED_INSUFFECIENT_FUND` : transaction amount is greater than account balance
* `APPROVED` : the transaction was successful and saved to transactions database
## Databases
- `AccountsDB.txt` : has all accounts PAN (Primary Account Number) and accounts balance

- `TransactionsDB.txt` : this stores different data about the transaction (shown in the picture below)
