2

I'm testing the iOS SDK of cardIO for scanning credit card, I followed the instructions in https://github.com/card-io/card.io-iOS-SDK , but I open my CardIOPaymentViewController it dont scan my card, there is no callback to "userDidProvideCreditCardInfo: " otherwise when I cancel the controller "userDidCancelPaymentViewController: " is called. Am I missing something ?

Note that the card is properly positioned and I'm using a visa card.

My source:

@interface TestViewController : UIViewController <CardIOPaymentViewControllerDelegate>

- (IBAction)scanCard:(id)sender;

@end

@implementation TestViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (IBAction)scanCard:(id)sender{
    CardIOPaymentViewController *scanViewController = [[CardIOPaymentViewController alloc] initWithPaymentDelegate:self];
    scanViewController.appToken = @"app-token";
    scanViewController.collectCVV = YES;
    scanViewController.collectExpiry = YES;
    scanViewController.useCardIOLogo = YES;
    [self.navigationController presentViewController:scanViewController animated:YES completion:nil];
}

- (void)userDidCancelPaymentViewController:(CardIOPaymentViewController *)scanViewController {
    NSLog(@"User canceled payment info");
    // Handle user cancellation here...
    [scanViewController dismissViewControllerAnimated:YES completion:nil];
}

- (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController {
    // The full card number is available as info.cardNumber, but don't log that!
    NSLog(@"Received card info. Number: %@, expiry: %02lu/%lu, cvv: %@.", info.redactedCardNumber, (unsigned long)info.expiryMonth, (unsigned long)info.expiryYear, info.cvv);
    // Use the card info...
    [scanViewController dismissViewControllerAnimated:YES completion:nil];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

Regards.

Dave Goldman
  • 2,229
  • 1
  • 11
  • 13
Reda Mimouni
  • 31
  • 1
  • 5
  • 1
    Yeah, not to be "that guy" but it kinda tells you what to do, you need a `userDidProvideCreditCardInfo:` method. Also it'll really help if you show your relevant code as well. – Matt S. Nov 08 '13 at 16:59

1 Answers1

3

Dave from card.io here.

Not all cards can be successfully scanned by card.io. For example, some recent credit cards use small, non-embossed digits rather than the traditional large, raised numbers for which card.io is currently designed.

Try a few different cards to determine whether this is a card-specific problem.

Dave Goldman
  • 2,229
  • 1
  • 11
  • 13