Release 1.1.1 version

This commit is contained in:
Dmitry Shakolo 2023-08-14 18:02:30 +03:00 committed by Ilia Fedorov
parent ed356c93f3
commit 4c9c594154
19 changed files with 381 additions and 185 deletions

View File

@ -1,3 +1,11 @@
# 1.1.1
* Fix SBP implementation readme. Fix and improve UI
# 1.1.0
* Support new payment method — SBP
# 1.0.6
* Fix crash with 3DS confirmation for Android Platform

200
README.md
View File

@ -122,6 +122,9 @@ await YookassaPaymentsFlutter.confirmation("3ds / App2App ссылка", result.
`.yooMoney` — ЮMoney (платежи из кошелька или привязанной картой)\
`.bankCard` — банковская карта (карты можно сканировать)\
`.sberbank` — SberPay (с подтверждением через приложение Сбербанк Онлайн, если оно установленно, иначе с подтверждением по смс)\
`.applePay` — Apple Pay\
`.googlePay` — Google Pay
`.sbp` - СБП\
## Настройка способов оплаты
@ -150,6 +153,21 @@ if (<Условие для ЮMoney>) {
paymentMethodTypes.add(PaymentMethod.yooMoney);
}
if <Условие для Apple Pay> {
// Добавляем в paymentMethodTypes элемент `.applePay`
paymentMethodTypes.insert(.applePay)
}
if <Условие для Google Pay> {
// Добавляем в paymentMethodTypes элемент `.googlePay`
paymentMethodTypes.insert(.googlePay)
}
if <Условие для СБП> {
// Добавляем в paymentMethodTypes элемент `.sbp`
paymentMethodTypes.insert(.sbp)
}
var settings = TokenizationSettings(PaymentMethodTypes(paymentMethodTypes));
```
@ -229,19 +247,6 @@ func application(
)
}
@available(iOS 9.0, *)
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
return YKSdk.shared.handleOpen(
url: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String
)
}
```
4. В `Info.plist` добавьте следующие строки:
```plistbase
@ -303,19 +308,6 @@ func application(
)
}
@available(iOS 9.0, *)
func application(
_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]
) -> Bool {
return YKSdk.shared.handleOpen(
url: url,
sourceApplication: options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String
)
}
```
3. В `Info.plist` добавьте следующие строки:
```plistbase
@ -340,7 +332,130 @@ func application(
где `examplescheme` - схема для открытия вашего приложения, которую вы указали в `applicationScheme` при создании `TokenizationModuleInputData`. Через эту схему будет открываться ваше приложение после успешной оплаты с помощью `SberPay`.
4. Обработка успешного подтверждения уже реализована в плагине. Плагин отобразит алерт с информацией об успешном подтверждении.
### SBP
С помощью SDK можно провести платеж через СБП — с подтверждением оплаты через приложение банка.
В `TokenizationModuleInputData` необходимо передавать `applicationScheme` схема для возврата в ваше приложение после успешного подтверждения платежа в приложении банка.
Пример `applicationScheme`:
```swift
let moduleData = TokenizationModuleInputData(
...
applicationScheme: "examplescheme://"
```
Чтобы провести платёж:
1. При создании `TokenizationModuleInputData` в `TokenizationSettings` передайте значение `PaymentMethodTypes.sbp`.
2. Получите токен.
3. [Создайте платеж](https://yookassa.ru/developers/api#create_payment) с токеном по API ЮKassa.
Для подтверждения платежа через выбранное пользователем банковское приложение:
1. В `AppDelegate` импортируйте зависимость `YooKassaPayments`:
```swift
import YooKassaPayments
```
2. Добавьте обработку ссылок через `YKSdk` в `AppDelegate`:
```swift
func application(
_ application: UIApplication,
open url: URL,
sourceApplication: String?,
annotation: Any
) -> Bool {
return YKSdk.shared.handleOpen(
url: url,
sourceApplication: sourceApplication
)
}
```
3. В `Info.plist` добавьте следующие строки:
```plistbase
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>${BUNDLE_ID}</string>
<key>CFBundleURLSchemes</key>
<array>
<string>examplescheme</string>
</array>
</dict>
</array>
```
где `examplescheme` - схема для открытия вашего приложения, которую вы указали в `applicationScheme` при создании `TokenizationModuleInputData`. Через эту схему будет открываться ваше приложение после успешной оплаты с помощью `SberPay`.
4. В `Info.plist` перечислить url-схемы приложений приоритетных для вас банков
SDK пользователю отображается список банков, поддерживающих оплату `СБП`. При выборе конкретного банка из списка произойдет переход в соответствующее банковское приложение.
Список банков в SDK сформирован на основе ответа [НСПК](https://qr.nspk.ru/proxyapp/c2bmembers.json). Он содержит более тысячи банков, и для удобства SDK в первую очередь отображает список популярных банков, которые чаще всего используют для оплаты. Для проверки факта установки приложения на телефоне мы используем системную функцию [canOpenURL(:)](https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl). Данная функция возвращает корректный ответ только для схем добавленных в `Info.plist` с ключом `LSApplicationQueriesSchemes`.
Поэтому для корректного отображения списка популярных банков вам необходимо внести в `Info.plist` их url-схемы:
```plistbase
<key>LSApplicationQueriesSchemes</key>
<array>
<string>bank100000000111</string> // Сбербанк
<string>bank100000000004</string> // Тинькофф
<string>bank110000000005</string> // ВТБ
<string>bank100000000008</string> // Альфа
<string>bank100000000007</string> // Райфайзен
<string>bank100000000015</string> // Открытие
</array>
```
Если список не добавлять в `Info.plist`, SDK сразу отобразит полный список банков поддерживающих оплату `СБП`.
5. Добавьте уникальную схему в `build.gradle`
Для добавления уникальной схемы диплинка нужно добавить в ваш файл `build.gradle` в блок android.defaultConfig строку `resValue "string", "ym_app_scheme", "exampleapp"`
```
android {
defaultConfig {
resValue "string", "ym_app_scheme", "exampleapp"
}
}
```
Или добавить в ваш strings.xml строку вида:
```
<resources>
<string name="ym_app_scheme" translatable="false">exampleapp</string>
</resources>
```
Где `exampleapp` - это уникальная схема диплинка вашего приложения.
6. Для подтверждения платежа при оплате через СБП необходимо запустить сценарий подтверждения:
```dart
var clientApplicationKey = "<Ключ для клиентских приложений>";
await YookassaPaymentsFlutter.confirmation(confirmationUrl, PaymentMethod.sbp, clientApplicationKey);
)
```
`confirmationUrl` вы получите в ответе от API ЮKassa при [создании платежа](https://yookassa.ru/developers/api#create_payment); он имеет вид "https://qr.nspk.ru/id?type=&bank=&sum=&cur=&crc=&payment_id="
7. После того, как пользователь пройдет процесс подтверждения платежа или пропустит его будет вызван метод протокола `TokenizationModuleOutput`. Обработайте в нем результат подтверждения:
```swift
func didFinishConfirmation(paymentMethodType: PaymentMethodType) {
guard let result = flutterResult else { return }
DispatchQueue.main.async { [weak self] in
if let controller = yoomoneyController {
controller.dismiss(animated: true)
}
}
result("{\"paymentMethodType\": \"\(paymentMethodType.rawValue)\"}")
}
```
## Описание публичных параметров
@ -453,13 +568,40 @@ func application(
Отправьте токен на ваш сервер и после успешной оплаты закройте модуль.\
Если ваш сервер сообщил о необходимости подтверждения платежа (т.е. платёж пришёл со статусом `pending`), вызовите метод `confirmation(confirmationUrl, paymentMethodType)`.
Примеры кода:
Пример кода:
```dart
await YookassaPaymentsFlutter.confirmation(controller.text, result.paymentMethodType);
await YookassaPaymentsFlutter.confirmation(confirmationUrl, result.paymentMethodType);
)
```
Если тип платежа - СБП необходимо также передать clientApplicationKey - Ключ для клиентских приложений из личного кабинета ЮKassa
Пример кода:
```dart
var clientApplicationKey = "<Ключ для клиентских приложений>";
await YookassaPaymentsFlutter.confirmation(confirmationUrl, result.paymentMethodType, clientApplicationKey);
)
```
`confirmationUrl` вы получите в ответе от API ЮKassa при [создании платежа](https://yookassa.ru/developers/api#create_payment); он имеет вид "https://qr.nspk.ru/id?type=&bank=&sum=&cur=&crc=&payment_id="
После того, как пользователь пройдет процесс подтверждения платежа или пропустит его будет вызван метод протокола `TokenizationModuleOutput`. Обработайте в нем результат подтверждения:
```swift
func didFinishConfirmation(paymentMethodType: PaymentMethodType) {
guard let result = flutterResult else { return }
DispatchQueue.main.async { [weak self] in
if let controller = yoomoneyController {
controller.dismiss(animated: true)
}
}
result("{\"paymentMethodType\": \"\(paymentMethodType.rawValue)\"}")
}
```
## Логирование
У вас есть возможность включить логирование всех сетевых запросов.\

View File

@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@ -52,5 +52,5 @@ android {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'ru.yoomoney.sdk.kassa.payments:yookassa-android-sdk:6.6.2'
implementation 'ru.yoomoney.sdk.kassa.payments:yookassa-android-sdk:6.7.1'
}

View File

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip

View File

@ -13,6 +13,7 @@ fun TokenizationResult.toJson(): String {
PaymentMethodType.BANK_CARD -> "bank_card"
PaymentMethodType.SBERBANK -> "sberbank"
PaymentMethodType.GOOGLE_PAY -> "google_pay"
PaymentMethodType.SBP -> "sbp"
})
return json.toString()
}

View File

@ -74,14 +74,17 @@ class YookassaPaymentsFlutterPlugin: FlutterPlugin, MethodCallHandler, ActivityA
"yooMoney" -> PaymentMethodType.YOO_MONEY
"sberbank" -> PaymentMethodType.SBERBANK
"googlePay" -> PaymentMethodType.GOOGLE_PAY
"sbp" -> PaymentMethodType.SBP
else -> PaymentMethodType.BANK_CARD
}
val url = data["url"] as String
val clientApplicationKey = data["clientApplicationKey"] as String?
val intent: Intent = Checkout.createConfirmationIntent(
context = context,
confirmationUrl = url,
clientApplicationKey = clientApplicationKey,
paymentMethodType = paymentMethod
)
@ -213,6 +216,7 @@ private fun PaymentMethodType(data: Map<String, Object>): Set<PaymentMethodType>
"PaymentMethod.yooMoney" -> paymentMethodTypes.add(PaymentMethodType.YOO_MONEY)
"PaymentMethod.sberbank" -> paymentMethodTypes.add(PaymentMethodType.SBERBANK)
"PaymentMethod.googlePay" -> paymentMethodTypes.add(PaymentMethodType.GOOGLE_PAY)
"PaymentMethod.sbp" -> paymentMethodTypes.add(PaymentMethodType.SBP)
}
}
return paymentMethodTypes

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip

View File

@ -1,39 +1,40 @@
PODS:
- Flutter (3.0.0)
- Flutter (1.0.0)
- FunctionalSwift (1.8.0)
- MoneyAuth (3.4.0):
- FunctionalSwift
- ThreatMetrixAdapter
- YooMoneyCoreApi
- ThreatMetrixAdapter (3.3.3)
- TMXProfiling (1.0.1)
- TMXProfilingConnections (1.0.1)
- YandexMobileMetrica/Dynamic (4.2.0):
- YandexMobileMetrica/Dynamic/Core (= 4.2.0)
- YandexMobileMetrica/Dynamic/Crashes (= 4.2.0)
- YandexMobileMetrica/Dynamic/Core (4.2.0)
- YandexMobileMetrica/Dynamic/Crashes (4.2.0):
- MobileSdk (2.0.0)
- MoneyAuth (6.1.0):
- FunctionalSwift (~> 1.8)
- YooMoneyCoreApi (~> 2.1)
- YooMoneyUI (~> 6.0)
- YandexMobileMetrica/Dynamic (4.5.2):
- YandexMobileMetrica/Dynamic/Core (= 4.5.2)
- YandexMobileMetrica/Dynamic/Crashes (= 4.5.2)
- YandexMobileMetrica/Dynamic/Core (4.5.2)
- YandexMobileMetrica/Dynamic/Crashes (4.5.2):
- YandexMobileMetrica/Dynamic/Core
- yookassa_payments_flutter (0.0.1):
- Flutter
- YooKassaPayments (= 6.8.0)
- YooKassaPayments (6.8.0):
- MoneyAuth (~> 3.4.0)
- ThreatMetrixAdapter (~> 3.3.3)
- TMXProfiling (= 1.0.1)
- TMXProfilingConnections (= 1.0.1)
- YooKassaPayments (= 6.12.0)
- YooKassaPayments (6.12.0):
- MoneyAuth (~> 6.1.0)
- YandexMobileMetrica/Dynamic (>= 3.0)
- YooKassaPaymentsApi (~> 2.11.0)
- YooKassaPaymentsApi (~> 2.20.1)
- YooKassaWalletApi (~> 2.3.1)
- YooMoneyCoreApi (~> 2.1.0)
- YooKassaPaymentsApi (2.11.0):
- YooMoneySessionProfiler (~> 5.0.1)
- YooMoneyUI (~> 6.2.0)
- YooKassaPaymentsApi (2.20.1):
- FunctionalSwift
- YooMoneyCoreApi
- YooKassaWalletApi (2.3.1):
- YooMoneyCoreApi (~> 2.1)
- YooKassaWalletApi (2.3.2):
- FunctionalSwift
- YooMoneyCoreApi
- YooMoneyCoreApi (2.1.0):
- FunctionalSwift (~> 1.8.0)
- YooMoneySessionProfiler (5.0.1):
- MobileSdk (~> 2.0)
- YooMoneyUI (6.2.0):
- FunctionalSwift
DEPENDENCIES:
- Flutter (from `Flutter`)
@ -42,14 +43,14 @@ DEPENDENCIES:
SPEC REPOS:
https://git.yoomoney.ru/scm/sdk/cocoa-pod-specs.git:
- FunctionalSwift
- MobileSdk
- MoneyAuth
- ThreatMetrixAdapter
- TMXProfiling
- TMXProfilingConnections
- YooKassaPayments
- YooKassaPaymentsApi
- YooKassaWalletApi
- YooMoneyCoreApi
- YooMoneySessionProfiler
- YooMoneyUI
https://github.com/CocoaPods/Specs.git:
- YandexMobileMetrica
@ -60,19 +61,19 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/yookassa_payments_flutter/ios"
SPEC CHECKSUMS:
Flutter: 6f378e544fdb3c2db75671011442c5eaf902d3c4
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
FunctionalSwift: b65b0a7ddde7f11a11e794f79a1e8009724ed0bd
MoneyAuth: 8f2e4968132e0d187c1f33b6a99f998220c22135
ThreatMetrixAdapter: 683cc07cd1faee65c14292f7d748d56b92ff34c9
TMXProfiling: a3b9808d62abf72227a366f2cbdca414ee38a023
TMXProfilingConnections: e3984a86c3c338f13af682bb77a6d18474289b79
YandexMobileMetrica: f5f9c605eaaba33ff6ab2b6bc3259035ca60ed87
yookassa_payments_flutter: d3cefc2d375b816278cb1f22a85a74adfda274b8
YooKassaPayments: 6e725f147d2dc30b1427518e72d6115e227c48a2
YooKassaPaymentsApi: 1b2ea9cadc898717f6216dd0e84dbabd5294dfb4
YooKassaWalletApi: ea6fd080bd4663c66fe5db0f37aafb999282048c
MobileSdk: 827ec8a9ef58a60f35e920cebaecf74f20a250c4
MoneyAuth: dedc9545fa857e7b489333e92403fe608585e518
YandexMobileMetrica: f5368ee93f286c793d73b58da00929babfc897c1
yookassa_payments_flutter: 9c4a1c019f2b042ebbd0b45fe19380054240d70a
YooKassaPayments: 09f7cb2b3562130aed01d75bba653a8f0d96d9f6
YooKassaPaymentsApi: d198a1da65988af52bd408d5d5d1c8cd93f039a2
YooKassaWalletApi: cbb352525bfe89fd2ad52635062f79f8bbbc23ec
YooMoneyCoreApi: ddf9ea035b9a3f8d0563b4da8e55652fa07040d3
YooMoneySessionProfiler: 1a19bed99feca98c04e2a906908f91a7d5db408d
YooMoneyUI: 01f293ed3486e00c5244a5feded457e7cdc18074
PODFILE CHECKSUM: b2e848e40e05488c9273432fb90c6c5918bb082f
PODFILE CHECKSUM: 6abfb72a0d401d5c53824cfe614a85f37a1a3040
COCOAPODS: 1.11.3

View File

@ -55,8 +55,9 @@ class _SuccessTokenizationScreenState extends State<SuccessTokenizationScreen> {
),
ElevatedButton(
onPressed: () async {
var clientApplicationKey = "<Ключ для клиентских приложений>";
await YookassaPaymentsFlutter.confirmation(
controller.text, result.paymentMethodType);
controller.text, result.paymentMethodType, clientApplicationKey);
showDialog(
context: context,
builder: (context) => const AlertDialog(

View File

@ -64,7 +64,8 @@ class TokenizationScreenState extends State<TokenizationScreen> {
tokenizationSettings: const TokenizationSettings(PaymentMethodTypes([
PaymentMethod.bankCard,
PaymentMethod.yooMoney,
PaymentMethod.sberbank
PaymentMethod.sberbank,
PaymentMethod.sbp
])),
testModeSettings: null);
var result =

View File

@ -5,58 +5,58 @@ packages:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.8.2"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.17.1"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
sha256: "1989d917fbe8e6b39806207df5a3fdd3d816cbd090fac2ce26fb45e9a71476e5"
url: "https://pub.dev"
source: hosted
version: "1.0.4"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@ -66,7 +66,8 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
url: "https://pub.dev"
source: hosted
version: "1.0.4"
flutter_test:
@ -74,41 +75,54 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
url: "https://pub.dev"
source: hosted
version: "1.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.dev"
source: hosted
version: "0.12.11"
version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
version: "0.1.3"
version: "0.2.0"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.7.0"
version: "1.9.1"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.8.3"
sky_engine:
dependency: transitive
description: flutter
@ -118,65 +132,65 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev"
source: hosted
version: "1.8.1"
version: "1.9.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.dev"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.5.1"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.4"
yookassa_payments_flutter:
dependency: "direct main"
description:
path: ".."
relative: true
source: path
version: "1.0.5"
version: "1.1.1"
sdks:
dart: ">=2.15.0 <3.0.0"
dart: ">=3.0.0-0 <4.0.0"
flutter: ">=2.10.5"

View File

@ -6,7 +6,7 @@ description: Demonstrates how to use the yookassa_payments_flutter plugin.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.15.0 <4.0.0"
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@ -82,4 +82,4 @@ flutter:
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages
# see https://flutter.dev/custom-fonts/#from-packages

View File

@ -63,6 +63,8 @@ public class SwiftYookassaPaymentsFlutterPlugin: NSObject, FlutterPlugin {
paymentMethod = .sberbank
case "applePay":
paymentMethod = .applePay
case "sbp":
paymentMethod = .sbp
default: break
}
@ -368,6 +370,8 @@ extension TokenizationSettings: Decodable {
paymentTypes.insert(.sberbank)
case "PaymentMethod.applePay":
paymentTypes.insert(.applePay)
case "PaymentMethod.sbp":
paymentTypes.insert(.sbp)
default: break
}
}

View File

@ -11,7 +11,7 @@ Flutter SDK from yoomoney
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'YooKassaPayments', '6.11.3'
s.dependency 'YooKassaPayments', '6.12.3'
s.platform = :ios, '10.0'

View File

@ -16,16 +16,19 @@ class PaymentMethodTypes {
PaymentMethodTypes([PaymentMethod.applePay]);
static const PaymentMethodTypes googlePay =
PaymentMethodTypes([PaymentMethod.googlePay]);
static const PaymentMethodTypes sbp =
PaymentMethodTypes([PaymentMethod.sbp]);
static const PaymentMethodTypes all = PaymentMethodTypes([
PaymentMethod.bankCard,
PaymentMethod.yooMoney,
PaymentMethod.sberbank,
PaymentMethod.applePay,
PaymentMethod.googlePay
PaymentMethod.googlePay,
PaymentMethod.sbp
]);
}
enum PaymentMethod { bankCard, yooMoney, applePay, googlePay, sberbank }
enum PaymentMethod { bankCard, yooMoney, applePay, googlePay, sberbank, sbp }
extension PaymentMethodExtension on PaymentMethod {
static PaymentMethod fromStringValue(String rawValue) {
@ -40,6 +43,8 @@ extension PaymentMethodExtension on PaymentMethod {
return PaymentMethod.applePay;
case 'google_pay':
return PaymentMethod.googlePay;
case 'sbp':
return PaymentMethod.sbp;
}
return PaymentMethod.bankCard;
}

View File

@ -56,6 +56,8 @@ PaymentMethod? _paymentMethodFromString(String type) {
return PaymentMethod.applePay;
case "google_pay":
return PaymentMethod.googlePay;
case "sbp":
return PaymentMethod.sbp;
default:
return null;
}

View File

@ -30,8 +30,8 @@ class YookassaPaymentsFlutter {
}
static Future<void> confirmation(
String url, PaymentMethod? paymentMethod) async {
var inputData = {'url': url, 'paymentMethod': paymentMethod?.name};
String url, PaymentMethod? paymentMethod, String? clientApplicationKey) async {
var inputData = {'url': url, 'paymentMethod': paymentMethod?.name, 'clientApplicationKey': clientApplicationKey};
return await _channel.invokeMethod('confirmation', inputData);
}

View File

@ -5,51 +5,50 @@ packages:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.8.2"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
version: "1.3.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.1.1"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
version: "1.15.0"
version: "1.17.1"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.3.1"
flutter:
dependency: "direct main"
description: flutter
@ -59,7 +58,8 @@ packages:
dependency: "direct dev"
description:
name: flutter_lints
url: "https://pub.dartlang.org"
sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493
url: "https://pub.dev"
source: hosted
version: "1.0.4"
flutter_test:
@ -67,41 +67,54 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
js:
dependency: transitive
description:
name: js
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.7"
lints:
dependency: transitive
description:
name: lints
url: "https://pub.dartlang.org"
sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c
url: "https://pub.dev"
source: hosted
version: "1.0.1"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb"
url: "https://pub.dev"
source: hosted
version: "0.12.11"
version: "0.12.15"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.dev"
source: hosted
version: "0.1.3"
version: "0.2.0"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.7.0"
version: "1.9.1"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
version: "1.8.3"
sky_engine:
dependency: transitive
description: flutter
@ -111,58 +124,58 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.dev"
source: hosted
version: "1.8.1"
version: "1.9.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "1.2.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb
url: "https://pub.dev"
source: hosted
version: "0.4.8"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "0.5.1"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.4"
sdks:
dart: ">=2.15.0 <3.0.0"
dart: ">=3.0.0-0 <4.0.0"
flutter: ">=2.10.5"

View File

@ -1,11 +1,11 @@
name: yookassa_payments_flutter
description: This Flutter SDK allows processing payments using a payment token. It works as an addition to the YooMoney API.
version: 1.0.6
version: 1.1.1
homepage: https://git.yoomoney.ru/projects/SDK/repos/yookassa-payments-flutter-sdk/browse
repository: https://git.yoomoney.ru/projects/SDK/repos/yookassa-payments-flutter-sdk/browse
environment:
sdk: ">=2.15.0 <3.0.0"
sdk: ">=2.15.0 <4.0.0"
flutter: ">=2.10.5"
dependencies: