diff --git a/CHANGELOG.md b/CHANGELOG.md
index 86485fe..1304889 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+### v2.2.5 от 14.02.2022
+* Отключен способ оплаты Webmoney
+* Обновлен SDK до версии 2.2.6
+
### v2.2.4 от 27.01.2022
* Исправление сохранения параметров типа и предмета оплаты по умолчанию для сертификатов
diff --git a/src/upload/admin/controller/extension/payment/yoomoney.php b/src/upload/admin/controller/extension/payment/yoomoney.php
index 64133fa..56e0839 100644
--- a/src/upload/admin/controller/extension/payment/yoomoney.php
+++ b/src/upload/admin/controller/extension/payment/yoomoney.php
@@ -12,7 +12,7 @@
class ControllerExtensionPaymentYoomoney extends Controller
{
const MODULE_NAME = 'yoomoney';
- const MODULE_VERSION = '2.2.4';
+ const MODULE_VERSION = '2.2.5';
const WIDGET_INSTALL_STATUS_SUCCESS = true;
const WIDGET_INSTALL_STATUS_FAIL = false;
diff --git a/src/upload/admin/model/extension/payment/yoomoney.php b/src/upload/admin/model/extension/payment/yoomoney.php
index 089b6b3..ad8b220 100644
--- a/src/upload/admin/model/extension/payment/yoomoney.php
+++ b/src/upload/admin/model/extension/payment/yoomoney.php
@@ -5,7 +5,7 @@ class ModelExtensionPaymentYoomoney extends Model
/**
* string
*/
- const MODULE_VERSION = '2.2.4';
+ const MODULE_VERSION = '2.2.5';
const YOOMONEY_EVENT_SECOND_RECEIPT_CODE = 'yoomoney_second_receipt_trigger';
private $kassaModel;
@@ -65,7 +65,7 @@ public function install()
`product_id` INTEGER NOT NULL,
`payment_subject` VARCHAR(256),
`payment_mode` VARCHAR(256),
-
+
CONSTRAINT `'.DB_PREFIX.'yoomoney_payment_pk` PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=UTF8 COLLATE=utf8_general_ci;
');
diff --git a/src/upload/catalog/controller/extension/payment/yoomoney.php b/src/upload/catalog/controller/extension/payment/yoomoney.php
index 918967b..07e6540 100644
--- a/src/upload/catalog/controller/extension/payment/yoomoney.php
+++ b/src/upload/catalog/controller/extension/payment/yoomoney.php
@@ -22,7 +22,7 @@
class ControllerExtensionPaymentYoomoney extends Controller
{
const MODULE_NAME = 'yoomoney';
- const MODULE_VERSION = '2.2.4';
+ const MODULE_VERSION = '2.2.5';
/**
* @var ModelExtensionPaymentYoomoney
diff --git a/src/upload/catalog/model/extension/payment/yoomoney.php b/src/upload/catalog/model/extension/payment/yoomoney.php
index 52032c1..e07b879 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney.php
@@ -20,7 +20,7 @@
*/
class ModelExtensionPaymentYoomoney extends Model
{
- const MODULE_VERSION = '2.2.4';
+ const MODULE_VERSION = '2.2.5';
private $kassaModel;
private $walletModel;
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/Model/KassaModel.php b/src/upload/catalog/model/extension/payment/yoomoney/Model/KassaModel.php
index 74076b7..26df365 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/Model/KassaModel.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/Model/KassaModel.php
@@ -28,6 +28,7 @@ class KassaModel extends AbstractPaymentModel
private static $_disabledPaymentMethods = array(
PaymentMethodType::B2B_SBERBANK,
PaymentMethodType::WECHAT,
+ PaymentMethodType::WEBMONEY,
);
protected $shopId;
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.json b/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.json
index 7ab9c30..0f6e8b2 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.json
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.json
@@ -52,17 +52,17 @@
},
{
"name": "yoomoney/yookassa-sdk-php",
- "version": "2.2.2",
- "version_normalized": "2.2.2.0",
+ "version": "2.2.6",
+ "version_normalized": "2.2.6.0",
"source": {
"type": "git",
"url": "https://github.com/yoomoney/yookassa-sdk-php.git",
- "reference": "cc9cddb807d93e4549af7f298f9780a3ebd3561a"
+ "reference": "0bbd87d76310b3239b6e6de6534c9fab9e7db847"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/yoomoney/yookassa-sdk-php/zipball/cc9cddb807d93e4549af7f298f9780a3ebd3561a",
- "reference": "cc9cddb807d93e4549af7f298f9780a3ebd3561a",
+ "url": "https://api.github.com/repos/yoomoney/yookassa-sdk-php/zipball/0bbd87d76310b3239b6e6de6534c9fab9e7db847",
+ "reference": "0bbd87d76310b3239b6e6de6534c9fab9e7db847",
"shasum": ""
},
"require": {
@@ -70,14 +70,14 @@
"ext-json": "*",
"ext-mbstring": "*",
"php": ">=5.3.0",
- "psr/log": "^1.0 || ^2.0 || ^3.0"
+ "psr/log": "^1.0"
},
"require-dev": {
"ext-xml": "*",
"mockery/mockery": "^0.9.9",
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
- "time": "2021-11-16T11:21:19+00:00",
+ "time": "2022-01-21T13:31:53+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
@@ -106,7 +106,7 @@
],
"support": {
"issues": "https://github.com/yoomoney/yookassa-sdk-php/issues",
- "source": "https://github.com/yoomoney/yookassa-sdk-php/tree/2.2.2"
+ "source": "https://github.com/yoomoney/yookassa-sdk-php/tree/2.2.6"
},
"install-path": "../yoomoney/yookassa-sdk-php"
}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.php
index 5733e64..8132890 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/composer/installed.php
@@ -5,7 +5,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => 'd2718ca30f64c0f7edd4fc28b89806b7498f1890',
+ 'reference' => 'caa0100705c3f1d5280ae67fa7aae693b5ca7382',
'name' => '__root__',
'dev' => true,
),
@@ -16,7 +16,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
- 'reference' => 'd2718ca30f64c0f7edd4fc28b89806b7498f1890',
+ 'reference' => 'caa0100705c3f1d5280ae67fa7aae693b5ca7382',
'dev_requirement' => false,
),
'psr/log' => array(
@@ -29,12 +29,12 @@
'dev_requirement' => false,
),
'yoomoney/yookassa-sdk-php' => array(
- 'pretty_version' => '2.2.2',
- 'version' => '2.2.2.0',
+ 'pretty_version' => '2.2.6',
+ 'version' => '2.2.6.0',
'type' => 'library',
'install_path' => __DIR__ . '/../yoomoney/yookassa-sdk-php',
'aliases' => array(),
- 'reference' => 'cc9cddb807d93e4549af7f298f9780a3ebd3561a',
+ 'reference' => '0bbd87d76310b3239b6e6de6534c9fab9e7db847',
'dev_requirement' => false,
),
),
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/.travis.yml b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/.travis.yml
index 0f76a41..4c11191 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/.travis.yml
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/.travis.yml
@@ -13,8 +13,8 @@ matrix:
include:
- php: 5.5
dist: trusty
-# - php: 5.4
-# dist: precise
+ - php: 5.4
+ dist: trusty
# - php: 5.3
# dist: precise
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md
index 31f2238..aba4c70 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md
@@ -1,3 +1,20 @@
+### v2.2.6 от 21.01.2022
+* Откат поддержки psr/log версий 2 и 3
+
+### v2.2.5 от 28.12.2021
+* Добавлен метод проверки IP адреса уведомления от Юkassa среди известных адресов Юkassa
+* Добавлены тесты
+* Добавлен пример в документацию
+
+### v2.2.4 от 09.12.2021
+* Фикс метода jsonSerialize() для ReceiptResponseItem
+* Добавлена проверка на параметр platform_fee_amount при создании запроса для двухстадийного платежа
+* Обновлены тесты
+* Обновлен readme
+
+### v2.2.3 от 07.12.2021
+* Добавлена обработка параметра authorization_details.three_d_secure.applied в объекте платежа
+
### v2.2.2 от 16.11.2021
* Добавлены уведомления по Сделкам и Выплатам
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.en.md b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.en.md
index a0af46d..34bde01 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.en.md
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.en.md
@@ -6,7 +6,7 @@
[![Monthly Downloads](https://poser.pugx.org/yoomoney/yookassa-sdk-php/d/monthly)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
[![License](https://poser.pugx.org/yoomoney/yookassa-sdk-php/license)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
-[Russian](https://github.com/yoomoney/yookassa-sdk-php/blob/master/README.md) | English
+[Russian](README.md) | English
This product is used for managing payments under [The YooKassa API](https://yookassa.ru/en/developers/api)
For usage by those who implemented YooKassa using the API method.
@@ -64,38 +64,38 @@ $client->setAuth('shopId', 'secretKey');
[More details in our documentation for the YooKassa API](https://yookassa.ru/en/developers/api#create_payment).
- [More details in our documentation for the YooKassa SDK](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/readme.md).
+ [More details in our documentation for the YooKassa SDK](docs/readme.md).
## Examples of using the API SDK
-#### [YooKassa SDK Settings](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md)
-* [Authentication](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Аутентификация)
-* [Statistics about the environment used](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Статистические-данные-об-используемом-окружении)
-* [Getting information about the store](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Получение-информации-о-магазине)
-* [Working with Webhook](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Работа-с-Webhook)
-* [Notifications](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Входящие-уведомления)
-
-#### [Working with payments](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md)
-* [Request to create a payment](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-создание-платежа)
-* [Request to create a payment via the builder](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-создание-платежа-через-билдер)
-* [Request for partial payment confirmation](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-частичное-подтверждение-платежа)
-* [Request to cancel an incomplete payment](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-отмену-незавершенного-платежа)
-* [Get payment information](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Получить-информацию-о-платеже)
-* [Get a list of payments with filtering](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Получить-список-платежей-с-фильтрацией)
-
-#### [Working with refunds](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md)
-* [Request to create a refund](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Запрос-на-создание-возврата)
-* [Request to create a refund via the builder](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Запрос-на-создание-возврата-через-билдер)
-* [Get refund information](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Получить-информацию-о-возврате)
-* [Get a list of returns with filtering](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Получить-список-возвратов-с-фильтрацией)
-
-#### [Working with receipts](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md)
-* [Request to create a receipt](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Запрос-на-создание-чека)
-* [Request to create a receipt via the builder](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Запрос-на-создание-чека-через-билдер)
-* [Get information about the receipt](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Получить-информацию-о-чеке)
-* [Get a list of receipts with filtering](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Получить-список-чеков-с-фильтрацией)
-
-#### [Working with deals](docs/examples/05-deals.md)
+#### [YooKassa SDK Settings](docs/examples/01-configuration.md)
+* [Authentication](docs/examples/01-configuration.md#Аутентификация)
+* [Statistics about the environment used](docs/examples/01-configuration.md#Статистические-данные-об-используемом-окружении)
+* [Getting information about the store](docs/examples/01-configuration.md#Получение-информации-о-магазине)
+* [Working with Webhook](docs/examples/01-configuration.md#Работа-с-Webhook)
+* [Notifications](docs/examples/01-configuration.md#Входящие-уведомления)
+
+#### [Working with payments](docs/examples/02-payments.md)
+* [Request to create a payment](docs/examples/02-payments.md#Запрос-на-создание-платежа)
+* [Request to create a payment via the builder](docs/examples/02-payments.md#Запрос-на-создание-платежа-через-билдер)
+* [Request for partial payment confirmation](docs/examples/02-payments.md#Запрос-на-частичное-подтверждение-платежа)
+* [Request to cancel an incomplete payment](docs/examples/02-payments.md#Запрос-на-отмену-незавершенного-платежа)
+* [Get payment information](docs/examples/02-payments.md#Получить-информацию-о-платеже)
+* [Get a list of payments with filtering](docs/examples/02-payments.md#Получить-список-платежей-с-фильтрацией)
+
+#### [Working with refunds](docs/examples/03-refunds.md)
+* [Request to create a refund](docs/examples/03-refunds.md#Запрос-на-создание-возврата)
+* [Request to create a refund via the builder](docs/examples/03-refunds.md#Запрос-на-создание-возврата-через-билдер)
+* [Get refund information](docs/examples/03-refunds.md#Получить-информацию-о-возврате)
+* [Get a list of returns with filtering](docs/examples/03-refunds.md#Получить-список-возвратов-с-фильтрацией)
+
+#### [Working with receipts](docs/examples/04-receipts.md)
+* [Request to create a receipt](docs/examples/04-receipts.md#Запрос-на-создание-чека)
+* [Request to create a receipt via the builder](docs/examples/04-receipts.md#Запрос-на-создание-чека-через-билдер)
+* [Get information about the receipt](docs/examples/04-receipts.md#Получить-информацию-о-чеке)
+* [Get a list of receipts with filtering](docs/examples/04-receipts.md#Получить-список-чеков-с-фильтрацией)
+
+#### [Working with safe deals](docs/examples/05-deals.md)
* [Request to create a deal](docs/examples/05-deals.md#Запрос-на-создание-сделки)
* [Request to create a deal via the builder](docs/examples/05-deals.md#Запрос-на-создание-сделки-через-билдер)
* [Request to create a payment with info about deal](docs/examples/05-deals.md#Запрос-на-создание-платежа-с-привязкой-к-сделке)
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.md b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.md
index b5edc5b..3b92213 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.md
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/README.md
@@ -6,7 +6,7 @@
[![Monthly Downloads](https://poser.pugx.org/yoomoney/yookassa-sdk-php/d/monthly)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
[![License](https://poser.pugx.org/yoomoney/yookassa-sdk-php/license)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
-Russian | [English](https://github.com/yoomoney/yookassa-sdk-php/blob/master/README.en.md)
+Russian | [English](README.en.md)
Клиент для работы с платежами по [API ЮKassa](https://yookassa.ru/developers/api)
Подходит тем, у кого способ подключения к ЮKassa называется API.
@@ -66,38 +66,38 @@ $client->setAuth('shopId', 'secretKey');
[Подробнее в документации к API ЮKassa](https://yookassa.ru/developers/api#create_payment).
- [Подробнее в документации к SDK ЮKassa](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/readme.md).
+ [Подробнее в документации к SDK ЮKassa](docs/readme.md).
## Примеры использования SDK
-#### [Настройки SDK API ЮKassa](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md)
-* [Аутентификация](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Аутентификация)
-* [Статистические данные об используемом окружении](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Статистические-данные-об-используемом-окружении)
-* [Получение информации о магазине](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Получение-информации-о-магазине)
-* [Работа с Webhook](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Работа-с-Webhook)
-* [Входящие уведомления](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/01-configuration.md#Входящие-уведомления)
-
-#### [Работа с платежами](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md)
-* [Запрос на создание платежа](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-создание-платежа)
-* [Запрос на создание платежа через билдер](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-создание-платежа-через-билдер)
-* [Запрос на частичное подтверждение платежа](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-частичное-подтверждение-платежа)
-* [Запрос на отмену незавершенного платежа](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Запрос-на-отмену-незавершенного-платежа)
-* [Получить информацию о платеже](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Получить-информацию-о-платеже)
-* [Получить список платежей с фильтрацией](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/02-payments.md#Получить-список-платежей-с-фильтрацией)
-
-#### [Работа с возвратами](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md)
-* [Запрос на создание возврата](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Запрос-на-создание-возврата)
-* [Запрос на создание возврата через билдер](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Запрос-на-создание-возврата-через-билдер)
-* [Получить информацию о возврате](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Получить-информацию-о-возврате)
-* [Получить список возвратов с фильтрацией](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/03-refunds.md#Получить-список-возвратов-с-фильтрацией)
-
-#### [Работа с чеками](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md)
-* [Запрос на создание чека](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Запрос-на-создание-чека)
-* [Запрос на создание чека через билдер](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Запрос-на-создание-чека-через-билдер)
-* [Получить информацию о чеке](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Получить-информацию-о-чеке)
-* [Получить список чеков с фильтрацией](https://github.com/yoomoney/yookassa-sdk-php/blob/master/docs/examples/04-receipts.md#Получить-список-чеков-с-фильтрацией)
-
-#### [Работа со сделками](docs/examples/05-deals.md)
+#### [Настройки SDK API ЮKassa](docs/examples/01-configuration.md)
+* [Аутентификация](docs/examples/01-configuration.md#Аутентификация)
+* [Статистические данные об используемом окружении](docs/examples/01-configuration.md#Статистические-данные-об-используемом-окружении)
+* [Получение информации о магазине](docs/examples/01-configuration.md#Получение-информации-о-магазине)
+* [Работа с Webhook](docs/examples/01-configuration.md#Работа-с-Webhook)
+* [Входящие уведомления](docs/examples/01-configuration.md#Входящие-уведомления)
+
+#### [Работа с платежами](docs/examples/02-payments.md)
+* [Запрос на создание платежа](docs/examples/02-payments.md#Запрос-на-создание-платежа)
+* [Запрос на создание платежа через билдер](docs/examples/02-payments.md#Запрос-на-создание-платежа-через-билдер)
+* [Запрос на частичное подтверждение платежа](docs/examples/02-payments.md#Запрос-на-частичное-подтверждение-платежа)
+* [Запрос на отмену незавершенного платежа](docs/examples/02-payments.md#Запрос-на-отмену-незавершенного-платежа)
+* [Получить информацию о платеже](docs/examples/02-payments.md#Получить-информацию-о-платеже)
+* [Получить список платежей с фильтрацией](docs/examples/02-payments.md#Получить-список-платежей-с-фильтрацией)
+
+#### [Работа с возвратами](docs/examples/03-refunds.md)
+* [Запрос на создание возврата](docs/examples/03-refunds.md#Запрос-на-создание-возврата)
+* [Запрос на создание возврата через билдер](docs/examples/03-refunds.md#Запрос-на-создание-возврата-через-билдер)
+* [Получить информацию о возврате](docs/examples/03-refunds.md#Получить-информацию-о-возврате)
+* [Получить список возвратов с фильтрацией](docs/examples/03-refunds.md#Получить-список-возвратов-с-фильтрацией)
+
+#### [Работа с чеками](docs/examples/04-receipts.md)
+* [Запрос на создание чека](docs/examples/04-receipts.md#Запрос-на-создание-чека)
+* [Запрос на создание чека через билдер](docs/examples/04-receipts.md#Запрос-на-создание-чека-через-билдер)
+* [Получить информацию о чеке](docs/examples/04-receipts.md#Получить-информацию-о-чеке)
+* [Получить список чеков с фильтрацией](docs/examples/04-receipts.md#Получить-список-чеков-с-фильтрацией)
+
+#### [Работа с безопасными сделками](docs/examples/05-deals.md)
* [Запрос на создание сделки](docs/examples/05-deals.md#Запрос-на-создание-сделки)
* [Запрос на создание сделки через билдер](docs/examples/05-deals.md#Запрос-на-создание-сделки-через-билдер)
* [Запрос на создание платежа с привязкой к сделке](docs/examples/05-deals.md#Запрос-на-создание-платежа-с-привязкой-к-сделке)
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/composer.json b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/composer.json
index cd8e78e..c5a9078 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/composer.json
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/composer.json
@@ -11,13 +11,13 @@
"email": "cms@yoomoney.ru"
}
],
- "version": "2.2.2",
+ "version": "2.2.6",
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
"ext-json": "*",
"ext-mbstring": "*",
- "psr/log": "^1.0 || ^2.0 || ^3.0"
+ "psr/log": "^1.0"
},
"require-dev": {
"ext-xml": "*",
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client.php
index 8223153..598ac1b 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client.php
@@ -112,7 +112,7 @@ class Client extends BaseClient
/**
* Текущая версия библиотеки
*/
- const SDK_VERSION = '2.2.2';
+ const SDK_VERSION = '2.2.6';
/**
* Получить список платежей магазина
@@ -1208,4 +1208,4 @@ public function me($filter = null)
return $result;
}
-}
\ No newline at end of file
+}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php
index 7467ad4..430c1ed 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php
@@ -43,6 +43,7 @@
use YooKassa\Common\ResponseObject;
use YooKassa\Helpers\Config\ConfigurationLoader;
use YooKassa\Helpers\Config\ConfigurationLoaderInterface;
+use YooKassa\Helpers\SecurityHelper;
class BaseClient
{
@@ -291,6 +292,22 @@ public function setMaxRequestAttempts($attempts)
return $this;
}
+
+ /**
+ * Метод проверяет, находится ли IP адрес среди IP адресов Юkassa, с которых отправляются уведомления
+ *
+ * @param string $ip - IPv4 или IPv6 адрес webhook уведомления
+ * @return bool
+ *
+ * @throws Exception - исключение будет выброшено, если будет передан IP адрес неверного формата
+ */
+ public function isNotificationIPTrusted($ip)
+ {
+ $securityHelper = new SecurityHelper();
+
+ return $securityHelper->isIPTrusted($ip);
+ }
+
/**
* Кодирует массив данных в JSON строку
*
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/SecurityHelper.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/SecurityHelper.php
new file mode 100644
index 0000000..fdc5f0a
--- /dev/null
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/SecurityHelper.php
@@ -0,0 +1,195 @@
+isIPv6($ip)) {
+ return $this->checkInIPv4TrustedList($ip);
+ }
+
+ if (!$this->isIPv4($ip)) {
+ return $this->checkInIPv6TrustedList($ip);
+ }
+ throw new \Exception(
+ 'Could not recognize IPv4 or IPv6: ' . $ip
+ );
+ }
+
+ /**
+ * Проверяет, является ли переданное в функцию значение IPv6 адресом
+ *
+ * @param $ip - IP адрес
+ * @return bool - true - является, false - не является
+ */
+ private function isIPv6($ip)
+ {
+ return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) != false;
+ }
+
+ /**
+ * Проверяет, является ли переданное в функцию значение IPv4 адресом
+ *
+ * @param $ip - IP адрес
+ * @return bool - true - является, false - не является
+ */
+ private function isIPv4($ip)
+ {
+ return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) != false;
+ }
+
+ /**
+ * Проверяет IPv4 адрес в списке IPv4 адресов Юkassa
+ *
+ * @param $ip - IPv4 адрес
+ * @return bool
+ */
+ private function checkInIPv4TrustedList($ip)
+ {
+ foreach($this->getIPv4TrustedList() as $range) {
+ if ($this->isIPInV4Range($ip, $range)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Проверяет IPv6 адрес в списке IPv6 адресов Юkassa
+ *
+ * @param $ip - IPv6 адрес
+ * @return bool
+ */
+ private function checkInIPv6TrustedList($ip)
+ {
+ foreach($this->getIPv6TrustedList() as $range) {
+ if ($this->isIPInV6Range($ip, $range)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Осуществляет проверку, входит ли IPv4 адрес $ip в диапазон IPv4 адресов $range
+ *
+ * @param $ip - IPv4 адрес
+ * @param $range - IPv4 адрес, или диапазон IPv4 адресов в формате CIDR
+ * @return bool
+ */
+ private function isIPInV4Range($ip, $range)
+ {
+ $ip_dec = ip2long($ip);
+
+ if (strpos($range, '/') === false) {
+ return ip2long($ip) == ip2long($range);
+ }
+ list($range, $netmask) = explode('/', $range, 2);
+ list($a,$b,$c,$d) = explode('.', $range);
+
+ $range = sprintf("%u.%u.%u.%u", $a, $b, $c, $d);
+ $range_dec = ip2long($range);
+
+ $wildcard_dec = pow(2, (32-$netmask)) - 1;
+ $netmask_dec = ~ $wildcard_dec;
+
+ return (($ip_dec & $netmask_dec) == ($range_dec & $netmask_dec));
+ }
+
+ /**
+ * Осуществляет проверку, входит ли IPv6 адрес $ip в диапазон IPv6 адресов $range
+ *
+ * @param $ip
+ * @param $range
+ * @return bool
+ */
+ private function isIPInV6Range($ip, $range)
+ {
+ $firstInRange = inet_pton($range[0]);
+ $lastInRange = inet_pton($range[1]);
+
+ $ip = inet_pton($ip);
+
+ return (strlen($ip) == strlen($firstInRange))
+ && ($ip >= $firstInRange && $ip <= $lastInRange);
+ }
+
+ /**
+ * Возвращает список диапазонов IPv4 адресов в формате CIDR и отдельных IPv4 адресов
+ * с которых Юkassa может отправлять уведомления
+ *
+ * @return string[]
+ */
+ final private function getIPv4TrustedList()
+ {
+ return array(
+ '185.71.76.0/27',
+ '185.71.77.0/27',
+ '77.75.153.0/25',
+ '77.75.154.128/25',
+ '77.75.156.11',
+ '77.75.156.35',
+ );
+ }
+
+ /**
+ * Возвращает список диапазонов IPv6 адресов с которых Юkassa может отправлять уведомления
+ *
+ * @return \string[][]
+ */
+ final private function getIPv6TrustedList()
+ {
+ return array(
+ array(
+ '2a02:5180:0000:1509:0000:0000:0000:0000',
+ '2a02:5180:0000:1509:ffff:ffff:ffff:ffff'
+ ),
+ array(
+ '2a02:5180:0000:2655:0000:0000:0000:0000',
+ '2a02:5180:0000:2655:ffff:ffff:ffff:ffff'
+ ),
+ array(
+ '2a02:5180:0000:1533:0000:0000:0000:0000',
+ '2a02:5180:0000:1533:ffff:ffff:ffff:ffff'
+ ),
+ array(
+ '2a02:5180:0000:2669:0000:0000:0000:0000',
+ '2a02:5180:0000:2669:ffff:ffff:ffff:ffff'
+ )
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetails.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetails.php
index 4af0ebe..cf2845a 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetails.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetails.php
@@ -35,6 +35,7 @@
*
* @property $rrn Retrieval Reference Number — уникальный идентификатор транзакции в системе эмитента
* @property string $authCode Код авторизации банковской карты
+ * @property ThreeDSecure $threeDSecure Данные о прохождении пользователем аутентификации по 3‑D Secure
*/
class AuthorizationDetails extends AbstractObject implements AuthorizationDetailsInterface
{
@@ -49,16 +50,24 @@ class AuthorizationDetails extends AbstractObject implements AuthorizationDetail
private $_authCode = '';
/**
- * @param string|null $rrn Уникальный идентификатор транзакции
- * @param string|null $authCode Код авторизации банковской карты
+ * @var ThreeDSecure Данные о прохождении пользователем аутентификации по 3‑D Secure
*/
- public function __construct($rrn = null, $authCode = null)
+ private $_threeDSecure;
+
+ public function fromArray($sourceArray)
{
- if ($rrn !== null) {
- $this->setRrn($rrn);
+
+ if (isset($sourceArray['rrn'])) {
+ $this->setRrn($sourceArray['rrn']);
}
- if ($authCode !== null) {
- $this->setAuthCode($authCode);
+
+ if (isset($sourceArray['auth_code'])) {
+ $this->setAuthCode($sourceArray['auth_code']);
+ }
+
+
+ if (isset($sourceArray['three_d_secure'])) {
+ $this->setThreeDSecure($sourceArray['three_d_secure']);
}
}
@@ -82,9 +91,22 @@ public function getAuthCode()
return $this->_authCode;
}
+ /**
+ * Возвращает данные о прохождении пользователем аутентификации по 3‑D Secure
+ *
+ * @return ThreeDSecure|null Объект с данными о прохождении пользователем аутентификации по 3‑D Secure
+ */
+ public function getThreeDSecure()
+ {
+ return $this->_threeDSecure;
+ }
+
/**
* Устанавливает уникальный идентификатор транзакции
+ *
* @param $value
+ *
+ * @throws InvalidPropertyValueTypeException
*/
public function setRrn($value)
{
@@ -100,7 +122,10 @@ public function setRrn($value)
/**
* Устанавливает код авторизации банковской карты
+ *
* @param $value
+ *
+ * @throws InvalidPropertyValueTypeException
*/
public function setAuthCode($value)
{
@@ -113,4 +138,23 @@ public function setAuthCode($value)
'authorization_details.auth_code', $value);
}
}
+
+ /**
+ * Устанавливает данные о прохождении пользователем аутентификации по 3‑D Secure
+ *
+ * @param ThreeDSecure|array $value Данные о прохождении аутентификации по 3‑D Secure
+ *
+ * @throws InvalidPropertyValueTypeException
+ */
+ public function setThreeDSecure($value)
+ {
+ if (is_array($value)) {
+ $this->_threeDSecure = new ThreeDSecure($value);
+ } elseif ($value instanceof ThreeDSecure) {
+ $this->_threeDSecure = $value;
+ } else {
+ throw new InvalidPropertyValueTypeException('Invalid three_d_secure value type', 0,
+ 'authorization_details.three_d_secure', $value);
+ }
+ }
}
\ No newline at end of file
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetailsInterface.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetailsInterface.php
index 02230a1..6b71c6f 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetailsInterface.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/AuthorizationDetailsInterface.php
@@ -33,6 +33,7 @@
*
* @property-read string $rrn Retrieval Reference Number — уникальный идентификатор транзакции в системе эмитента
* @property-read string $authCode Код авторизации банковской карты
+ * @property-read ThreeDSecure $threeDSecure Данные о прохождении пользователем аутентификации по 3‑D Secure
*/
interface AuthorizationDetailsInterface
{
@@ -48,4 +49,9 @@ function getRrn();
*/
function getAuthCode();
+ /**
+ * Возвращает данные о прохождении пользователем аутентификации по 3‑D Secure
+ * @return ThreeDSecure|null Объект с данными о прохождении пользователем аутентификации по 3‑D Secure
+ */
+ function getThreeDSecure();
}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/ThreeDSecure.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/ThreeDSecure.php
new file mode 100644
index 0000000..3932b9a
--- /dev/null
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Model/ThreeDSecure.php
@@ -0,0 +1,60 @@
+_applied;
+ }
+
+ /**
+ * Устанавливает признак отображения пользователю формы для прохождения аутентификации по 3‑D Secure
+ *
+ * @param bool $value Данные о прохождении аутентификации по 3‑D Secure
+ *
+ * @throws InvalidPropertyValueTypeException
+ */
+ public function setApplied($value)
+ {
+ if ($value === null || $value === '') {
+ throw new EmptyPropertyValueException(
+ 'Empty value for "applied" parameter in ThreeDSecure',
+ 0,
+ 'authorization_details.three_d_secure.applied'
+ );
+ }
+
+ if (!TypeCast::canCastToBoolean($value)) {
+ throw new InvalidPropertyValueTypeException(
+ 'Invalid applied value type',
+ 0,
+ 'authorization_details.three_d_secure.applied',
+ $value
+ );
+ }
+
+ $this->_applied = (bool)$value;
+ }
+}
\ No newline at end of file
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php
index 70da34e..fb52c88 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php
@@ -175,10 +175,7 @@ public function fromArray($sourceArray)
$this->setCancellationDetails(new CancellationDetails($party, $reason));
}
if (!empty($sourceArray['authorization_details'])) {
- $authorizationDetails = $sourceArray['authorization_details'];
- $rrn = isset($authorizationDetails['rrn']) ? $authorizationDetails['rrn'] : null;
- $authCode = isset($authorizationDetails['auth_code']) ? $authorizationDetails['auth_code'] : null;
- $this->setAuthorizationDetails(new AuthorizationDetails($rrn, $authCode));
+ $this->setAuthorizationDetails(new AuthorizationDetails($sourceArray['authorization_details']));
}
if (!empty($sourceArray['transfers'])) {
$transfers = array();
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
index cc7f5de..544898c 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
@@ -144,10 +144,16 @@ private function serializeTransfers(array $transfers)
{
$result = array();
foreach ($transfers as $transfer) {
- $result[] = array(
+ $item = array(
'account_id' => $transfer->getAccountId(),
'amount' => $this->serializeAmount($transfer->getAmount())
);
+
+ if ($transfer->hasPlatformFeeAmount()) {
+ $item['platform_fee_amount'] = $this->serializeAmount($transfer->getPlatformFeeAmount());
+ }
+
+ $result[] = $item;
}
return $result;
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php
index 866289e..f075336 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php
@@ -358,4 +358,19 @@ private function factoryAmount($options)
return $amount;
}
-}
\ No newline at end of file
+
+ /**
+ * @inheritdoc
+ *
+ * @return array
+ */
+ public function jsonSerialize()
+ {
+ $result = parent::jsonSerialize();
+
+ $result['amount'] = $result['price'];
+ unset($result['price']);
+
+ return $result;
+ }
+}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php
index c15f1dd..9b4411f 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php
@@ -73,10 +73,22 @@ function getPrice();
*/
function getVatCode();
+ /**
+ * Возвращает признак предмета расчета
+ * @return string|null Признак предмета расчета
+ */
+ function getPaymentSubject();
+
+ /**
+ * Возвращает признак способа расчета
+ * @return string|null Признак способа расчета
+ */
+ function getPaymentMode();
+
/**
* Возвращает информацию о поставщике товара или услуги
* @return SupplierInterface
*/
function getSupplier();
-}
\ No newline at end of file
+}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/phpdoc.xml b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/phpdoc.xml
index 7d752f0..d109a12 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/phpdoc.xml
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/phpdoc.xml
@@ -9,7 +9,7 @@
-
+
latest
-
\ No newline at end of file
+
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Client/BaseClientTest.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Client/BaseClientTest.php
index d7aa136..bfed3ad 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Client/BaseClientTest.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Client/BaseClientTest.php
@@ -2,12 +2,10 @@
namespace Tests\YooKassa\Client;
-use YooKassa\Client;
use YooKassa\Client\ApiClientInterface;
use YooKassa\Client\BaseClient;
use PHPUnit\Framework\TestCase;
use YooKassa\Client\CurlClient;
-use YooKassa\Common\LoggerWrapper;
use YooKassa\Helpers\Config\ConfigurationLoader;
use YooKassa\Helpers\Random;
@@ -85,6 +83,32 @@ public function testGetSetConfig($apiClient, $configLoader)
self::assertEquals($client->getConfig(), $instance->getConfig());
}
+ /**
+ * @dataProvider validIPv4DataProvider
+ * @param $ip
+ */
+ public function testIsIPInTrustedRangeValid($ip)
+ {
+ $instance = $this->getInstance();
+
+ $checkResult = $instance->isNotificationIPTrusted($ip);
+
+ self::assertEquals(true, $checkResult);
+ }
+
+ /**
+ * @dataProvider inValidIPv4DataProvider
+ * @param $ip
+ */
+ public function testIsIPInTrustedRangeInValid($ip)
+ {
+ $instance = $this->getInstance();
+
+ $checkResult = $instance->isNotificationIPTrusted($ip);
+
+ self::assertEquals(false, $checkResult);
+ }
+
public function validDataProvider()
{
return array(
@@ -124,4 +148,35 @@ public function validConfigurationDataProvider()
)
);
}
+
+ public function validIPv4DataProvider()
+ {
+ return array(
+ array('185.71.76.' . rand(1, 31)),
+ array('185.71.77.' . rand(1, 31)),
+ array('77.75.153.' . rand(1, 127)),
+ array('77.75.154.' . rand(128, 254)),
+ array('77.75.156.11'),
+ array('77.75.156.35'),
+ array('2a02:5180:0000:2669:0000:0000:0000:7d35'),
+ array('2a02:5180:0000:2655:0000:0000:7d35:0000'),
+ array('2a02:5180:0000:1533:0000:7d35:0000:0000'),
+ array('2a02:5180:0000:2669:7d35:0000:0000:0000'),
+ );
+ }
+
+ public function inValidIPv4DataProvider()
+ {
+ return array(
+ array('185.71.76.32'),
+ array('185.71.77.32'),
+ array('185.71.153.128'),
+ array('185.71.154.' . rand(1, 128)),
+ array('127.0.0.1'),
+ array('77.75.156.12'),
+ array('192.168.1.1'),
+ array('8701:746f:d4f1:d39d:9dcc:6ea2:875e:7d35'),
+ array('::1'),
+ );
+ }
}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php
index cff3ff3..8d4d8ef 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php
@@ -5,65 +5,89 @@
use PHPUnit\Framework\TestCase;
use YooKassa\Helpers\Random;
use YooKassa\Model\AuthorizationDetails;
+use YooKassa\Model\ThreeDSecure;
class AuthorizationDetailsTest extends TestCase
{
/**
- * @param null $rrn
- * @param null $authCode
+ * @param array $authorizationDetails
* @return AuthorizationDetails
*/
- protected static function getInstance($rrn = null, $authCode = null)
+ protected static function getInstance($authorizationDetails = array('three_d_secure' => array('applied' => false)))
{
- return new AuthorizationDetails($rrn, $authCode);
+ return new AuthorizationDetails($authorizationDetails);
}
/**
* @dataProvider validDataProvider
*
- * @param $rrn
- * @param $authCode
+ * @param array $authorizationDetails
*/
- public function testConstructor($rrn = null, $authCode = null)
+ public function testConstructor($authorizationDetails)
{
- $instance = self::getInstance($rrn, $authCode);
+ $instance = self::getInstance($authorizationDetails);
- self::assertEquals($rrn, $instance->getRrn());
- self::assertEquals($authCode, $instance->getAuthCode());
+ self::assertEquals($authorizationDetails['rrn'], $instance->getRrn());
+ self::assertEquals($authorizationDetails['auth_code'], $instance->getAuthCode());
+ self::assertInstanceOf('YooKassa\\Model\\ThreeDSecure', $instance->getThreeDSecure());
}
/**
* @dataProvider validDataProvider
*
- * @param $rrn
- * @param $authCode
+ * @param array $authorizationDetails
*/
- public function testGetSetRrn($rrn = null, $authCode = null)
+ public function testGetSetRrn($authorizationDetails)
{
- $instance = self::getInstance($rrn, $authCode);
- self::assertEquals($rrn, $instance->getRrn());
+ $instance = self::getInstance($authorizationDetails);
+ self::assertEquals($authorizationDetails['rrn'], $instance->getRrn());
- $instance = self::getInstance();
- $instance->setRrn($rrn);
- self::assertEquals($rrn, $instance->getRrn());
- self::assertEquals($rrn, $instance->rrn);
+ $instance = self::getInstance($authorizationDetails);
+ $instance->setRrn($authorizationDetails['rrn']);
+ self::assertEquals($authorizationDetails['rrn'], $instance->getRrn());
+ self::assertEquals($authorizationDetails['rrn'], $instance->rrn);
}
/**
* @dataProvider validDataProvider
*
- * @param null $rrn
- * @param null $authCode
+ * @param array $authorizationDetails
*/
- public function testGetSetAuthCode($rrn = null, $authCode = null)
+ public function testGetSetAuthCode($authorizationDetails)
{
- $instance = self::getInstance($rrn, $authCode);
- self::assertEquals($authCode, $instance->getAuthCode());
+ $instance = self::getInstance($authorizationDetails);
+ self::assertEquals($authorizationDetails['auth_code'], $instance->getAuthCode());
- $instance = self::getInstance();
- $instance->setAuthCode($authCode);
- self::assertEquals($authCode, $instance->getAuthCode());
- self::assertEquals($authCode, $instance->authCode);
+ $instance = self::getInstance($authorizationDetails);
+ $instance->setAuthCode($authorizationDetails['auth_code']);
+ self::assertEquals($authorizationDetails['auth_code'], $instance->getAuthCode());
+ self::assertEquals($authorizationDetails['auth_code'], $instance->authCode);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param array $authorizationDetails
+ */
+ public function testGetSetThreeDSecure($authorizationDetails)
+ {
+ $instance = self::getInstance($authorizationDetails);
+ self::assertInstanceOf('YooKassa\\Model\\ThreeDSecure', $instance->getThreeDSecure());
+
+ $instance = self::getInstance($authorizationDetails);
+ $instance->setThreeDSecure($authorizationDetails['three_d_secure']);
+
+ if (is_object($authorizationDetails['three_d_secure'])) {
+ $threeDSecureObj = $authorizationDetails['three_d_secure'];
+ $threeDSecureExpect = $threeDSecureObj->getApplied();
+ } else {
+ $threeDSecureExpect = $authorizationDetails['three_d_secure']['applied'];
+ }
+
+ self::assertInstanceOf('YooKassa\\Model\\ThreeDSecure', $instance->getThreeDSecure());
+ self::assertInstanceOf('YooKassa\\Model\\ThreeDSecure', $instance->threeDSecure);
+
+ self::assertEquals($threeDSecureExpect, $instance->getThreeDSecure()->getApplied());
}
/**
@@ -96,28 +120,65 @@ public function testSetterInvalidAuthCode($value, $exceptionClassName)
}
}
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetterInvalidThreeDSecure($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setThreeDSecure($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
/**
* @return array
* @throws \Exception
*/
public function validDataProvider()
{
- $result = array(
+ return array(
array(
- 'rrn' => null,
- 'authCode' => null,
+ 'authorizationDetails' => array(
+ 'rrn' => null,
+ 'auth_code' => null,
+ 'three_d_secure' => array(
+ 'applied' => false
+ )
+ )
),
array(
- 'rrn' => '',
- 'authCode' => '',
+ 'authorizationDetails' => array(
+ 'rrn' => '',
+ 'auth_code' => '',
+ 'three_d_secure' => array(
+ 'applied' => false
+ )
+ )
),
array(
- 'rrn' => Random::str(32),
- 'authCode' => Random::str(32),
+ 'authorizationDetails' => array(
+ 'rrn' => Random::str(32),
+ 'auth_code' => Random::str(32),
+ 'three_d_secure' => array(
+ 'applied' => true
+ )
+ )
),
+ array(
+ 'authorizationDetails' => array(
+ 'rrn' => Random::str(32),
+ 'auth_code' => Random::str(32),
+ 'three_d_secure' => new ThreeDSecure(array(
+ 'applied' => true
+ ))
+ )
+ )
);
-
- return $result;
}
public function invalidValueDataProvider()
@@ -131,22 +192,28 @@ public function invalidValueDataProvider()
array(0.0, $exceptionNamespace.'InvalidPropertyValueTypeException'),
array(true, $exceptionNamespace.'InvalidPropertyValueTypeException'),
array(false, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(new \StdClass, $exceptionNamespace.'InvalidPropertyValueTypeException'),
);
}
/**
* @dataProvider validDataProvider
*
- * @param null $rrn
- * @param null $authCode
+ * @param array $authorizationDetails
*/
- public function testJsonSerialize($rrn = null, $authCode = null)
+ public function testJsonSerialize($authorizationDetails)
{
- $instance = new AuthorizationDetails($rrn, $authCode);
+ $instance = new AuthorizationDetails($authorizationDetails);
+
$expected = array(
- 'rrn' => $rrn,
- 'auth_code' => $authCode,
+ 'rrn' => $authorizationDetails['rrn'],
+ 'auth_code' => $authorizationDetails['auth_code'],
+ 'three_d_secure' =>
+ is_object($authorizationDetails['three_d_secure'])
+ ? $authorizationDetails['three_d_secure']->jsonSerialize()
+ : $authorizationDetails['three_d_secure']
);
+
self::assertEquals($expected, $instance->jsonSerialize());
}
}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/ThreeDSecureTest.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/ThreeDSecureTest.php
new file mode 100644
index 0000000..a49d910
--- /dev/null
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Model/ThreeDSecureTest.php
@@ -0,0 +1,106 @@
+getApplied());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $threeDSecure
+ */
+ public function testGetSetApplied($threeDSecure)
+ {
+ $instance = new ThreeDSecure($threeDSecure);
+
+ self::assertEquals($threeDSecure['applied'], $instance->getApplied());
+
+ $instance = new ThreeDSecure();
+
+ $instance->setApplied($threeDSecure['applied']);
+ self::assertEquals($threeDSecure['applied'], $instance->getApplied());
+ self::assertEquals($threeDSecure['applied'], $instance->applied);
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetInvalidApplied($value, $exceptionClassName)
+ {
+ $instance = new ThreeDSecure();
+ try {
+ $instance->setApplied($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function validDataProvider()
+ {
+ return array(
+ array(
+ 'threeDSecure' => array(
+ 'applied' => true
+ )
+ ),
+ array(
+ 'threeDSecure' => array(
+ 'applied' => false
+ )
+ ),
+ array(
+ 'threeDSecure' => new ThreeDSecure(array('applied' => false))
+ )
+ );
+ }
+
+ public function invalidValueDataProvider()
+ {
+ $exceptionNamespace = 'YooKassa\\Common\\Exceptions\\';
+ return array(
+ array(array(), $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(fopen(__FILE__, 'r'), $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(-1, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(-0.01, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(0.0, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array('', $exceptionNamespace.'EmptyPropertyValueException'),
+ array(null, $exceptionNamespace.'EmptyPropertyValueException'),
+ );
+ }
+
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param array $threeDSecure
+ */
+ public function testJsonSerialize($threeDSecure)
+ {
+ if (is_object($threeDSecure)){
+ $threeDSecure = $threeDSecure->jsonSerialize();
+ }
+
+ $instance = new ThreeDSecure($threeDSecure);
+
+ self::assertEquals($threeDSecure, $instance->jsonSerialize());
+ }
+}
diff --git a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php
index f47dd8e..f69a5ff 100644
--- a/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php
+++ b/src/upload/catalog/model/extension/payment/yoomoney/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php
@@ -79,6 +79,15 @@ public function testSerialize($options)
'currency' => isset($transfers['amount']['currency']) ? $transfers['amount']['currency'] : CurrencyCode::RUB
);
}
+ if (!empty($transfers['platform_fee_amount'])) {
+ $transferData['platform_fee_amount'] = array(
+ 'value' => $transfers['platform_fee_amount']['value'],
+ 'currency' =>
+ isset($transfers['platform_fee_amount']['currency'])
+ ? $transfers['amount']['currency']
+ : CurrencyCode::RUB
+ );
+ }
$expected['transfers'][] = $transferData;
}
}
@@ -125,7 +134,8 @@ public function validDataProvider()
'transfers' => array(
new Transfer(array(
'account_id' => Random::str(36),
- 'amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB')
+ 'amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'platform_fee_amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
)),
)
)
diff --git a/yoomoney.oc3x.ocmod.zip b/yoomoney.oc3x.ocmod.zip
index adabe29..4f7ceb3 100644
Binary files a/yoomoney.oc3x.ocmod.zip and b/yoomoney.oc3x.ocmod.zip differ