Skip to content

Commit 0afd843

Browse files
authored
Merge branch 'feature/payto-base' into feature/payto-stored
2 parents d88bf87 + 0681b2c commit 0afd843

28 files changed

Lines changed: 837 additions & 375 deletions

.github/workflows/get_release_notes.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ jobs:
4848
OUTPUT=""
4949
# Loop through each label and find matching commits
5050
for LABEL in "${ALLOWED_LABELS_ARRAY[@]}"; do
51-
LABEL=$(echo "$LABEL" | xargs) # Trim spaces
51+
LABEL=$(echo "$LABEL" | xargs) # Trim spaces
5252
5353
# Finding content inside of <$LABEL> & </$LABEL> + trimming leading/trailling spaces/newlines
54-
LABEL_OUTPUT=$(echo "$COMMITS" | awk "/<$LABEL>/,/<\/$LABEL>/" | sed "s/<$LABEL>//g; s/<\/$LABEL>//g" | xargs)
54+
LABEL_OUTPUT=$(echo "$COMMITS" | awk "/<$LABEL>/,/<\/$LABEL>/" | sed "s/<$LABEL>//g; s/<\/$LABEL>//g" | xargs -0)
55+
echo $LABEL_OUTPUT
5556
5657
if [ -n "$LABEL_OUTPUT" ]; then
5758
OUTPUT="$OUTPUT

Adyen.xcodeproj/project.pbxproj

Lines changed: 52 additions & 8 deletions
Large diffs are not rendered by default.

Adyen/Assets/Generated/LocalizationKey.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
//
2-
// Copyright (c) 2021 Adyen N.V.
2+
// Copyright (c) 2023 Adyen N.V.
33
//
44
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
// This file is autogenerated. Please do not modify it.
56
//
67

78
// swiftlint:disable all

AdyenActions/Components/3DS2/3DS2 SDK Adapters/AnyAuthenticationRequestParameters.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// This file is open source and available under the MIT license. See the LICENSE file for more info.
55
//
66

7-
import Adyen3DS2
87
import Foundation
98

109
internal protocol AnyAuthenticationRequestParameters {
@@ -21,5 +20,3 @@ internal protocol AnyAuthenticationRequestParameters {
2120

2221
var messageVersion: String { get }
2322
}
24-
25-
extension ADYAuthenticationRequestParameters: AnyAuthenticationRequestParameters {}

AdyenActions/Components/3DS2/3DS2 SDK Adapters/AnyChallengeResult.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44
// This file is open source and available under the MIT license. See the LICENSE file for more info.
55
//
66

7-
import Adyen3DS2
87
import Foundation
98

109
internal protocol AnyChallengeResult {
1110

1211
var transactionStatus: String { get }
1312
}
14-
15-
extension ADYChallengeResult: AnyChallengeResult {}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// Copyright (c) 2025 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
7+
import Foundation
8+
9+
internal struct ChallengeParameters {
10+
internal let challengeToken: ThreeDS2Component.ChallengeToken
11+
internal let threeDSRequestorAppURL: URL?
12+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// Copyright (c) 2025 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
7+
import class Adyen3DS2.ADYAppearanceConfiguration
8+
import Foundation
9+
10+
internal struct FingerprintServiceParameters {
11+
internal let directoryServerIdentifier: String
12+
internal let directoryServerPublicKey: String
13+
internal let directoryServerRootCertificates: String
14+
internal let deviceExcludedParameters: [String: Any]?
15+
internal let appearanceConfiguration: Adyen3DS2.ADYAppearanceConfiguration
16+
internal let threeDSMessageVersion: String
17+
}

AdyenActions/Components/3DS2/3DS2 SDK Adapters/ADYServiceAdapter.swift renamed to AdyenActions/Components/3DS2/3DS2 SDK Adapters/LegacySDK/ADYServiceAdapter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal final class ADYServiceAdapter: AnyADYService {
3636

3737
internal func transaction(withMessageVersion: String) throws -> AnyADYTransaction {
3838
guard let service else {
39-
throw UnknownError(errorDescription: "ADYService is nil.")
39+
throw UnknownError.serviceIsNil
4040
}
4141
return try service.transaction(withMessageVersion: withMessageVersion)
4242
}

AdyenActions/Components/3DS2/3DS2 SDK Adapters/AnyADYTransaction.swift renamed to AdyenActions/Components/3DS2/3DS2 SDK Adapters/LegacySDK/AnyADYTransaction.swift

File renamed without changes.
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
//
2+
// Copyright (c) 2025 Adyen N.V.
3+
//
4+
// This file is open source and available under the MIT license. See the LICENSE file for more info.
5+
//
6+
7+
import Adyen3DS2
8+
import Foundation
9+
@_spi(AdyenInternal) import Adyen
10+
11+
/// This is a wrapper class for the Objective C 3ds2 sdk.
12+
/// This translates simple non specific sdk bound types such as
13+
/// `FingerprintServiceParameters` & `ChallengeParameters` to sdk specific types and performs actions.
14+
internal final class ThreeDSServiceLegacy: ThreeDSServiceable {
15+
private var service: AnyADYService
16+
private var transaction: AnyADYTransaction?
17+
18+
internal init(
19+
service: AnyADYService = ADYServiceAdapter()
20+
) {
21+
self.service = service
22+
}
23+
24+
internal func performFingerprint(
25+
parameters: FingerprintServiceParameters,
26+
completionHandler: @escaping (Result<AnyAuthenticationRequestParameters, ThreeDSServiceFingerprintError>) -> Void
27+
) {
28+
let serviceParameters = ADYServiceParameters(
29+
directoryServerIdentifier: parameters.directoryServerIdentifier,
30+
directoryServerPublicKey: parameters.directoryServerPublicKey,
31+
directoryServerRootCertificates: parameters.directoryServerRootCertificates
32+
)
33+
service.service(
34+
with: serviceParameters,
35+
appearanceConfiguration: parameters.appearanceConfiguration
36+
) { [weak self] service in
37+
guard let self else { return }
38+
do {
39+
let transaction = try service.transaction(withMessageVersion: parameters.threeDSMessageVersion)
40+
self.transaction = transaction
41+
completionHandler(.success(transaction.authenticationParameters))
42+
43+
} catch {
44+
completionHandler(
45+
.failure(.fingerprintingError(
46+
errorPayload: self.opaqueErrorObject(error: error)
47+
))
48+
)
49+
}
50+
}
51+
}
52+
53+
internal func performChallenge(
54+
with parameters: ChallengeParameters,
55+
completionHandler: @escaping (Result<AnyChallengeResult, ThreeDSServiceChallengeError>) -> Void
56+
) {
57+
let challengeParameters = ADYChallengeParameters(
58+
serverTransactionIdentifier: parameters.challengeToken.serverTransactionIdentifier,
59+
threeDSRequestorAppURL: parameters.threeDSRequestorAppURL,
60+
acsTransactionIdentifier: parameters.challengeToken.acsTransactionIdentifier,
61+
acsReferenceNumber: parameters.challengeToken.acsReferenceNumber,
62+
acsSignedContent: parameters.challengeToken.acsSignedContent
63+
)
64+
65+
guard let transaction else {
66+
return completionHandler(.failure(.transactionNotInitialized(
67+
errorPayload: opaqueErrorObject(error: ThreeDSServiceChallengeError.transactionNotInitialized(errorPayload: ""))
68+
)))
69+
}
70+
71+
transaction.performChallenge(
72+
with: challengeParameters
73+
) { [weak self] challengeResult, error in
74+
guard let self else { return }
75+
76+
guard let result = challengeResult else {
77+
guard let error else {
78+
completionHandler(.failure(.errorAndResultAreNil(
79+
errorPayload: opaqueErrorObject(error: UnknownError.resultAndErrorAreNil)
80+
)))
81+
return
82+
}
83+
84+
if isCancelled(error: error) {
85+
return completionHandler(.failure(.cancelled(
86+
errorPayload: opaqueErrorObject(error: error)
87+
)))
88+
} else {
89+
return completionHandler(.failure(.challengeError(
90+
errorPayload: opaqueErrorObject(error: error)
91+
)))
92+
}
93+
}
94+
completionHandler(.success(result))
95+
}
96+
}
97+
98+
private func isCancelled(error: Error) -> Bool {
99+
let error: NSError = error as NSError
100+
return (error.code == Int(ADYRuntimeErrorCode.challengeCancelled.rawValue)) && (error.domain == ADYRuntimeErrorDomain)
101+
}
102+
103+
internal func opaqueErrorObject(error: any Error) -> String {
104+
(error as NSError).base64Representation()
105+
}
106+
107+
internal func resetTransaction() {
108+
self.transaction = nil
109+
}
110+
}
111+
112+
extension Adyen3DS2.ADYAuthenticationRequestParameters: AnyAuthenticationRequestParameters {}
113+
extension Adyen3DS2.ADYChallengeResult: AnyChallengeResult {}

0 commit comments

Comments
 (0)