Skip to content

belleskendall/cc_takehome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cc_takehome

This is a RESSTful API IAW the takehome specifications from creditcards.com. The file index2.html is the first endpoint described in the documentation. The page populates a drop box with the available issuers from the database. Then, the user selects the issuer, clicks the button, and the page creates a table showing all cards from that card issuer. The file index.html is the second endpoint described in the documentation. The user enters a credit card number that is in the databse, a valid loan amount, and a valid payment then clicks the button. The page retrieves the credit card information and calulates the interest and remaining loan principle after the first month's payment. This page includes basic error handling. The page recognizes invalid card formats, valid card numbers not in the database, invalid loans or payments (e.g. "4.0.1", or "yes", or "4,000.25", only numbers and one decimal point are allowed), and invalid loan payment pairs (e.g. a loan of 40.25 and a payment of 50.00). Class declarations are in functions.php. This allows for centralized coding of core classes. Included in functions.php in a method test1. This function creates a sample database. This method is not called, but is there so show the structure of the database. Both index.html and index2.html use the smaller PHP files, through AJAX calls, to contact the database. These files instantiate the class of functions.php, call needed mthods, return the results as a JSON, then unset the instance of the class. This is to adhere to the RESTful constraint of statelessness. All other processing is handled by jQuery functions in index.html and index2.html, respectively.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published