verifyCreditCard : Verify the credit card number


This method takes in the credit card number as a string. Then it runs through a verification algorithm checking to see if the credit card is valid or invalid.

The method returns true if the credit card is valid. Returns false if the credit card is invalid.

Code Snippet

- (void)checkCreditCard
   CreditCardPayment *ccPayment = [[CreditCardPayment alloc]init];
   NSString *creditCardValue = @"5555444433332226";
   if([ccPayment verifyCreditCard:creditCardValue])
        NSLog(@"credit card is valid");
        NSLog(@"Credit card is invalid");
developer/ios-verifycc.txt · Last modified: 2014/04/30 09:29 by jlei

Page Tools