Adding a credit card scan using a camera

IOS8 has some built-in features in Safari and Apple Pay for scanning credit cards using a camcorder, so that the user does not have to manually punch a number. Does anyone know if there is an API call or a ready-made controller for Swift that will allow you to add this feature to any iOS application?

+4
source share
1 answer

This is exactly what you are looking for:

What you need is card.io:

  • Download the latest SDK.
  • Just open the SampleApp folder or the SampleApp-Swift folder and follow the instructions in the README.md file that you will find there.

Implementing a simple IO reader for ViewController Card:

- (IBAction)scanCard:(id)sender {
  CardIOPaymentViewController *scanViewController = [[CardIOPaymentViewController alloc] initWithPaymentDelegate:self];
  [self presentViewController:scanViewController animated:YES completion:nil];
}

And pass methods to get map information:

- (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: %02i/%i, cvv: %@.", info.redactedCardNumber, info.expiryMonth, info.expiryYear, info.cvv);
  // Use the card info...
  [scanViewController dismissViewControllerAnimated:YES completion:nil];
}

LINK: https://github.com/card-io/card.io-iOS-SDK

PayPal .

!

-2

All Articles