我正在使用card.io_ios_sdk_3.8.0
,我完全遵循https://github.com/card-io/card.io-iOS-SDK中提到的内容。我无法扫描信用卡或借记卡(VISA,Discover等)。
我得到" NSScanner:nil字符串参数"。
我知道我犯了一个错误,但我不知道如何跟踪它。有没有国家?
- (IBAction)scanCard:(id)sender
{
CardIOPaymentViewController *scanViewController = [[CardIOPaymentViewController alloc] initWithPaymentDelegate:self];
scanViewController.appToken = @"<I have entered my app token>"; // get your app token from the card.io website
[self presentViewController:scanViewController animated: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: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv);
// Use the card info...
if(info.cardNumber!=Nil && ![info.cardNumber isEqualToString:@""] && ! [info.cardNumber isKindOfClass:[NSNull class]])cardNumber.text = info.cardNumber;
if(info.cvv!=Nil && ![info.cvv isEqualToString:@""] && ![info.cvv isKindOfClass:[NSNull class]])cvvno.text = info.cvv;
if(info.expiryMonth!=0)[self getCorrectMonth:[NSString stringWithFormat:@"%02i",info.expiryMonth]];
if(info.expiryYear!=0) year.text = [NSString stringWithFormat:@"%i",info.expiryYear];
[scanViewController dismissViewControllerAnimated:YES completion:nil];
}
我不确定,它是否与正确添加的确认相关。