我正在测试cardIO的iOS SDK以扫描信用卡,我按照https://github.com/card-io/card.io-iOS-SDK中的说明进行操作,但是我打开CardIOPaymentViewController却不扫描我的卡,因此没有回调到“userDidProvideCreditCardInfo:”,否则当我取消控制器“userDidCancelPaymentViewController: “叫做。我想念什么吗?
请注意,卡的位置正确,我正在使用签证卡。
我的来源:
@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
问候。
最佳答案
来自card.io的Dave。
并非card.io可以成功扫描所有卡。例如,某些最近的信用卡使用小的,没有浮雕的数字,而不是使用card.io目前为其设计的传统的大号凸起数字。
尝试几种不同的卡,以确定这是否是特定于卡的问题。
关于ios - CardIO无法获取我的卡信息,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19864303/