Not scanning credit/debit cards using card.io

2019-05-06 16:54发布

问题:

I am using card.io_ios_sdk_3.8.0, I followed exactly what is mentioned in https://github.com/card-io/card.io-iOS-SDK. I am unable to scan credit or debit cards (VISA , Discover, etc).

I get "NSScanner: nil string argument".

I know I am making a mistake but I don't know how to track that. Is there any country based?

      - (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];
        }

I am not sure , whether its related to acknowledgements properly added or not.