Migrating from card.io (iOS)
Last updated
Was this helpful?
Last updated
Was this helpful?
If you haven't already, follow the "Importing DyScan" steps in the .
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, onFailure(_ paymentViewController: DyScanViewController!, reason: DyScanExitReason)
, and onSuccess(_ cardInfo:DyScanCreditCardInfo!, in paymentViewController: DyScanViewController!)
. These should be analogous to the corresponding functions with Card.io, except that the names have been modified and the failure case provides a reason that you may choose to use to give a more robust experience.
Make your view controller conform to DyScanViewControllerDelegate
instead of CardIOPaymentViewControllerDelegate
.
Replacing the instantiation and presentation of the CardIOPaymentViewController
with
DyScanCreditCardInfo
is analogous to card.io's, but contains fewer methods. You can access the relevant fields by indexing cardNumber
, expiryMonth
, and expiryYear
.