Question
Develop an application that will validate credit cards based on the following requirements: Only Visa and MasterCard are accepted. All card numbers have 16 digits.
Develop an application that will validate credit cards based on the following requirements: Only Visa and MasterCard are accepted. All card numbers have 16 digits. Card numbers can optionally include spaces every 4 digits. Visa card numbers start with a 4. MasterCard card numbers start with the numbers 51 through 55. The final digit of the card (verification digit) must be validated against the Luhn formula. Expiration dates must use the format MM/YY (e.g. 01/19 represents January 2019). Expiration dates must be in the future. Credit cards must not be present on the blacklist (see below). Here is a blacklist of cards that have been detected as high risk by our fraud prevention team. These cards must not pass validation: { "blacklist":[ "4788 3845 3855 2446", "5144 3854 3852 3845" ] } Please implement a REST service that will take as input credit cards numbers and their expiration date and provide a response if the validation passes or not. Also if the credit card has been blacklisted, the service must respond with an appropriate response. The details of the implementation is up to you, considering what would be the best way to solve this problem.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started