Menu

Migrating from Card.io (iOS)


If you haven't already, follow the steps in the General Integration Guide up until the "Next Steps" section.

If card.io was integrated as view controller, replace the view controller with the following steps:

  • First, 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.
  • 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 card.io was integrated as a view, replace the view with the following steps:

  • First, 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.
  • 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