0

I need to create a web service for school project, and I need to verify that the Credit details was entered are correct.
Can anyone help create this web service or provide some links with explanations ?
I need to verify the credit by it's number, cvv and exp date. In Addition I'm working with MVC.

Thanks in Advance.

EDIT
Since I am not going to use real details, The only choice I have got is to check only the Credit Card number. What's the best algorithm for that ? and how I can determine the type of the card ?

BuStRaMa
  • 53
  • 7
  • 2
    It depends whether you want to do it for real or not. If you want to do it for real, I guess an easy way to collect, validate and store credit card details would be to use the API of an existing provider, such as PayPal. – Luke May 26 '15 at 11:33
  • You have a couple of options. 1) DIY the validation by [using regex](http://www.richardsramblings.com/regex/credit-card-numbers), but validating the security code and dates are impossible - how could you know they are correct. 2) Use a third-party API such as PayPal. They likely have a developer account you could use for testing against. I'm not familiar with doing that myself though. – Jason Evans May 26 '15 at 11:36
  • I recommend looking into WebAPI. Create a controller with a Post() method that accepts the values you want to validate. Validate them and return the results back. You can call on the service using JavaScript/jQuery/Ajax and retrieve the results. – Luke May 26 '15 at 11:44
  • I am not going to use real details, it's just have to be according to the credits rules. Is there a way to use PayPal without charging anything ? just to check if the credit details are meeting the standards ? – BuStRaMa May 26 '15 at 12:02
  • 1
    See http://stackoverflow.com/questions/4514430 for some minor offline verification you can do. Mainly the Luhn check. You won't be able to reliably check the card type, but could make a stab at it. – PaulG May 26 '15 at 15:27

0 Answers0