Skip to content

Commit 031608c

Browse files
authored
2.0.1 (#5) (#6)
* chore: recreating example * ci: add make, actions, dependabot * chore: edit gitignore * docs: readme & license * style: lint * chore: dependency update * feat: Update models & add new * feat: Added more options for working with proxy api. Redesigned network client. * docs: update readme & add changelog * chore: bump 2.0.1
1 parent 683e000 commit 031608c

File tree

121 files changed

+2360
-2030
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2360
-2030
lines changed

.github/dependabot.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
enable-beta-ecosystems: true
3+
updates:
4+
- package-ecosystem: "pub"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: pull_request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
format:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 30
12+
steps:
13+
- name: 'Git Checkout'
14+
uses: actions/checkout@v3
15+
- name: 'Install Flutter'
16+
uses: subosito/flutter-action@v2
17+
with:
18+
channel: 'stable'
19+
- name: 'Install Tools'
20+
run: flutter pub global activate fvm; make init;
21+
- name: 'Format Code'
22+
run: make fix
23+
- name: 'Validate Formatting'
24+
run: ./tool/validate-formatting.sh

.github/workflows/push.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: push
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: jacopocarlini/action-autotag@master
14+
with:
15+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
16+
package_root: "/"
17+
tag_prefix: "v"

.gitignore

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Miscellaneous
22
*.class
3+
*.lock
34
*.log
45
*.pyc
56
*.swp
@@ -9,16 +10,18 @@
910
.history
1011
.svn/
1112
.fvm/
13+
.melos_tool/
1214

1315
# IntelliJ related
1416
*.iml
1517
*.ipr
1618
*.iws
1719
.idea/
1820

19-
# The .vscode folder contains launch configuration and tasks you configure in
20-
# VS Code which you may wish to be included in version control, so this line
21-
# is commented out by default.
21+
# Visual Studio Code related
22+
.classpath
23+
.project
24+
.settings/
2225
.vscode/
2326

2427
# Flutter/Dart/Pub related
@@ -30,6 +33,11 @@
3033
.pub-cache/
3134
.pub/
3235
build/
36+
flutter_*.png
37+
linked_*.ds
38+
unlinked.ds
39+
unlinked_spec.ds
40+
3341

3442
# Android related
3543
**/android/**/gradle-wrapper.jar
@@ -73,11 +81,18 @@ build/
7381
!**/ios/**/default.mode2v3
7482
!**/ios/**/default.pbxuser
7583
!**/ios/**/default.perspectivev3
84+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
85+
86+
# Web related
87+
lib/generated_plugin_registrant.dart
88+
89+
# Symbolication related
90+
app.*.symbols
91+
92+
# Obfuscation related
93+
app.*.map.json
94+
95+
# Exceptions to above rules.
96+
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
7697

77-
# Mad Brains internal files
78-
fastlane/
79-
.gitlab-ci.yml
80-
.ruby-version
81-
Gemfile
82-
Gemfile.lock
83-
.templates
98+
example/ios/Podfile.lock

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## [2.0.1]
2+
3+
* Update models & add new
4+
* Added more options for working with proxy api
5+
* Redesigned network client
6+
17
## [2.0.0]
28

39
* Null safe support

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Mad Brains
3+
Copyright (c) 2022 Mad Brains
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
.PHONY: version doctor
2+
3+
PANA_SCRIPT=./tool/verify_pub_score.sh 100
4+
5+
EXAMPLE_PATH= example
6+
7+
FVM = fvm
8+
FVM_FLUTTER = $(FVM) flutter
9+
FVM_DART = $(FVM) dart
10+
11+
12+
init:
13+
$(FVM) use 3.0.1 --force; $(FVM_DART) pub global activate pana;
14+
15+
version:
16+
$(FVM_FLUTTER) --version; $(FVM_DART) --version;
17+
18+
doctor:
19+
$(FVM_FLUTTER) doctor;
20+
21+
ifeq (bump, $(firstword $(MAKECMDGOALS)))
22+
runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
23+
$(eval $(runargs):;@true)
24+
endif
25+
bump:
26+
./tool/bump-version.sh $(filter-out $@,$(MAKECMDGOALS))
27+
28+
build_runner:
29+
$(FVM_FLUTTER) pub run build_runner build --delete-conflicting-outputs;
30+
31+
pub_get:
32+
$(FVM_FLUTTER) packages get;
33+
34+
clean:
35+
$(FVM_FLUTTER) clean;
36+
37+
fix:
38+
$(FVM_FLUTTER) format .;
39+
40+
analyze:
41+
$(FVM_FLUTTER) analyze . --fatal-infos;
42+
43+
pana:
44+
$(PANA_SCRIPT);

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Acquiring SDK allows you to integrate [Sberbank Internet Acquiring][acquiring] i
1919
Add this to your package's pubspec.yaml file:
2020
```yaml
2121
dependencies:
22-
sberbank_acquiring: 2.0.0
22+
sberbank_acquiring: <lastles>
2323
```
2424
2525
## Before usage
@@ -37,10 +37,10 @@ The SDK also allows you to configure request proxying, by default all requests g
3737
To configure the operation mode, set the following parameters:
3838
```dart
3939
final SberbankAcquiring acquiring = SberbankAcquiring(
40-
SberbankAcquiringConfig(
40+
SberbankAcquiringConfig.credential(
4141
userName: userName,
4242
password: password,
43-
debug: false,
43+
isDebugMode: false,
4444
),
4545
);
4646
```
@@ -50,6 +50,7 @@ If you want to use `token`, use the following constructor:
5050
final SberbankAcquiring acquiring = SberbankAcquiring(
5151
SberbankAcquiringConfig.token(
5252
token: token,
53+
isDebugMode: false,
5354
),
5455
);
5556
```
@@ -58,7 +59,13 @@ If you want to use a `proxy`, use the following constructor:
5859
```dart
5960
final SberbankAcquiring acquiring = SberbankAcquiring(
6061
SberbankAcquiringConfig.proxy(
61-
proxyUrl: 'https://server.com/',
62+
proxyDomain: 'server.com',
63+
proxyPath: 'api/v1/',
64+
globalHeaders: <String, String>{'auth': 'test'},
65+
mapping: (AcquiringRequest request, bool isDebugMode) {
66+
if(request is RegisterRequest) return ProxyMapping(path: '/register');
67+
return;
68+
}
6269
),
6370
);
6471
```
@@ -68,6 +75,6 @@ final SberbankAcquiring acquiring = SberbankAcquiring(
6875
The [Example][example] is in the corresponding folder
6976

7077

71-
[documentation]: https://securepayments.sberbank.ru/wiki/doku.php/integration:paymentpage:paymentpage_design
78+
[documentation]: https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:start
7279
[acquiring]: https://securepayments.sberbank.ru/wiki/doku.php/main_page
7380
[example]: https://github.com/MadBrains/Sberbank-Acquiring-SDK-Flutter/tree/main/example/

README.ru.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Acquiring SDK позволяет интегрировать [Интернет-Э
1717
Для подключения добавьте в файл pubspec.yaml зависимости:
1818
```yaml
1919
dependencies:
20-
sberbank_acquiring: 2.0.0
20+
sberbank_acquiring: <lastles>
2121
```
2222
2323
## Подготовка к работе
@@ -35,10 +35,10 @@ SDK позволяет настроить режим работы (debug/prod),
3535
Чтобы настроить режим работы, установите параметры:
3636
```dart
3737
final SberbankAcquiring acquiring = SberbankAcquiring(
38-
SberbankAcquiringConfig(
38+
SberbankAcquiringConfig.credential(
3939
userName: userName,
4040
password: password,
41-
debug: false,
41+
isDebugMode: false,
4242
),
4343
);
4444
```
@@ -48,6 +48,7 @@ final SberbankAcquiring acquiring = SberbankAcquiring(
4848
final SberbankAcquiring acquiring = SberbankAcquiring(
4949
SberbankAcquiringConfig.token(
5050
token: token,
51+
isDebugMode: false,
5152
),
5253
);
5354
```
@@ -56,7 +57,13 @@ final SberbankAcquiring acquiring = SberbankAcquiring(
5657
```dart
5758
final SberbankAcquiring acquiring = SberbankAcquiring(
5859
SberbankAcquiringConfig.proxy(
59-
proxyUrl: 'https://server.com/',
60+
proxyDomain: 'server.com',
61+
proxyPath: 'api/v1/',
62+
globalHeaders: <String, String>{'auth': 'test'},
63+
mapping: (AcquiringRequest request, bool isDebugMode) {
64+
if(request is RegisterRequest) return ProxyMapping(path: '/register');
65+
return;
66+
}
6067
),
6168
);
6269
```
@@ -66,6 +73,6 @@ final SberbankAcquiring acquiring = SberbankAcquiring(
6673
Пример работы SDK доступен в [Example][example]
6774

6875

69-
[documentation]: https://securepayments.sberbank.ru/wiki/doku.php/integration:paymentpage:paymentpage_design
76+
[documentation]: https://securepayments.sberbank.ru/wiki/doku.php/integration:api:rest:start
7077
[acquiring]: https://securepayments.sberbank.ru/wiki/doku.php/main_page
7178
[example]: https://github.com/MadBrains/Sberbank-Acquiring-SDK-Flutter/tree/main/example/

analysis_options.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
analyzer:
22
exclude:
33
- "**/*.g.dart"
4+
language:
5+
strict-casts: true
6+
strict-inference: true
7+
strict-raw-types: true
48
strong-mode:
59
implicit-casts: false
610
implicit-dynamic: false
@@ -18,6 +22,7 @@ linter:
1822
rules:
1923
- public_member_api_docs
2024
- always_declare_return_types
25+
- always_require_non_null_named_parameters
2126
- annotate_overrides
2227
- avoid_bool_literals_in_conditional_expressions
2328
- avoid_catching_errors
@@ -137,3 +142,4 @@ linter:
137142
- sort_constructors_first
138143
- prefer_single_quotes
139144
- always_specify_types
145+
- require_trailing_commas

0 commit comments

Comments
 (0)