-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [EACQAPW-5561] Tinkoff Pay doesn't pass SuccessURL & FailURL in /In…
…it (#467)
- Loading branch information
1 parent
577e40c
commit af733b9
Showing
6 changed files
with
55 additions
and
11 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
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
34 changes: 34 additions & 0 deletions
34
TinkoffASDKUI/TinkoffASDKUITests/TestCases/PaymentFlowTests.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,34 @@ | ||
// | ||
// PaymentFlowTests.swift | ||
// TinkoffASDKUI | ||
// | ||
// Created by Ivan Glushko on 17.07.2023. | ||
// | ||
|
||
@testable import TinkoffASDKCore | ||
@testable import TinkoffASDKUI | ||
import XCTest | ||
|
||
final class PaymentFlowTests: XCTestCase { | ||
|
||
func test_mergePaymentDataIfNeeded_passes_paymentCallbackURL() { | ||
// given | ||
let successURL = "https://tinkoff.ru/SuccessURL" | ||
let failURL = "tinkoffbank://Main/fail" | ||
var paymentOptions = PaymentOptions.fake() | ||
paymentOptions.paymentCallbackURL = PaymentCallbackURL(successURL: successURL, failureURL: failURL) | ||
let sut = PaymentFlow.full(paymentOptions: paymentOptions) | ||
// when | ||
let result = sut.mergePaymentDataIfNeeded(Self.tinkoffPayData) | ||
// then | ||
guard case let .full(mergedOptions) = result else { XCTFail(); return } | ||
XCTAssertEqual(mergedOptions.paymentCallbackURL?.successURL, successURL) | ||
XCTAssertEqual(mergedOptions.paymentCallbackURL?.failureURL, failURL) | ||
} | ||
} | ||
|
||
// MARK: - Constants | ||
|
||
extension PaymentFlowTests { | ||
static let tinkoffPayData = ["TinkoffPayWeb": "true"] | ||
} |