Menu

Migrating from Card.io (iOS)


First, follow the steps in Part I of our General Integration Guide.

If you integrated Card.io as view controller, replace the view controller with the following steps:

  • First, import DyScan in the view controller that will instantiate DyScan. There is no need for a bridging header as with Card.io, as DyScan is written in Swift.
  • Make your view controller conform to DyScanViewControllerDelegate instead of CardIOPaymentViewControllerDelegate.
  • Implement two functions, userDidCancel(_ paymentViewController: DyScanViewController!), and userDidProvide(_ cardInfo:DyScanCreditCardInfo!, in paymentViewController: DyScanViewController!). These should be analogous to the corresponding functions with Card.io.
  • 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)

If you integrated Card.io as view, replace the view with the following steps:

  • First, import DyScan in the view that will instantiate DyScan. There is no need for a bridging header as with Card.io, as DyScan is written in Swift.
  • Make your view controller conform to DyScanViewDelegate instead of CardIOViewControllerDelegate.
  • 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.
  • Replacing the instantiation and presentation of the CardIOViewController with
    dyScanView = DyScanView(frame: CGRect(x: 0, y: 100, width: self.view.frame.width , height: self.view.frame.width))
    dyScanView?.apiKey = "{YOUR API KEY}"
    dyScanView?.delegate = self
    dyScanView?.prepare()
    self.view.addSubview(dyScanView!)
Get Started