Question

I am using card.io for iOS SDK and fetch the card information with the following code. My problem is i am getting card number in encryted form like this

Received card info. Number: ••••••••••••2430, expiry: 02/2014, cvv: 123.

How can i get decrypted full 16 digit card number so i can use it with some API to pass to purchase ticket using this for my client or there is any kind of alternative to pass Recieved card information as server side must need to decrypt the card number before it will process to generate ticket? // SomeViewController.m

- (IBAction)scanCard:(id)sender {
  CardIOPaymentViewController *scanViewController = [[CardIOPaymentViewController alloc] initWithPaymentDelegate:self];
  scanViewController.appToken = @"YOUR_APP_TOKEN_HERE"; // get your app token from the card.io website i enter mine token here its work well
  [self presentModalViewController:scanViewController animated:YES];
}


// SomeViewController.m

- (void)userDidCancelPaymentViewController:(CardIOPaymentViewController *)scanViewController {
  NSLog(@"User canceled payment info");
  // Handle user cancellation here...
  [scanViewController dismissModalViewControllerAnimated:YES];
}

- (void)userDidProvideCreditCardInfo:(CardIOCreditCardInfo *)info inPaymentViewController:(CardIOPaymentViewController *)scanViewController {
  NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv);
  // Use the card info...
  [scanViewController dismissModalViewControllerAnimated:YES];
}
Was it helpful?

Solution

That's because you're using the redacted card info which is purposely obfuscated from the user for security. Try just using info.cardNumber which is actually right there in the comments of the code that you have written there. Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top