Skip to content

Commit

Permalink
Merge pull request #89 in MI/yandex-checkout-payments-swift from rele…
Browse files Browse the repository at this point in the history
…ase/2.3.1 to master

* commit '3d052f0e00d353095200cba5a7304a37404838b7':
  [NO-TASK] Update CHANGELOG.md
  [BIOS-1324] Fix 3DS on BankCardRepeat flow
  • Loading branch information
AutoMergeBot authored and AutoMergeBot committed Nov 26, 2019
2 parents a994abc + 3d052f0 commit 80454d5
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Changelog

### 2.3.1

1. Починили 3DS в `.bankCardRepeat TokenizationFlow`

### 2.3.0

1. Добавили поддержку темной темы в iOS 13.
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PODS:
- Reveal-SDK (24)
- SwiftLint (0.34.0)
- When (4.0.0)
- YandexCheckoutPayments (2.3.0):
- YandexCheckoutPayments (2.3.1):
- FunctionalSwift (~> 1.1.0)
- When (~> 4.0.0)
- YandexCheckoutPaymentsApi (~> 1.5.0)
Expand Down Expand Up @@ -63,7 +63,7 @@ SPEC CHECKSUMS:
Reveal-SDK: 5d7e56b8f018c0a88b3a2c10bf68d598bbd3b071
SwiftLint: 79d48a17c6565dc286c37efb8322c7b450f95c67
When: 4ffc88d535a094ad4bd5eaf2fd187de747e716d1
YandexCheckoutPayments: a560fd50ec1c5b8ed247f1e86183ef41e1740345
YandexCheckoutPayments: 47ae852ab96031801258e9e1a01dea22b94bfb24
YandexCheckoutPaymentsApi: e3f45d08993fc8e67f63c28d194b04d25a31e303
YandexCheckoutShowcaseApi: 44382163176b3a53692fa1c3b85c0c8d0a82b7e6
YandexCheckoutWalletApi: 5d2774cd1216ee0ce47d6412184008b37caeaeac
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ let moduleData = TokenizationModuleInputData(
| Параметр | Тип | Описание |
| -------------------------- | --------------------- | -------- |
| testModeSettings | TestModeSettings | По умолчанию `nil`. Настройки тестового режима. |
| returnUrl | String | По умолчанию `nil`. URL страницы (поддерживается только `https`), на которую надо вернуться после прохождения 3-D Secure. Необходим только при кастомной реализации 3-D Secure. Если вы используете `start3dsProcess(requestUrl:)`, не задавайте этот параметр. |
| isLoggingEnabled | Bool | По умолчанию `false`. Включает логирование сетевых запросов. |
| customizationSettings | CustomizationSettings | По умолчанию используется цвет blueRibbon. Цвет основных элементов, кнопки, переключатели, поля ввода. |

Expand Down
2 changes: 1 addition & 1 deletion YandexCheckoutPayments.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'YandexCheckoutPayments'
s.version = '2.3.0'
s.version = '2.3.1'
s.homepage = 'https://github.com/yandex-money/yandex-checkout-payments-swift'
s.license = {
:type => "MIT",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,53 @@ extension BankCardRepeatPresenter: MaskedBankCardDataInputModuleOutput {
// MARK: - TokenizationModuleInput

extension BankCardRepeatPresenter: TokenizationModuleInput {
public func start3dsProcess(requestUrl: String, redirectUrl: String) {}
public func start3dsProcess(requestUrl: String) {}
func start3dsProcess(requestUrl: String, redirectUrl: String) {
let moduleInputData = CardSecModuleInputData(
requestUrl: requestUrl,
redirectUrl: inputData.returnUrl ?? Constants.returnUrl,
isLoggingEnabled: inputData.isLoggingEnabled
)
DispatchQueue.main.async { [weak self] in
guard let strongSelf = self else { return }
strongSelf.router.present3dsModule(
inputData: moduleInputData,
moduleOutput: strongSelf
)
}
}

func start3dsProcess(requestUrl: String) {
let moduleInputData = CardSecModuleInputData(
requestUrl: requestUrl,
redirectUrl: inputData.returnUrl ?? Constants.returnUrl,
isLoggingEnabled: inputData.isLoggingEnabled
)
DispatchQueue.main.async { [weak self] in
guard let strongSelf = self else { return }
strongSelf.router.present3dsModule(
inputData: moduleInputData,
moduleOutput: strongSelf
)
}
}
}

// MARK: - CardSecModuleOutput

extension BankCardRepeatPresenter: CardSecModuleOutput {
func didSuccessfullyPassedCardSec(on module: CardSecModuleInput) {
moduleOutput?.didSuccessfullyPassedCardSec(on: self)
}

func didPressCloseButton(on module: CardSecModuleInput) {
moduleOutput?.didFinish(on: self, with: nil)
}
}

// MARK: - Constants

private enum Constants {
static let returnUrl = "https://custom.redirect.url/"
}

// MARK: - Private global helpers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ public struct BankCardRepeatModuleInputData {
/// Test mode settings.
let testModeSettings: TestModeSettings?

/// Return url for close 3ds.
let returnUrl: String?

/// Enable logging
let isLoggingEnabled: Bool

Expand All @@ -34,6 +37,7 @@ public struct BankCardRepeatModuleInputData {
/// - paymentMethodId: The ID of the saved payment method.
/// - amount: Amount of payment.
/// - testModeSettings: Test mode settings.
/// - returnUrl: Return url for close 3ds.
/// - isLoggingEnabled: Enable logging
/// - customizationSettings: Settings to customize SDK interface.
///
Expand All @@ -45,6 +49,7 @@ public struct BankCardRepeatModuleInputData {
paymentMethodId: String,
amount: Amount,
testModeSettings: TestModeSettings? = nil,
returnUrl: String? = nil,
isLoggingEnabled: Bool = false,
customizationSettings: CustomizationSettings = CustomizationSettings()
) {
Expand All @@ -54,6 +59,7 @@ public struct BankCardRepeatModuleInputData {
self.paymentMethodId = paymentMethodId
self.amount = amount
self.testModeSettings = testModeSettings
self.returnUrl = returnUrl
self.isLoggingEnabled = isLoggingEnabled
self.customizationSettings = customizationSettings
}
Expand Down

0 comments on commit 80454d5

Please sign in to comment.