developer:ios-verifycc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

developer:ios-verifycc [2014/04/30 09:29] (current)
jlei created
Line 1: Line 1:
 +=====verifyCreditCard : Verify the credit card number=====
  
 +====Description====
 +
 +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===
 +
 +<code c>
 +- (void)checkCreditCard
 +{
 +   ​CreditCardPayment *ccPayment = [[CreditCardPayment alloc]init];​
 +    ​
 +   ​NSString *creditCardValue = @"​5555444433332226";​
 +    ​
 +   ​if([ccPayment verifyCreditCard:​creditCardValue])
 +    {
 +        NSLog(@"​credit card is valid"​);​
 +    }
 +    ​
 +    else
 +    {
 +        NSLog(@"​Credit card is invalid"​);​
 +    }
 +}
 +</​code>​
developer/ios-verifycc.txt ยท Last modified: 2014/04/30 09:29 by jlei

Page Tools