I am testing the iOS SDK cardIO for credit card scanning, I followed the instructions at https://github.com/card-io/card.io-iOS-SDK , but I open my CardIOPaymentViewController it does not scan my card, there is no callback to " userDidProvideCreditCardInfo: ", otherwise, when the controller is canceled," userDidCancelPaymentViewController: "is called. Did I miss something?
Please note that the card is correctly installed and I am 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) {
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (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");
[scanViewController dismissViewControllerAnimated:YES completion:nil];
}
- (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController {
NSLog(@"Received card info. Number: %@, expiry: %02lu/%lu, cvv: %@.", info.redactedCardNumber, (unsigned long)info.expiryMonth, (unsigned long)info.expiryYear, info.cvv);
[scanViewController dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
@end
Sincerely.
source
share