【问题标题】:Scan Credit Card library on Swift 5在 Swift 5 上扫描信用卡库
【发布时间】:2020-07-20 03:06:57
【问题描述】:

我想在 iOS 应用上扫描信用卡。 我使用 CardIO 框架,但它不适用于 ios13

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)

所以我想知道在提供 cardInfo 时不显示内置预加载视图的情况下实现 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 库,但既不返回 expiryDate 也不返回名片持有人。 我不确定我开发的代码块是否遗漏了配置 creditInfo 回调的东西。

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

iOS 是否为开发人员提供任何公共 API 来扫描信用卡?或者有没有更好的解决方案?

【问题讨论】:

  • 嗨,我正在调查这个问题,但无法确切了解根本问题是什么。你的 ScanViewController 是什么样子的?此外,您提到该框架无法在 iOS 13 上运行 - 我创建了一个 fork 并将其更新为最新的 Xcode,并且在 iOS 13 上运行它没有问题:github.com/Cerovec/card.io-iOS-SDK
  • 可以确认 CardIO 仍在 iOS 14 上工作

标签: ios swift frameworks credit-card scanning


【解决方案1】:

基本上你可以自己创建,步骤是

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

  2. 获取已识别文本的归一化坐标

  3. 使用 CoreML、SciKit learn 等训练一个机器学习模型,其中包含各种卡片详细信息(如 16 位、卡片名称、到期日等)的标准化位置。

  4. 根据步骤 3 中的训练模型预测步骤 2 中的归一化值。

工作得很好,就像我做的一样。

【讨论】:

    猜你喜欢
    • 2015-11-09
    • 2019-01-04
    • 1970-01-01
    • 2020-03-26
    • 2017-11-26
    • 2014-12-18
    • 2015-12-03
    • 2019-05-28
    • 2015-12-11
    相关资源
    最近更新 更多