Migrating from card.io (iOS)

If you haven't already, follow the "Importing DyScan" steps in the General Integration Guide.

View Controller
View

import DyScan in the file with the view controller that will instantiate DyScan. Unlike card.io, a bridging header is not necessary as DyScan is written in Swift.

Implement two functions, userDidCancel(_ paymentViewController: DyScanViewController!), and userDidProvide(_ cardInfo:DyScanCreditCardInfo!, in paymentViewController: DyScanViewController!). These should be analogous to the corresponding functions with Card.io.

Make your view controller conform to DyScanViewControllerDelegate instead of CardIOPaymentViewControllerDelegate.

Replacing the instantiation and presentation of the CardIOPaymentViewController with

let scanVC = DyScanViewController()
let navigationController = UINavigationController(rootViewController: scanVC)
scanVC.paymentDelegate = self
scanVC.apiKey = "{YOUR API KEY}"
present(navigationController, animated: true, completion: nil)

DyScanCreditCardInfo is analogous to card.io's, but contains fewer methods. You can access the relevant fields by indexing cardNumber, expiryMonth, and expiryYear.

import DyScan in the file with the view controller that will instantiate DyScan. Unlike card.io, a bridging header is not necessary as DyScan is written in Swift.

Implement two functions, dyScanView(_ dyScanIOView: DyScanView!, didScanCard cardInfo: DyScanCreditCardInfo?), and noCameraPermission(_ dyScanIOView: DyScanView!). dyScanView should be analogous to the corresponding function in Card.io. noCameraPermission is called when the camera permission is denied by the user.

Make your view controller conform to DyScanViewDelegate instead of CardIOViewControllerDelegate.

Replacing the instantiation and presentation of the CardIOViewController with

dyScanView = DyScanView(frame: CGRect(x: 0, y: 0, width: self.view.frame.width , height: self.view.frame.width))
dyScanView?.apiKey = "{YOUR API KEY}"
dyScanView?.delegate = self
dyScanView?.prepare()
self.view.addSubview(dyScanView!)

DyScanCreditCardInfo is analogous to card.io's, but contains fewer methods. You can access the relevant fields by indexing cardNumber, expiryMonth, and expiryYear.