在Swift 5上扫描信用卡库

5

我希望在iOS应用程序上扫描信用卡。 我使用了CardIO框架,但在iOS 13上不起作用。

guard let cardIOVC = CardIOPaymentViewController(paymentDelegate: self) else { 
            print("This device is incompatible with CardIO")
            return
        }

        cardIOVC.collectCVV = false
        cardIOVC.modalPresentationStyle = .overCurrentContext
        present(cardIOVC, animated: true, completion: nil)

我想知道在提供卡片信息时,实现CardIO而不显示内置预加载视图的最佳方法。

guard let cardIOVC = ScanViewController.createViewController(withDelegate: self) else {
        print("This device is incompatible with CardScan")
        return
    }
    cardIOVC.allowSkip = true
    present(cardIOVC, animated: true, completion: nil)

因此,CardScan库没有返回有效期或持卡人姓名。我不确定我开发的代码块是否缺少配置creditInfo回调的某些内容。

我还测试了DyScan框架作为CardIO API的更新,但是没有可用的podSpec:DyscanIntegrationGuide

iOS是否提供了开发者扫描信用卡的公共API?还有更好的解决方案吗?


1
嗨,我正在研究这个问题,但无法理解其中的根本问题。你的ScanViewController是什么样子?此外,你提到该框架在iOS 13上不起作用 - 我已创建了一个分支并将其更新为最新版本的Xcode,并且在iOS 13上运行它没有任何问题:https://github.com/Cerovec/card.io-iOS-SDK - Cerovec
可以确认CardIO在iOS 14上仍然可用。 - AMAN77
1个回答

0

基本上,您可以创建自己的步骤如下:

  1. 使用VisionKit、Tesseract、AWS Textract等提取图像中的文本。

  2. 获取识别文本的标准化坐标。

  3. 使用CoreML、SciKit learn等训练mlmodel,并使用各种卡详细信息(如16位数字、卡名称、过期日期等)的标准化位置。

  4. 将步骤2中的标准化值与步骤3中训练的模型进行预测。

我做了同样类型的一个,效果还不错。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接