Not scanning credit/debit cards using card.io

允我心安 提交于 2019-12-07 07:05:08

问题


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.

来源:https://stackoverflow.com/questions/24283620/not-scanning-credit-debit-cards-using-card-io

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!