Skip to content

Commit

Permalink
Merge pull request #55 from MadBrains/3.0.11
Browse files Browse the repository at this point in the history
3.0.11
  • Loading branch information
KolasikOmetov authored May 30, 2023
2 parents 17f6827 + e67763d commit 805263a
Show file tree
Hide file tree
Showing 18 changed files with 79 additions and 70 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ FVM_FLUTTER = $(FVM) flutter
FVM_DART = $(FVM) dart

init:
$(FVM) use 3.3.5 --force; $(FVM_DART) pub global activate pana;
$(FVM) use 3.10.2 --force; $(FVM_DART) pub global activate pana;

version:
$(FVM_FLUTTER) --version; $(FVM_DART) --version;
Expand All @@ -36,7 +36,7 @@ clean:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) clean; cd ../..;)

fix:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) format .; cd ../..;)
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_DART) format .; cd ../..;)

analyze:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) analyze . --fatal-infos; cd ../..;)
Expand Down
3 changes: 0 additions & 3 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ analyzer:
strict-casts: true
strict-inference: true
strict-raw-types: true
strong-mode:
implicit-casts: false
implicit-dynamic: false
errors:
todo: ignore
missing_return: warning
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 32
compileSdkVersion 33

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
5 changes: 4 additions & 1 deletion example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -200,10 +200,12 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
);
name = "Thin Binary";
outputPaths = (
Expand Down Expand Up @@ -236,6 +238,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down
2 changes: 2 additions & 0 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@
<false/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
5 changes: 2 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ final TinkoffAcquiring acquiring = TinkoffAcquiring(
TinkoffAcquiringConfig.credential(
terminalKey: terminalKey,
password: password,
isDebugMode: true,
),
);

Expand Down Expand Up @@ -330,8 +329,8 @@ details: ${response.details}
paReq: fa.paReq,
acsTransId: fa.acsTransId,
version: check3DSVersion.version,
onLoad: (bool v) {
debugPrint('WebView load: $v');
onLoad: ({required bool isLoading}) {
debugPrint('WebView load: $isLoading');
},
onFinished: (Submit3DSAuthorizationResponse? v) {
Navigator.of(context).pop();
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ version: 1.0.0+1
publish_to: none

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"
dependencies:
flutter:
sdk: flutter

tinkoff_acquiring: ^3.0.10
tinkoff_acquiring_flutter: ^3.0.10
tinkoff_acquiring: ^3.0.11
tinkoff_acquiring_flutter: ^3.0.11

dependency_overrides:
tinkoff_acquiring:
Expand Down
5 changes: 5 additions & 0 deletions packages/tinkoff_acquiring/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 3.0.11

* Bumped Flutter to 3.10.2, Dart to 3
* Upgraded dependencies

# 3.0.10

* Fixing the 3DSv2 Challenge Flow Passage
Expand Down
10 changes: 5 additions & 5 deletions packages/tinkoff_acquiring/lib/src/constants.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore_for_file: public_member_api_docs

abstract class JsonKeys {
abstract final class JsonKeys {
static const String terminalKey = 'TerminalKey';
static const String customerKey = 'CustomerKey';
static const String checkType = 'CheckType';
Expand Down Expand Up @@ -144,7 +144,7 @@ abstract class JsonKeys {
static const String timestamp = 'Timestamp';
}

abstract class NetworkSettings {
abstract final class NetworkSettings {
static const String domainDebug = 'rest-api-test.tinkoff.ru';
static const String domainRelease = 'securepay.tinkoff.ru';
static const String apiPath = '/';
Expand All @@ -160,7 +160,7 @@ abstract class NetworkSettings {
};
}

abstract class ApiMethods {
abstract final class ApiMethods {
static const String init = 'Init';
static const String finishAuthorize = 'FinishAuthorize';
static const String confirm = 'Confirm';
Expand Down Expand Up @@ -189,7 +189,7 @@ abstract class ApiMethods {
static const String getAddCardState = 'GetAddCardState';
}

abstract class Ignore {
abstract final class Ignore {
static const Set<String> ignoredFields = <String>{
JsonKeys.data,
JsonKeys.receipt,
Expand All @@ -198,7 +198,7 @@ abstract class Ignore {
};
}

abstract class CardSettings {
abstract final class CardSettings {
static const List<int> defaultRangers = <int>[16];
static const List<int> unknownRangers = <int>[13, 14, 15, 16, 17, 18, 19];
static const List<int> maestroRangers = <int>[13, 14, 15, 16, 17, 18, 19];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ class FinishAuthorizeRequest extends AcquiringRequest {
}

/// Проверка запроса на наличие 3DsV2
@JsonKey(ignore: true)
@JsonKey(includeToJson: false, includeFromJson: false)
bool get is3DsVersionV2 => data != null && ip != null;

/// Зашифрованные данные карты. См. класс [PaymentSource].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import 'models/base/base.dart';
/// Позволяет изменять путь и загаловок запроса.
/// {@endtemplate}
typedef ProxyMapping = ProxyRequest? Function(
AcquiringRequest request,
bool isDebugMode,
);
AcquiringRequest request, {
required bool isDebugMode,
});

/// {@template tinkoff_acquiring_config}
/// Класс позволяет конфигурировать SDK.
/// {@endtemplate}
abstract class TinkoffAcquiringConfig {
sealed class TinkoffAcquiringConfig {
/// Создает экземпляр класса для конфигурирования SDK, через `terminalKey` и `password`.
///
/// Если не передать `password`, то SDK будет работать в режиме passwordless.
Expand Down
2 changes: 1 addition & 1 deletion packages/tinkoff_acquiring/lib/src/utils/logger.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:developer' as dev;

/// Интерфейс базового логгера
abstract class BaseLogger {
abstract interface class BaseLogger {
/// Конструктор базового логгера
const BaseLogger();

Expand Down
53 changes: 28 additions & 25 deletions packages/tinkoff_acquiring/lib/src/utils/network_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import 'crypto_utils.dart';
/// {@endtemplate}
class NetworkClient {
/// {@macro network_client}
NetworkClient(this._config);
const NetworkClient(this._config);

/// {@macro tinkoff_acquiring_config}
final TinkoffAcquiringConfig _config;
Expand All @@ -31,7 +31,7 @@ class NetworkClient {
if (config is TinkoffAcquiringConfigProxy) {
final ProxyRequest? setting = config.mapping?.call(
request,
_config.isDebugMode,
isDebugMode: _config.isDebugMode,
);

proxyHeaders = <String, String>{
Expand Down Expand Up @@ -114,30 +114,33 @@ class NetworkClient {
) {
final Map<String, dynamic> temp = request.toJson();

if (config is TinkoffAcquiringConfigCredential) {
final String token = SignToken.generate(
terminalKey: config.terminalKey,
password: config.password,
request: request,
);

final Map<String, dynamic> _request = temp
..addAll(<String, dynamic>{
JsonKeys.terminalKey: config.terminalKey,
JsonKeys.token: token,
});

return _request;
switch (config) {
case TinkoffAcquiringConfigCredential():
final String token = SignToken.generate(
terminalKey: config.terminalKey,
password: config.password,
request: request,
);

final Map<String, dynamic> _request = temp
..addAll(
<String, dynamic>{
JsonKeys.terminalKey: config.terminalKey,
JsonKeys.token: token,
},
);

return _request;
case TinkoffAcquiringConfigToken():
return temp
..addAll(
<String, dynamic>{
JsonKeys.terminalKey: config.terminalKey,
},
);
case TinkoffAcquiringConfigProxy():
return temp;
}

if (config is TinkoffAcquiringConfigToken) {
return temp
..addAll(<String, dynamic>{
JsonKeys.terminalKey: config.terminalKey,
});
}

return temp;
}
}

Expand Down
18 changes: 9 additions & 9 deletions packages/tinkoff_acquiring/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
name: tinkoff_acquiring
description: Flutter Tinkoff Acquiring SDK is a simple way to integrate payments into your mobile application.
version: 3.0.10
version: 3.0.11
repository: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter
issue_tracker: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/issues
homepage: https://madbrains.ru/

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
comparer: ^2.0.1
crypto: ^3.0.2
crypton: ^2.0.5
http: ^0.13.4
meta: ^1.7.0
json_annotation: ^4.5.0
crypto: ^3.0.3
crypton: ^2.1.0
http: ^1.0.0
meta: ^1.9.1
json_annotation: ^4.8.1

dev_dependencies:
test: ^1.21.3
build_runner: ^2.1.11
json_serializable: ^6.2.0
build_runner: ^2.4.4
json_serializable: ^6.7.0
6 changes: 3 additions & 3 deletions packages/tinkoff_acquiring_flutter/lib/src/constants.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ignore_for_file: public_member_api_docs

abstract class WebViewKeys {
abstract final class WebViewKeys {
static const String threeDSServerTransId = 'threeDSServerTransID';
static const String threeDSMethodNotificationURL =
'threeDSMethodNotificationURL';
Expand All @@ -16,7 +16,7 @@ abstract class WebViewKeys {
static const String cresCallbackUrl = 'cresCallbackUrl';
}

abstract class WebViewSettings {
abstract final class WebViewSettings {
static const String messageType = 'CReq';
static const String challengeWindowSize = '05';
static const List<String> cancelActions = <String>[
Expand All @@ -25,7 +25,7 @@ abstract class WebViewSettings {
];
}

abstract class WebViewMethods {
abstract final class WebViewMethods {
static const String submit3DSAuthorization = 'Submit3DSAuthorization';
static const String submit3DSAuthorizationV2 = 'Submit3DSAuthorizationV2';
static const String complete3DSMethodv2 = 'Complete3DSMethodv2';
Expand Down
6 changes: 3 additions & 3 deletions packages/tinkoff_acquiring_flutter/lib/src/web_view_3ds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class WebView3DS extends StatefulWidget {
final void Function(Submit3DSAuthorizationResponse?) onFinished;

/// Загрузка 3-D Secure
final void Function(bool) onLoad;
final void Function({required bool isLoading}) onLoad;

String get _termUrl => config
.apiUrl(
Expand Down Expand Up @@ -134,7 +134,7 @@ class _WebView3DSState extends State<WebView3DS> {
await _logNavigationDelegate('onPageStarted', url);

if (url == widget._termUrl) {
widget.onLoad(true);
widget.onLoad(isLoading: true);
}
},
onPageFinished: (String url) async {
Expand All @@ -151,7 +151,7 @@ class _WebView3DSState extends State<WebView3DS> {
if (url == widget._termUrl) {
await _response();
} else {
widget.onLoad(false);
widget.onLoad(isLoading: false);
}
},
),
Expand Down
10 changes: 5 additions & 5 deletions packages/tinkoff_acquiring_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
name: tinkoff_acquiring_flutter
description: Flutter Tinkoff Acquiring SDK is a simple way to integrate payments into your mobile application.
version: 3.0.10
version: 3.0.11
repository: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter
issue_tracker: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/issues
homepage: https://madbrains.ru/

environment:
sdk: ">=2.12.0 <3.0.0"
flutter: ">=2.0.0"
sdk: ">=3.0.0 <4.0.0"
flutter: ">=3.10.2"

dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
tinkoff_acquiring: ^3.0.10
webview_flutter: ^4.0.2
tinkoff_acquiring: ^3.0.11
webview_flutter: ^4.2.1

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit 805263a

Please sign in to comment.