-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from tinkoff-mobile-tech/configuration
Рефакторинг конфигурирования SDK
- Loading branch information
Showing
17 changed files
with
156 additions
and
63 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
Development/Source/Extensions/Environment+EnvironmentConfiguration.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,17 @@ | ||
// | ||
// Environment+EnvironmentConfiguration.swift | ||
// TinkoffID | ||
// | ||
// Created by Dmitry on 20.01.2021. | ||
// | ||
|
||
import Foundation | ||
|
||
extension TinkoffEnvironment: EnvironmentConfiguration { | ||
public var apiBaseUrl: String { | ||
switch self { | ||
case .production: | ||
return "https://id.tinkoff.ru" | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
Development/Source/Extensions/TinkoffApp+TargetAppConfiguration.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,24 @@ | ||
// | ||
// TinkoffApp+TargetAppConfiguration.swift | ||
// TinkoffID | ||
// | ||
// Created by Dmitry on 21.12.2020. | ||
// | ||
|
||
import Foundation | ||
|
||
extension TinkoffApp: TargetAppConfiguration { | ||
public var urlScheme: String { | ||
switch self { | ||
case .bank: | ||
return "tinkoffbank://" | ||
} | ||
} | ||
|
||
public var authUrl: String { | ||
switch self { | ||
case .bank: | ||
return "https://tinkoff.ru/partner_auth" | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,13 @@ | ||
// | ||
// TinkoffEnvironment.swift | ||
// TinkoffID | ||
// | ||
// Created by Dmitry on 20.01.2021. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Окружение Тинькофф | ||
public enum TinkoffEnvironment { | ||
case production | ||
} |
File renamed without changes.
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
14 changes: 14 additions & 0 deletions
14
Development/Source/SDK/Configuration/EnvironmentConfiguration.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,14 @@ | ||
// | ||
// EnvironmentConfiguration.swift | ||
// TinkoffID | ||
// | ||
// Created by Dmitry on 20.01.2021. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Описывает окружение для работы SDK | ||
public protocol EnvironmentConfiguration { | ||
/// Базовый URL API | ||
var apiBaseUrl: String { get } | ||
} |
17 changes: 17 additions & 0 deletions
17
Development/Source/SDK/Configuration/TargetAppConfiguration.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,17 @@ | ||
// | ||
// TargetAppConfiguration.swift | ||
// TinkoffID | ||
// | ||
// Created by Dmitry on 20.01.2021. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Описывает приложение через которое выполняется авторизация | ||
public protocol TargetAppConfiguration { | ||
/// URL-схема, используемая для определения установлено ли заданное приложение | ||
var urlScheme: String { get } | ||
|
||
/// Ссылка для проведения авторизации | ||
var authUrl: String { get } | ||
} |
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.