Credit Card Manager Gem

Managing Credit card processing with ease via command line.

Installation

gem install cc_manager

Usage

Step 1: Make a file in and write the operations for the processing

for example, I created a file "cc_file.txt" on desktop of my system

#cc_file.txt
  Add Tom 4111111111111111 $1000
  Add Lisa 5454545454545454 $3000
  Add Quincy 1234567890123456 $2000
  Charge Tom $500
  Charge Tom $800
  Charge Lisa $7
  Credit Lisa $100
  Credit Quincy $200

Step 2: Run following command in CLI to see the final output according to the operations written in file

Case 1: If you want final output without any error messages

  ccmgr --file=/Users/manish/Desktop/cc_file.txt

--file takes the path of the file for processing

Case 2: If you want final output displaying error messages if any

  ccmgr --file=/Users/manish/Desktop/cc_file.txt --errors

OR

  ccmgr -f=/Users/manish/Desktop/cc_file.txt -e

aliases:

  --file   = -f
  --errors = -e

Demo Output

  ccmgr --file=/Users/manish/Desktop/cc_file.txt

Output displayed in the Terminal will be:

  OUTPUT: 

  Lisa: $-93
  Quincy: Error
  Tom: $500

If you want output with error messages, then type:

  ccmgr --file=/Users/manish/Desktop/cc_file.txt --errors

output displayed in the Terminal will be followed by the error messages in the format as shown below:

*************************************************************************************************************************
  3 Errors found in File:
  +---------------------------------------------+--------------------------------------------------------------+
  | Invalid Operation                           | Error Message                                                |
  +---------------------------------------------+--------------------------------------------------------------+
  | Add Quincy 1234567890123456 $2000 (line: 3) | Quincy's account cannot be added - Credit Card is invalid!!! |
  | Charge Tom $800 (line: 5)                   | Cannot Charge - Charged Amount exceeded the limit!!!         |
  | Credit Quincy $200 (line: 8)                | Cannot Add Credit - Invalid Account!!!                       |
  +---------------------------------------------+--------------------------------------------------------------+

Version of gem

To get the version:

  ccmgr version

OR

  ccmgr -v

Help

For Help

  ccmgr help

Further Help

  ccmgr help process