Skip to content

* [EACQAPW-5434] Remove tds controller crutches / handles #511

Merged
merged 2 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
* [EACQAPW-5827] Update fakes
* [EACQAPW-5625] Added Card Options to pass DATA field in /AttachCard
* [EACQAPW-5828] Combine all Core Fakes in one file
* [EACQAPW-5434] Remove tds controller error handles

### Changed
* [EACQAPW-5617] Now Receipt initializer checks validity of mandatory fields
Expand Down
10 changes: 5 additions & 5 deletions ThirdParty/TdsSdkIos.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>TdsSdkIos.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>TdsSdkIos.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file not shown.

Large diffs are not rendered by default.

Binary file modified ThirdParty/TdsSdkIos.xcframework/ios-arm64/TdsSdkIos.framework/TdsSdkIos
100644 → 100755
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file modified ThirdParty/TdsSdkIos.xcframework/ios-arm64_x86_64-simulator/TdsSdkIos.framework/TdsSdkIos
100644 → 100755
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion ThirdParty/versions-info.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# ThreeDSWrapper - 2.2.3
# TdsSdkIos - 2.0.2
# TdsSdkIos - 2.0.3
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,6 @@ final class TDSController: ITDSController {
private let threeDSDeviceInfoProvider: IThreeDSDeviceInfoProvider
private let mainQueue: any IDispatchQueue

// TODO: EACQAPW-5434 Убрать костыль задержки в TDSController
// Костыль нужен для решения проблемы одновременных анимаций модалок.
// Из-за этого не показывается шторка асдк с ошибкой оплаты
private let delayExecutor: IDelayedExecutor

// 3ds sdk properties

private var transaction: ITransaction?
Expand All @@ -76,15 +71,13 @@ final class TDSController: ITDSController {
tdsTimeoutResolver: ITimeoutResolver,
tdsCertsManager: ITDSCertsManager,
threeDSDeviceInfoProvider: IThreeDSDeviceInfoProvider,
delayExecutor: IDelayedExecutor,
mainQueue: IDispatchQueue
) {
self.threeDsService = threeDsService
self.tdsWrapper = tdsWrapper
self.tdsTimeoutResolver = tdsTimeoutResolver
self.tdsCertsManager = tdsCertsManager
self.threeDSDeviceInfoProvider = threeDSDeviceInfoProvider
self.delayExecutor = delayExecutor
self.mainQueue = mainQueue
}

Expand Down Expand Up @@ -214,13 +207,6 @@ extension TDSController {
)
}

private func sendCompletionWithDelay(result: Result<GetPaymentStatePayload, Error>) {
delayExecutor.execute { [weak self] in
guard let self = self else { return }
self.completionHandler?(result)
}
}

private func buildCresValue(with transStatus: String) throws -> String {
guard let challengeParams = challengeParams else { return "" }
let acsTransID = try challengeParams.getAcsTransactionId()
Expand Down Expand Up @@ -266,15 +252,13 @@ extension TDSController: ChallengeStatusReceiver {

func cancelled() {
finishTransaction()
delayExecutor.execute { [weak self] in
self?.cancelHandler?()
}
cancelHandler?()
clear()
}

func timedout() {
finishTransaction()
sendCompletionWithDelay(result: .failure(TDSFlowError.timeout))
completionHandler?(.failure(TDSFlowError.timeout))
clear()
}

Expand All @@ -283,7 +267,7 @@ extension TDSController: ChallengeStatusReceiver {
let errorDescription = protocolErrorEvent.getErrorMessage().getErrorDescription()
let errorCode = Int(protocolErrorEvent.getErrorMessage().getErrorCode()) ?? 1
let error = NSError(domain: errorDescription, code: errorCode)
sendCompletionWithDelay(result: .failure(error))
completionHandler?(.failure(error))
clear()
}

Expand All @@ -292,7 +276,7 @@ extension TDSController: ChallengeStatusReceiver {
let errorDescription = runtimeErrorEvent.getErrorMessage()
let errorCode = Int(runtimeErrorEvent.getErrorCode()) ?? 1
let error = NSError(domain: errorDescription, code: errorCode)
sendCompletionWithDelay(result: .failure(error))
completionHandler?(.failure(error))
clear()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ final class TDSControllerAssembly: ITDSControllerAssembly {
tdsTimeoutResolver: TDSTimeoutResolver(),
tdsCertsManager: tdsCertsManager,
threeDSDeviceInfoProvider: threeDSDeviceInfoProvider,
delayExecutor: DelayedExecutor.buildDefault(),
mainQueue: DispatchQueue.main
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ final class TDSControllerTests: BaseTestCase {
var transactionMock: TransactionMock!
var tdsCertsManagerMock: TDSCertsManagerMock!
var threeDSDeviceInfoProviderMock: ThreeDSDeviceInfoProviderMock!
var delayExecutorMock: DelayedExecutorMock!
var mainQueueMock: DispatchQueueMock!

// MARK: - Setup
Expand All @@ -36,9 +35,7 @@ final class TDSControllerTests: BaseTestCase {
transactionMock = TransactionMock()
tdsCertsManagerMock = TDSCertsManagerMock()
threeDSDeviceInfoProviderMock = ThreeDSDeviceInfoProviderMock()
delayExecutorMock = DelayedExecutorMock()
mainQueueMock = DispatchQueueMock()
delayExecutorMock.executeWorkShouldExecute = true
DispatchQueueMock.performOnMainBlockShouldExecute = true

tDSWrapperMock.createTransactionReturnValue = transactionMock
Expand All @@ -49,13 +46,11 @@ final class TDSControllerTests: BaseTestCase {
tdsTimeoutResolver: timeoutResolverMock,
tdsCertsManager: tdsCertsManagerMock,
threeDSDeviceInfoProvider: threeDSDeviceInfoProviderMock,
delayExecutor: delayExecutorMock,
mainQueue: mainQueueMock
)
}

override func tearDown() {
delayExecutorMock.executeWorkShouldExecute = false
DispatchQueueMock.performOnMainBlockShouldExecute = false

acquiringThreeDSServiceMock = nil
Expand All @@ -64,7 +59,6 @@ final class TDSControllerTests: BaseTestCase {
transactionMock = nil
tdsCertsManagerMock = nil
threeDSDeviceInfoProviderMock = nil
delayExecutorMock = nil
mainQueueMock = nil

sut = nil
Expand Down
Loading