-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// Copyright (c) 2025 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import Foundation | ||
import UIKit | ||
|
||
protocol CardScanning { | ||
static func createCardScanner( | ||
completion: @escaping (Result<CreditCard, CardScannerError>) -> Void | ||
) -> UIViewController? | ||
|
||
static var isAvailable: Bool { get } | ||
} | ||
|
||
public enum CardScanner: CardScanning { | ||
|
||
// MARK: - Properties | ||
|
||
private static let cardScannerAssembler = CardScannerAssembler() | ||
|
||
// MARK: - CardScanning | ||
|
||
public static func createCardScanner( | ||
completion: @escaping (Result<CreditCard, CardScannerError>) -> Void | ||
) -> UIViewController? { | ||
let cardScannerViewController = cardScannerAssembler.resolveCardScannerViewController(completion: completion) | ||
return cardScannerViewController | ||
} | ||
|
||
public static var isAvailable: Bool { | ||
cardScannerAssembler.captureDevice != nil | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters