-
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
63 additions
and
32 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 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) 2024 Adyen N.V. | ||
// | ||
// This file is open source and available under the MIT license. See the LICENSE file for more info. | ||
// | ||
|
||
import Foundation | ||
#if canImport(TwintSDK) | ||
import TwintSDK | ||
#endif | ||
|
||
#if canImport(TwintSDK) | ||
extension Twint { | ||
@objc func fetchInstalledAppConfigurations(completion: @escaping ([TWAppConfiguration]) -> Void) { | ||
Twint.fetchInstalledAppConfigurations { configurations in | ||
completion(configurations ?? []) | ||
} | ||
} | ||
|
||
@objc func pay(withCode code: String, appConfiguration: TWAppConfiguration, callback: String) -> Error? { | ||
Twint.pay(withCode: code, appConfiguration: appConfiguration, callback: callback) | ||
} | ||
|
||
@objc func controller( | ||
for installedAppConfigurations: [TWAppConfiguration], | ||
selectionHandler: @escaping (TWAppConfiguration?) -> Void, | ||
cancelHandler: @escaping () -> Void | ||
) -> UIAlertController? { | ||
Twint.controller( | ||
for: installedAppConfigurations.map { $0 }, | ||
selectedConfigurationHandler: { selectionHandler($0) }, | ||
cancelHandler: { cancelHandler() } | ||
) | ||
} | ||
} | ||
#endif |
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
File renamed without changes.