-
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
1 parent
92ba243
commit e62b678
Showing
8 changed files
with
418 additions
and
30 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
44 changes: 44 additions & 0 deletions
44
AdyenActions/Components/3DS2/3DS2 SDK Adapters/LegacySDK/ADYServiceAdapter.swift
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,44 @@ | ||
// | ||
// 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 Adyen3DS2 | ||
import Foundation | ||
@_spi(AdyenInternal) import Adyen | ||
|
||
internal protocol AnyADYService { | ||
func service( | ||
with parameters: ADYServiceParameters, | ||
appearanceConfiguration: ADYAppearanceConfiguration, | ||
completionHandler: @escaping (_ service: AnyADYService) -> Void | ||
) | ||
|
||
func transaction(withMessageVersion: String) throws -> AnyADYTransaction | ||
} | ||
|
||
internal final class ADYServiceAdapter: AnyADYService { | ||
|
||
private var service: ADYService? | ||
|
||
internal func service( | ||
with parameters: ADYServiceParameters, | ||
appearanceConfiguration: ADYAppearanceConfiguration, | ||
completionHandler: @escaping (AnyADYService) -> Void | ||
) { | ||
ADYService.service(with: parameters, appearanceConfiguration: appearanceConfiguration) { [weak self] service in | ||
guard let self else { return } | ||
self.service = service | ||
completionHandler(self) | ||
} | ||
} | ||
|
||
internal func transaction(withMessageVersion: String) throws -> AnyADYTransaction { | ||
guard let service else { | ||
throw UnknownError.serviceIsNil | ||
} | ||
return try service.transaction(withMessageVersion: withMessageVersion) | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
AdyenActions/Components/3DS2/3DS2 SDK Adapters/LegacySDK/AnyADYTransaction.swift
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,32 @@ | ||
// | ||
// 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 Adyen3DS2 | ||
import Foundation | ||
|
||
internal protocol AnyADYTransaction { | ||
|
||
var authenticationParameters: AnyAuthenticationRequestParameters { get } | ||
|
||
func performChallenge(with parameters: ADYChallengeParameters, completionHandler: @escaping (AnyChallengeResult?, Error?) -> Void) | ||
} | ||
|
||
extension ADYTransaction: AnyADYTransaction { | ||
|
||
internal var authenticationParameters: AnyAuthenticationRequestParameters { authenticationRequestParameters } | ||
|
||
internal func performChallenge( | ||
with parameters: ADYChallengeParameters, | ||
completionHandler: @escaping (AnyChallengeResult?, Error?) -> Void | ||
) { | ||
performChallenge( | ||
with: parameters, | ||
completionHandler: { (result: ADYChallengeResult?, error: Error?) in | ||
completionHandler(result, error) | ||
} | ||
) | ||
} | ||
} |
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
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
Oops, something went wrong.