Skip to content

Commit

Permalink
Merge pull request #40 from MadBrains/3.0.8
Browse files Browse the repository at this point in the history
3.0.8
  • Loading branch information
mit-73 authored Dec 19, 2022
2 parents c621ddb + d4b6ba6 commit 2630d30
Show file tree
Hide file tree
Showing 75 changed files with 541 additions and 414 deletions.
52 changes: 10 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ PANA_SCRIPT=../../tool/verify_pub_score.sh 100

DART_PATH= packages/tinkoff_acquiring
FLUTTER_PATH= packages/tinkoff_acquiring_flutter
EXAMPLE_PATH= example
PACKAGES_PATH= $(DART_PATH) $(FLUTTER_PATH) example

FVM = fvm
FVM_FLUTTER = $(FVM) flutter
FVM_DART = $(FVM) dart

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

version:
$(FVM_FLUTTER) --version; $(FVM_DART) --version;
Expand All @@ -29,49 +29,17 @@ bump:
build_runner:
cd $(DART_PATH); $(FVM_FLUTTER) pub run build_runner build --delete-conflicting-outputs;

pub_get: pub_get_dart pub_get_flutter pub_get_example
pub_get:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) packages get; cd ../..;)

pub_get_dart:
cd $(DART_PATH); $(FVM_FLUTTER) packages get;
clean:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) clean; cd ../..;)

pub_get_flutter:
cd $(FLUTTER_PATH); $(FVM_FLUTTER) packages get;
fix:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) format .; cd ../..;)

pub_get_example:
cd $(EXAMPLE_PATH); $(FVM_FLUTTER) packages get;

clean: clean_dart clean_flutter clean_example

clean_dart:
cd $(DART_PATH); $(FVM_FLUTTER) clean;

clean_flutter:
cd $(FLUTTER_PATH); $(FVM_FLUTTER) clean;

clean_example:
cd $(EXAMPLE_PATH); $(FVM_FLUTTER) clean;

fix: fix_dart fix_flutter fix_example

fix_dart:
cd $(DART_PATH); $(FVM_FLUTTER) format .;

fix_flutter:
cd $(FLUTTER_PATH); $(FVM_FLUTTER) format .;

fix_example:
cd $(EXAMPLE_PATH); $(FVM_FLUTTER) format .;

analyze: analyze_dart analyze_flutter analyze_example

analyze_dart:
cd $(DART_PATH); $(FVM_FLUTTER) analyze . --fatal-infos;

analyze_flutter:
cd $(FLUTTER_PATH); $(FVM_FLUTTER) analyze . --fatal-infos;

analyze_example:
cd $(EXAMPLE_PATH); $(FVM_FLUTTER) analyze . --fatal-infos;
analyze:
$(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) analyze . --fatal-infos; cd ../..;)

pana: pana_dart pana_flutter

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Acquiring SDK allows you to integrate [Tinkoff Internet Acquiring][acquiring] in

[Available API Documentation][documentation].

EACQ protocol version with PCI DSS: 1.42 (30.08.2022)
EACQ protocol version with PCI DSS: 1.50 (09.12.2022)

## SDK Features

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
6 changes: 3 additions & 3 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -418,7 +418,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -467,7 +467,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ environment:
dependencies:
flutter:
sdk: flutter
tinkoff_acquiring: ^3.0.7
tinkoff_acquiring_flutter: ^3.0.7
tinkoff_acquiring: ^3.0.8
tinkoff_acquiring_flutter: ^3.0.8

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

* Fixed & add/remove new request and response models (Sync with documentation)
* Fix readme
* Update dependency webview_flutter to 4.0.0

# 3.0.7

* Add PaymentId to AddCardResponse
Expand Down
8 changes: 4 additions & 4 deletions packages/tinkoff_acquiring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ Acquiring SDK allows you to integrate [Tinkoff Internet Acquiring][acquiring] in
Add this to your package's pubspec.yaml file:
```yaml
dependencies:
tinkoff_acquiring: <lastles>
tinkoff_acquiring_flutter: <lastles> # for UI
tinkoff_acquiring: ^3.0.8
tinkoff_acquiring_flutter: ^3.0.8
```
## Before usage
Expand Down Expand Up @@ -78,8 +78,8 @@ If you want to use a proxy, use the following constructor:
```dart
final TinkoffAcquiring acquiring = TinkoffAcquiring(
TinkoffAcquiringConfig.proxy(
proxyDomain: terminalKey,
proxyPath: password,
proxyDomain: 'myserver.com',
proxyPath: '/acquiring',
isDebugMode: false,
globalHeaders: <String, String>{...},
mapping: (AcquiringRequest request, bool isDebugMode) {
Expand Down
8 changes: 4 additions & 4 deletions packages/tinkoff_acquiring/README.ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ Acquiring SDK позволяет интегрировать [Интернет-Э
Для подключения добавьте в файл Pubspec зависимости:
```yaml
dependencies:
tinkoff_acquiring: <lastles>
tinkoff_acquiring_flutter: <lastles> # for UI
tinkoff_acquiring: ^3.0.8
tinkoff_acquiring_flutter: ^3.0.8
```
## Подготовка к работе
Expand Down Expand Up @@ -76,8 +76,8 @@ request.copyWith(signToken: ...);
```dart
final TinkoffAcquiring acquiring = TinkoffAcquiring(
TinkoffAcquiringConfig.proxy(
proxyDomain: terminalKey,
proxyPath: password,
proxyDomain: 'myserver.com',
proxyPath: '/acquiring',
isDebugMode: false,
globalHeaders: <String, String>{...},
mapping: (AcquiringRequest request, bool isDebugMode) {
Expand Down
11 changes: 9 additions & 2 deletions packages/tinkoff_acquiring/lib/src/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,20 @@ abstract class JsonKeys {
static const String isRejected = 'IsRejected';
static const String notificationTypes = 'NotificationTypes';
static const String residentState = 'ResidentState';
static const String qrMemberId = 'QrMemberId';
static const String operatingCheckProps = 'OperatingCheckProps';
static const String sectoralCheckProps = 'SectoralCheckProps';
static const String addUserProp = 'AddUserProp';
static const String additionalCheckProps = 'AdditionalCheckProps';
static const String timestamp = 'Timestamp';
}

abstract class NetworkSettings {
static const String apiVersion = 'v2';
static const String domainDebug = 'rest-api-test.tinkoff.ru';
static const String domainRelease = 'securepay.tinkoff.ru';
static const String apiPath = '$apiVersion/';
static const String apiPath = '/';
static const String apiVersion2 = 'v2';
static const String apiVersionCashbox = 'cashbox';

static const Duration timeout = Duration(seconds: 40);

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ class AddCardRequest extends AcquiringRequest {
///
/// Возможные значения:
/// 1. NO – сохранить карту без проверок. Rebill ID для рекуррентных платежей не возвращается;
/// 2. – при сохранении сделать списание на 0 руб.*
/// 2. HOLD – при сохранении сделать списание на 0 руб.*
/// RebillID возвращается для терминалов без поддержки 3DS.
/// 3. 3DS – при сохранении карты выполнить проверку 3DS и выполнить списание на 0 р.*
/// В этом случае RebillID будет только для 3DS карт.
/// Карты, не поддерживающие 3DS, привязаны не будут.
/// 4. 3DSHOLD – при привязке карты выполняем проверку, поддерживает карта 3DS или нет.
/// Для карт МИР с 3DS v1 выполняется списание, а затем отмена на 1р.
/// Для прочих карт выполняется списание на 0р.
///
/// Для всех карт выполняется списание на 0р.
@JsonKey(name: JsonKeys.checkType)
final CheckType? checkType;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ abstract class AcquiringRequest extends BaseRequest {
/// Метод запроса
String get apiMethod;

/// Версия метода запроса
String get apiVersion => NetworkSettings.apiVersion2;

/// Полный путь до метода запроса (версия + метод)
String get apiMethodPath => '$apiVersion/$apiMethod';

/// Опциональный параметр: готовая подпись запроса
@JsonKey(name: JsonKeys.token)
final String? signToken;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:json_annotation/json_annotation.dart';

import '../base/acquiring_request.dart';
import '../common/receipt.dart';
import '../common/receipts.dart';
import '../common/shops.dart';

part 'cancel_request.g.dart';
Expand All @@ -15,6 +14,12 @@ part 'cancel_request.g.dart';
/// - CONFIRMED -> PARTIAL_REFUNDED – если отмена не на полную сумму
/// - CONFIRMED -> REFUNDED – если отмена на полную сумму
///
/// \* в случае отмены статуса NEW поле Amount, даже если оно проставлено, игнорируется.
/// Отмена производится на полную сумму.
///
/// \** в случае полной отмены структура чека не передается.
/// В случае частичной отмены необходимо передавать те товары, которые нужно отменить.
///
/// [CancelRequest](https://www.tinkoff.ru/kassa/develop/api/payments/cancel-description/)
@JsonSerializable(includeIfNull: false)
class CancelRequest extends AcquiringRequest {
Expand All @@ -25,7 +30,7 @@ class CancelRequest extends AcquiringRequest {
this.amount,
this.receipt,
this.shops,
this.receipts,
this.qrMemberId,
String? signToken,
}) : super(signToken);

Expand All @@ -47,7 +52,6 @@ class CancelRequest extends AcquiringRequest {
JsonKeys.ip: ip,
JsonKeys.receipt: receipt,
JsonKeys.shops: shops,
JsonKeys.receipts: receipts,
};

@override
Expand All @@ -58,7 +62,6 @@ class CancelRequest extends AcquiringRequest {
String? ip,
Receipt? receipt,
List<Shops>? shops,
List<Receipts>? receipts,
}) {
return CancelRequest(
signToken: signToken ?? this.signToken,
Expand All @@ -67,7 +70,6 @@ class CancelRequest extends AcquiringRequest {
ip: ip ?? this.ip,
receipt: receipt ?? this.receipt,
shops: shops ?? this.shops,
receipts: receipts ?? this.receipts,
);
}

Expand All @@ -81,13 +83,6 @@ class CancelRequest extends AcquiringRequest {
}
}

final List<Receipts>? receipts = this.receipts;
if (receipts != null) {
for (int i = 0; i < receipts.length; i++) {
receipts[i].validate();
}
}

paymentId.validateId(JsonKeys.paymentId, checkNull: true);
amount.validateAmount(JsonKeys.amount);
ip.validateIp(JsonKeys.ip);
Expand Down Expand Up @@ -121,9 +116,9 @@ class CancelRequest extends AcquiringRequest {
@JsonKey(name: JsonKeys.shops)
final List<Shops>? shops;

/// Массив объектов с чеками для каждого ShopCode из объекта Shops
/// Код банка в классификации СБП, в который необходимо выполнить возврат
///
/// Имеет приоритет над данными, переданными в методе `Init`
@JsonKey(name: JsonKeys.receipts)
final List<Receipts>? receipts;
/// См параметр [memberId] в Методе [QrMembersList]
@JsonKey(name: JsonKeys.qrMemberId)
final String? qrMemberId;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2630d30

Please sign in to comment.