├── .pubignore ├── example ├── ios │ ├── Runner │ │ ├── Runner-Bridging-Header.h │ │ ├── Assets.xcassets │ │ │ ├── LaunchImage.imageset │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ ├── README.md │ │ │ │ └── Contents.json │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ ├── AppDelegate.swift │ │ ├── Base.lproj │ │ │ └── Main.storyboard │ │ └── Info.plist │ ├── Flutter │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── AppFrameworkInfo.plist │ ├── Runner.xcodeproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ ├── .gitignore │ └── Podfile ├── android │ ├── gradle.properties │ ├── app │ │ ├── src │ │ │ ├── main │ │ │ │ ├── res │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ └── ic_launcher.png │ │ │ │ │ ├── drawable │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── drawable-v21 │ │ │ │ │ │ └── launch_background.xml │ │ │ │ │ ├── values │ │ │ │ │ │ └── styles.xml │ │ │ │ │ └── values-night │ │ │ │ │ │ └── styles.xml │ │ │ │ ├── kotlin │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── example │ │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug │ │ │ │ └── AndroidManifest.xml │ │ │ └── profile │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── settings.gradle │ └── build.gradle ├── .metadata ├── pubspec.yaml ├── README.md └── .gitignore ├── packages ├── tinkoff_acquiring_flutter │ ├── analysis_options.yaml │ ├── test │ │ └── tinkoff_acquiring_flutter_test.dart │ ├── pubspec_overrides.yaml │ ├── lib │ │ ├── tinkoff_acquiring_flutter.dart │ │ └── src │ │ │ ├── utils.dart │ │ │ └── constants.dart │ ├── README.md │ ├── example │ │ └── README.md │ ├── .metadata │ ├── pubspec.yaml │ ├── LICENSE │ └── CHANGELOG.md └── tinkoff_acquiring │ ├── analysis_options.yaml │ ├── example │ └── README.md │ ├── lib │ ├── src │ │ ├── core │ │ │ └── models │ │ │ │ ├── base │ │ │ │ ├── base.dart │ │ │ │ ├── base_response.dart │ │ │ │ ├── base_request.dart │ │ │ │ ├── proxy_request.dart │ │ │ │ ├── acquiring_request.dart │ │ │ │ ├── acquiring_response.dart │ │ │ │ └── acquiring_response.g.dart │ │ │ │ ├── enums │ │ │ │ ├── language.dart │ │ │ │ ├── pay_type.dart │ │ │ │ ├── card_status.dart │ │ │ │ ├── data_type.dart │ │ │ │ ├── route.dart │ │ │ │ ├── card_type.dart │ │ │ │ ├── enums.dart │ │ │ │ ├── tax.dart │ │ │ │ ├── taxation.dart │ │ │ │ ├── payment_method.dart │ │ │ │ ├── agent_sign.dart │ │ │ │ ├── check_type.dart │ │ │ │ ├── source.dart │ │ │ │ └── mark_code_type.dart │ │ │ │ ├── common │ │ │ │ ├── common.dart │ │ │ │ ├── add_user_prop.g.dart │ │ │ │ ├── mark_quantity.g.dart │ │ │ │ ├── supplier_info.g.dart │ │ │ │ ├── operating_check_props.g.dart │ │ │ │ ├── sectoral_check_props.g.dart │ │ │ │ ├── sectoral_item_props.g.dart │ │ │ │ ├── member.g.dart │ │ │ │ ├── shops.g.dart │ │ │ │ ├── mark_code.g.dart │ │ │ │ ├── payments.g.dart │ │ │ │ ├── client_info.g.dart │ │ │ │ ├── add_user_prop.dart │ │ │ │ ├── card_info.g.dart │ │ │ │ ├── member.dart │ │ │ │ ├── mark_quantity.dart │ │ │ │ ├── operating_check_props.dart │ │ │ │ ├── card_info.dart │ │ │ │ ├── shops.dart │ │ │ │ ├── sectoral_check_props.dart │ │ │ │ ├── agent_data.g.dart │ │ │ │ ├── payments.dart │ │ │ │ └── sectoral_item_props.dart │ │ │ │ ├── get_account_qr_list │ │ │ │ ├── get_account_qr_list_request.g.dart │ │ │ │ ├── get_account_qr_list_request.dart │ │ │ │ └── get_account_qr_list_response.dart │ │ │ │ ├── check_order │ │ │ │ ├── check_order_request.g.dart │ │ │ │ ├── check_order_request.dart │ │ │ │ └── check_order_response.dart │ │ │ │ ├── qr_members_list │ │ │ │ ├── qr_members_list_request.g.dart │ │ │ │ ├── qr_members_list_request.dart │ │ │ │ └── qr_members_list_response.dart │ │ │ │ ├── get_state │ │ │ │ ├── get_state_request.g.dart │ │ │ │ ├── get_state_request.dart │ │ │ │ └── get_state_response.dart │ │ │ │ ├── get_add_card_state │ │ │ │ ├── get_add_card_state_request.g.dart │ │ │ │ └── get_add_card_state_request.dart │ │ │ │ ├── get_customer │ │ │ │ ├── get_customer_request.g.dart │ │ │ │ ├── get_customer_request.dart │ │ │ │ └── get_customer_response.dart │ │ │ │ ├── get_card_list │ │ │ │ ├── get_card_list_request.g.dart │ │ │ │ ├── get_card_list_response.dart │ │ │ │ └── get_card_list_request.dart │ │ │ │ ├── resend │ │ │ │ ├── resend_request.g.dart │ │ │ │ ├── resend_response.dart │ │ │ │ └── resend_request.dart │ │ │ │ ├── get_add_account_qr_state │ │ │ │ ├── get_add_account_qr_state_request.g.dart │ │ │ │ └── get_add_account_qr_state_request.dart │ │ │ │ ├── remove_customer │ │ │ │ ├── remove_customer_request.g.dart │ │ │ │ ├── remove_customer_response.dart │ │ │ │ └── remove_customer_request.dart │ │ │ │ ├── check_3ds_version │ │ │ │ ├── check_3ds_version_request.g.dart │ │ │ │ └── check_3ds_version_request.dart │ │ │ │ ├── remove_card │ │ │ │ ├── remove_card_request.g.dart │ │ │ │ ├── remove_card_response.g.dart │ │ │ │ └── remove_card_request.dart │ │ │ │ ├── send_closing_receipt │ │ │ │ ├── send_closing_receipt_request.g.dart │ │ │ │ └── send_closing_receipt_response.dart │ │ │ │ ├── sbp_pay_test │ │ │ │ ├── sbp_pay_test_request.g.dart │ │ │ │ └── sbp_pay_test_response.dart │ │ │ │ ├── get_static_qr │ │ │ │ ├── get_static_qr_request.g.dart │ │ │ │ ├── get_static_qr_response.dart │ │ │ │ └── get_static_qr_request.dart │ │ │ │ ├── attach_card │ │ │ │ └── attach_card_request.g.dart │ │ │ │ ├── add_customer │ │ │ │ ├── add_customer_request.g.dart │ │ │ │ └── add_customer_response.dart │ │ │ │ ├── get_qr │ │ │ │ ├── get_qr_request.g.dart │ │ │ │ ├── get_qr_request.dart │ │ │ │ └── get_qr_response.dart │ │ │ │ ├── charge │ │ │ │ ├── charge_request.g.dart │ │ │ │ └── charge_response.dart │ │ │ │ ├── charge_qr │ │ │ │ ├── charge_qr_request.g.dart │ │ │ │ └── charge_qr_response.dart │ │ │ │ ├── add_card │ │ │ │ ├── add_card_request.g.dart │ │ │ │ └── add_card_response.dart │ │ │ │ ├── confirm │ │ │ │ ├── confirm_request.g.dart │ │ │ │ └── confirm_response.dart │ │ │ │ ├── cancel │ │ │ │ ├── cancel_request.g.dart │ │ │ │ └── cancel_response.dart │ │ │ │ ├── add_account_qr │ │ │ │ ├── add_account_qr_request.g.dart │ │ │ │ └── add_account_qr_response.dart │ │ │ │ └── init │ │ │ │ └── init_response.dart │ │ └── utils │ │ │ ├── logger.dart │ │ │ └── crypto_utils.dart │ ├── tinkoff_acquiring_utils.dart │ └── tinkoff_acquiring.dart │ ├── .metadata │ ├── pubspec.yaml │ ├── test │ ├── crypto_test.dart │ └── sdk_test_constant.dart │ ├── LICENSE │ └── CHANGELOG.md ├── docs ├── info.png ├── banner.png ├── follow_us_stroke.png └── get_started_stroke.png ├── .github ├── dependabot.yaml └── workflows │ ├── push.yaml │ └── pull_request.yaml ├── tool ├── verify_pub_score.sh ├── validate-formatting.sh └── bump-version.sh ├── LICENSE ├── Makefile ├── CONTRIBUTING.md ├── README.md └── .gitignore /.pubignore: -------------------------------------------------------------------------------- 1 | pubspec_overrides.yaml -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/test/tinkoff_acquiring_flutter_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | -------------------------------------------------------------------------------- /docs/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/docs/info.png -------------------------------------------------------------------------------- /docs/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/docs/banner.png -------------------------------------------------------------------------------- /docs/follow_us_stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/docs/follow_us_stroke.png -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /docs/get_started_stroke.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/docs/get_started_stroke.png -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/pubspec_overrides.yaml: -------------------------------------------------------------------------------- 1 | dependency_overrides: 2 | tinkoff_acquiring: 3 | path: ../tinkoff_acquiring -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: ../../analysis_options.yaml 2 | 3 | analyzer: 4 | exclude: 5 | - "**/*.g.dart" 6 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/lib/tinkoff_acquiring_flutter.dart: -------------------------------------------------------------------------------- 1 | library tinkoff_acquiring_flutter; 2 | 3 | export 'src/web_view_3ds.dart'; 4 | export 'src/collect_data.dart'; 5 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/example/README.md: -------------------------------------------------------------------------------- 1 | The [Example][example] is in the corresponding folder 2 | 3 | [example]: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/tree/main/example -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/README.md: -------------------------------------------------------------------------------- 1 | Extension for [tinkoff_acquiring][repo] please go there for documentation. 2 | 3 | [repo]: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/example/README.md: -------------------------------------------------------------------------------- 1 | The [Example][example] is in the corresponding folder 2 | 3 | [example]: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/tree/main/example -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/base.dart: -------------------------------------------------------------------------------- 1 | export 'acquiring_request.dart'; 2 | export 'acquiring_response.dart'; 3 | export 'base_request.dart'; 4 | export 'base_response.dart'; 5 | export 'proxy_request.dart'; 6 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/language.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Список языков платежной формы 4 | enum Language { 5 | /// ru — русский 6 | @JsonValue('ru') 7 | ru, 8 | 9 | /// en — английский 10 | @JsonValue('en') 11 | en, 12 | } 13 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/pay_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Список типов оплаты 4 | enum PayType { 5 | /// one (O) — одностадийная 6 | @JsonValue('O') 7 | one, 8 | 9 | /// two (T) — двухстадийная 10 | @JsonValue('T') 11 | two, 12 | } 13 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/tinkoff_acquiring_utils.dart: -------------------------------------------------------------------------------- 1 | /// Содержит дополнительные инструменты для разработки 2 | library tinkoff_acquiring_utils; 3 | 4 | export 'src/utils/card_validator.dart'; 5 | export 'src/utils/ip_address.dart'; 6 | export 'src/utils/logger.dart'; 7 | export 'src/utils/network_client.dart' show SignToken; 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.github/dependabot.yaml: -------------------------------------------------------------------------------- 1 | version: 2 2 | enable-beta-ecosystems: true 3 | updates: 4 | - package-ecosystem: "pub" 5 | directory: "/packages/tinkoff_acquiring/" 6 | schedule: 7 | interval: "weekly" 8 | - package-ecosystem: "pub" 9 | directory: "/packages/tinkoff_acquiring_flutter/" 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: bbfbf1770cca2da7c82e887e4e4af910034800b6 8 | channel: unknown 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: bbfbf1770cca2da7c82e887e4e4af910034800b6 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818 8 | channel: unknown 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /.github/workflows/push.yaml: -------------------------------------------------------------------------------- 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: "/packages/tinkoff_acquiring" 17 | tag_prefix: "v" 18 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/card_status.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Статус карты 4 | enum CardStatus { 5 | /// A - активная 6 | @JsonValue('A') 7 | active, 8 | 9 | /// I - неактивная 10 | @JsonValue('I') 11 | inactive, 12 | 13 | /// D - удалена 14 | @JsonValue('D') 15 | deleted, 16 | 17 | /// не существует 18 | notExist, 19 | } 20 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/data_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Тип возвращаемых данных 4 | enum DataType { 5 | /// не существует 6 | notExist, 7 | 8 | /// В ответе возвращается только `Payload` (по умолчанию) 9 | @JsonValue('PAYLOAD') 10 | payload, 11 | 12 | /// В ответе возвращается только `SVG` изображение `QR` 13 | @JsonValue('IMAGE') 14 | image, 15 | } 16 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/route.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Способ платежа. 4 | enum Route { 5 | /// ACQ – для Cards, Apple Pay и Google Pay 6 | @JsonValue('ACQ') 7 | acq, 8 | 9 | /// Mobile commerce 10 | @JsonValue('MC') 11 | mc, 12 | 13 | /// Envoicing 14 | @JsonValue('EINV') 15 | einv, 16 | 17 | /// WebMoney 18 | @JsonValue('WM') 19 | wm, 20 | } 21 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/card_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Тип карты 4 | enum CardType { 5 | /// не существует 6 | notExist, 7 | 8 | /// [writeOffs] — списания 9 | @JsonValue(0) 10 | writeOffs, 11 | 12 | /// [replenishment] — пополнения 13 | @JsonValue(1) 14 | replenishment, 15 | 16 | /// [writeOffsAndReplenishment] — списания и пополнения 17 | @JsonValue(2) 18 | writeOffsAndReplenishment, 19 | } 20 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/enums.dart: -------------------------------------------------------------------------------- 1 | export 'agent_sign.dart'; 2 | export 'card_status.dart'; 3 | export 'card_type.dart'; 4 | export 'check_type.dart'; 5 | export 'data_type.dart'; 6 | export 'language.dart'; 7 | export 'mark_code_type.dart'; 8 | export 'pay_type.dart'; 9 | export 'payment_method.dart'; 10 | export 'payment_object.dart'; 11 | export 'route.dart'; 12 | export 'source.dart'; 13 | export 'status.dart'; 14 | export 'tax.dart'; 15 | export 'taxation.dart'; 16 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/base_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:comparer/comparer.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | export '../../../constants.dart'; 5 | export '../../../utils/extensions.dart'; 6 | 7 | /// Базовый класс ответа 8 | @immutable 9 | abstract class BaseResponse extends ComparerMap { 10 | @override 11 | Map get equals => {}; 12 | 13 | /// Преобразование модели в json 14 | Map toJson(); 15 | } 16 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/lib/src/utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert' as convert; 2 | import 'dart:typed_data'; 3 | 4 | /// Метод для получения кодированных двоичных данных `Base64` без `Padding` 5 | String base64WithoutPadding(Uint8List value) { 6 | final String encoded = convert.base64.encode(value); 7 | 8 | if (encoded.endsWith('==')) return encoded.substring(0, encoded.length - 2); 9 | if (encoded.endsWith('=')) return encoded.substring(0, encoded.length - 1); 10 | return encoded; 11 | } 12 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | version: 1.0.0+1 4 | 5 | publish_to: none 6 | 7 | environment: 8 | sdk: ">=3.0.0 <4.0.0" 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | tinkoff_acquiring: ^3.0.11 14 | tinkoff_acquiring_flutter: ^3.0.11 15 | 16 | dependency_overrides: 17 | tinkoff_acquiring: 18 | path: ../packages/tinkoff_acquiring 19 | tinkoff_acquiring_flutter: 20 | path: ../packages/tinkoff_acquiring_flutter 21 | 22 | flutter: 23 | uses-material-design: true -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/tax.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Ставка НДС 4 | enum Tax { 5 | /// none — без НДС 6 | @JsonValue('none') 7 | none, 8 | 9 | /// vat0 — 0% 10 | @JsonValue('vat0') 11 | vat0, 12 | 13 | /// vat10 — 10% 14 | @JsonValue('vat10') 15 | vat10, 16 | 17 | /// vat20 — 20% 18 | @JsonValue('vat20') 19 | vat20, 20 | 21 | /// vat110 — 10/110 22 | @JsonValue('vat110') 23 | vat110, 24 | 25 | /// vat120 — 20/120 26 | @JsonValue('vat120') 27 | vat120, 28 | } 29 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/common.dart: -------------------------------------------------------------------------------- 1 | export 'account_qr_token.dart'; 2 | export 'add_user_prop.dart'; 3 | export 'agent_data.dart'; 4 | export 'card_info.dart'; 5 | export 'client_info.dart'; 6 | export 'items.dart'; 7 | export 'mark_code.dart'; 8 | export 'mark_quantity.dart'; 9 | export 'member.dart'; 10 | export 'operating_check_props.dart'; 11 | export 'order_payments.dart'; 12 | export 'payment_source.dart'; 13 | export 'payments.dart'; 14 | export 'receipt.dart'; 15 | export 'sectoral_check_props.dart'; 16 | export 'sectoral_item_props.dart'; 17 | export 'shops.dart'; 18 | export 'supplier_info.dart'; 19 | -------------------------------------------------------------------------------- /.github/workflows/pull_request.yaml: -------------------------------------------------------------------------------- 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 -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/add_user_prop.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'add_user_prop.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AddUserProp _$AddUserPropFromJson(Map json) => AddUserProp( 10 | json['Name'] as String, 11 | json['Value'] as String, 12 | ); 13 | 14 | Map _$AddUserPropToJson(AddUserProp instance) => 15 | { 16 | 'Name': instance.name, 17 | 'Value': instance.value, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: tinkoff_acquiring 2 | description: Flutter Tinkoff Acquiring SDK is a simple way to integrate payments into your mobile application. 3 | version: 3.0.11 4 | repository: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter 5 | issue_tracker: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/issues 6 | homepage: https://madbrains.ru/ 7 | 8 | environment: 9 | sdk: ">=3.0.0 <4.0.0" 10 | 11 | dependencies: 12 | comparer: ^2.0.1 13 | crypto: ^3.0.3 14 | crypton: ^2.1.0 15 | http: ^1.0.0 16 | meta: ^1.9.1 17 | json_annotation: ^4.8.1 18 | 19 | dev_dependencies: 20 | test: ^1.21.3 21 | build_runner: ^2.4.4 22 | json_serializable: ^6.7.0 -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: tinkoff_acquiring_flutter 2 | description: Flutter Tinkoff Acquiring SDK is a simple way to integrate payments into your mobile application. 3 | version: 3.0.11 4 | repository: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter 5 | issue_tracker: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/issues 6 | homepage: https://madbrains.ru/ 7 | 8 | environment: 9 | sdk: ">=3.0.0 <4.0.0" 10 | flutter: ">=3.10.2" 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | flutter_localizations: 16 | sdk: flutter 17 | tinkoff_acquiring: ^3.0.11 18 | webview_flutter: ^4.2.1 19 | 20 | dev_dependencies: 21 | flutter_test: 22 | sdk: flutter 23 | 24 | flutter: -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/taxation.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Система налогообложения 4 | enum Taxation { 5 | /// osn — общая 6 | @JsonValue('osn') 7 | osn, 8 | 9 | /// 2. usn_income — упрощенная (доходы) 10 | @JsonValue('usn_income') 11 | usnIncome, 12 | 13 | /// 3. usn_income_outcome — упрощенная (доходы минус расходы) 14 | @JsonValue('usn_income_outcome') 15 | usnIncomeOutcome, 16 | 17 | /// 4. patent — патентная 18 | @JsonValue('patent') 19 | patent, 20 | 21 | /// 5. envd — единый налог на вмененный доход 22 | @JsonValue('envd') 23 | envd, 24 | 25 | /// 5. esn — единый сельскохозяйственный налог 26 | @JsonValue('esn') 27 | esn, 28 | } 29 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.6.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/base_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:comparer/comparer.dart'; 2 | import 'package:meta/meta.dart'; 3 | 4 | export '../../../constants.dart'; 5 | export '../../../utils/extensions.dart'; 6 | 7 | /// Базовый класс запроса 8 | @immutable 9 | abstract class BaseRequest extends ComparerMap { 10 | /// Базовый класс запроса 11 | BaseRequest() { 12 | validate(); 13 | } 14 | 15 | @override 16 | Map get equals => {}; 17 | 18 | /// Преобразование модели в json 19 | Map toJson(); 20 | 21 | /// Создает экземпляр с заданными параметрами 22 | BaseRequest copyWith(); 23 | 24 | /// Метод проверяет валидность данных 25 | void validate(); 26 | } 27 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/mark_quantity.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'mark_quantity.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | MarkQuantity _$MarkQuantityFromJson(Map json) => MarkQuantity( 10 | numerator: json['numerator'] as int, 11 | denominator: json['denominator'] as int, 12 | ); 13 | 14 | Map _$MarkQuantityToJson(MarkQuantity instance) => 15 | { 16 | 'numerator': instance.numerator, 17 | 'denominator': instance.denominator, 18 | }; 19 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/tinkoff_acquiring.dart: -------------------------------------------------------------------------------- 1 | /// Является базовым модулем для работы с Tinkoff Acquiring API. 2 | /// Модуль реализует протокол взаимодействия с сервером и позволяет не осуществлять прямых обращений в API. 3 | /// 4 | /// Основной класс модуля: `TinkoffAcquiring` - предоставляет интерфейс для взаимодействия с Tinkoff Acquiring API. 5 | /// Для работы необходимы ключи и пароль продавца. 6 | library tinkoff_acquiring; 7 | 8 | export 'src/core/models/models.dart' 9 | hide 10 | ObjectRequestValidate, 11 | NumEx, 12 | MapEx, 13 | JsonKeys, 14 | NetworkSettings, 15 | ApiMethods, 16 | Ignore, 17 | CardSettings; 18 | export 'src/core/tinkoff_acquiring.dart'; 19 | export 'src/core/tinkoff_acquiring_config.dart'; 20 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/supplier_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'supplier_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | SupplierInfo _$SupplierInfoFromJson(Map json) => SupplierInfo( 10 | (json['Phones'] as List).map((e) => e as String).toList(), 11 | json['Name'] as String, 12 | json['Inn'] as String, 13 | ); 14 | 15 | Map _$SupplierInfoToJson(SupplierInfo instance) => 16 | { 17 | 'Phones': instance.phones, 18 | 'Name': instance.name, 19 | 'Inn': instance.inn, 20 | }; 21 | -------------------------------------------------------------------------------- /tool/verify_pub_score.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Runs `pana . --no-warning` and verifies that the package score 4 | # is greater or equal to the desired score. By default the desired score is 5 | # a perfect score but it can be overridden by passing the desired score as an argument. 6 | # 7 | # Ensure the package has a score of at least a 100 8 | # `./verify_pub_score.sh 100` 9 | # 10 | # Ensure the package has a perfect score 11 | # `./verify_pub_score.sh` 12 | 13 | PANA=$(pana . --no-warning); PANA_SCORE=$(echo $PANA | sed -n "s/.*Points: \([0-9]*\)\/\([0-9]*\)./\1\/\2/p") 14 | echo "score: $PANA_SCORE" 15 | IFS='/'; read -a SCORE_ARR <<< "$PANA_SCORE"; SCORE=SCORE_ARR[0]; TOTAL=SCORE_ARR[1] 16 | if [ -z "$1" ]; then MINIMUM_SCORE=TOTAL; else MINIMUM_SCORE=$1; fi 17 | if (( $SCORE < $MINIMUM_SCORE )); then echo "minimum score $MINIMUM_SCORE was not met!"; exit 1; fi -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/operating_check_props.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'operating_check_props.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | OperatingCheckProps _$OperatingCheckPropsFromJson(Map json) => 10 | OperatingCheckProps( 11 | json['Name'] as String, 12 | json['Value'] as String, 13 | json['Timestamp'] as String, 14 | ); 15 | 16 | Map _$OperatingCheckPropsToJson( 17 | OperatingCheckProps instance) => 18 | { 19 | 'Name': instance.name, 20 | 'Value': instance.value, 21 | 'Timestamp': instance.timestamp, 22 | }; 23 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/test/crypto_test.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | import 'package:test/test.dart'; 4 | import 'package:tinkoff_acquiring/src/utils/crypto_utils.dart'; 5 | 6 | Future main() async { 7 | group('Crypto Tests', () { 8 | test('sha256', () { 9 | final String testData = CryptoUtils.sha256( 10 | '100000testTokenExampleTinkoffBankTestTinkoffBankTest', 11 | ); 12 | const String resultData = 13 | '48d4ca825aab2ede06736d3eae099bd56ac97bd1bcdd598aff210f729de4eb21'; 14 | 15 | expect(testData, resultData); 16 | }); 17 | 18 | test('base64', () { 19 | final String testData = 20 | CryptoUtils.base64(Uint8List.fromList('123q6e321'.codeUnits)); 21 | const String resultData = 'MTIzcTZlMzIx'; 22 | 23 | expect(testData, resultData); 24 | }); 25 | }); 26 | } 27 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/payment_method.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Признак способа расчета 4 | enum PaymentMethod { 5 | /// full_payment — полный расчет 6 | @JsonValue('full_payment') 7 | fullPayment, 8 | 9 | /// full_prepayment — предоплата 100% 10 | @JsonValue('full_prepayment') 11 | fullPrepayment, 12 | 13 | /// prepayment — предоплата 14 | @JsonValue('prepayment') 15 | prepayment, 16 | 17 | /// advance — аванс 18 | @JsonValue('advance') 19 | advance, 20 | 21 | /// partial_payment — частичный расчет и кредит 22 | @JsonValue('partial_payment') 23 | partialPayment, 24 | 25 | /// credit — передача в кредит 26 | @JsonValue('credit') 27 | credit, 28 | 29 | /// credit_payment — оплата кредита 30 | @JsonValue('credit_payment') 31 | creditPayment, 32 | } 33 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/utils/logger.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer' as dev; 2 | 3 | /// Интерфейс базового логгера 4 | abstract interface class BaseLogger { 5 | /// Конструктор базового логгера 6 | const BaseLogger(); 7 | 8 | /// Метод логирует сообщение 9 | void log({ 10 | required String message, 11 | String name = '', 12 | Object error, 13 | StackTrace stackTrace, 14 | }); 15 | } 16 | 17 | /// Реализация простого логгера 18 | class Logger extends BaseLogger { 19 | /// Конструктор логгера 20 | const Logger(); 21 | 22 | @override 23 | void log({ 24 | required String message, 25 | String name = '', 26 | Object? error, 27 | StackTrace? stackTrace, 28 | }) { 29 | dev.log( 30 | message, 31 | name: 'Tinkoff | $name', 32 | error: error, 33 | stackTrace: stackTrace, 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/proxy_request.dart: -------------------------------------------------------------------------------- 1 | import '../../../constants.dart'; 2 | 3 | /// {@template proxy_request} 4 | /// Модель Proxy запроса, позволяет задать свой путь и заголовок при обращении к Proxy API. 5 | /// {@endtemplate} 6 | class ProxyRequest { 7 | /// {@macro proxy_request} 8 | const ProxyRequest({ 9 | this.methodPath, 10 | this.headers = NetworkSettings.baseHeaders, 11 | }); 12 | 13 | /// Путь запроса 14 | final String? methodPath; 15 | 16 | /// Заголовок запроса 17 | final Map? headers; 18 | 19 | /// Создает экземпляр с заданными параметрами 20 | ProxyRequest copyWith({ 21 | String? methodPath, 22 | Map? headers, 23 | }) { 24 | return ProxyRequest( 25 | methodPath: methodPath ?? this.methodPath, 26 | headers: headers ?? this.headers, 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/sectoral_check_props.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'sectoral_check_props.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | SectoralCheckProps _$SectoralCheckPropsFromJson(Map json) => 10 | SectoralCheckProps( 11 | json['FederalId'] as String, 12 | json['Date'] as String, 13 | json['Number'] as String, 14 | json['Value'] as String, 15 | ); 16 | 17 | Map _$SectoralCheckPropsToJson(SectoralCheckProps instance) => 18 | { 19 | 'FederalId': instance.federalId, 20 | 'Date': instance.date, 21 | 'Number': instance.number, 22 | 'Value': instance.value, 23 | }; 24 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/agent_sign.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Признак агента. 4 | enum AgentSign { 5 | /// bank_paying_agent – банковский платежный агент 6 | @JsonValue('bank_paying_agent') 7 | bankPayingAgent, 8 | 9 | /// bank_paying_subagent – банковский платежный субагент 10 | @JsonValue('bank_paying_subagent') 11 | bankPayingSubagent, 12 | 13 | /// paying_agent – платежный агент 14 | @JsonValue('paying_agent') 15 | payingAgent, 16 | 17 | /// paying_subagent – платежный субагент 18 | @JsonValue('paying_subagent') 19 | payingSubagent, 20 | 21 | /// attorney – поверенный 22 | @JsonValue('attorney') 23 | attorney, 24 | 25 | /// commission_agent – комиссионер 26 | @JsonValue('commission_agent') 27 | commissionAgent, 28 | 29 | /// another – другой тип агента 30 | @JsonValue('another') 31 | another, 32 | } 33 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | **/ios/Flutter/.last_build_id 26 | .dart_tool/ 27 | .flutter-plugins 28 | .flutter-plugins-dependencies 29 | .packages 30 | .pub-cache/ 31 | .pub/ 32 | /build/ 33 | 34 | # Web related 35 | lib/generated_plugin_registrant.dart 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Exceptions to above rules. 44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 45 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/check_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Тип проверки карты 4 | /// 5 | /// Для всех карт выполняется списание на 0р. 6 | enum CheckType { 7 | /// NO – сохранить карту без проверок. Rebill ID для рекуррентных платежей не возвращается. 8 | @JsonValue('NO') 9 | no, 10 | 11 | /// HOLD – при сохранении сделать списание на 0 руб.* 12 | /// RebillID возвращается для терминалов без поддержки 3DS. 13 | @JsonValue('HOLD') 14 | hold, 15 | 16 | /// 3DS – при сохранении карты выполнить проверку 3DS и выполнить списание на 0 р.* 17 | /// В этом случае RebillID будет только для 3DS карт. 18 | /// Карты, не поддерживающие 3DS, привязаны не будут. 19 | @JsonValue('3DS') 20 | threeDS, 21 | 22 | /// 3DSHOLD – при привязке карты выполняем проверку, поддерживает карта 3DS или нет. 23 | @JsonValue('3DSHOLD') 24 | threeDSHold, 25 | } 26 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/sectoral_item_props.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'sectoral_item_props.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | SectoralItemProps _$SectoralItemPropsFromJson(Map json) => 10 | SectoralItemProps( 11 | federalId: json['FederalId'] as String, 12 | date: json['Date'] as String, 13 | number: json['Number'] as String, 14 | value: json['Value'] as String, 15 | ); 16 | 17 | Map _$SectoralItemPropsToJson(SectoralItemProps instance) => 18 | { 19 | 'FederalId': instance.federalId, 20 | 'Date': instance.date, 21 | 'Number': instance.number, 22 | 'Value': instance.value, 23 | }; 24 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_account_qr_list/get_account_qr_list_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_account_qr_list_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetAccountQrListRequest _$GetAccountQrListRequestFromJson( 10 | Map json) => 11 | GetAccountQrListRequest( 12 | signToken: json['Token'] as String?, 13 | ); 14 | 15 | Map _$GetAccountQrListRequestToJson( 16 | GetAccountQrListRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | return val; 27 | } 28 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/check_order/check_order_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'check_order_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | CheckOrderRequest _$CheckOrderRequestFromJson(Map json) => 10 | CheckOrderRequest( 11 | orderId: json['OrderId'] as int, 12 | signToken: json['Token'] as String?, 13 | ); 14 | 15 | Map _$CheckOrderRequestToJson(CheckOrderRequest instance) { 16 | final val = {}; 17 | 18 | void writeNotNull(String key, dynamic value) { 19 | if (value != null) { 20 | val[key] = value; 21 | } 22 | } 23 | 24 | writeNotNull('Token', instance.signToken); 25 | val['OrderId'] = instance.orderId; 26 | return val; 27 | } 28 | -------------------------------------------------------------------------------- /tool/validate-formatting.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $(git ls-files --modified) ]]; then 4 | echo "" 5 | echo "" 6 | echo "These files are not formatted correctly:" 7 | for f in $(git ls-files --modified); do 8 | echo "" 9 | echo "" 10 | echo "-----------------------------------------------------------------" 11 | echo "$f" 12 | echo "-----------------------------------------------------------------" 13 | echo "" 14 | git --no-pager diff --unified=0 --minimal $f 15 | echo "" 16 | echo "-----------------------------------------------------------------" 17 | echo "" 18 | echo "" 19 | done 20 | if [[ $GITHUB_WORKFLOW ]]; then 21 | git checkout . > /dev/null 2>&1 22 | fi 23 | echo "" 24 | echo "❌ Some files are incorrectly formatted, see above output." 25 | echo "" 26 | echo "To fix these locally, run: 'melos run format'." 27 | exit 1 28 | else 29 | echo "" 30 | echo "✅ All files are formatted correctly." 31 | fi -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/source.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Источник платежа. 4 | /// 5 | /// Значение параметра зависит от параметра [Route] 6 | enum Source { 7 | /// [ACQ] Cards – банковские карты 8 | @JsonValue('Cards') 9 | cards, 10 | 11 | /// [ACQ] ApplePay 12 | @JsonValue('ApplePay') 13 | applePay, 14 | 15 | /// [ACQ] GooglePay 16 | @JsonValue('GooglePay') 17 | googlePay, 18 | 19 | /// [ACQ] YandexPay 20 | @JsonValue('YandexPay') 21 | yandexPay, 22 | 23 | /// [MC] beeline 24 | @JsonValue('beeline') 25 | beeline, 26 | 27 | /// [MC] mts 28 | @JsonValue('mts') 29 | mts, 30 | 31 | /// [MC] tele2 32 | @JsonValue('tele2') 33 | tele2, 34 | 35 | /// [MC] megafon 36 | @JsonValue('megafon') 37 | megafon, 38 | 39 | /// [EINV] envoicing 40 | @JsonValue('envoicing') 41 | envoicing, 42 | 43 | /// [WM] webmoney 44 | @JsonValue('webmoney') 45 | webmoney, 46 | } 47 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/member.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'member.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Member _$MemberFromJson(Map json) => Member( 10 | memberId: json['MemberId'] as String?, 11 | memberName: json['MemberName'] as String?, 12 | isPayee: json['IsPayee'] as bool?, 13 | ); 14 | 15 | Map _$MemberToJson(Member instance) { 16 | final val = {}; 17 | 18 | void writeNotNull(String key, dynamic value) { 19 | if (value != null) { 20 | val[key] = value; 21 | } 22 | } 23 | 24 | writeNotNull('MemberId', instance.memberId); 25 | writeNotNull('MemberName', instance.memberName); 26 | writeNotNull('IsPayee', instance.isPayee); 27 | return val; 28 | } 29 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/shops.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'shops.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Shops _$ShopsFromJson(Map json) => Shops( 10 | shopCode: json['ShopCode'] as String, 11 | amount: json['Amount'] as int, 12 | name: json['Name'] as String?, 13 | fee: json['Fee'] as String?, 14 | ); 15 | 16 | Map _$ShopsToJson(Shops instance) { 17 | final val = { 18 | 'ShopCode': instance.shopCode, 19 | 'Amount': instance.amount, 20 | }; 21 | 22 | void writeNotNull(String key, dynamic value) { 23 | if (value != null) { 24 | val[key] = value; 25 | } 26 | } 27 | 28 | writeNotNull('Name', instance.name); 29 | writeNotNull('Fee', instance.fee); 30 | return val; 31 | } 32 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/qr_members_list/qr_members_list_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'qr_members_list_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | QrMembersListRequest _$QrMembersListRequestFromJson( 10 | Map json) => 11 | QrMembersListRequest( 12 | paymentId: json['PaymentId'] as int, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$QrMembersListRequestToJson( 17 | QrMembersListRequest instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Token', instance.signToken); 27 | val['PaymentId'] = instance.paymentId; 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_state/get_state_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_state_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetStateRequest _$GetStateRequestFromJson(Map json) => 10 | GetStateRequest( 11 | paymentId: json['PaymentId'] as int, 12 | ip: json['IP'] as String?, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetStateRequestToJson(GetStateRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | val['PaymentId'] = instance.paymentId; 27 | writeNotNull('IP', instance.ip); 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_add_card_state/get_add_card_state_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_add_card_state_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetAddCardStateRequest _$GetAddCardStateRequestFromJson( 10 | Map json) => 11 | GetAddCardStateRequest( 12 | requestKey: json['RequestKey'] as String, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetAddCardStateRequestToJson( 17 | GetAddCardStateRequest instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Token', instance.signToken); 27 | val['RequestKey'] = instance.requestKey; 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_customer/get_customer_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_customer_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetCustomerRequest _$GetCustomerRequestFromJson(Map json) => 10 | GetCustomerRequest( 11 | customerKey: json['CustomerKey'] as String, 12 | ip: json['IP'] as String?, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetCustomerRequestToJson(GetCustomerRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | val['CustomerKey'] = instance.customerKey; 27 | writeNotNull('IP', instance.ip); 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_card_list/get_card_list_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_card_list_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetCardListRequest _$GetCardListRequestFromJson(Map json) => 10 | GetCardListRequest( 11 | customerKey: json['CustomerKey'] as String, 12 | ip: json['IP'] as String?, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetCardListRequestToJson(GetCardListRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | val['CustomerKey'] = instance.customerKey; 27 | writeNotNull('IP', instance.ip); 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/resend/resend_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'resend_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ResendRequest _$ResendRequestFromJson(Map json) => 10 | ResendRequest( 11 | paymentId: json['PaymentId'] as String?, 12 | notificationTypes: json['NotificationTypes'] as String?, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$ResendRequestToJson(ResendRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | writeNotNull('PaymentId', instance.paymentId); 27 | writeNotNull('NotificationTypes', instance.notificationTypes); 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_add_account_qr_state/get_add_account_qr_state_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_add_account_qr_state_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetAddAccountQrStateRequest _$GetAddAccountQrStateRequestFromJson( 10 | Map json) => 11 | GetAddAccountQrStateRequest( 12 | requestKey: json['RequestKey'] as String, 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetAddAccountQrStateRequestToJson( 17 | GetAddAccountQrStateRequest instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Token', instance.signToken); 27 | val['RequestKey'] = instance.requestKey; 28 | return val; 29 | } 30 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/utils/crypto_utils.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert' as convert; 2 | import 'dart:typed_data'; 3 | 4 | import 'package:crypto/crypto.dart' as crypto; 5 | import 'package:crypton/crypton.dart'; 6 | 7 | /// Класс для работы с криптографией 8 | class CryptoUtils { 9 | /// Метод для получения хеш-функций `SHA256` 10 | static String sha256(String string) { 11 | return crypto.sha256 12 | .convert(Uint8List.fromList(string.codeUnits)) 13 | .toString(); 14 | } 15 | 16 | /// Метод для получения криптосистемы `RSA` 17 | /// 18 | /// Открытый ключ генерируется Банком и выдается при регистрации терминала. 19 | /// Открытый ключ имеет формат: `X509 RSA 2048` 20 | static Uint8List rsa(String string, String publicKey) { 21 | final RSAPublicKey key = RSAPublicKey.fromString(publicKey); 22 | return key.encryptData(Uint8List.fromList(string.codeUnits)); 23 | } 24 | 25 | /// Метод для получения кодированных двоичных данных `Base64` 26 | static String base64(Uint8List value) { 27 | return convert.base64.encode(value); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/remove_customer/remove_customer_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'remove_customer_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | RemoveCustomerRequest _$RemoveCustomerRequestFromJson( 10 | Map json) => 11 | RemoveCustomerRequest( 12 | customerKey: json['CustomerKey'] as String, 13 | ip: json['IP'] as String?, 14 | signToken: json['Token'] as String?, 15 | ); 16 | 17 | Map _$RemoveCustomerRequestToJson( 18 | RemoveCustomerRequest instance) { 19 | final val = {}; 20 | 21 | void writeNotNull(String key, dynamic value) { 22 | if (value != null) { 23 | val[key] = value; 24 | } 25 | } 26 | 27 | writeNotNull('Token', instance.signToken); 28 | val['CustomerKey'] = instance.customerKey; 29 | writeNotNull('IP', instance.ip); 30 | return val; 31 | } 32 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/check_3ds_version/check_3ds_version_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'check_3ds_version_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Check3DSVersionRequest _$Check3DSVersionRequestFromJson( 10 | Map json) => 11 | Check3DSVersionRequest( 12 | paymentId: json['PaymentId'] as int, 13 | cardData: json['CardData'] as String, 14 | signToken: json['Token'] as String?, 15 | ); 16 | 17 | Map _$Check3DSVersionRequestToJson( 18 | Check3DSVersionRequest instance) { 19 | final val = {}; 20 | 21 | void writeNotNull(String key, dynamic value) { 22 | if (value != null) { 23 | val[key] = value; 24 | } 25 | } 26 | 27 | writeNotNull('Token', instance.signToken); 28 | val['PaymentId'] = instance.paymentId; 29 | val['CardData'] = instance.cardData; 30 | return val; 31 | } 32 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/remove_card/remove_card_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'remove_card_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | RemoveCardRequest _$RemoveCardRequestFromJson(Map json) => 10 | RemoveCardRequest( 11 | cardId: json['CardId'] as int, 12 | customerKey: json['CustomerKey'] as String, 13 | ip: json['IP'] as String?, 14 | signToken: json['Token'] as String?, 15 | ); 16 | 17 | Map _$RemoveCardRequestToJson(RemoveCardRequest instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Token', instance.signToken); 27 | val['CardId'] = instance.cardId; 28 | val['CustomerKey'] = instance.customerKey; 29 | writeNotNull('IP', instance.ip); 30 | return val; 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mad Brains 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/mark_code.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'mark_code.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | MarkCode _$MarkCodeFromJson(Map json) => MarkCode( 10 | markCodeType: $enumDecode(_$MarkCodeTypeEnumMap, json['MarkCodeType']), 11 | value: json['Value'] as String, 12 | ); 13 | 14 | Map _$MarkCodeToJson(MarkCode instance) => { 15 | 'MarkCodeType': _$MarkCodeTypeEnumMap[instance.markCodeType]!, 16 | 'Value': instance.value, 17 | }; 18 | 19 | const _$MarkCodeTypeEnumMap = { 20 | MarkCodeType.unknown: 'Unknown', 21 | MarkCodeType.ean8: 'ean8', 22 | MarkCodeType.ean13: 'ean13', 23 | MarkCodeType.itf14: 'itf14', 24 | MarkCodeType.gs10: 'gs10', 25 | MarkCodeType.gs1m: 'gs1m', 26 | MarkCodeType.short: 'short', 27 | MarkCodeType.fur: 'fur', 28 | MarkCodeType.egais20: 'egais20', 29 | MarkCodeType.egais30: 'egais30', 30 | }; 31 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mad Brains 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/send_closing_receipt/send_closing_receipt_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'send_closing_receipt_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | SendClosingReceiptRequest _$SendClosingReceiptRequestFromJson( 10 | Map json) => 11 | SendClosingReceiptRequest( 12 | paymentId: json['PaymentId'] as int, 13 | receipt: Receipt.fromJson(json['Receipt'] as Map), 14 | signToken: json['Token'] as String?, 15 | ); 16 | 17 | Map _$SendClosingReceiptRequestToJson( 18 | SendClosingReceiptRequest instance) { 19 | final val = {}; 20 | 21 | void writeNotNull(String key, dynamic value) { 22 | if (value != null) { 23 | val[key] = value; 24 | } 25 | } 26 | 27 | writeNotNull('Token', instance.signToken); 28 | val['PaymentId'] = instance.paymentId; 29 | val['Receipt'] = instance.receipt; 30 | return val; 31 | } 32 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Mad Brains 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/payments.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'payments.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | Payments _$PaymentsFromJson(Map json) => Payments( 10 | electronic: json['Electronic'] as int, 11 | cash: json['Cash'] as int?, 12 | advancePayment: json['AdvancePayment'] as int?, 13 | credit: json['Credit'] as int?, 14 | provision: json['Provision'] as int?, 15 | ); 16 | 17 | Map _$PaymentsToJson(Payments instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Cash', instance.cash); 27 | val['Electronic'] = instance.electronic; 28 | writeNotNull('AdvancePayment', instance.advancePayment); 29 | writeNotNull('Credit', instance.credit); 30 | writeNotNull('Provision', instance.provision); 31 | return val; 32 | } 33 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/enums/mark_code_type.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | /// Тип штрих кода 4 | enum MarkCodeType { 5 | /// код товара, формат которого не идентифицирован, как один из реквизитов 6 | @JsonValue('Unknown') 7 | unknown, 8 | 9 | /// код товара в формате EAN-8 10 | @JsonValue('ean8') 11 | ean8, 12 | 13 | /// код товара в формате EAN-13 14 | @JsonValue('ean13') 15 | ean13, 16 | 17 | /// код товара в формате ITF-14 18 | @JsonValue('itf14') 19 | itf14, 20 | 21 | /// код товара в формате GS1, нанесенный на товар, не подлежащий маркировке 22 | @JsonValue('gs10') 23 | gs10, 24 | 25 | /// код товара в формате GS1, нанесенный на товар, подлежащий маркировке 26 | @JsonValue('gs1m') 27 | gs1m, 28 | 29 | /// код товара в формате короткого кода маркировки, нанесенный на товар 30 | @JsonValue('short') 31 | short, 32 | 33 | /// контрольно-идентификационный знак мехового изделия 34 | @JsonValue('fur') 35 | fur, 36 | 37 | /// код товара в формате ЕГАИС-2.0 38 | @JsonValue('egais20') 39 | egais20, 40 | 41 | /// код товара в формате ЕГАИС-3.0 42 | @JsonValue('egais30') 43 | egais30, 44 | } 45 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/sbp_pay_test/sbp_pay_test_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'sbp_pay_test_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | SbpPayTestRequest _$SbpPayTestRequestFromJson(Map json) => 10 | SbpPayTestRequest( 11 | paymentId: json['PaymentId'] as String, 12 | isDeadlineExpired: json['IsDeadlineExpired'] as bool?, 13 | isRejected: json['IsRejected'] as bool?, 14 | signToken: json['Token'] as String?, 15 | ); 16 | 17 | Map _$SbpPayTestRequestToJson(SbpPayTestRequest instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Token', instance.signToken); 27 | val['PaymentId'] = instance.paymentId; 28 | writeNotNull('IsDeadlineExpired', instance.isDeadlineExpired); 29 | writeNotNull('IsRejected', instance.isRejected); 30 | return val; 31 | } 32 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_static_qr/get_static_qr_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_static_qr_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetStaticQrRequest _$GetStaticQrRequestFromJson(Map json) => 10 | GetStaticQrRequest( 11 | dataType: $enumDecodeNullable(_$DataTypeEnumMap, json['DataType'], 12 | unknownValue: DataType.payload), 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetStaticQrRequestToJson(GetStaticQrRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | writeNotNull('DataType', _$DataTypeEnumMap[instance.dataType]); 27 | return val; 28 | } 29 | 30 | const _$DataTypeEnumMap = { 31 | DataType.notExist: 'notExist', 32 | DataType.payload: 'PAYLOAD', 33 | DataType.image: 'IMAGE', 34 | }; 35 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/attach_card/attach_card_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'attach_card_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AttachCardRequest _$AttachCardRequestFromJson(Map json) => 10 | AttachCardRequest( 11 | requestKey: json['RequestKey'] as String, 12 | cardData: json['CardData'] as String, 13 | data: (json['DATA'] as Map?)?.map( 14 | (k, e) => MapEntry(k, e as String), 15 | ), 16 | signToken: json['Token'] as String?, 17 | ); 18 | 19 | Map _$AttachCardRequestToJson(AttachCardRequest instance) { 20 | final val = {}; 21 | 22 | void writeNotNull(String key, dynamic value) { 23 | if (value != null) { 24 | val[key] = value; 25 | } 26 | } 27 | 28 | writeNotNull('Token', instance.signToken); 29 | val['RequestKey'] = instance.requestKey; 30 | val['CardData'] = instance.cardData; 31 | writeNotNull('DATA', instance.data); 32 | return val; 33 | } 34 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/add_customer/add_customer_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'add_customer_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AddCustomerRequest _$AddCustomerRequestFromJson(Map json) => 10 | AddCustomerRequest( 11 | customerKey: json['CustomerKey'] as String, 12 | email: json['Email'] as String?, 13 | phone: json['Phone'] as String?, 14 | ip: json['IP'] as String?, 15 | signToken: json['Token'] as String?, 16 | ); 17 | 18 | Map _$AddCustomerRequestToJson(AddCustomerRequest instance) { 19 | final val = {}; 20 | 21 | void writeNotNull(String key, dynamic value) { 22 | if (value != null) { 23 | val[key] = value; 24 | } 25 | } 26 | 27 | writeNotNull('Token', instance.signToken); 28 | val['CustomerKey'] = instance.customerKey; 29 | writeNotNull('Email', instance.email); 30 | writeNotNull('Phone', instance.phone); 31 | writeNotNull('IP', instance.ip); 32 | return val; 33 | } 34 | -------------------------------------------------------------------------------- /tool/bump-version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail 4 | 5 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 6 | cd $SCRIPT_DIR/.. 7 | 8 | NEW_VERSION="${1}" 9 | 10 | echo "Bumping version: ${NEW_VERSION}" 11 | 12 | for pkg in {tinkoff_acquiring,tinkoff_acquiring_flutter}; do 13 | # Bump version in pubspec.yaml 14 | perl -pi -e "s/^version: .*/version: $NEW_VERSION/" packages/$pkg/pubspec.yaml 15 | done 16 | 17 | perl -pi -e "s/tinkoff_acquiring: .*/tinkoff_acquiring: ^$NEW_VERSION/" packages/tinkoff_acquiring_flutter/pubspec.yaml 18 | perl -pi -e "s/tinkoff_acquiring: .*/tinkoff_acquiring: ^$NEW_VERSION/" example/pubspec.yaml 19 | perl -pi -e "s/tinkoff_acquiring_flutter: .*/tinkoff_acquiring_flutter: ^$NEW_VERSION/" example/pubspec.yaml 20 | perl -pi -e "s/tinkoff_acquiring: .*/tinkoff_acquiring: ^$NEW_VERSION/" packages/tinkoff_acquiring/README.md 21 | perl -pi -e "s/tinkoff_acquiring: .*/tinkoff_acquiring: ^$NEW_VERSION/" packages/tinkoff_acquiring/README.ru.md 22 | perl -pi -e "s/tinkoff_acquiring_flutter: .*/tinkoff_acquiring_flutter: ^$NEW_VERSION/" packages/tinkoff_acquiring/README.md 23 | perl -pi -e "s/tinkoff_acquiring_flutter: .*/tinkoff_acquiring_flutter: ^$NEW_VERSION/" packages/tinkoff_acquiring/README.ru.md -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/client_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'client_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ClientInfo _$ClientInfoFromJson(Map json) => ClientInfo( 10 | birthdate: json['Birthdate'] as String?, 11 | citizenship: json['citizenship'] as String?, 12 | documentCode: json['DocumentСode'] as String?, 13 | documentData: json['DocumentData'] as String?, 14 | address: json['Address'] as String?, 15 | ); 16 | 17 | Map _$ClientInfoToJson(ClientInfo instance) { 18 | final val = {}; 19 | 20 | void writeNotNull(String key, dynamic value) { 21 | if (value != null) { 22 | val[key] = value; 23 | } 24 | } 25 | 26 | writeNotNull('Birthdate', instance.birthdate); 27 | writeNotNull('citizenship', instance.citizenship); 28 | writeNotNull('DocumentСode', instance.documentCode); 29 | writeNotNull('DocumentData', instance.documentData); 30 | writeNotNull('Address', instance.address); 31 | return val; 32 | } 33 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_qr/get_qr_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'get_qr_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | GetQrRequest _$GetQrRequestFromJson(Map json) => GetQrRequest( 10 | paymentId: json['PaymentId'] as int, 11 | dataType: $enumDecodeNullable(_$DataTypeEnumMap, json['DataType'], 12 | unknownValue: DataType.payload), 13 | signToken: json['Token'] as String?, 14 | ); 15 | 16 | Map _$GetQrRequestToJson(GetQrRequest instance) { 17 | final val = {}; 18 | 19 | void writeNotNull(String key, dynamic value) { 20 | if (value != null) { 21 | val[key] = value; 22 | } 23 | } 24 | 25 | writeNotNull('Token', instance.signToken); 26 | val['PaymentId'] = instance.paymentId; 27 | writeNotNull('DataType', _$DataTypeEnumMap[instance.dataType]); 28 | return val; 29 | } 30 | 31 | const _$DataTypeEnumMap = { 32 | DataType.notExist: 'notExist', 33 | DataType.payload: 'PAYLOAD', 34 | DataType.image: 'IMAGE', 35 | }; 36 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/send_closing_receipt/send_closing_receipt_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'send_closing_receipt_response.g.dart'; 7 | 8 | /// Ответ от сервера на закрывающий чек в кассу 9 | /// 10 | /// [SendClosingReceiptResponse](https://www.tinkoff.ru/kassa/develop/api/payments/SendClosingReceipt-response/) 11 | @JsonSerializable() 12 | class SendClosingReceiptResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на закрывающий чек в кассу 14 | SendClosingReceiptResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | }) : super( 21 | status: status, 22 | success: success, 23 | errorCode: errorCode, 24 | message: message, 25 | details: details, 26 | ); 27 | 28 | /// Преобразование json в модель 29 | factory SendClosingReceiptResponse.fromJson(Map json) => 30 | _$SendClosingReceiptResponseFromJson(json); 31 | 32 | @override 33 | Map toJson() => _$SendClosingReceiptResponseToJson(this); 34 | } 35 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/charge/charge_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'charge_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ChargeRequest _$ChargeRequestFromJson(Map json) => 10 | ChargeRequest( 11 | paymentId: json['PaymentId'] as int, 12 | rebillId: json['RebillId'] as int, 13 | ip: json['IP'] as String?, 14 | sendEmail: json['SendEmail'] as bool?, 15 | infoEmail: json['InfoEmail'] as String?, 16 | signToken: json['Token'] as String?, 17 | ); 18 | 19 | Map _$ChargeRequestToJson(ChargeRequest instance) { 20 | final val = {}; 21 | 22 | void writeNotNull(String key, dynamic value) { 23 | if (value != null) { 24 | val[key] = value; 25 | } 26 | } 27 | 28 | writeNotNull('Token', instance.signToken); 29 | val['PaymentId'] = instance.paymentId; 30 | val['RebillId'] = instance.rebillId; 31 | writeNotNull('SendEmail', instance.sendEmail); 32 | writeNotNull('InfoEmail', instance.infoEmail); 33 | writeNotNull('IP', instance.ip); 34 | return val; 35 | } 36 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/acquiring_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import 'base_request.dart'; 4 | 5 | export '../../../constants.dart'; 6 | export '../../../utils/extensions.dart'; 7 | 8 | /// Базовый класс создания запроса Acquiring API 9 | abstract class AcquiringRequest extends BaseRequest { 10 | /// Конструктор базового класса для запросов 11 | AcquiringRequest(this.signToken); 12 | 13 | @override 14 | Map get equals => { 15 | if (signToken != null) JsonKeys.token: signToken, 16 | }; 17 | 18 | /// Заголовок метода 19 | Map get headers => NetworkSettings.baseHeaders; 20 | 21 | /// Список игнорируемых полей при создании токена запроса 22 | Set get ignoredFields => Ignore.ignoredFields; 23 | 24 | /// Метод запроса 25 | String get apiMethod; 26 | 27 | /// Версия метода запроса 28 | String get apiVersion => NetworkSettings.apiVersion2; 29 | 30 | /// Полный путь до метода запроса (версия + метод) 31 | String get apiMethodPath => '$apiVersion/$apiMethod'; 32 | 33 | /// Опциональный параметр: готовая подпись запроса 34 | @JsonKey(name: JsonKeys.token) 35 | final String? signToken; 36 | 37 | @override 38 | AcquiringRequest copyWith({String? signToken}); 39 | } 40 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/charge_qr/charge_qr_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'charge_qr_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ChargeQrRequest _$ChargeQrRequestFromJson(Map json) => 10 | ChargeQrRequest( 11 | paymentId: json['PaymentId'] as int, 12 | accountToken: json['AccountToken'] as String, 13 | ip: json['IP'] as String?, 14 | sendEmail: json['SendEmail'] as bool?, 15 | infoEmail: json['InfoEmail'] as String?, 16 | signToken: json['Token'] as String?, 17 | ); 18 | 19 | Map _$ChargeQrRequestToJson(ChargeQrRequest instance) { 20 | final val = {}; 21 | 22 | void writeNotNull(String key, dynamic value) { 23 | if (value != null) { 24 | val[key] = value; 25 | } 26 | } 27 | 28 | writeNotNull('Token', instance.signToken); 29 | val['PaymentId'] = instance.paymentId; 30 | val['AccountToken'] = instance.accountToken; 31 | writeNotNull('IP', instance.ip); 32 | writeNotNull('SendEmail', instance.sendEmail); 33 | writeNotNull('InfoEmail', instance.infoEmail); 34 | return val; 35 | } 36 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 3.0.10 2 | 3 | * Fixing the 3DSv2 Challenge Flow Passage 4 | 5 | # 3.0.9 6 | 7 | * Fix paymentId type in OrderPayments 8 | 9 | # 3.0.8 10 | 11 | * Fixed & add/remove new request and response models (Sync with documentation) 12 | * Fix readme 13 | * Update dependency webview_flutter to 4.0.0 14 | 15 | # 3.0.7 16 | 17 | * Add PaymentId to AddCardResponse 18 | 19 | # 3.0.6 20 | 21 | * Update dependencies 22 | * Fixed & add new request and response models (Sync with documentation) 23 | * Reworked TinkoffAcquiringConfig 24 | * New PaymentSource 25 | * Payment through the Fast Payment System (SBP) by QR 26 | 27 | # 3.0.5 28 | 29 | * Update dependencies 30 | 31 | # 3.0.4 32 | 33 | * Changed mode of encoding threeDsMethod params with Base64 without Padding according to 3DS 2.0 requirements 34 | 35 | # 3.0.3 36 | 37 | * Fix `meta` dependencie 38 | 39 | # 3.0.2 40 | 41 | * Update `tinkoff_acquiring` dependencie 42 | * Update `webview_flutter` dependencie 43 | 44 | # 3.0.1 45 | 46 | * Update `tinkoff_acquiring` dependencie 47 | 48 | # 3.0.0 49 | 50 | * **BREAKING**: Splitting the library into two packages: 51 | - tinkoff_acquiring: Package for working with Tinkoff API 52 | - tinkoff_acquiring_flutter: A package for working with UI, at the moment it is WebView. In the future, it will be QR and much more 53 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/sbp_pay_test/sbp_pay_test_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'sbp_pay_test_response.g.dart'; 7 | 8 | /// Ответ от сервера на тестированию платежной сессии с предопределенным статусом по СБП. 9 | /// 10 | /// [SbpPayTestResponse](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/sbppaytest-response/) 11 | @JsonSerializable() 12 | class SbpPayTestResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на тестированию платежной сессии с предопределенным статусом по СБП. 14 | SbpPayTestResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | }) : super( 21 | status: status, 22 | success: success, 23 | errorCode: errorCode, 24 | message: message, 25 | details: details, 26 | ); 27 | 28 | /// Преобразование json в модель 29 | factory SbpPayTestResponse.fromJson(Map json) => 30 | _$SbpPayTestResponseFromJson(json); 31 | 32 | @override 33 | Map toJson() => _$SbpPayTestResponseToJson(this); 34 | 35 | @override 36 | Map get equals => { 37 | ...super.equals, 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring_flutter/lib/src/constants.dart: -------------------------------------------------------------------------------- 1 | // ignore_for_file: public_member_api_docs 2 | 3 | abstract final class WebViewKeys { 4 | static const String threeDSServerTransId = 'threeDSServerTransID'; 5 | static const String threeDSMethodNotificationURL = 6 | 'threeDSMethodNotificationURL'; 7 | static const String acsTransId = 'acsTransID'; 8 | static const String messageVersion = 'messageVersion'; 9 | static const String challengeWindowSize = 'challengeWindowSize'; 10 | static const String messageType = 'messageType'; 11 | static const String threeDSCompInd = 'threeDSCompInd'; 12 | static const String language = 'language'; 13 | static const String timezone = 'timezone'; 14 | static const String screenHeight = 'screen_height'; 15 | static const String screenWidth = 'screen_width'; 16 | static const String cresCallbackUrl = 'cresCallbackUrl'; 17 | } 18 | 19 | abstract final class WebViewSettings { 20 | static const String messageType = 'CReq'; 21 | static const String challengeWindowSize = '05'; 22 | static const List cancelActions = [ 23 | 'cancel.do', 24 | 'cancel=true', 25 | ]; 26 | } 27 | 28 | abstract final class WebViewMethods { 29 | static const String submit3DSAuthorization = 'Submit3DSAuthorization'; 30 | static const String submit3DSAuthorizationV2 = 'Submit3DSAuthorizationV2'; 31 | static const String complete3DSMethodv2 = 'Complete3DSMethodv2'; 32 | } 33 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: version doctor 2 | 3 | PANA_SCRIPT=../../tool/verify_pub_score.sh 100 4 | 5 | DART_PATH= packages/tinkoff_acquiring 6 | FLUTTER_PATH= packages/tinkoff_acquiring_flutter 7 | PACKAGES_PATH= $(DART_PATH) $(FLUTTER_PATH) example 8 | 9 | FVM = fvm 10 | FVM_FLUTTER = $(FVM) flutter 11 | FVM_DART = $(FVM) dart 12 | 13 | init: 14 | $(FVM) use 3.10.2 --force; $(FVM_DART) pub global activate pana; 15 | 16 | version: 17 | $(FVM_FLUTTER) --version; $(FVM_DART) --version; 18 | 19 | doctor: 20 | $(FVM_FLUTTER) doctor; 21 | 22 | ifeq (bump, $(firstword $(MAKECMDGOALS))) 23 | runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS)) 24 | $(eval $(runargs):;@true) 25 | endif 26 | bump: 27 | ./tool/bump-version.sh $(filter-out $@,$(MAKECMDGOALS)) 28 | 29 | build_runner: 30 | cd $(DART_PATH); $(FVM_FLUTTER) pub run build_runner build --delete-conflicting-outputs; 31 | 32 | pub_get: 33 | $(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) packages get; cd ../..;) 34 | 35 | clean: 36 | $(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) clean; cd ../..;) 37 | 38 | fix: 39 | $(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_DART) format .; cd ../..;) 40 | 41 | analyze: 42 | $(foreach v, $(PACKAGES_PATH), cd $(v); $(FVM_FLUTTER) analyze . --fatal-infos; cd ../..;) 43 | 44 | pana: pana_dart pana_flutter 45 | 46 | pana_dart: 47 | cd $(DART_PATH); $(PANA_SCRIPT); 48 | 49 | pana_flutter: 50 | cd $(FLUTTER_PATH); $(PANA_SCRIPT); -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/add_card/add_card_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'add_card_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AddCardRequest _$AddCardRequestFromJson(Map json) => 10 | AddCardRequest( 11 | customerKey: json['CustomerKey'] as String, 12 | checkType: $enumDecodeNullable(_$CheckTypeEnumMap, json['CheckType']), 13 | ip: json['IP'] as String?, 14 | residentState: json['ResidentState'] as bool?, 15 | signToken: json['Token'] as String?, 16 | ); 17 | 18 | Map _$AddCardRequestToJson(AddCardRequest instance) { 19 | final val = {}; 20 | 21 | void writeNotNull(String key, dynamic value) { 22 | if (value != null) { 23 | val[key] = value; 24 | } 25 | } 26 | 27 | writeNotNull('Token', instance.signToken); 28 | val['CustomerKey'] = instance.customerKey; 29 | writeNotNull('CheckType', _$CheckTypeEnumMap[instance.checkType]); 30 | writeNotNull('IP', instance.ip); 31 | writeNotNull('ResidentState', instance.residentState); 32 | return val; 33 | } 34 | 35 | const _$CheckTypeEnumMap = { 36 | CheckType.no: 'NO', 37 | CheckType.hold: 'HOLD', 38 | CheckType.threeDS: '3DS', 39 | CheckType.threeDSHold: '3DSHOLD', 40 | }; 41 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_account_qr_list/get_account_qr_list_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'get_account_qr_list_request.g.dart'; 6 | 7 | /// Возвращает список привязанных счетов покупателя по магазину 8 | /// 9 | /// [GetAccountQrListRequest](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/getaccountqrlist-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class GetAccountQrListRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению списока привязанных счетов покупателя по магазину 13 | GetAccountQrListRequest({ 14 | String? signToken, 15 | }) : super(signToken); 16 | 17 | /// Преобразование json в модель 18 | factory GetAccountQrListRequest.fromJson(Map json) => 19 | _$GetAccountQrListRequestFromJson(json); 20 | 21 | @override 22 | String get apiMethod => ApiMethods.getAccountQrList; 23 | 24 | @override 25 | Map toJson() => _$GetAccountQrListRequestToJson(this); 26 | 27 | @override 28 | Map get equals => { 29 | ...super.equals, 30 | }; 31 | 32 | @override 33 | GetAccountQrListRequest copyWith({ 34 | String? signToken, 35 | }) { 36 | return GetAccountQrListRequest( 37 | signToken: signToken ?? this.signToken, 38 | ); 39 | } 40 | 41 | @override 42 | void validate() {} 43 | } 44 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/confirm/confirm_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'confirm_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | ConfirmRequest _$ConfirmRequestFromJson(Map json) => 10 | ConfirmRequest( 11 | paymentId: json['PaymentId'] as int, 12 | amount: json['Amount'] as int?, 13 | ip: json['IP'] as String?, 14 | receipt: json['Receipt'] == null 15 | ? null 16 | : Receipt.fromJson(json['Receipt'] as Map), 17 | shops: (json['Shops'] as List?) 18 | ?.map((e) => Shops.fromJson(e as Map)) 19 | .toList(), 20 | signToken: json['Token'] as String?, 21 | ); 22 | 23 | Map _$ConfirmRequestToJson(ConfirmRequest instance) { 24 | final val = {}; 25 | 26 | void writeNotNull(String key, dynamic value) { 27 | if (value != null) { 28 | val[key] = value; 29 | } 30 | } 31 | 32 | writeNotNull('Token', instance.signToken); 33 | val['PaymentId'] = instance.paymentId; 34 | writeNotNull('Amount', instance.amount); 35 | writeNotNull('IP', instance.ip); 36 | writeNotNull('Receipt', instance.receipt); 37 | writeNotNull('Shops', instance.shops); 38 | return val; 39 | } 40 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/add_user_prop.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'add_user_prop.g.dart'; 6 | 7 | /// Данные поставщика платежного агента 8 | /// 9 | /// [AgentData](https://www.tinkoff.ru/kassa/develop/api/payments/init-request/#AddUserProp) 10 | @JsonSerializable(includeIfNull: false) 11 | class AddUserProp extends BaseRequest { 12 | /// Создает экземпляр данных поставщика платежного агента 13 | AddUserProp( 14 | this.name, 15 | this.value, 16 | ); 17 | 18 | /// Преобразование json в модель 19 | factory AddUserProp.fromJson(Map json) => 20 | _$AddUserPropFromJson(json); 21 | 22 | @override 23 | Map get equals => { 24 | JsonKeys.name: name, 25 | JsonKeys.value: value, 26 | }; 27 | 28 | @override 29 | Map toJson() => _$AddUserPropToJson(this); 30 | 31 | @override 32 | AddUserProp copyWith({ 33 | String? name, 34 | String? value, 35 | }) { 36 | return AddUserProp( 37 | name ?? this.name, 38 | value ?? this.value, 39 | ); 40 | } 41 | 42 | @override 43 | void validate() {} 44 | 45 | /// Наименование дополнительного реквизита пользователя (тег 1085) 46 | @JsonKey(name: JsonKeys.name) 47 | final String name; 48 | 49 | /// Значение дополнительного реквизита пользователя (тег1086) 50 | @JsonKey(name: JsonKeys.value) 51 | final String value; 52 | } 53 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '11.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/card_info.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'card_info.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | CardInfo _$CardInfoFromJson(Map json) => CardInfo( 10 | pan: json['Pan'] as String?, 11 | cardId: json['CardId'] as String?, 12 | rebillId: json['RebillId'] as String?, 13 | cardType: $enumDecodeNullable(_$CardTypeEnumMap, json['CardType'], 14 | unknownValue: CardType.notExist), 15 | expDate: json['ExpDate'] as String?, 16 | status: $enumDecodeNullable(_$CardStatusEnumMap, json['Status']), 17 | ); 18 | 19 | Map _$CardInfoToJson(CardInfo instance) => { 20 | 'Pan': instance.pan, 21 | 'CardId': instance.cardId, 22 | 'RebillId': instance.rebillId, 23 | 'CardType': _$CardTypeEnumMap[instance.cardType], 24 | 'Status': _$CardStatusEnumMap[instance.status], 25 | 'ExpDate': instance.expDate, 26 | }; 27 | 28 | const _$CardTypeEnumMap = { 29 | CardType.notExist: 'notExist', 30 | CardType.writeOffs: 0, 31 | CardType.replenishment: 1, 32 | CardType.writeOffsAndReplenishment: 2, 33 | }; 34 | 35 | const _$CardStatusEnumMap = { 36 | CardStatus.active: 'A', 37 | CardStatus.inactive: 'I', 38 | CardStatus.deleted: 'D', 39 | CardStatus.notExist: 'notExist', 40 | }; 41 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_card_list/get_card_list_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../common/card_info.dart'; 5 | import '../enums/status.dart'; 6 | 7 | part 'get_card_list_response.g.dart'; 8 | 9 | /// Ответ от сервера на список привязанных карт у покупателя 10 | /// 11 | /// [GetCardListResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/getcardlist-response/) 12 | @JsonSerializable() 13 | class GetCardListResponse extends AcquiringResponse { 14 | /// Создает экземпляр ответа от сервера на список привязанных карт у покупателя 15 | GetCardListResponse({ 16 | Status? status, 17 | bool? success, 18 | String? errorCode, 19 | String? message, 20 | String? details, 21 | this.cardInfo, 22 | }) : super( 23 | status: status, 24 | success: success, 25 | errorCode: errorCode, 26 | message: message, 27 | details: details, 28 | ); 29 | 30 | /// Преобразование json в модель 31 | factory GetCardListResponse.fromJson(Map json) => 32 | _$GetCardListResponseFromJson(json); 33 | 34 | @override 35 | Map toJson() => _$GetCardListResponseToJson(this); 36 | 37 | @override 38 | Map get equals => { 39 | ...super.equals, 40 | JsonKeys.cardInfo: cardInfo, 41 | }; 42 | 43 | /// Данные карты 44 | @JsonKey(name: JsonKeys.cardInfo) 45 | final List? cardInfo; 46 | } 47 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/cancel/cancel_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'cancel_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | CancelRequest _$CancelRequestFromJson(Map json) => 10 | CancelRequest( 11 | paymentId: json['PaymentId'] as int, 12 | ip: json['IP'] as String?, 13 | amount: json['Amount'] as int?, 14 | receipt: json['Receipt'] == null 15 | ? null 16 | : Receipt.fromJson(json['Receipt'] as Map), 17 | shops: (json['Shops'] as List?) 18 | ?.map((e) => Shops.fromJson(e as Map)) 19 | .toList(), 20 | qrMemberId: json['QrMemberId'] as String?, 21 | signToken: json['Token'] as String?, 22 | ); 23 | 24 | Map _$CancelRequestToJson(CancelRequest instance) { 25 | final val = {}; 26 | 27 | void writeNotNull(String key, dynamic value) { 28 | if (value != null) { 29 | val[key] = value; 30 | } 31 | } 32 | 33 | writeNotNull('Token', instance.signToken); 34 | val['PaymentId'] = instance.paymentId; 35 | writeNotNull('Amount', instance.amount); 36 | writeNotNull('IP', instance.ip); 37 | writeNotNull('Receipt', instance.receipt); 38 | writeNotNull('Shops', instance.shops); 39 | writeNotNull('QrMemberId', instance.qrMemberId); 40 | return val; 41 | } 42 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/add_account_qr/add_account_qr_request.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'add_account_qr_request.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AddAccountQrRequest _$AddAccountQrRequestFromJson(Map json) => 10 | AddAccountQrRequest( 11 | description: json['Description'] as String, 12 | dataType: $enumDecodeNullable(_$DataTypeEnumMap, json['DataType'], 13 | unknownValue: DataType.payload), 14 | data: (json['DATA'] as Map?)?.map( 15 | (k, e) => MapEntry(k, e as String), 16 | ), 17 | redirectDueDate: json['RedirectDueDate'] as String?, 18 | signToken: json['Token'] as String?, 19 | ); 20 | 21 | Map _$AddAccountQrRequestToJson(AddAccountQrRequest instance) { 22 | final val = {}; 23 | 24 | void writeNotNull(String key, dynamic value) { 25 | if (value != null) { 26 | val[key] = value; 27 | } 28 | } 29 | 30 | writeNotNull('Token', instance.signToken); 31 | val['Description'] = instance.description; 32 | writeNotNull('DataType', _$DataTypeEnumMap[instance.dataType]); 33 | writeNotNull('DATA', instance.data); 34 | writeNotNull('RedirectDueDate', instance.redirectDueDate); 35 | return val; 36 | } 37 | 38 | const _$DataTypeEnumMap = { 39 | DataType.notExist: 'notExist', 40 | DataType.payload: 'PAYLOAD', 41 | DataType.image: 'IMAGE', 42 | }; 43 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/check_order/check_order_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'check_order_request.g.dart'; 6 | 7 | /// Метод возвращает текущий статус платежа. 8 | /// 9 | /// [CheckOrderRequest](https://www.tinkoff.ru/kassa/develop/api/payments/CheckOrder-description/) 10 | @JsonSerializable(includeIfNull: false) 11 | class CheckOrderRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению статуса платежа 13 | CheckOrderRequest({ 14 | required this.orderId, 15 | String? signToken, 16 | }) : super(signToken); 17 | 18 | /// Преобразование json в модель 19 | factory CheckOrderRequest.fromJson(Map json) => 20 | _$CheckOrderRequestFromJson(json); 21 | 22 | @override 23 | String get apiMethod => ApiMethods.checkOrder; 24 | 25 | @override 26 | Map toJson() => _$CheckOrderRequestToJson(this); 27 | 28 | @override 29 | Map get equals => { 30 | ...super.equals, 31 | JsonKeys.orderId: orderId, 32 | }; 33 | 34 | @override 35 | CheckOrderRequest copyWith({ 36 | String? signToken, 37 | int? orderId, 38 | }) { 39 | return CheckOrderRequest( 40 | signToken: signToken ?? this.signToken, 41 | orderId: orderId ?? this.orderId, 42 | ); 43 | } 44 | 45 | @override 46 | void validate() { 47 | orderId.validateId(JsonKeys.orderId); 48 | } 49 | 50 | /// Идентификатор платежа в системе банка 51 | @JsonKey(name: JsonKeys.orderId) 52 | final int orderId; 53 | } 54 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_add_card_state/get_add_card_state_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'get_add_card_state_request.g.dart'; 6 | 7 | /// Возвращает статус привязки карты. 8 | /// 9 | /// [GetAddCardStateRequest](http://static2.tinkoff.ru/acquiring/manuals/android_sdk.pdf) 10 | @JsonSerializable(includeIfNull: false) 11 | class GetAddCardStateRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению статуса привязки карты 13 | GetAddCardStateRequest({ 14 | required this.requestKey, 15 | String? signToken, 16 | }) : super(signToken); 17 | 18 | /// Преобразование json в модель 19 | factory GetAddCardStateRequest.fromJson(Map json) => 20 | _$GetAddCardStateRequestFromJson(json); 21 | 22 | @override 23 | String get apiMethod => ApiMethods.getAddCardState; 24 | 25 | @override 26 | Map toJson() => _$GetAddCardStateRequestToJson(this); 27 | 28 | @override 29 | Map get equals => { 30 | ...super.equals, 31 | JsonKeys.requestKey: requestKey, 32 | }; 33 | 34 | @override 35 | GetAddCardStateRequest copyWith({ 36 | String? requestKey, 37 | String? signToken, 38 | }) { 39 | return GetAddCardStateRequest( 40 | requestKey: requestKey ?? this.requestKey, 41 | signToken: signToken ?? this.signToken, 42 | ); 43 | } 44 | 45 | @override 46 | void validate() {} 47 | 48 | /// Идентификатор запроса на привязку счета 49 | @JsonKey(name: JsonKeys.requestKey) 50 | final String requestKey; 51 | } 52 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/test/sdk_test_constant.dart: -------------------------------------------------------------------------------- 1 | import 'package:tinkoff_acquiring/tinkoff_acquiring.dart'; 2 | 3 | const int orderId = 990100; 4 | const String terminalKey = 'TestSDK'; 5 | const String password = '12345678'; 6 | const String customerKey = 'madbrains-user-key'; 7 | const String requestKey = 'd0b61e9b-cedc-4e36-8786-fceb8c903a82'; 8 | const String payForm = 'Checkout'; 9 | const int amount = 1400; 10 | const String ip = '127.0.0.1'; 11 | const String email = 'test@gmail.com'; 12 | const String phone = '+78005553535'; 13 | const String description = 14 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.'; 15 | const int cardId = 4034; 16 | 17 | const String publicKey = 18 | 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5Yg3RyEkszggDVMDHCAGzJm0mYpYT53BpasrsKdby8iaWJVACj8ueR0Wj3Tu2BY64HdIoZFvG0v7UqSFztE/zUvnznbXVYguaUcnRdwao9gLUQO2I/097SHF9r++BYI0t6EtbbcWbfi755A1EWfu9tdZYXTrwkqgU9ok2UIZCPZ4evVDEzDCKH6ArphVc4+iKFrzdwbFBmPmwi5Xd6CB9Na2kRoPYBHePGzGgYmtKgKMNs+6rdv5v9VB3k7CS/lSIH4p74/OPRjyryo6Q7NbL+evz0+s60Qz5gbBRGfqCA57lUiB3hfXQZq5/q1YkABOHf9cR6Ov5nTRSOnjORgPjwIDAQAB'; 19 | 20 | final String cardDataNo3DS = CardData( 21 | pan: '2200770239097761', 22 | expDate: '1225', 23 | cvv: '123', 24 | ).encode(publicKey); 25 | 26 | // For mobile, use password: 1234 27 | // For web, use password: password 28 | // ACS 1qwezxc 29 | final String cardData3DS = CardData( 30 | pan: '2201382000000013', 31 | expDate: '1225', 32 | cvv: '123', 33 | ).encode(publicKey); 34 | 35 | final TinkoffAcquiring acquiring = TinkoffAcquiring( 36 | TinkoffAcquiringConfig.credential( 37 | terminalKey: terminalKey, 38 | password: password, 39 | ), 40 | ); 41 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/resend/resend_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'resend_response.g.dart'; 7 | 8 | /// Ответ от сервера на отправку неотправленных уведомлений 9 | /// 10 | /// [ResendResponse](https://www.tinkoff.ru/kassa/develop/api/payments/resend-response/) 11 | @JsonSerializable() 12 | class ResendResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на отправку неотправленных уведомлений 14 | ResendResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.count, 22 | }) : super( 23 | status: status, 24 | success: success, 25 | errorCode: errorCode, 26 | message: message, 27 | details: details, 28 | ); 29 | 30 | /// Преобразование json в модель 31 | factory ResendResponse.fromJson(Map json) => 32 | _$ResendResponseFromJson(json); 33 | 34 | @override 35 | Map toJson() => _$ResendResponseToJson(this); 36 | 37 | @override 38 | Map get equals => { 39 | ...super.equals, 40 | JsonKeys.terminalKey: terminalKey, 41 | JsonKeys.customerKey: count, 42 | }; 43 | 44 | /// Идентификатор терминала. 45 | /// Выдается продавцу банком при заведении терминала 46 | @JsonKey(name: JsonKeys.terminalKey) 47 | final String? terminalKey; 48 | 49 | /// Количество сообщений, отправленных на повторную рассылку 50 | @JsonKey(name: JsonKeys.count) 51 | final int? count; 52 | } 53 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_account_qr_list/get_account_qr_list_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../common/account_qr_token.dart'; 5 | import '../enums/status.dart'; 6 | 7 | part 'get_account_qr_list_response.g.dart'; 8 | 9 | /// Ответ от сервера на список привязанных счетов покупателя по магазину 10 | /// 11 | /// [GetAccountQrListResponse](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/getaccountqrlist-response/) 12 | @JsonSerializable() 13 | class GetAccountQrListResponse extends AcquiringResponse { 14 | /// Создает экземпляр ответа от сервера на список привязанных счетов покупателя по магазину 15 | GetAccountQrListResponse({ 16 | Status? status, 17 | bool? success, 18 | String? errorCode, 19 | String? message, 20 | String? details, 21 | this.accountTokens, 22 | }) : super( 23 | status: status, 24 | success: success, 25 | errorCode: errorCode, 26 | message: message, 27 | details: details, 28 | ); 29 | 30 | /// Преобразование json в модель 31 | factory GetAccountQrListResponse.fromJson(Map json) => 32 | _$GetAccountQrListResponseFromJson(json); 33 | 34 | @override 35 | Map toJson() => _$GetAccountQrListResponseToJson(this); 36 | 37 | @override 38 | Map get equals => { 39 | ...super.equals, 40 | JsonKeys.accountTokens: accountTokens, 41 | }; 42 | 43 | /// Идентификатор терминала. 44 | /// Выдается продавцу банком при заведении терминала 45 | @JsonKey(name: JsonKeys.accountTokens) 46 | final List? accountTokens; 47 | } 48 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/member.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'member.g.dart'; 6 | 7 | /// Данные участника 8 | /// 9 | /// [Member](https://www.tinkoff.ru/kassa/develop/api/receipt/ffd12/#Member) 10 | @JsonSerializable(includeIfNull: false) 11 | class Member extends BaseRequest { 12 | /// Создает экземпляр rод маркировки в машиночитаемой форме 13 | Member({ 14 | this.memberId, 15 | this.memberName, 16 | this.isPayee, 17 | }); 18 | 19 | /// Преобразование json в модель 20 | factory Member.fromJson(Map json) => _$MemberFromJson(json); 21 | 22 | @override 23 | Map get equals => { 24 | JsonKeys.memberId: memberId, 25 | JsonKeys.memberName: memberName, 26 | JsonKeys.isPayee: isPayee, 27 | }; 28 | 29 | @override 30 | Map toJson() => _$MemberToJson(this); 31 | 32 | @override 33 | Member copyWith({ 34 | String? memberId, 35 | String? memberName, 36 | bool? isPayee, 37 | }) { 38 | return Member( 39 | memberId: memberId ?? this.memberId, 40 | memberName: memberName ?? this.memberName, 41 | isPayee: isPayee ?? this.isPayee, 42 | ); 43 | } 44 | 45 | @override 46 | void validate() {} 47 | 48 | /// Идентификатор участника 49 | @JsonKey(name: JsonKeys.memberId) 50 | final String? memberId; 51 | 52 | /// Наименование участника 53 | @JsonKey(name: JsonKeys.memberName) 54 | final String? memberName; 55 | 56 | /// true - если данный участник был получателем указанного платежа, 57 | /// false - в противном случае 58 | @JsonKey(name: JsonKeys.isPayee) 59 | final bool? isPayee; 60 | } 61 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/add_customer/add_customer_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'add_customer_response.g.dart'; 7 | 8 | /// Ответ от сервера на регистрацию покупателя 9 | /// 10 | /// [AddCustomerResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/addcustomer-response/) 11 | @JsonSerializable() 12 | class AddCustomerResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на регистрацию покупателя 14 | AddCustomerResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.customerKey, 22 | }) : super( 23 | status: status, 24 | success: success, 25 | errorCode: errorCode, 26 | message: message, 27 | details: details, 28 | ); 29 | 30 | /// Преобразование json в модель 31 | factory AddCustomerResponse.fromJson(Map json) => 32 | _$AddCustomerResponseFromJson(json); 33 | 34 | @override 35 | Map toJson() => _$AddCustomerResponseToJson(this); 36 | 37 | @override 38 | Map get equals => { 39 | ...super.equals, 40 | JsonKeys.terminalKey: terminalKey, 41 | JsonKeys.customerKey: customerKey, 42 | }; 43 | 44 | /// Идентификатор терминала. 45 | /// Выдается продавцу банком при заведении терминала 46 | @JsonKey(name: JsonKeys.terminalKey) 47 | final String? terminalKey; 48 | 49 | /// Идентификатор платежа в системе банка 50 | @JsonKey(name: JsonKeys.customerKey) 51 | final String? customerKey; 52 | } 53 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/mark_quantity.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'mark_quantity.g.dart'; 6 | 7 | /// Реквизит «дробное количество маркированного товара». 8 | /// 9 | /// [MarkQuantity](https://www.tinkoff.ru/kassa/develop/api/receipt/ffd12/#Items) 10 | @JsonSerializable(includeIfNull: false) 11 | class MarkQuantity extends BaseRequest { 12 | /// Создает экземпляр реквизита «дробное количество маркированного товара». 13 | MarkQuantity({ 14 | required this.numerator, 15 | required this.denominator, 16 | }); 17 | 18 | /// Преобразование json в модель 19 | factory MarkQuantity.fromJson(Map json) => 20 | _$MarkQuantityFromJson(json); 21 | 22 | @override 23 | Map get equals => { 24 | JsonKeys.numerator: numerator, 25 | JsonKeys.denominator: denominator, 26 | }; 27 | 28 | @override 29 | Map toJson() => _$MarkQuantityToJson(this); 30 | 31 | @override 32 | MarkQuantity copyWith({ 33 | int? numerator, 34 | int? denominator, 35 | }) { 36 | return MarkQuantity( 37 | numerator: numerator ?? this.numerator, 38 | denominator: denominator ?? this.denominator, 39 | ); 40 | } 41 | 42 | @override 43 | void validate() {} 44 | 45 | /// Числитель дробной части предмета расчета. Значение должно быть строго меньше значения реквизита «знаменатель». 46 | @JsonKey(name: JsonKeys.numerator) 47 | final int numerator; 48 | 49 | /// Знаменатель дробной части предмета расчета. Значение равно количеству товара в партии (упаковке), имеющей общий код маркировки товара 50 | @JsonKey(name: JsonKeys.denominator) 51 | final int denominator; 52 | } 53 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_add_account_qr_state/get_add_account_qr_state_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'get_add_account_qr_state_request.g.dart'; 6 | 7 | /// Метод возвращает статус привязки счета Покупателя по магазину в СБП 8 | /// 9 | /// [GetAddAccountQrStateRequest](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/getaddaccountqrstate-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class GetAddAccountQrStateRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению статуса платежа 13 | GetAddAccountQrStateRequest({ 14 | required this.requestKey, 15 | String? signToken, 16 | }) : super(signToken); 17 | 18 | /// Преобразование json в модель 19 | factory GetAddAccountQrStateRequest.fromJson(Map json) => 20 | _$GetAddAccountQrStateRequestFromJson(json); 21 | 22 | @override 23 | String get apiMethod => ApiMethods.getAddAccountQrState; 24 | 25 | @override 26 | Map toJson() => _$GetAddAccountQrStateRequestToJson(this); 27 | 28 | @override 29 | Map get equals => { 30 | ...super.equals, 31 | JsonKeys.requestKey: requestKey, 32 | }; 33 | 34 | @override 35 | GetAddAccountQrStateRequest copyWith({ 36 | String? requestKey, 37 | String? signToken, 38 | }) { 39 | return GetAddAccountQrStateRequest( 40 | requestKey: requestKey ?? this.requestKey, 41 | signToken: signToken ?? this.signToken, 42 | ); 43 | } 44 | 45 | @override 46 | void validate() {} 47 | 48 | /// Идентификатор запроса на привязку счета 49 | @JsonKey(name: JsonKeys.requestKey) 50 | final String requestKey; 51 | } 52 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/remove_customer/remove_customer_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'remove_customer_response.g.dart'; 7 | 8 | /// Ответ от сервера на удаление данных покупателя 9 | /// 10 | /// [RemoveCustomerResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/removecustomer-response/) 11 | @JsonSerializable() 12 | class RemoveCustomerResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на удаление данных покупателя 14 | RemoveCustomerResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.customerKey, 22 | }) : super( 23 | status: status, 24 | success: success, 25 | errorCode: errorCode, 26 | message: message, 27 | details: details, 28 | ); 29 | 30 | /// Преобразование json в модель 31 | factory RemoveCustomerResponse.fromJson(Map json) => 32 | _$RemoveCustomerResponseFromJson(json); 33 | 34 | @override 35 | Map toJson() => _$RemoveCustomerResponseToJson(this); 36 | 37 | @override 38 | Map get equals => { 39 | ...super.equals, 40 | JsonKeys.terminalKey: terminalKey, 41 | JsonKeys.customerKey: customerKey, 42 | }; 43 | 44 | /// Идентификатор терминала. 45 | /// Выдается продавцу банком при заведении терминала 46 | @JsonKey(name: JsonKeys.terminalKey) 47 | final String? terminalKey; 48 | 49 | /// Идентификатор платежа в системе банка 50 | @JsonKey(name: JsonKeys.customerKey) 51 | final String? customerKey; 52 | } 53 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/operating_check_props.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'operating_check_props.g.dart'; 6 | 7 | /// Операционный реквизит чека (тег 1270), только для ФФД 1.2 8 | @JsonSerializable(includeIfNull: false) 9 | class OperatingCheckProps extends BaseRequest { 10 | /// Создает экземпляр данных операционного реквизита чека (тег 1270) 11 | OperatingCheckProps( 12 | this.name, 13 | this.value, 14 | this.timestamp, 15 | ); 16 | 17 | /// Преобразование json в модель 18 | factory OperatingCheckProps.fromJson(Map json) => 19 | _$OperatingCheckPropsFromJson(json); 20 | 21 | @override 22 | Map get equals => { 23 | JsonKeys.name: name, 24 | JsonKeys.value: value, 25 | JsonKeys.timestamp: timestamp, 26 | }; 27 | 28 | @override 29 | Map toJson() => _$OperatingCheckPropsToJson(this); 30 | 31 | @override 32 | OperatingCheckProps copyWith({ 33 | String? name, 34 | String? value, 35 | String? timestamp, 36 | }) { 37 | return OperatingCheckProps( 38 | name ?? this.name, 39 | value ?? this.value, 40 | timestamp ?? this.timestamp, 41 | ); 42 | } 43 | 44 | @override 45 | void validate() {} 46 | 47 | /// Идентификатор операции (тег 1271) 48 | /// 49 | /// Принимает значения «0» до определения значения реквизита ФНС России. 50 | @JsonKey(name: JsonKeys.name) 51 | final String name; 52 | 53 | /// Данные операции (тег 1272) 54 | @JsonKey(name: JsonKeys.value) 55 | final String value; 56 | 57 | /// Дата и время операции в формате ДД.ММ.ГГГГ ЧЧ:ММ:СС (тег 1273) 58 | @JsonKey(name: JsonKeys.timestamp) 59 | final String timestamp; 60 | } 61 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/qr_members_list/qr_members_list_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'qr_members_list_request.g.dart'; 6 | 7 | /// Метод возвращает cписок участников куда может быть осуществлен возврат платежа, совершенного по QR. 8 | /// 9 | /// [QrMembersListRequest](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/qrmemberslist-description/) 10 | @JsonSerializable(includeIfNull: false) 11 | class QrMembersListRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению cписока участников куда может быть осуществлен возврат платежа, совершенного по QR. 13 | QrMembersListRequest({ 14 | required this.paymentId, 15 | String? signToken, 16 | }) : super(signToken); 17 | 18 | /// Преобразование json в модель 19 | factory QrMembersListRequest.fromJson(Map json) => 20 | _$QrMembersListRequestFromJson(json); 21 | 22 | @override 23 | String get apiMethod => ApiMethods.qrMembersList; 24 | 25 | @override 26 | Map toJson() => _$QrMembersListRequestToJson(this); 27 | 28 | @override 29 | Map get equals => { 30 | ...super.equals, 31 | JsonKeys.paymentId: paymentId, 32 | }; 33 | 34 | @override 35 | QrMembersListRequest copyWith({ 36 | int? paymentId, 37 | String? signToken, 38 | }) { 39 | return QrMembersListRequest( 40 | paymentId: paymentId ?? this.paymentId, 41 | signToken: signToken ?? this.signToken, 42 | ); 43 | } 44 | 45 | @override 46 | void validate() { 47 | paymentId.validateId(JsonKeys.paymentId); 48 | } 49 | 50 | /// Идентификатор платежа в системе банка 51 | @JsonKey(name: JsonKeys.paymentId) 52 | final int paymentId; 53 | } 54 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/qr_members_list/qr_members_list_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../models.dart'; 4 | 5 | part 'qr_members_list_response.g.dart'; 6 | 7 | /// Ответ от сервера на получение cписока участников куда может быть осуществлен возврат платежа, совершенного по QR. 8 | /// 9 | /// [QrMembersListResponse](https://www.tinkoff.ru/kassa/develop/api/payments/QrMembersList-response/) 10 | @JsonSerializable() 11 | class QrMembersListResponse extends AcquiringResponse { 12 | /// Создает экземпляр ответа от сервера на получение cписока участников куда может быть осуществлен возврат платежа, совершенного по QR. 13 | QrMembersListResponse({ 14 | Status? status, 15 | bool? success, 16 | String? errorCode, 17 | String? message, 18 | String? details, 19 | this.members, 20 | this.orderId, 21 | }) : super( 22 | status: status, 23 | success: success, 24 | errorCode: errorCode, 25 | message: message, 26 | details: details, 27 | ); 28 | 29 | /// Преобразование json в модель 30 | factory QrMembersListResponse.fromJson(Map json) => 31 | _$QrMembersListResponseFromJson(json); 32 | 33 | @override 34 | Map toJson() => _$QrMembersListResponseToJson(this); 35 | 36 | @override 37 | Map get equals => { 38 | ...super.equals, 39 | JsonKeys.terminalKey: members, 40 | JsonKeys.orderId: orderId, 41 | }; 42 | 43 | /// Идентификатор заказа в системе продавца 44 | @JsonKey(name: JsonKeys.orderId) 45 | final String? orderId; 46 | 47 | /// Массив списка участников. Возвращается только если возврат возможен 48 | @JsonKey(name: JsonKeys.members) 49 | final List? members; 50 | } 51 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_state/get_state_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'get_state_request.g.dart'; 6 | 7 | /// Метод возвращает текущий статус платежа. 8 | /// 9 | /// [GetStateRequest](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/getqrstate-description/) 10 | @JsonSerializable(includeIfNull: false) 11 | class GetStateRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению статуса платежа 13 | GetStateRequest({ 14 | required this.paymentId, 15 | this.ip, 16 | String? signToken, 17 | }) : super(signToken); 18 | 19 | /// Преобразование json в модель 20 | factory GetStateRequest.fromJson(Map json) => 21 | _$GetStateRequestFromJson(json); 22 | 23 | @override 24 | String get apiMethod => ApiMethods.getState; 25 | 26 | @override 27 | Map toJson() => _$GetStateRequestToJson(this); 28 | 29 | @override 30 | Map get equals => { 31 | ...super.equals, 32 | JsonKeys.paymentId: paymentId, 33 | JsonKeys.ip: ip, 34 | }; 35 | 36 | @override 37 | GetStateRequest copyWith({ 38 | int? paymentId, 39 | String? ip, 40 | String? signToken, 41 | }) { 42 | return GetStateRequest( 43 | paymentId: paymentId ?? this.paymentId, 44 | ip: ip ?? this.ip, 45 | signToken: signToken ?? this.signToken, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | paymentId.validateId(JsonKeys.paymentId); 52 | ip.validateIp(JsonKeys.ip); 53 | } 54 | 55 | /// Идентификатор платежа в системе банка 56 | @JsonKey(name: JsonKeys.paymentId) 57 | final int paymentId; 58 | 59 | /// IP-адрес покупателя 60 | @JsonKey(name: JsonKeys.ip) 61 | final String? ip; 62 | } 63 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/confirm/confirm_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'confirm_response.g.dart'; 7 | 8 | /// Ответ от сервера на подтверждения платежа 9 | /// 10 | /// [ConfirmResponse](https://www.tinkoff.ru/kassa/develop/api/payments/confirm-response/) 11 | @JsonSerializable() 12 | class ConfirmResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на подтверждения платежа 14 | ConfirmResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.orderId, 22 | this.paymentId, 23 | }) : super( 24 | status: status, 25 | success: success, 26 | errorCode: errorCode, 27 | message: message, 28 | details: details, 29 | ); 30 | 31 | /// Преобразование json в модель 32 | factory ConfirmResponse.fromJson(Map json) => 33 | _$ConfirmResponseFromJson(json); 34 | 35 | @override 36 | Map toJson() => _$ConfirmResponseToJson(this); 37 | 38 | @override 39 | Map get equals => { 40 | ...super.equals, 41 | JsonKeys.terminalKey: terminalKey, 42 | JsonKeys.orderId: orderId, 43 | JsonKeys.paymentId: paymentId, 44 | }; 45 | 46 | /// Идентификатор терминала. 47 | /// Выдается продавцу банком при заведении терминала 48 | @JsonKey(name: JsonKeys.terminalKey) 49 | final String? terminalKey; 50 | 51 | /// Идентификатор заказа в системе продавца 52 | @JsonKey(name: JsonKeys.orderId) 53 | final String? orderId; 54 | 55 | /// Идентификатор платежа в системе банка 56 | @JsonKey(name: JsonKeys.paymentId) 57 | final String? paymentId; 58 | } 59 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_static_qr/get_static_qr_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'get_static_qr_response.g.dart'; 7 | 8 | /// Ответ от сервера на регистрацию статического QR 9 | /// 10 | /// [GetStaticQrResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/getstaticqr-response/) 11 | @JsonSerializable() 12 | class GetStaticQrResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на регистрацию статического QR 14 | GetStaticQrResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.data, 22 | }) : super( 23 | status: status, 24 | success: success, 25 | errorCode: errorCode, 26 | message: message, 27 | details: details, 28 | ); 29 | 30 | /// Преобразование json в модель 31 | factory GetStaticQrResponse.fromJson(Map json) => 32 | _$GetStaticQrResponseFromJson(json); 33 | 34 | @override 35 | Map toJson() => _$GetStaticQrResponseToJson(this); 36 | 37 | @override 38 | Map get equals => { 39 | ...super.equals, 40 | JsonKeys.terminalKey: terminalKey, 41 | JsonKeys.data2: data, 42 | }; 43 | 44 | /// Идентификатор терминала. 45 | /// Выдается продавцу банком при заведении терминала 46 | @JsonKey(name: JsonKeys.terminalKey) 47 | final String? terminalKey; 48 | 49 | /// В зависимости от `DataType` в запросе это: `Payload` - информация, 50 | /// которая должна быть закодирована в `QR` 51 | /// или `SVG` изображение `QR` в котором уже закодирован `Payload` 52 | @JsonKey(name: JsonKeys.data2) 53 | final String? data; 54 | } 55 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 3.0.11 2 | 3 | * Bumped Flutter to 3.10.2, Dart to 3 4 | * Upgraded dependencies 5 | 6 | # 3.0.10 7 | 8 | * Fixing the 3DSv2 Challenge Flow Passage 9 | 10 | # 3.0.9 11 | 12 | * Fix paymentId type in OrderPayments 13 | 14 | # 3.0.8 15 | 16 | * Fixed & add/remove new request and response models (Sync with documentation) 17 | * Fix readme 18 | * Update dependency webview_flutter to 4.0.0 19 | 20 | # 3.0.7 21 | 22 | * Add PaymentId to AddCardResponse 23 | 24 | # 3.0.6 25 | 26 | * Update dependencies 27 | * Fixed & add new request and response models (Sync with documentation) 28 | * Reworked TinkoffAcquiringConfig 29 | * New PaymentSource 30 | * Payment through the Fast Payment System (SBP) by QR 31 | 32 | # 3.0.5 33 | 34 | * Update dependencies 35 | * Add AttachedCardData 36 | 37 | # 3.0.4 38 | 39 | * Fix dependencies 40 | 41 | # 3.0.3 42 | 43 | * Fix Json Key pan in `CardInfo` 44 | * Update dependencies 45 | 46 | # 3.0.2 47 | 48 | * Add `getQr` endpoint for SBP 49 | * Add `getStaticQr` endpoint for SBP 50 | 51 | # 3.0.1 52 | 53 | * Add SendClosingReceipt endpoint 54 | * Small fixes 55 | 56 | # 3.0.0 57 | 58 | * **BREAKING**: Splitting the library into two packages: 59 | - tinkoff_acquiring: Package for working with Tinkoff API 60 | - tinkoff_acquiring_flutter: A package for working with UI, at the moment it is WebView. In the future, it will be QR and much more 61 | 62 | # 2.1.0 63 | 64 | * Add Base Model & Update models 65 | * Add Card Validators 66 | * Replacing Comparer with a package 67 | 68 | # 2.0.0 69 | 70 | * Null safe migration 71 | * Edit models constructors 72 | * Add `TinkoffAcquiringConfig` 73 | 74 | # 1.0.3 75 | 76 | * Fix CollectData 77 | 78 | # 1.0.2 79 | 80 | * Add Comparer (`hashCode`, `==` & `toString` generator) 81 | * Fixed example using 3-D Secure 2.0 82 | 83 | # 1.0.1 84 | 85 | * Add support 3-D Secure 2.0 86 | * Fix and clean code 87 | 88 | # 1.0.0 89 | 90 | * Initial stable release. 91 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/card_info.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_response.dart'; 4 | import '../enums/card_status.dart'; 5 | import '../enums/card_type.dart'; 6 | 7 | part 'card_info.g.dart'; 8 | 9 | /// Данные карты 10 | @JsonSerializable() 11 | class CardInfo extends BaseResponse { 12 | /// Данные карты 13 | CardInfo({ 14 | this.pan, 15 | this.cardId, 16 | this.rebillId, 17 | this.cardType, 18 | this.expDate, 19 | this.status, 20 | }); 21 | 22 | /// Преобразование json в модель 23 | factory CardInfo.fromJson(Map json) => 24 | _$CardInfoFromJson(json); 25 | 26 | @override 27 | Map get equals => { 28 | JsonKeys.pan: pan, 29 | JsonKeys.cardId: cardId, 30 | JsonKeys.rebillId: rebillId, 31 | JsonKeys.cardType: cardType, 32 | JsonKeys.expDate: expDate, 33 | JsonKeys.status: status, 34 | }; 35 | 36 | @override 37 | Map toJson() => _$CardInfoToJson(this); 38 | 39 | /// Номер карты маскированный 40 | @JsonKey(name: JsonKeys.pan) 41 | final String? pan; 42 | 43 | /// Идентификатор карты в системе Банка 44 | @JsonKey(name: JsonKeys.cardId) 45 | final String? cardId; 46 | 47 | /// Идентификатор рекуррентного платежа в системе банка 48 | @JsonKey(name: JsonKeys.rebillId) 49 | final String? rebillId; 50 | 51 | /// Карта: 52 | /// * 0 — списания 53 | /// * 1 — пополнения 54 | /// * 2 — списания и пополнения 55 | @JsonKey(name: JsonKeys.cardType, unknownEnumValue: CardType.notExist) 56 | final CardType? cardType; 57 | 58 | /// Статус карты: 59 | /// * A - активная 60 | /// * I - неактивная 61 | /// * D - удалена 62 | @JsonKey(name: JsonKeys.status) 63 | final CardStatus? status; 64 | 65 | /// Срок действия карты 66 | @JsonKey(name: JsonKeys.expDate) 67 | final String? expDate; 68 | } 69 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/check_order/check_order_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../common/order_payments.dart'; 5 | import '../enums/status.dart'; 6 | 7 | part 'check_order_response.g.dart'; 8 | 9 | /// Ответ от сервера на получение статуса платежа 10 | /// 11 | /// [CheckOrderResponse](https://www.tinkoff.ru/kassa/develop/api/payments/CheckOrder-response/) 12 | @JsonSerializable() 13 | class CheckOrderResponse extends AcquiringResponse { 14 | /// Создает экземпляр ответа от сервера на получение статуса платежа 15 | CheckOrderResponse({ 16 | Status? status, 17 | bool? success, 18 | String? errorCode, 19 | String? message, 20 | String? details, 21 | this.terminalKey, 22 | this.orderId, 23 | this.payments, 24 | }) : super( 25 | status: status, 26 | success: success, 27 | errorCode: errorCode, 28 | message: message, 29 | details: details, 30 | ); 31 | 32 | /// Преобразование json в модель 33 | factory CheckOrderResponse.fromJson(Map json) => 34 | _$CheckOrderResponseFromJson(json); 35 | 36 | @override 37 | Map toJson() => _$CheckOrderResponseToJson(this); 38 | 39 | @override 40 | Map get equals => { 41 | ...super.equals, 42 | JsonKeys.terminalKey: terminalKey, 43 | JsonKeys.orderId: orderId, 44 | JsonKeys.payments: payments, 45 | }; 46 | 47 | /// Идентификатор терминала. 48 | /// Выдается продавцу банком при заведении терминала 49 | @JsonKey(name: JsonKeys.terminalKey) 50 | final String? terminalKey; 51 | 52 | /// Идентификатор заказа в системе продавца 53 | @JsonKey(name: JsonKeys.orderId) 54 | final String? orderId; 55 | 56 | /// Детали 57 | @JsonKey(name: JsonKeys.payments) 58 | final List? payments; 59 | } 60 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/remove_card/remove_card_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'remove_card_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | RemoveCardResponse _$RemoveCardResponseFromJson(Map json) => 10 | RemoveCardResponse( 11 | success: json['Success'] as bool?, 12 | errorCode: json['ErrorCode'] as String?, 13 | message: json['Message'] as String?, 14 | details: json['Details'] as String?, 15 | terminalKey: json['TerminalKey'] as String?, 16 | customerKey: json['CustomerKey'] as String?, 17 | cardId: json['CardId'] as String?, 18 | cardStatus: $enumDecodeNullable(_$CardStatusEnumMap, json['Status'], 19 | unknownValue: CardStatus.notExist), 20 | cardType: $enumDecodeNullable(_$CardTypeEnumMap, json['CardType'], 21 | unknownValue: CardType.notExist), 22 | ); 23 | 24 | Map _$RemoveCardResponseToJson(RemoveCardResponse instance) => 25 | { 26 | 'Success': instance.success, 27 | 'ErrorCode': instance.errorCode, 28 | 'Message': instance.message, 29 | 'Details': instance.details, 30 | 'TerminalKey': instance.terminalKey, 31 | 'CustomerKey': instance.customerKey, 32 | 'CardId': instance.cardId, 33 | 'Status': _$CardStatusEnumMap[instance.cardStatus], 34 | 'CardType': _$CardTypeEnumMap[instance.cardType], 35 | }; 36 | 37 | const _$CardStatusEnumMap = { 38 | CardStatus.active: 'A', 39 | CardStatus.inactive: 'I', 40 | CardStatus.deleted: 'D', 41 | CardStatus.notExist: 'notExist', 42 | }; 43 | 44 | const _$CardTypeEnumMap = { 45 | CardType.notExist: 'notExist', 46 | CardType.writeOffs: 0, 47 | CardType.replenishment: 1, 48 | CardType.writeOffsAndReplenishment: 2, 49 | }; 50 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing Guidelines 2 | 3 | Thank you for your interest in contributing to our project! <3 Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community. Please read through these guidelines carefully before submitting a PR or issue and let us know if it's not up-to-date (or even better, submit a PR with your corrections ;)). 4 | 5 | ## Setting up for local development 6 | 7 | This section should get you running with **Flutter Tinkoff Acquiring SDK** and get you familiar with the basics of the codebase. 8 | 9 | Start by, [Forking](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the main branch of Tinkoff-Acquiring-SDK-Flutter repo. 10 | 11 | You will need to install `melos` for dependency management. 12 | Run `melos bootstrap` to link local packages together and install remaining dependencies. 13 | 14 | > Melos launching via FVM goes like this: `fvm flutter pub global run melos...` 15 | 16 | Note that running `pub get` in the packages is no longer required, because `melos bootstrap` has 17 | already installed all the dependencies. 18 | 19 | See [invertase/melos](https://github.com/invertase/melos) for more instructions on how to use `melos`. 20 | 21 | ``` 22 | $ git clone git@github.com:MadBrains/Tinkoff-Acquiring-SDK-Flutter.git 23 | $ cd amplify-flutter 24 | $ pub global activate melos 25 | $ melos bootstrap 26 | ``` 27 | 28 | > Note: Make sure to always [sync your fork](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) with main branch of Tinkoff-Acquiring-SDK-Flutter repo. 29 | 30 | 31 | ## Contributing: 32 | 33 | 1) To start contributing make a fork of this repo and create a branch where you will make your changes to a particular `packages/[category]`. 34 | 35 | 2) Update the example app to use your new changes (if applicable) and to build the app on iOS and Android. 36 | 37 | 3) Run the test suite 38 | 39 | 4) Submit a PR 40 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_qr/get_qr_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | import '../enums/data_type.dart'; 5 | 6 | part 'get_qr_request.g.dart'; 7 | 8 | /// Метод регистрирует QR и возвращает информацию о нем. Должен быть вызван после метода `Init` 9 | /// 10 | /// [GetQrRequest](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/getqr-description/) 11 | @JsonSerializable(includeIfNull: false) 12 | class GetQrRequest extends AcquiringRequest { 13 | /// Создает экземпляр метода регистрации QR 14 | GetQrRequest({ 15 | required this.paymentId, 16 | this.dataType, 17 | String? signToken, 18 | }) : super(signToken); 19 | 20 | /// Преобразование json в модель 21 | factory GetQrRequest.fromJson(Map json) => 22 | _$GetQrRequestFromJson(json); 23 | 24 | @override 25 | String get apiMethod => ApiMethods.getQr; 26 | 27 | @override 28 | Map toJson() => _$GetQrRequestToJson(this); 29 | 30 | @override 31 | Map get equals => { 32 | ...super.equals, 33 | JsonKeys.paymentId: paymentId, 34 | JsonKeys.dataType: dataType, 35 | }; 36 | 37 | @override 38 | GetQrRequest copyWith({ 39 | int? paymentId, 40 | DataType? dataType, 41 | String? signToken, 42 | }) { 43 | return GetQrRequest( 44 | paymentId: paymentId ?? this.paymentId, 45 | dataType: dataType ?? this.dataType, 46 | signToken: signToken ?? this.signToken, 47 | ); 48 | } 49 | 50 | @override 51 | void validate() { 52 | assert(paymentId.length <= 20); 53 | } 54 | 55 | /// Уникальный идентификатор транзакции в системе Банка, полученный в ответе на вызов метода `Init` 56 | @JsonKey(name: JsonKeys.paymentId) 57 | final int paymentId; 58 | 59 | /// Тип возвращаемых данных 60 | @JsonKey(name: JsonKeys.dataType, unknownEnumValue: DataType.payload) 61 | final DataType? dataType; 62 | } 63 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/acquiring_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../enums/status.dart'; 4 | import 'base_response.dart'; 5 | 6 | export '../../../constants.dart'; 7 | export '../../../utils/extensions.dart'; 8 | 9 | part 'acquiring_response.g.dart'; 10 | 11 | /// Базовый класс ответа Acquiring API 12 | @JsonSerializable() 13 | class AcquiringResponse extends BaseResponse { 14 | /// Базовый класс ответа Acquiring API 15 | AcquiringResponse({ 16 | this.success, 17 | this.status, 18 | this.errorCode, 19 | this.message, 20 | this.details, 21 | }); 22 | 23 | /// Преобразование json в модель 24 | factory AcquiringResponse.fromJson(Map json) => 25 | _$AcquiringResponseFromJson(json); 26 | 27 | @override 28 | Map get equals => { 29 | JsonKeys.success: success, 30 | JsonKeys.status: status, 31 | JsonKeys.errorCode: errorCode, 32 | JsonKeys.message: message, 33 | JsonKeys.details: details, 34 | }; 35 | 36 | @override 37 | Map toJson() => _$AcquiringResponseToJson(this); 38 | 39 | /// Проверка наличии ошибки 40 | bool get hasError => success == false && errorCode != '0'; 41 | 42 | /// Выполнение операции 43 | @JsonKey(name: JsonKeys.success) 44 | final bool? success; 45 | 46 | /// Статус в ответе на запрос методов 47 | /// 48 | /// [Status](https://www.tinkoff.ru/kassa/develop/api/payments/) 49 | @JsonKey(name: JsonKeys.status, unknownEnumValue: Status.notExist) 50 | final Status? status; 51 | 52 | /// Код ошибки 53 | /// 54 | /// Если ошибки не произошло, передается значение «0» 55 | @JsonKey(name: JsonKeys.errorCode) 56 | final String? errorCode; 57 | 58 | /// Краткое описание ошибки 59 | @JsonKey(name: JsonKeys.message) 60 | final String? message; 61 | 62 | /// Подробное описание ошибки 63 | @JsonKey(name: JsonKeys.details) 64 | final String? details; 65 | } 66 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/charge/charge_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'charge_response.g.dart'; 7 | 8 | /// Ответ от сервера на автоплатеж 9 | /// 10 | /// [ChargeResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/charge-response/) 11 | @JsonSerializable() 12 | class ChargeResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на автоплатеж 14 | ChargeResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.orderId, 22 | this.paymentId, 23 | this.amount, 24 | }) : super( 25 | status: status, 26 | success: success, 27 | errorCode: errorCode, 28 | message: message, 29 | details: details, 30 | ); 31 | 32 | /// Преобразование json в модель 33 | factory ChargeResponse.fromJson(Map json) => 34 | _$ChargeResponseFromJson(json); 35 | 36 | @override 37 | Map toJson() => _$ChargeResponseToJson(this); 38 | 39 | @override 40 | Map get equals => { 41 | ...super.equals, 42 | JsonKeys.terminalKey: terminalKey, 43 | JsonKeys.orderId: orderId, 44 | JsonKeys.paymentId: paymentId, 45 | JsonKeys.amount: amount, 46 | }; 47 | 48 | /// Идентификатор терминала. 49 | /// Выдается продавцу банком при заведении терминала 50 | @JsonKey(name: JsonKeys.terminalKey) 51 | final String? terminalKey; 52 | 53 | /// Сумма в копейках 54 | @JsonKey(name: JsonKeys.amount) 55 | final int? amount; 56 | 57 | /// Идентификатор заказа в системе продавца 58 | @JsonKey(name: JsonKeys.orderId) 59 | final String? orderId; 60 | 61 | /// Идентификатор платежа в системе банка 62 | @JsonKey(name: JsonKeys.paymentId) 63 | final String? paymentId; 64 | } 65 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_customer/get_customer_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'get_customer_request.g.dart'; 6 | 7 | /// Метод по получению данных покупателя из системы продавца. 8 | /// 9 | /// [GetCustomerRequest](https://www.tinkoff.ru/kassa/develop/api/autopayments/getcustomer-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class GetCustomerRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по получению данных покупателя 13 | GetCustomerRequest({ 14 | required this.customerKey, 15 | this.ip, 16 | String? signToken, 17 | }) : super(signToken); 18 | 19 | /// Преобразование json в модель 20 | factory GetCustomerRequest.fromJson(Map json) => 21 | _$GetCustomerRequestFromJson(json); 22 | 23 | @override 24 | String get apiMethod => ApiMethods.getCustomer; 25 | 26 | @override 27 | Map toJson() => _$GetCustomerRequestToJson(this); 28 | 29 | @override 30 | Map get equals => { 31 | ...super.equals, 32 | JsonKeys.customerKey: customerKey, 33 | JsonKeys.ip: ip, 34 | }; 35 | 36 | @override 37 | GetCustomerRequest copyWith({ 38 | String? customerKey, 39 | String? ip, 40 | String? signToken, 41 | }) { 42 | return GetCustomerRequest( 43 | customerKey: customerKey ?? this.customerKey, 44 | ip: ip ?? this.ip, 45 | signToken: signToken ?? this.signToken, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | assert(customerKey.length <= 36); 52 | 53 | final String? _ip = ip; 54 | if (_ip != null) { 55 | assert(_ip.length >= 7 && _ip.length <= 45); 56 | } 57 | } 58 | 59 | /// Идентификатор платежа в системе банка 60 | @JsonKey(name: JsonKeys.customerKey) 61 | final String customerKey; 62 | 63 | /// IP-адрес покупателя 64 | @JsonKey(name: JsonKeys.ip) 65 | final String? ip; 66 | } 67 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/shops.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'shops.g.dart'; 6 | 7 | /// Данными Маркетплейса 8 | /// 9 | /// [Shops](https://www.tinkoff.ru/kassa/develop/api/payments/init-request/#Shops) 10 | @JsonSerializable(includeIfNull: false) 11 | class Shops extends BaseRequest { 12 | /// Создает экземпляр данных Маркетплейса 13 | Shops({ 14 | required this.shopCode, 15 | required this.amount, 16 | this.name, 17 | this.fee, 18 | }); 19 | 20 | /// Преобразование json в модель 21 | factory Shops.fromJson(Map json) => _$ShopsFromJson(json); 22 | 23 | @override 24 | Map get equals => { 25 | JsonKeys.shopCode: shopCode, 26 | JsonKeys.amount: amount, 27 | JsonKeys.name: name, 28 | JsonKeys.fee: fee, 29 | }; 30 | 31 | @override 32 | Map toJson() => _$ShopsToJson(this); 33 | 34 | @override 35 | Shops copyWith({ 36 | String? shopCode, 37 | int? amount, 38 | String? name, 39 | String? fee, 40 | }) { 41 | return Shops( 42 | shopCode: shopCode ?? this.shopCode, 43 | amount: amount ?? this.amount, 44 | name: name ?? this.name, 45 | fee: fee ?? this.fee, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | amount.validateAmount(JsonKeys.amount); 52 | } 53 | 54 | /// Код магазина 55 | @JsonKey(name: JsonKeys.shopCode) 56 | final String shopCode; 57 | 58 | /// Cумма в копейках, которая относится к указанному [shopCode] 59 | @JsonKey(name: JsonKeys.amount) 60 | final int amount; 61 | 62 | /// Наименование позиции 63 | @JsonKey(name: JsonKeys.name) 64 | final String? name; 65 | 66 | /// Сумма комиссии в копейках, удерживаемая из возмещения Партнера в пользу Маркетплейса. 67 | /// Если не передано, используется комиссия, указанная при регистрации. 68 | @JsonKey(name: JsonKeys.fee) 69 | final String? fee; 70 | } 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

Tinkoff Acquiring SDK

5 | 6 |

Acquiring SDK allows you to integrate Tinkoff Internet Acquiring into mobile applications for iOS and Android platforms.

7 | 8 | 9 |

We solve problems of brand presence on mobile devices, specializing in development of mobile applications and services in the b2c segment.

10 | 11 | 12 |

13 | 14 |

Subscribe for the latest updates:
15 | 16 |

17 |
18 | 19 | 20 | [Available API Documentation][documentation]. 21 | 22 | EACQ protocol version with PCI DSS: 1.50 (09.12.2022) 23 | 24 | ## SDK Features 25 | 26 | - Making payments (including recurring payments); 27 | - Saving customers bank cards; 28 | - Getting information about customers and saved bank cards; 29 | - Management of saved bank cards; 30 | - Integration with online checkouts; 31 | - Payment through the Faster Payments System (SPB) by QR; 32 | 33 | ## Packages 34 | | | | 35 | |:---:|:---:| 36 | | tinkoff_acquiring | [![pub package](https://img.shields.io/pub/v/tinkoff_acquiring.svg)](https://pub.dartlang.org/packages/tinkoff_acquiring) | 37 | | tinkoff_acquiring_flutter | [![pub package](https://img.shields.io/pub/v/tinkoff_acquiring_flutter.svg)](https://pub.dartlang.org/packages/tinkoff_acquiring_flutter) | 38 | 39 | 40 | ## Example 41 | The [Example][example] is in the corresponding folder 42 | 43 | [documentation]: https://www.tinkoff.ru/kassa/develop/api/payments/ 44 | [acquiring]: https://www.tinkoff.ru/business/internet-acquiring/ 45 | [example]: https://github.com/MadBrains/Tinkoff-Acquiring-SDK-Flutter/tree/main/example -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_static_qr/get_static_qr_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | import '../enums/data_type.dart'; 5 | 6 | part 'get_static_qr_request.g.dart'; 7 | 8 | /// Метод регистрирует статический QR и возвращает информацию о нем. 9 | /// 10 | /// При первом вызове регистрирует QR и возвращает информацию о нем при последующих вызовах вовзращает информацию о ранее сгенерированном QR. 11 | /// Перерегистрация статического QR происходит только при смене расчетного счета. 12 | /// Не привязан к конкретному платежу, может быть вызван в любое время без предварительного вызова Init. 13 | /// 14 | /// [GetStaticQrRequest](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/getstaticqr-description/) 15 | @JsonSerializable(includeIfNull: false) 16 | class GetStaticQrRequest extends AcquiringRequest { 17 | /// Создает экземпляр метода регистрации статического QR 18 | GetStaticQrRequest({ 19 | this.dataType, 20 | String? signToken, 21 | }) : super(signToken); 22 | 23 | /// Преобразование json в модель 24 | factory GetStaticQrRequest.fromJson(Map json) => 25 | _$GetStaticQrRequestFromJson(json); 26 | 27 | @override 28 | String get apiMethod => ApiMethods.getStaticQr; 29 | 30 | @override 31 | Map toJson() => _$GetStaticQrRequestToJson(this); 32 | 33 | @override 34 | Map get equals => { 35 | ...super.equals, 36 | JsonKeys.dataType: dataType, 37 | }; 38 | 39 | @override 40 | GetStaticQrRequest copyWith({ 41 | DataType? dataType, 42 | String? signToken, 43 | }) { 44 | return GetStaticQrRequest( 45 | dataType: dataType ?? this.dataType, 46 | signToken: signToken ?? this.signToken, 47 | ); 48 | } 49 | 50 | @override 51 | void validate() {} 52 | 53 | /// Тип возвращаемых данных 54 | @JsonKey(name: JsonKeys.dataType, unknownEnumValue: DataType.payload) 55 | final DataType? dataType; 56 | } 57 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_card_list/get_card_list_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'get_card_list_request.g.dart'; 6 | 7 | /// Метод возвращает список привязанных карт у покупателя 8 | /// 9 | /// [GetCardListRequest](https://www.tinkoff.ru/kassa/develop/api/autopayments/getcardlist-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class GetCardListRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по возвращению списка привязанных карт у покупателя 13 | GetCardListRequest({ 14 | required this.customerKey, 15 | this.ip, 16 | String? signToken, 17 | }) : super(signToken); 18 | 19 | /// Преобразование json в модель 20 | factory GetCardListRequest.fromJson(Map json) => 21 | _$GetCardListRequestFromJson(json); 22 | 23 | @override 24 | String get apiMethod => ApiMethods.getCardList; 25 | 26 | @override 27 | Map toJson() => _$GetCardListRequestToJson(this); 28 | 29 | @override 30 | Map get equals => { 31 | ...super.equals, 32 | JsonKeys.customerKey: customerKey, 33 | JsonKeys.ip: ip, 34 | }; 35 | 36 | @override 37 | GetCardListRequest copyWith({ 38 | String? customerKey, 39 | String? ip, 40 | String? signToken, 41 | }) { 42 | return GetCardListRequest( 43 | customerKey: customerKey ?? this.customerKey, 44 | ip: ip ?? this.ip, 45 | signToken: signToken ?? this.signToken, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | assert(customerKey.length <= 36); 52 | 53 | final String? _ip = ip; 54 | if (_ip != null) { 55 | assert(_ip.length >= 7 && _ip.length <= 45); 56 | } 57 | } 58 | 59 | /// Идентификатор платежа в системе банка 60 | @JsonKey(name: JsonKeys.customerKey) 61 | final String customerKey; 62 | 63 | /// IP-адрес покупателя 64 | @JsonKey(name: JsonKeys.ip) 65 | final String? ip; 66 | } 67 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/check_3ds_version/check_3ds_version_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'check_3ds_version_request.g.dart'; 6 | 7 | /// Метод проверяет поддерживаемую версию 3DS протокола по карточным данным из входящих параметров 8 | /// 9 | /// [Check3DSVersionRequest](https://www.tinkoff.ru/kassa/develop/api/payments/check_3ds_version-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class Check3DSVersionRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по проверки 3DS протокола 13 | Check3DSVersionRequest({ 14 | required this.paymentId, 15 | required this.cardData, 16 | String? signToken, 17 | }) : super(signToken); 18 | 19 | /// Преобразование json в модель 20 | factory Check3DSVersionRequest.fromJson(Map json) => 21 | _$Check3DSVersionRequestFromJson(json); 22 | 23 | @override 24 | String get apiMethod => ApiMethods.check3DSVersion; 25 | 26 | @override 27 | Map toJson() => _$Check3DSVersionRequestToJson(this); 28 | 29 | @override 30 | Map get equals => { 31 | ...super.equals, 32 | JsonKeys.paymentId: paymentId, 33 | JsonKeys.cardData: cardData, 34 | }; 35 | 36 | @override 37 | Check3DSVersionRequest copyWith({ 38 | int? paymentId, 39 | String? cardData, 40 | String? signToken, 41 | }) { 42 | return Check3DSVersionRequest( 43 | paymentId: paymentId ?? this.paymentId, 44 | cardData: cardData ?? this.cardData, 45 | signToken: signToken ?? this.signToken, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | paymentId.validateId(JsonKeys.paymentId); 52 | } 53 | 54 | /// Идентификатор платежа в системе банка 55 | @JsonKey(name: JsonKeys.paymentId) 56 | final int paymentId; 57 | 58 | /// Зашифрованные данные карты. См. класс [PaymentSource]. 59 | @JsonKey(name: JsonKeys.cardData) 60 | final String cardData; 61 | } 62 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/remove_customer/remove_customer_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'remove_customer_request.g.dart'; 6 | 7 | /// Метод удаляет данные зарегистрированного покупателя. 8 | /// 9 | /// [RemoveCustomerRequest](https://www.tinkoff.ru/kassa/develop/api/autopayments/removecustomer-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class RemoveCustomerRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по удалению данных покупателя 13 | RemoveCustomerRequest({ 14 | required this.customerKey, 15 | this.ip, 16 | String? signToken, 17 | }) : super(signToken); 18 | 19 | /// Преобразование json в модель 20 | factory RemoveCustomerRequest.fromJson(Map json) => 21 | _$RemoveCustomerRequestFromJson(json); 22 | 23 | @override 24 | String get apiMethod => ApiMethods.removeCustomer; 25 | 26 | @override 27 | Map toJson() => _$RemoveCustomerRequestToJson(this); 28 | 29 | @override 30 | Map get equals => { 31 | ...super.equals, 32 | JsonKeys.customerKey: customerKey, 33 | JsonKeys.ip: ip, 34 | }; 35 | 36 | @override 37 | RemoveCustomerRequest copyWith({ 38 | String? customerKey, 39 | String? ip, 40 | String? signToken, 41 | }) { 42 | return RemoveCustomerRequest( 43 | customerKey: customerKey ?? this.customerKey, 44 | ip: ip ?? this.ip, 45 | signToken: signToken ?? this.signToken, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | assert(customerKey.length <= 36); 52 | 53 | final String? _ip = ip; 54 | if (_ip != null) { 55 | assert(_ip.length >= 7 && _ip.length <= 45); 56 | } 57 | } 58 | 59 | /// Идентификатор платежа в системе банка 60 | @JsonKey(name: JsonKeys.customerKey) 61 | final String customerKey; 62 | 63 | /// IP-адрес покупателя 64 | @JsonKey(name: JsonKeys.ip) 65 | final String? ip; 66 | } 67 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/sectoral_check_props.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'sectoral_check_props.g.dart'; 6 | 7 | /// Данные поставщика платежного агента 8 | /// 9 | /// [AgentData](https://www.tinkoff.ru/kassa/develop/api/payments/init-request/#SectoralCheckProps) 10 | @JsonSerializable(includeIfNull: false) 11 | class SectoralCheckProps extends BaseRequest { 12 | /// Создает экземпляр данных поставщика платежного агента 13 | SectoralCheckProps( 14 | this.federalId, 15 | this.date, 16 | this.number, 17 | this.value, 18 | ); 19 | 20 | /// Преобразование json в модель 21 | factory SectoralCheckProps.fromJson(Map json) => 22 | _$SectoralCheckPropsFromJson(json); 23 | 24 | @override 25 | Map get equals => { 26 | JsonKeys.federalId: federalId, 27 | JsonKeys.date: date, 28 | JsonKeys.number: number, 29 | JsonKeys.value: value, 30 | }; 31 | 32 | @override 33 | Map toJson() => _$SectoralCheckPropsToJson(this); 34 | 35 | @override 36 | SectoralCheckProps copyWith({ 37 | String? federalId, 38 | String? date, 39 | String? number, 40 | String? value, 41 | }) { 42 | return SectoralCheckProps( 43 | federalId ?? this.federalId, 44 | date ?? this.date, 45 | number ?? this.number, 46 | value ?? this.value, 47 | ); 48 | } 49 | 50 | @override 51 | void validate() {} 52 | 53 | /// Идентификатор ФОИВ (тег 1262). Максимальное количество символов – 3 54 | @JsonKey(name: JsonKeys.federalId) 55 | final String federalId; 56 | 57 | /// Дата документа основания в формате ДД.ММ.ГГГГ (тег 1263) 58 | @JsonKey(name: JsonKeys.date) 59 | final String date; 60 | 61 | /// Номер документа основания (тег 1264) 62 | @JsonKey(name: JsonKeys.number) 63 | final String number; 64 | 65 | /// Значение отраслевого реквизита (тег 1265) 66 | @JsonKey(name: JsonKeys.value) 67 | final String value; 68 | } 69 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_state/get_state_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'get_state_response.g.dart'; 7 | 8 | /// Ответ от сервера на получение статуса платежа 9 | /// 10 | /// [GetStateResponse](https://www.tinkoff.ru/kassa/develop/api/payments/getstate-response/) 11 | @JsonSerializable() 12 | class GetStateResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на получение статуса платежа 14 | GetStateResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.orderId, 22 | this.paymentId, 23 | this.amount, 24 | }) : super( 25 | status: status, 26 | success: success, 27 | errorCode: errorCode, 28 | message: message, 29 | details: details, 30 | ); 31 | 32 | /// Преобразование json в модель 33 | factory GetStateResponse.fromJson(Map json) => 34 | _$GetStateResponseFromJson(json); 35 | 36 | @override 37 | Map toJson() => _$GetStateResponseToJson(this); 38 | 39 | @override 40 | Map get equals => { 41 | ...super.equals, 42 | JsonKeys.terminalKey: terminalKey, 43 | JsonKeys.orderId: orderId, 44 | JsonKeys.paymentId: paymentId, 45 | JsonKeys.amount: amount, 46 | }; 47 | 48 | /// Идентификатор терминала. 49 | /// Выдается продавцу банком при заведении терминала 50 | @JsonKey(name: JsonKeys.terminalKey) 51 | final String? terminalKey; 52 | 53 | /// Идентификатор заказа в системе продавца 54 | @JsonKey(name: JsonKeys.orderId) 55 | final String? orderId; 56 | 57 | /// Идентификатор платежа в системе банка 58 | @JsonKey(name: JsonKeys.paymentId) 59 | final String? paymentId; 60 | 61 | /// Сумма операции в копейках 62 | @JsonKey(name: JsonKeys.amount) 63 | final int? amount; 64 | } 65 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/add_account_qr/add_account_qr_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/data_type.dart'; 5 | import '../enums/status.dart'; 6 | 7 | part 'add_account_qr_response.g.dart'; 8 | 9 | /// Ответ от сервера на инициацию привязки счета покупателя к магазину в СБП и возвращает информацию о нём. 10 | /// 11 | /// [AddAccountQrResponse](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/addaccountqr-response/) 12 | @JsonSerializable() 13 | class AddAccountQrResponse extends AcquiringResponse { 14 | /// Создает экземпляр ответа от инициацию привязки счета покупателя к магазину в СБП и возвращает информацию о нём. 15 | AddAccountQrResponse({ 16 | Status? status, 17 | bool? success, 18 | String? errorCode, 19 | String? message, 20 | String? details, 21 | this.terminalKey, 22 | this.dataType, 23 | this.requestKey, 24 | }) : super( 25 | status: status, 26 | success: success, 27 | errorCode: errorCode, 28 | message: message, 29 | details: details, 30 | ); 31 | 32 | /// Преобразование json в модель 33 | factory AddAccountQrResponse.fromJson(Map json) => 34 | _$AddAccountQrResponseFromJson(json); 35 | 36 | @override 37 | Map toJson() => _$AddAccountQrResponseToJson(this); 38 | 39 | @override 40 | Map get equals => { 41 | ...super.equals, 42 | JsonKeys.terminalKey: terminalKey, 43 | JsonKeys.dataType: dataType, 44 | JsonKeys.requestKey: requestKey, 45 | }; 46 | 47 | /// Идентификатор терминала. 48 | /// Выдается продавцу банком при заведении терминала 49 | @JsonKey(name: JsonKeys.terminalKey) 50 | final String? terminalKey; 51 | 52 | /// Тип возвращаемых данных 53 | @JsonKey(name: JsonKeys.data2, unknownEnumValue: DataType.notExist) 54 | final DataType? dataType; 55 | 56 | /// Идентификатор запроса на привязку счета 57 | @JsonKey(name: JsonKeys.requestKey) 58 | final String? requestKey; 59 | } 60 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.lock 4 | *.log 5 | *.pyc 6 | *.swp 7 | .DS_Store 8 | .atom/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .fvm/ 13 | .melos_tool/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # Visual Studio Code related 22 | .classpath 23 | .project 24 | .settings/ 25 | .vscode/ 26 | 27 | # Flutter/Dart/Pub related 28 | **/doc/api/ 29 | .dart_tool/ 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .packages 33 | .pub-cache/ 34 | .pub/ 35 | build/ 36 | flutter_*.png 37 | linked_*.ds 38 | unlinked.ds 39 | unlinked_spec.ds 40 | 41 | 42 | # Android related 43 | **/android/**/gradle-wrapper.jar 44 | **/android/.gradle 45 | **/android/captures/ 46 | **/android/gradlew 47 | **/android/gradlew.bat 48 | **/android/local.properties 49 | **/android/**/GeneratedPluginRegistrant.java 50 | 51 | # iOS/XCode related 52 | **/ios/**/*.mode1v3 53 | **/ios/**/*.mode2v3 54 | **/ios/**/*.moved-aside 55 | **/ios/**/*.pbxuser 56 | **/ios/**/*.perspectivev3 57 | **/ios/**/*sync/ 58 | **/ios/**/.sconsign.dblite 59 | **/ios/**/.tags* 60 | **/ios/**/.vagrant/ 61 | **/ios/**/DerivedData/ 62 | **/ios/**/Icon? 63 | **/ios/**/Pods/ 64 | **/ios/**/.symlinks/ 65 | **/ios/**/profile 66 | **/ios/**/xcuserdata 67 | **/ios/.generated/ 68 | **/ios/Flutter/App.framework 69 | **/ios/Flutter/Flutter.framework 70 | **/ios/Flutter/Flutter.podspec 71 | **/ios/Flutter/Generated.xcconfig 72 | **/ios/Flutter/app.flx 73 | **/ios/Flutter/app.zip 74 | **/ios/Flutter/flutter_assets/ 75 | **/ios/Flutter/flutter_export_environment.sh 76 | **/ios/ServiceDefinitions.json 77 | **/ios/Runner/GeneratedPluginRegistrant.* 78 | 79 | # Exceptions to above rules. 80 | !**/ios/**/default.mode1v3 81 | !**/ios/**/default.mode2v3 82 | !**/ios/**/default.pbxuser 83 | !**/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 97 | 98 | example/ios/Podfile.lock -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/init/init_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'init_response.g.dart'; 7 | 8 | /// Ответ от сервера на создание платежа 9 | /// 10 | /// [InitResponse](https://www.tinkoff.ru/kassa/develop/api/payments/init-response/) 11 | @JsonSerializable() 12 | class InitResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на создание платежа 14 | InitResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.amount, 22 | this.orderId, 23 | this.paymentId, 24 | this.paymentURL, 25 | }) : super( 26 | status: status, 27 | success: success, 28 | errorCode: errorCode, 29 | message: message, 30 | details: details, 31 | ); 32 | 33 | /// Преобразование json в модель 34 | factory InitResponse.fromJson(Map json) => 35 | _$InitResponseFromJson(json); 36 | 37 | @override 38 | Map toJson() => _$InitResponseToJson(this); 39 | 40 | @override 41 | Map get equals => { 42 | ...super.equals, 43 | JsonKeys.terminalKey: terminalKey, 44 | JsonKeys.amount: amount, 45 | JsonKeys.orderId: orderId, 46 | JsonKeys.paymentId: paymentId, 47 | JsonKeys.paymentUrl: paymentURL, 48 | }; 49 | 50 | /// Идентификатор терминала. 51 | /// Выдается продавцу банком при заведении терминала 52 | @JsonKey(name: JsonKeys.terminalKey) 53 | final String? terminalKey; 54 | 55 | /// Сумма в копейках 56 | @JsonKey(name: JsonKeys.amount) 57 | final int? amount; 58 | 59 | /// Идентификатор заказа в системе продавца 60 | @JsonKey(name: JsonKeys.orderId) 61 | final String? orderId; 62 | 63 | /// Идентификатор платежа в системе банка 64 | @JsonKey(name: JsonKeys.paymentId) 65 | final String? paymentId; 66 | 67 | /// Ссылка на платежную форму 68 | @JsonKey(name: JsonKeys.paymentUrl) 69 | final String? paymentURL; 70 | } 71 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 33 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | 36 | kotlinOptions { 37 | jvmTarget = '1.8' 38 | } 39 | 40 | sourceSets { 41 | main.java.srcDirs += 'src/main/kotlin' 42 | } 43 | 44 | defaultConfig { 45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 46 | applicationId "com.example.example" 47 | minSdkVersion 21 48 | targetSdkVersion flutter.targetSdkVersion 49 | versionCode flutterVersionCode.toInteger() 50 | versionName flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | release { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig signingConfigs.debug 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source '../..' 64 | } 65 | 66 | dependencies { 67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 68 | } 69 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/resend/resend_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'resend_request.g.dart'; 6 | 7 | /// Метод отправляет все неотправленные уведомления. 8 | /// 9 | /// [ResendRequest](https://www.tinkoff.ru/kassa/develop/api/payments/resend-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class ResendRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по отправки неотправленых уведомлений 13 | ResendRequest({ 14 | this.paymentId, 15 | this.notificationTypes, 16 | String? signToken, 17 | }) : super(signToken); 18 | 19 | /// Преобразование json в модель 20 | factory ResendRequest.fromJson(Map json) => 21 | _$ResendRequestFromJson(json); 22 | 23 | @override 24 | String get apiMethod => ApiMethods.resend; 25 | 26 | @override 27 | Map toJson() => _$ResendRequestToJson(this); 28 | 29 | @override 30 | Map get equals => { 31 | ...super.equals, 32 | JsonKeys.paymentId: paymentId, 33 | JsonKeys.notificationTypes: notificationTypes, 34 | }; 35 | 36 | @override 37 | ResendRequest copyWith({ 38 | String? signToken, 39 | String? paymentId, 40 | String? notificationTypes, 41 | }) { 42 | return ResendRequest( 43 | signToken: signToken ?? this.signToken, 44 | paymentId: paymentId ?? this.paymentId, 45 | notificationTypes: notificationTypes ?? this.notificationTypes, 46 | ); 47 | } 48 | 49 | @override 50 | void validate() { 51 | paymentId.validateId(JsonKeys.paymentId); 52 | 53 | assert( 54 | () { 55 | if (paymentId != null) return notificationTypes != null; 56 | return true; 57 | }(), 58 | ); 59 | } 60 | 61 | /// Уникальный идентификатор транзакции в системе Банка 62 | @JsonKey(name: JsonKeys.paymentId) 63 | final String? paymentId; 64 | 65 | /// Тип нотификации, который необходимо получить из архива повторно. 66 | /// 67 | /// Параметр обязателен при передаче PaymentId 68 | @JsonKey(name: JsonKeys.notificationTypes) 69 | final String? notificationTypes; 70 | } 71 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/charge_qr/charge_qr_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'charge_qr_response.g.dart'; 7 | 8 | /// Ответ от сервера на проведение платежа по привязанному счету QR 9 | /// 10 | /// [ChargeQrResponse](https://www.tinkoff.ru/kassa/develop/api/payments-sbp/chargeqr-response/) 11 | @JsonSerializable() 12 | class ChargeQrResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на проведение платежа по привязанному счету QR 14 | ChargeQrResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.orderId, 22 | this.paymentId, 23 | this.amount, 24 | this.currency, 25 | }) : super( 26 | status: status, 27 | success: success, 28 | errorCode: errorCode, 29 | message: message, 30 | details: details, 31 | ); 32 | 33 | /// Преобразование json в модель 34 | factory ChargeQrResponse.fromJson(Map json) => 35 | _$ChargeQrResponseFromJson(json); 36 | 37 | @override 38 | Map toJson() => _$ChargeQrResponseToJson(this); 39 | 40 | @override 41 | Map get equals => { 42 | ...super.equals, 43 | JsonKeys.terminalKey: terminalKey, 44 | JsonKeys.orderId: orderId, 45 | JsonKeys.paymentId: paymentId, 46 | JsonKeys.amount: amount, 47 | }; 48 | 49 | /// Идентификатор терминала. 50 | /// Выдается продавцу банком при заведении терминала 51 | @JsonKey(name: JsonKeys.terminalKey) 52 | final String? terminalKey; 53 | 54 | /// Идентификатор заказа в системе продавца 55 | @JsonKey(name: JsonKeys.orderId) 56 | final String? orderId; 57 | 58 | /// Сумма в копейках 59 | @JsonKey(name: JsonKeys.amount) 60 | final int? amount; 61 | 62 | /// Код валюты ISO 421. 63 | @JsonKey(name: JsonKeys.currency) 64 | final int? currency; 65 | 66 | /// Идентификатор платежа в системе банка 67 | @JsonKey(name: JsonKeys.paymentId) 68 | final String? paymentId; 69 | } 70 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/agent_data.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'agent_data.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AgentData _$AgentDataFromJson(Map json) => AgentData( 10 | agentSign: $enumDecodeNullable(_$AgentSignEnumMap, json['AgentSign']), 11 | operationName: json['OperationName'] as String?, 12 | phones: 13 | (json['Phones'] as List?)?.map((e) => e as String).toList(), 14 | receiverPhones: (json['ReceiverPhones'] as List?) 15 | ?.map((e) => e as String) 16 | .toList(), 17 | transferPhones: (json['TransferPhones'] as List?) 18 | ?.map((e) => e as String) 19 | .toList(), 20 | operatorName: json['OperatorName'] as String?, 21 | operatorAddress: json['OperatorAddress'] as String?, 22 | operatorInn: json['OperatorInn'] as String?, 23 | ); 24 | 25 | Map _$AgentDataToJson(AgentData instance) { 26 | final val = {}; 27 | 28 | void writeNotNull(String key, dynamic value) { 29 | if (value != null) { 30 | val[key] = value; 31 | } 32 | } 33 | 34 | writeNotNull('AgentSign', _$AgentSignEnumMap[instance.agentSign]); 35 | writeNotNull('OperationName', instance.operationName); 36 | writeNotNull('Phones', instance.phones); 37 | writeNotNull('ReceiverPhones', instance.receiverPhones); 38 | writeNotNull('TransferPhones', instance.transferPhones); 39 | writeNotNull('OperatorName', instance.operatorName); 40 | writeNotNull('OperatorAddress', instance.operatorAddress); 41 | writeNotNull('OperatorInn', instance.operatorInn); 42 | return val; 43 | } 44 | 45 | const _$AgentSignEnumMap = { 46 | AgentSign.bankPayingAgent: 'bank_paying_agent', 47 | AgentSign.bankPayingSubagent: 'bank_paying_subagent', 48 | AgentSign.payingAgent: 'paying_agent', 49 | AgentSign.payingSubagent: 'paying_subagent', 50 | AgentSign.attorney: 'attorney', 51 | AgentSign.commissionAgent: 'commission_agent', 52 | AgentSign.another: 'another', 53 | }; 54 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_qr/get_qr_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'get_qr_response.g.dart'; 7 | 8 | /// Ответ от сервера на регистрацию QR 9 | /// 10 | /// [GetQrResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/getqr-response/) 11 | @JsonSerializable() 12 | class GetQrResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на регистрацию QR 14 | GetQrResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.paymentId, 22 | this.orderId, 23 | this.data, 24 | }) : super( 25 | status: status, 26 | success: success, 27 | errorCode: errorCode, 28 | message: message, 29 | details: details, 30 | ); 31 | 32 | /// Преобразование json в модель 33 | factory GetQrResponse.fromJson(Map json) => 34 | _$GetQrResponseFromJson(json); 35 | 36 | @override 37 | Map toJson() => _$GetQrResponseToJson(this); 38 | 39 | @override 40 | Map get equals => { 41 | ...super.equals, 42 | JsonKeys.terminalKey: terminalKey, 43 | JsonKeys.paymentId: paymentId, 44 | JsonKeys.orderId: orderId, 45 | JsonKeys.data2: data, 46 | }; 47 | 48 | /// Идентификатор терминала. 49 | /// Выдается продавцу банком при заведении терминала 50 | @JsonKey(name: JsonKeys.terminalKey) 51 | final String? terminalKey; 52 | 53 | /// Уникальный идентификатор транзакции в системе Банка, полученный в ответе на вызов метода `Init` 54 | @JsonKey(name: JsonKeys.paymentId) 55 | final int? paymentId; 56 | 57 | /// Идентификатор заказа в системе продавца 58 | @JsonKey(name: JsonKeys.orderId) 59 | final String? orderId; 60 | 61 | /// В зависимости от `DataType` в запросе это: `Payload` - информация, 62 | /// которая должна быть закодирована в `QR` 63 | /// или `SVG` изображение `QR` в котором уже закодирован `Payload` 64 | @JsonKey(name: JsonKeys.data2) 65 | final String? data; 66 | } 67 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/get_customer/get_customer_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'get_customer_response.g.dart'; 7 | 8 | /// Ответ от сервера на получению данных покупателя 9 | /// 10 | /// [GetCustomerResponse](https://www.tinkoff.ru/kassa/develop/api/autopayments/getcustomer-response/) 11 | @JsonSerializable() 12 | class GetCustomerResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на получению данных покупателя 14 | GetCustomerResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.customerKey, 22 | this.email, 23 | this.phone, 24 | }) : super( 25 | status: status, 26 | success: success, 27 | errorCode: errorCode, 28 | message: message, 29 | details: details, 30 | ); 31 | 32 | /// Преобразование json в модель 33 | factory GetCustomerResponse.fromJson(Map json) => 34 | _$GetCustomerResponseFromJson(json); 35 | 36 | @override 37 | Map toJson() => _$GetCustomerResponseToJson(this); 38 | 39 | @override 40 | Map get equals => { 41 | ...super.equals, 42 | JsonKeys.terminalKey: terminalKey, 43 | JsonKeys.customerKey: customerKey, 44 | JsonKeys.email: email, 45 | JsonKeys.phone: phone, 46 | }; 47 | 48 | /// Идентификатор терминала. 49 | /// Выдается продавцу банком при заведении терминала 50 | @JsonKey(name: JsonKeys.terminalKey) 51 | final String? terminalKey; 52 | 53 | /// Идентификатор платежа в системе банка 54 | @JsonKey(name: JsonKeys.customerKey) 55 | final String? customerKey; 56 | 57 | /// Электронная почта покупателя 58 | /// 59 | /// Пример: `a@test.ru` 60 | @JsonKey(name: JsonKeys.email) 61 | final String? email; 62 | 63 | /// Телефон покупателя 64 | /// 65 | /// Строка длиной от 1 до 19 символов, формат +{Ц} 66 | /// 67 | /// Пример: `+71234567890` 68 | @JsonKey(name: JsonKeys.phone) 69 | final String? phone; 70 | } 71 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/cancel/cancel_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'cancel_response.g.dart'; 7 | 8 | /// Ответ от сервера на отмену платежа 9 | /// 10 | /// [CancelResponse](https://www.tinkoff.ru/kassa/develop/api/payments/cancel-response/) 11 | @JsonSerializable() 12 | class CancelResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на отмену платежа 14 | CancelResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.orderId, 22 | this.paymentId, 23 | this.originalAmount, 24 | this.newAmount, 25 | }) : super( 26 | status: status, 27 | success: success, 28 | errorCode: errorCode, 29 | message: message, 30 | details: details, 31 | ); 32 | 33 | /// Преобразование json в модель 34 | factory CancelResponse.fromJson(Map json) => 35 | _$CancelResponseFromJson(json); 36 | 37 | @override 38 | Map toJson() => _$CancelResponseToJson(this); 39 | 40 | @override 41 | Map get equals => { 42 | ...super.equals, 43 | JsonKeys.terminalKey: terminalKey, 44 | JsonKeys.orderId: orderId, 45 | JsonKeys.paymentId: paymentId, 46 | JsonKeys.originalAmount: originalAmount, 47 | JsonKeys.newAmount: newAmount, 48 | }; 49 | 50 | /// Идентификатор терминала. 51 | /// Выдается продавцу банком при заведении терминала 52 | @JsonKey(name: JsonKeys.terminalKey) 53 | final String? terminalKey; 54 | 55 | /// Идентификатор заказа в системе продавца 56 | @JsonKey(name: JsonKeys.orderId) 57 | final String? orderId; 58 | 59 | /// Идентификатор платежа в системе банка 60 | @JsonKey(name: JsonKeys.paymentId) 61 | final String? paymentId; 62 | 63 | /// Сумма до возврата в копейках 64 | @JsonKey(name: JsonKeys.originalAmount) 65 | final int? originalAmount; 66 | 67 | /// Сумма после возврата в копейках 68 | @JsonKey(name: JsonKeys.newAmount) 69 | final int? newAmount; 70 | } 71 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/remove_card/remove_card_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_request.dart'; 4 | 5 | part 'remove_card_request.g.dart'; 6 | 7 | /// Метод удаляет привязанную карту у покупателя 8 | /// 9 | /// [RemoveCardRequest](https://www.tinkoff.ru/kassa/develop/api/autopayments/removecard-request/) 10 | @JsonSerializable(includeIfNull: false) 11 | class RemoveCardRequest extends AcquiringRequest { 12 | /// Создает экземпляр метода по удалению привязанной карты у покупателя 13 | RemoveCardRequest({ 14 | required this.cardId, 15 | required this.customerKey, 16 | this.ip, 17 | String? signToken, 18 | }) : super(signToken); 19 | 20 | /// Преобразование json в модель 21 | factory RemoveCardRequest.fromJson(Map json) => 22 | _$RemoveCardRequestFromJson(json); 23 | 24 | @override 25 | String get apiMethod => ApiMethods.removeCard; 26 | 27 | @override 28 | Map toJson() => _$RemoveCardRequestToJson(this); 29 | 30 | @override 31 | Map get equals => { 32 | ...super.equals, 33 | JsonKeys.cardId: cardId, 34 | JsonKeys.customerKey: customerKey, 35 | JsonKeys.ip: ip, 36 | }; 37 | 38 | @override 39 | RemoveCardRequest copyWith({ 40 | int? cardId, 41 | String? customerKey, 42 | String? ip, 43 | String? signToken, 44 | }) { 45 | return RemoveCardRequest( 46 | cardId: cardId ?? this.cardId, 47 | customerKey: customerKey ?? this.customerKey, 48 | ip: ip ?? this.ip, 49 | signToken: signToken ?? this.signToken, 50 | ); 51 | } 52 | 53 | @override 54 | void validate() { 55 | assert(cardId.length <= 40); 56 | assert(customerKey.length <= 36); 57 | 58 | final String? _ip = ip; 59 | if (_ip != null) { 60 | assert(_ip.length >= 7 && _ip.length <= 45); 61 | } 62 | } 63 | 64 | /// Идентификатор карты в системе Банка 65 | @JsonKey(name: JsonKeys.cardId) 66 | final int cardId; 67 | 68 | /// Идентификатор платежа в системе банка 69 | @JsonKey(name: JsonKeys.customerKey) 70 | final String customerKey; 71 | 72 | /// IP-адрес покупателя 73 | @JsonKey(name: JsonKeys.ip) 74 | final String? ip; 75 | } 76 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/payments.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'payments.g.dart'; 6 | 7 | /// Объект с информацией о видах оплаты заказа 8 | /// 9 | /// [Payments](https://www.tinkoff.ru/kassa/develop/api/receipt#Payments) 10 | @JsonSerializable(includeIfNull: false) 11 | class Payments extends BaseRequest { 12 | /// Создает экземпляр объекта с информацией о видах оплаты заказа 13 | Payments({ 14 | required this.electronic, 15 | this.cash, 16 | this.advancePayment, 17 | this.credit, 18 | this.provision, 19 | }); 20 | 21 | /// Преобразование json в модель 22 | factory Payments.fromJson(Map json) => 23 | _$PaymentsFromJson(json); 24 | 25 | @override 26 | Map get equals => { 27 | JsonKeys.electronic: electronic, 28 | JsonKeys.cash: cash, 29 | JsonKeys.advancePayment: advancePayment, 30 | JsonKeys.credit: credit, 31 | JsonKeys.provision: provision, 32 | }; 33 | 34 | @override 35 | Map toJson() => _$PaymentsToJson(this); 36 | 37 | @override 38 | Payments copyWith({ 39 | int? cash, 40 | int? electronic, 41 | int? advancePayment, 42 | int? credit, 43 | int? provision, 44 | }) { 45 | return Payments( 46 | cash: cash ?? this.cash, 47 | electronic: electronic ?? this.electronic, 48 | advancePayment: advancePayment ?? this.advancePayment, 49 | credit: credit ?? this.credit, 50 | provision: provision ?? this.provision, 51 | ); 52 | } 53 | 54 | @override 55 | void validate() {} 56 | 57 | /// Вид оплаты "Наличные". Сумма к оплате в копейках не более 14 знаков. 58 | @JsonKey(name: JsonKeys.cash) 59 | final int? cash; 60 | 61 | /// Вид оплаты "Безналичный". 62 | @JsonKey(name: JsonKeys.electronic) 63 | final int electronic; 64 | 65 | /// Вид оплаты "Предварительная оплата (Аванс)". 66 | @JsonKey(name: JsonKeys.advancePayment) 67 | final int? advancePayment; 68 | 69 | /// Вид оплаты "Постоплата (Кредит)" 70 | @JsonKey(name: JsonKeys.credit) 71 | final int? credit; 72 | 73 | /// Вид оплаты "Иная форма оплаты". 74 | @JsonKey(name: JsonKeys.provision) 75 | final int? provision; 76 | } 77 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/common/sectoral_item_props.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/base_request.dart'; 4 | 5 | part 'sectoral_item_props.g.dart'; 6 | 7 | /// Отраслевой реквизит предмета расчета. 8 | /// Необходимо указывать только для товаров подлежащих обязательной маркировке средством идентификации 9 | /// и включение данного реквизита предусмотрено НПА отраслевого регулирования для соответствующей товарной группы. 10 | /// 11 | /// [SectoralItemProps](https://www.tinkoff.ru/kassa/develop/api/receipt/ffd12#SectoralItemProps) 12 | @JsonSerializable(includeIfNull: false) 13 | class SectoralItemProps extends BaseRequest { 14 | /// Создает экземпляр данных отраслевого реквизита предмета расчета. 15 | SectoralItemProps({ 16 | required this.federalId, 17 | required this.date, 18 | required this.number, 19 | required this.value, 20 | }); 21 | 22 | /// Преобразование json в модель 23 | factory SectoralItemProps.fromJson(Map json) => 24 | _$SectoralItemPropsFromJson(json); 25 | 26 | @override 27 | Map get equals => { 28 | JsonKeys.federalId: federalId, 29 | JsonKeys.date: date, 30 | JsonKeys.number: number, 31 | JsonKeys.value: value, 32 | }; 33 | 34 | @override 35 | Map toJson() => _$SectoralItemPropsToJson(this); 36 | 37 | @override 38 | SectoralItemProps copyWith({ 39 | String? federalId, 40 | String? date, 41 | String? number, 42 | String? value, 43 | }) { 44 | return SectoralItemProps( 45 | federalId: federalId ?? this.federalId, 46 | date: date ?? this.date, 47 | number: number ?? this.number, 48 | value: value ?? this.value, 49 | ); 50 | } 51 | 52 | @override 53 | void validate() {} 54 | 55 | /// Идентификатор ФОИВ (федеральный орган исполнительной власти). 56 | @JsonKey(name: JsonKeys.federalId) 57 | final String federalId; 58 | 59 | /// Дата нормативного акта ФОИВ 60 | @JsonKey(name: JsonKeys.date) 61 | final String date; 62 | 63 | /// Номер нормативного акта ФОИВ 64 | @JsonKey(name: JsonKeys.number) 65 | final String number; 66 | 67 | /// Состав значений, определенных нормативного актом ФОИВ. 68 | @JsonKey(name: JsonKeys.value) 69 | final String value; 70 | } 71 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/base/acquiring_response.g.dart: -------------------------------------------------------------------------------- 1 | // GENERATED CODE - DO NOT MODIFY BY HAND 2 | 3 | part of 'acquiring_response.dart'; 4 | 5 | // ************************************************************************** 6 | // JsonSerializableGenerator 7 | // ************************************************************************** 8 | 9 | AcquiringResponse _$AcquiringResponseFromJson(Map json) => 10 | AcquiringResponse( 11 | success: json['Success'] as bool?, 12 | status: $enumDecodeNullable(_$StatusEnumMap, json['Status'], 13 | unknownValue: Status.notExist), 14 | errorCode: json['ErrorCode'] as String?, 15 | message: json['Message'] as String?, 16 | details: json['Details'] as String?, 17 | ); 18 | 19 | Map _$AcquiringResponseToJson(AcquiringResponse instance) => 20 | { 21 | 'Success': instance.success, 22 | 'Status': _$StatusEnumMap[instance.status], 23 | 'ErrorCode': instance.errorCode, 24 | 'Message': instance.message, 25 | 'Details': instance.details, 26 | }; 27 | 28 | const _$StatusEnumMap = { 29 | Status.notExist: 'notExist', 30 | Status.newest: 'NEW', 31 | Status.formShowed: 'FORM_SHOWED', 32 | Status.deadlineExpired: 'DEADLINE_EXPIRED', 33 | Status.canceled: 'CANCELED', 34 | Status.preAuthorizing: 'PREAUTHORIZING', 35 | Status.authorizing: 'AUTHORIZING', 36 | Status.authFail: 'AUTH_FAIL', 37 | Status.rejected: 'REJECTED', 38 | Status.threeDsChecking: '3DS_CHECKING', 39 | Status.threeDsChecked: '3DS_CHECKED', 40 | Status.payChecked: 'PAY_CHECKING', 41 | Status.authorized: 'AUTHORIZED', 42 | Status.reversing: 'REVERSING', 43 | Status.partialReversed: 'PARTIAL_REVERSED', 44 | Status.reversed: 'REVERSED', 45 | Status.confirming: 'CONFIRMING', 46 | Status.confirmChecking: 'CONFIRM_CHECKING', 47 | Status.confirmed: 'CONFIRMED', 48 | Status.refunding: 'REFUNDING', 49 | Status.asyncRefunding: 'ASYNC_REFUNDING', 50 | Status.partialRefunded: 'PARTIAL_REFUNDED', 51 | Status.refunded: 'REFUNDED', 52 | Status.unknown: 'UNKNOWN', 53 | Status.loopChecking: 'LOOP_CHECKING', 54 | Status.loopChecked: 'LOOP_CHECKED', 55 | Status.completed: 'COMPLETED', 56 | Status.proccesing: 'PROCCESING', 57 | Status.active: 'ACTIVE', 58 | Status.inacitve: 'INACITVE', 59 | }; 60 | -------------------------------------------------------------------------------- /packages/tinkoff_acquiring/lib/src/core/models/add_card/add_card_response.dart: -------------------------------------------------------------------------------- 1 | import 'package:json_annotation/json_annotation.dart'; 2 | 3 | import '../base/acquiring_response.dart'; 4 | import '../enums/status.dart'; 5 | 6 | part 'add_card_response.g.dart'; 7 | 8 | /// Ответ от сервера на привязку карты к покупателю 9 | /// 10 | /// [AddCardResponse](http://static2.tinkoff.ru/acquiring/manuals/android_sdk.pdf) 11 | @JsonSerializable() 12 | class AddCardResponse extends AcquiringResponse { 13 | /// Создает экземпляр ответа от сервера на привязку карты к покупателю 14 | AddCardResponse({ 15 | Status? status, 16 | bool? success, 17 | String? errorCode, 18 | String? message, 19 | String? details, 20 | this.terminalKey, 21 | this.customerKey, 22 | this.requestKey, 23 | this.paymentURL, 24 | this.paymentId, 25 | }) : super( 26 | status: status, 27 | success: success, 28 | errorCode: errorCode, 29 | message: message, 30 | details: details, 31 | ); 32 | 33 | /// Преобразование json в модель 34 | factory AddCardResponse.fromJson(Map json) => 35 | _$AddCardResponseFromJson(json); 36 | 37 | @override 38 | Map toJson() => _$AddCardResponseToJson(this); 39 | 40 | @override 41 | Map get equals => { 42 | ...super.equals, 43 | JsonKeys.terminalKey: terminalKey, 44 | JsonKeys.customerKey: customerKey, 45 | JsonKeys.requestKey: requestKey, 46 | JsonKeys.paymentUrl: paymentURL, 47 | }; 48 | 49 | /// Идентификатор терминала. 50 | /// Выдается продавцу банком при заведении терминала 51 | @JsonKey(name: JsonKeys.terminalKey) 52 | final String? terminalKey; 53 | 54 | /// Идентификатор платежа в системе банка 55 | @JsonKey(name: JsonKeys.customerKey) 56 | final String? customerKey; 57 | 58 | /// Идентификатор запроса на привязку карты 59 | @JsonKey(name: JsonKeys.requestKey) 60 | final String? requestKey; 61 | 62 | /// Ссылка на страницу привязки карты. 63 | /// На данную страницу необходимо переадресовать клиента для привязки карты 64 | @JsonKey(name: JsonKeys.paymentUrl) 65 | final String? paymentURL; 66 | 67 | /// Уникальный идентификатор транзакции в системе Банка 68 | @JsonKey(name: JsonKeys.paymentId) 69 | final int? paymentId; 70 | } 71 | --------------------------------------------------------------------------------