views:

266

answers:

3
A: 

If you are selling things from inside your app, it is very likely that apple will reject it unless you are using in-app sales (in which case, you shouldn't need any credit card validation).

AlexC
its an app very similar to fandango, but for a private movie chain. What do ya think?
Louie
Hmm, actually I may be wrong on this point. Reviewing the iPhone Agreement (https://developer.apple.com/iphone/terms/program/iphone_standard_agreement_20100408.pdf, see attachment 2 that starts on page 25, needs an ADC log in) seems to imply that in-app purchases are only for when the content purchased is to be used within the app, which doesn't apply to this.
AlexC
This is no different than the Chipotle app, which is doing just fine.
kubi
thank you kubi, i took a look at that app and i feel pretty a comfortable moving forward now. (not that I stopped, but its nice knowing its already being done)
Louie
+1  A: 

Here is some code that will likely work (uses the Luhn Algorithm):

-(BOOL) validateCardNumber:(NSString *)cardNumber
{

const char *str = [cardNumber UTF8String];
int n, i, alternate, sum;

n = strlen(str);

if ( n < 13 || n > 19 )
    return NO;

for ( alternate = 0, sum = 0, i = n-1; i>-1; –i) {
    if ( !isdigit(str[i]))
        return NO;

    n = str[i] – ‘0′;

    if ( alternate ) {
        n*=2;
        if ( n > 9 )
            n = ( n % 10 ) + 1;
    }

    alternate = !alternate;

    sum += n;
}

return ( sum % 10 == 0 );
}

Credit to Donald Bellenger for this method.

christo16
A: 

I was able to answer my own question, shared it above in the "updated" area.

Louie