diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39a224e..999736d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,100 +1,4 @@
-### v1.4.3 от 06.11.2020
-* Изменена ссылка для обновления модуля yandex-money -> yoomoney
-* Обновлен SDK до версии 1.6.8
+### v2.0.0 от 10.12.2020
+* Ребрендинг модуля
-### v1.4.2 от 28.09.2020
-* Добавлен файл apple-developer-merchantid-domain-association для виджета
-
-### v1.4.1 от 30.07.2020
-* Мелкие правки
-
-### v1.4.0 от 10.07.2020
-* Обновлен SDK до версии 1.6.4
-
-### v1.3.0 от 24.04.2020
-* Добавлен способ оплаты через виджет
-
-### v1.2.0 от 23.10.2019
-* Добавлена поддержка отправки второго чека
-
-### v1.1.7 от 04.09.2019
-* Исправлена ошибка выбора способов оплаты p2p
-* Исправлен баг с записью логов по СББОЛ
-
-### v1.1.6 от 30.08.2019
-* Исправлен баг с оплатой через СББОЛ
-* Исправлен баг с оплатой через Альфа-Клик и QIWI
-* Исправлены ошибки возникающие при установке модуля
-
-### v1.1.5 от 11.04.2019
-* Изменен лейбл для ставки НДС с 18% на 20%
-* Добавлены константы для других ставок
-
-### v1.1.4 от 07.03.2019
-* Исправлен баг с 500 на нотификации.
-
-### v1.1.3 от 18.02.2019
-* Добавлен метод ТКС.
-
-### v1.1.2 от 27.12.2018
-* Добавлены поля ФФД 1.05
-
-### v1.1.1 от 19.12.2018
-* Обновлено SDK.
-
-### v1.1.0 от 24.11.2018
-* Добавлен способ оплаты Сбербанк Бизнес Онлайн
-
-### v1.0.14 от 03.08.2018
-* Добавлено холдирование
-
-### v1.0.13 от 13.07.2018
-* Добавлен выбор ставки налога по умолчанию
-
-### v1.0.12 от 05.06.2018
-* Добавлена отправка описания платежа в ЛК Яндекс.Кассы
-
-### v1.0.11 от 23.05.2018
-* Добавлена локализация
-
-### v1.0.10 от 04.05.2018
-* Исправлена ошибка с редиректом при пропуске шага оплаты
-
-### v1.0.9 от 03.05.2018
-* Убрана кнопка кредитования
-
-### v1.0.8 от 28.04.2018
-* Актуализация PHP SDK до версии 1.0.8
-* Добавлен метод "Заплатить по частям"
-* Исправлен баг с невозможностью оплаты при включенном 54-ФЗ без указания эл. почты
-
-### v1.0.7 от 09.04.2018
-* Актуализация PHP SDK до версии 1.0.6
-* Добавлена поддержка уведомлений succeeded
-
-###v1.0.6 от 30.03.2017
-* Исправлено изменение статуса заказа по нотификации.
-
-### v1.0.5 от 25.12.2017
-* Добавлена возможность обновления модуля прямо из настроек
-* В настройках оплаты с помощью Яндекс.Кассы добавлена проверка валидности указанных shopId и Секретного ключа
-
-### v1.0.4 от 15.12.2017
-* Исправлено отображение налоговых ставок в настройках модуля, если выбран способ выбора оплаты на стороне Яндекс.Кассы
-* Исправлено формирование чека
-* В настройки модуля добавлена возможность установки флага сохранения логов
-* В настройки модуля добавлена возможность просмотра логов модуля
-
-### v1.0.3 от 06.12.2017
-* Для версии joomla 2.x в настройках исправлено отображение ссылки на страницу отправки нотификаций
-* Исправлена обработка нотификаций
-
-### v1.0.2 от 30.11.2017
-* Мелкие правки интерфейса настроек модуля
-* Исправлена отображаемая в настройках ссылка на страницу отправки нотификаций
-
-### v1.0.1 от 17.11.2017
-* Добавлена отправка информации о имени CMS и версии используемого модуля в параметре metadata платежа
-
-### v1.0.0
-* Добавлена возможность создания платежей через API Яндекс.Кассы с использованием Yandex Checkout SDK
+###
diff --git a/LICENSE b/LICENSE
index 7e1177d..4715701 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,3 +1,3 @@
Лицензионный договор.
-Любое использование Вами программы означает полное и безоговорочное принятие Вами условий лицензионного договора, размещенного по адресу https://money.yandex.ru/doc.xml?id=527132 (далее – «Лицензионный договор»). Если Вы не принимаете условия Лицензионного договора в полном объёме, Вы не имеете права использовать программу в каких-либо целях.
\ No newline at end of file
+Любое использование Вами программы означает полное и безоговорочное принятие Вами условий лицензионного договора, размещенного по адресу https://yoomoney.ru/doc.xml?id=527132 (далее – «Лицензионный договор»). Если Вы не принимаете условия Лицензионного договора в полном объёме, Вы не имеете права использовать программу в каких-либо целях.
\ No newline at end of file
diff --git a/README.md b/README.md
index 7a9b8ba..38dde4f 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
-# yandexmoney-joomla-joomshopping
+# yoomoney-joomla-joomshopping
-С помощью модуля можно настроить прием платежей через Яндекс.Кассу
+С помощью модуля можно настроить прием платежей через ЮKassa
-[Инструкция по настройке](https://kassa.yandex.ru/manuals/joomshopping)
+[Инструкция по настройке](https://yookassa.ru/docs/support/payments/onboarding/integration/cms-module/joomshopping)
### Установка модуля
Для установки данного модуля необходимо:
* перейти в раздел установка/обновление компонента JoomShopping
-* указать [архив](https://github.com/yoomoney/yandex-money-cms-v2-joomshopping/blob/master/yandex-money-cms-v2-joomshopping.zip?raw=true) в качестве файла пакета обновления
+* указать [архив](https://github.com/yoomoney/cms-joomshopping/blob/master/cms-joomshopping.zip?raw=true) в качестве файла пакета обновления
* загрузить пакет, щелкнув по `Загрузить`
Пожалуйста, обязательно делайте бекапы!
@@ -18,23 +18,23 @@
* версия 3.2.х - 3.8.х;
* компонент JoomShopping версии 4.х
-### О Кассе
+### О ЮKassa
Сервис, который позволяет включить прием платежей на сайте.
-[Сайт Кассы](http://kassa.yandex.ru/)
+[Сайт ЮKassa](https://yookassa.ru/)
#### Условия
* подходит для юрлиц и ИП,
* деньги приходят на расчетный счет,
* комиссия берется с каждого успешного платежа.
-Для использования нужно [подключиться к Яндекс.Кассе](https://money.yandex.ru/joinups) и получить в личном кабинете на сайте Кассы параметры **shopId** и **Секретный ключ**.
+Для использования нужно [подключиться к ЮKassa](https://yookassa.ru/joinups) и получить в личном кабинете на сайте ЮKassa параметры **shopId** и **Секретный ключ**.
### Способы приема платежей
Вы можете выбрать любое количество способов из списка:
* Банковские карты — Visa, Mastercard и Maestro, «Мир»;
-* Яндекс.Деньги;
+* ЮMoney;
* Webmoney;
* QIWI Wallet;
* Наличные;
@@ -44,20 +44,20 @@
### Дополнительные возможности
-**Оплата на стороне Яндекса**
+**Оплата на стороне ЮMoney**
-Включите в модуле оплату на стороне Яндекса — и не придется размещать на своем сайте все способы оплаты. Вместо этого останется одна кнопка «Заплатить».
+Включите в модуле оплату на стороне ЮMoney — и не придется размещать на своем сайте все способы оплаты. Вместо этого останется одна кнопка «Заплатить».
-[Пример в демо-магазине Кассы](https://kassa.yandex.ru/demo/index.html)
+[Пример в демо-магазине ЮKassa](https://yookassa.ru/demo/)
**Отправка данных для чеков по 54-фз**
-Если вы подключите решение Кассы для 54-фз, модуль будет отправлять в Кассу данные для чека вместе с информацией о заказе.
+Если вы подключите решение ЮKassa для 54-фз, модуль будет отправлять в ЮKassa данные для чека вместе с информацией о заказе.
-[Подробности на сайте Кассы](https://kassa.yandex.ru/features)
+[Подробности на сайте ЮKassa](https://yookassa.ru/features/)
### Контакты
-Если у вас есть вопросы или идеи для модуля, напишите нам: cms@yamoney.ru
+Если у вас есть вопросы или идеи для модуля, напишите нам: cms@yoomoney.ru
В письме укажите:
* версию платформы,
diff --git a/src/components/com_jshopping/images/yandex_money/ab.png b/src/components/com_jshopping/images/yoomoney/ab.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/ab.png
rename to src/components/com_jshopping/images/yoomoney/ab.png
diff --git a/src/components/com_jshopping/images/yandex_money/ac.png b/src/components/com_jshopping/images/yoomoney/ac.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/ac.png
rename to src/components/com_jshopping/images/yoomoney/ac.png
diff --git a/src/components/com_jshopping/images/yandex_money/gp.png b/src/components/com_jshopping/images/yoomoney/gp.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/gp.png
rename to src/components/com_jshopping/images/yoomoney/gp.png
diff --git a/src/components/com_jshopping/images/yandex_money/installments.png b/src/components/com_jshopping/images/yoomoney/installments.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/installments.png
rename to src/components/com_jshopping/images/yoomoney/installments.png
diff --git a/src/components/com_jshopping/images/yandex_money/ma.png b/src/components/com_jshopping/images/yoomoney/ma.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/ma.png
rename to src/components/com_jshopping/images/yoomoney/ma.png
diff --git a/src/components/com_jshopping/images/yandex_money/mc.png b/src/components/com_jshopping/images/yoomoney/mc.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/mc.png
rename to src/components/com_jshopping/images/yoomoney/mc.png
diff --git a/src/components/com_jshopping/images/yandex_money/pb.png b/src/components/com_jshopping/images/yoomoney/pb.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/pb.png
rename to src/components/com_jshopping/images/yoomoney/pb.png
diff --git a/src/components/com_jshopping/images/yandex_money/pc.png b/src/components/com_jshopping/images/yoomoney/pc.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/pc.png
rename to src/components/com_jshopping/images/yoomoney/pc.png
diff --git a/src/components/com_jshopping/images/yandex_money/qp.png b/src/components/com_jshopping/images/yoomoney/qp.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/qp.png
rename to src/components/com_jshopping/images/yoomoney/qp.png
diff --git a/src/components/com_jshopping/images/yandex_money/qw.png b/src/components/com_jshopping/images/yoomoney/qw.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/qw.png
rename to src/components/com_jshopping/images/yoomoney/qw.png
diff --git a/src/components/com_jshopping/images/yandex_money/sb.png b/src/components/com_jshopping/images/yoomoney/sb.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/sb.png
rename to src/components/com_jshopping/images/yoomoney/sb.png
diff --git a/src/components/com_jshopping/images/yandex_money/tinkoff_bank.png b/src/components/com_jshopping/images/yoomoney/tinkoff_bank.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/tinkoff_bank.png
rename to src/components/com_jshopping/images/yoomoney/tinkoff_bank.png
diff --git a/src/components/com_jshopping/images/yandex_money/tks.png b/src/components/com_jshopping/images/yoomoney/tks.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/tks.png
rename to src/components/com_jshopping/images/yoomoney/tks.png
diff --git a/src/components/com_jshopping/images/yandex_money/widget.png b/src/components/com_jshopping/images/yoomoney/widget.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/widget.png
rename to src/components/com_jshopping/images/yoomoney/widget.png
diff --git a/src/components/com_jshopping/images/yandex_money/wm.png b/src/components/com_jshopping/images/yoomoney/wm.png
similarity index 100%
rename from src/components/com_jshopping/images/yandex_money/wm.png
rename to src/components/com_jshopping/images/yoomoney/wm.png
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/3x/yandex_payments.php b/src/components/com_jshopping/payments/pm_yandex_money/3x/yandex_payments.php
deleted file mode 100644
index 838980e..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/3x/yandex_payments.php
+++ /dev/null
@@ -1,66 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lang/en-GB.php b/src/components/com_jshopping/payments/pm_yandex_money/lang/en-GB.php
deleted file mode 100644
index e011a4c..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lang/en-GB.php
+++ /dev/null
@@ -1,230 +0,0 @@
-Yandex.Checkout.");
-define('_JSHOP_YM_VERSION_DESCRIPTION','Module version ');
-
-define('_JSHOP_YM_TAB_MONEY', 'Yandex.Money');
-define('_JSHOP_YM_TAB_KASSA', 'Yandex.Checkout');
-define('_JSHOP_YM_TAB_PAYMENTS', 'Billing');
-
-define('_JSHOP_YM_KASSA_ON', 'Enable payment acceptance via Yandex.Checkout');
-define('_JSHOP_YM_KASSA_HELP_CHECKURL', 'Only required if Yandex.Checkout\'s specialists ask for it');
-
-define('_JSHOP_YM_KASSA_HEAD_LK', 'Parameters from Yandex.Checkout\'s Merchant Profile');
-define('_JSHOP_YM_KASSA_SHOP_ID_LABEL', 'shopId');
-define('_JSHOP_YM_KASSA_SHOP_ID_DESCRIPTION', 'Copy your shopId from your Yandex.Checkout\'s Merchant Profile');
-define('_JSHOP_YM_KASSA_PASSWORD_LABEL', 'Secret key');
-define('_JSHOP_YM_KASSA_PASSWORD_DESCRIPTION', 'Issue and activate a secret key under your Yandex.Checkout\'s Merchant Profile. Then copy it here.');
-
-define('_JSHOP_YM_KASSA_PAYMODE_HEAD', 'Check the preferable scenario of selecting the payment method');
-define('_JSHOP_YM_KASSA_PAYMODE_LABEL', 'Select payment method');
-define('_JSHOP_YM_KASSA_SEND_RECEIPT_LABEL', 'Transmit details for receipts to Yandex.Checkout (Federal Law 54-FZ)');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_LABEL', 'Второй чек:');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_STATUS_LABEL', 'Формировать второй чек при переходе заказа в статус');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_INFO', 'Два чека нужно формировать, если покупатель вносит предоплату и потом получает товар или услугу. Первый чек — когда деньги поступают вам на счёт, второй — при отгрузке товаров или выполнении услуг.');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_HELP_BLOCK', 'Если в заказе будут позиции с признаками «Полная предоплата» — второй чек отправится автоматически, когда заказ перейдёт в выбранный статус.');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_HISTORY', 'Отправлен второй чек. Сумма %s рублей.');
-define('_JSHOP_YM_KASSA_PAYMODE_KASSA', 'On Yandex.Checkout\'s site');
-define('_JSHOP_YM_KASSA_PAYMODE_SHOP', 'On the store\'s site');
-define('_JSHOP_YM_KASSA_PAYMODE_LINK', 'More about payment scenarios');
-define('_JSHOP_YM_KASSA_SELECT_TEXT', 'Check payment methods from the contract');
-define('_JSHOP_YM_KASSA_CREDENTIALS_ERROR', 'Such secret key does not exist. If you are sure you copied the key correctly, this means it does not work for some reason. Issue and activate the key again under your Merchant Profile');
-define('_JSHOP_YM_KASSA_TEST_WARNING', 'You have enabled the test mode. Check the payment making process. Learn more');
-define('_JSHOP_YM_DESCRIPTION_TITLE', 'Transaction data');
-define('_JSHOP_YM_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Payment for order No. %order_id%');
-define('_JSHOP_YM_ENABLE_HOLD_MODE', 'Enable payment holding');
-define('_JSHOP_YM_ENABLE_HOLD_MODE_HELP', 'If the option is enabled, payments are processed in two steps: first, the required amount is blocked on the customer’s card, and then you need to manually capture it via the administrator’s dashboard. Learn more at.');
-define('_JSHOP_YM_HOLD_MODE_STATUSES', 'What status should be assigned to an order if it is:');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS', 'waiting for capture');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS_HELP', 'the order status will be changed to this one after the funds are credited, until the store\'s operator either captures or cancels the payment');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS', 'canceled');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS_HELP', 'the order status will be changed to this one after the payment is canceled');
-define('_JSHOP_YM_HOLD_MODE_COMMENT_ON_HOLD', 'New payment received. Capture until %1$s, after that date it will be automatically canceled');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'You\'ve captured a payment in Yandex.Checkout. ');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Payment wasn\'t captured. Please try again.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'You\'ve canceled a payment in Yandex.Checkout. Money will be returned to the user.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Payment wasn\'t canceled. Please try again.');
-define('_JSHOP_YM_DESCRIPTION_HELP', 'Full description of the transaction that the user will see during the checkout process. You can find it in your Yandex.Checkout Merchant Profile. For example, "Payment for order No. 72 by user@yandex.ru". Limitations: no more than 128 symbols.');
-define('_JSHOP_YM_METHOD_YANDEX_MONEY_DESCRIPTION', 'Yandex.Money');
-define('_JSHOP_YM_METHOD_CARDS_DESCRIPTION', 'Bank cards');
-define('_JSHOP_YM_METHOD_BANK_CARD_DESCRIPTION', 'Bank cards');
-define('_JSHOP_YM_METHOD_CASH_DESCRIPTION', 'Cash via payment kiosks');
-define('_JSHOP_YM_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Direct carrier billing');
-define('_JSHOP_YM_METHOD_WEBMONEY_DESCRIPTION', 'Webmoney');
-define('_JSHOP_YM_METHOD_ALFABANK_DESCRIPTION', 'Alfa-Click');
-define('_JSHOP_YM_METHOD_SBERBANK_DESCRIPTION', 'Sberbank Online');
-define('_JSHOP_YM_METHOD_MA_DESCRIPTION', 'MasterPass');
-define('_JSHOP_YM_METHOD_PB_DESCRIPTION', 'Promsvyazbank');
-define('_JSHOP_YM_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
-define('_JSHOP_YM_METHOD_TINKOFF_BANK_DESCRIPTION', 'Tinkoff online banking');
-define('_JSHOP_YM_METHOD_MP_DESCRIPTION', 'Mobile payment kiosk');
-define('_JSHOP_YM_METHOD_WIDGET_DESCRIPTION', 'Payment widget from Yandex.Checkout (cards, Apple Pay and Google Play)');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_DESCRIPTION', 'Installments');
-
-define('_JSHOP_YM_METHOD_YANDEX_MONEY_DESCRIPTION_PUBLIC', 'Yandex.Money');
-define('_JSHOP_YM_METHOD_CARDS_DESCRIPTION_PUBLIC', 'Bank cards');
-define('_JSHOP_YM_METHOD_BANK_CARD_DESCRIPTION_PUBLIC', 'Bank cards');
-define('_JSHOP_YM_METHOD_CASH_DESCRIPTION_PUBLIC', 'Cash via payment kiosks');
-define('_JSHOP_YM_METHOD_MOBILE_BALANCE_DESCRIPTION_PUBLIC', 'Direct carrier billing');
-define('_JSHOP_YM_METHOD_WEBMONEY_DESCRIPTION_PUBLIC', 'Webmoney');
-define('_JSHOP_YM_METHOD_ALFABANK_DESCRIPTION_PUBLIC', 'Alfa-Click');
-define('_JSHOP_YM_METHOD_SBERBANK_DESCRIPTION_PUBLIC', 'Sberbank Online');
-define('_JSHOP_YM_METHOD_MA_DESCRIPTION_PUBLIC', 'MasterPass');
-define('_JSHOP_YM_METHOD_PB_DESCRIPTION_PUBLIC', 'Promsvyazbank');
-define('_JSHOP_YM_METHOD_QIWI_DESCRIPTION_PUBLIC', 'QIWI Wallet');
-define('_JSHOP_YM_METHOD_TINKOFF_BANK_DESCRIPTION_PUBLIC', 'Tinkoff online banking');
-define('_JSHOP_YM_METHOD_MP_DESCRIPTION_PUBLIC', 'Mobile payment kiosk');
-define('_JSHOP_YM_METHOD_WIDGET_DESCRIPTION_PUBLIC', 'Bank cards, Apple Pay, Google Play');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_DESCRIPTION_PUBLIC', 'Installments');
-
-define('_JSHOP_YM_INSTALL_VERIFY_APPLE_PAY_FILE_WARNING', 'Чтобы покупатели могли заплатить вам через Apple Pay, скачайте файл apple-developer-merchantid-domain-association и добавьте его в папку ./well-known на вашем сайте. Если не знаете, как это сделать, обратитесь к администратору сайта или в поддержку хостинга. Не забудьте также подключить оплату через Apple Pay в личном кабинете Кассы. Почитать о подключении Apple Pay в документации Кассы');
-
-define('_JSHOP_YM_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ per month)');
-
-define('_JSHOP_YM_KASSA_MPOS_LABEL', 'Success page for the Payment by Card on Delivery method');
-define('_JSHOP_YM_KASSA_MPOS_HELP', 'This page contains delivery information. Specify the terms of the delivery and the payment here');
-
-
-define('_JSHOP_YM_MONEY_HEAD', 'To start operating the module, connect your store to Yandex.Money.');
-define('_JSHOP_YM_MONEY_ON', 'Enable payment acceptance to the Yandex.Money Wallet');
-define('_JSHOP_YM_MONEY_REDIRECT_HELP', "Copy this link to the Redirect URL field at the notifications settings page.");
-
-define('_JSHOP_YM_MONEY_SET_HEAD', 'Payment acceptance settings');
-define('_JSHOP_YM_MONEY_WALLET', 'Wallet number');
-define('_JSHOP_YM_MONEY_PSW', 'Codeword');
-
-define('_JSHOP_YM_MONEY_SELECT_HEAD', 'Check the preferable scenario of selecting the payment method');
-define('_JSHOP_YM_MONEY_SELECT_LABEL', 'Select payment method');
-define('_JSHOP_YM_METHOD_YM2_DESCRIPTION_PUBLIC', 'Yandex.Money');
-define('_JSHOP_YM_METHOD_CARDS2_DESCRIPTION_PUBLIC', 'Bank cards');
-
-define('_JSHOP_YM_COMMON_HEAD', 'Additional settings for administrator');
-define('_JSHOP_YM_COMMON_STATUS', 'Order status after the payment');
-
-define('_JSHOP_YM_PAYMENTS_HEAD', 'This is a payment form for your website. It allows accepting payments to the company\'s account from
-cards and Yandex.Money wallets, without a contract.
-Setting up requires the form\'s ID: it will be indicated in the email once you
-build the form in the constructor.');
-
-define('_JSHOP_YM_PAYMENTS_ON', 'Activate payments via Billing');
-define('_JSHOP_YM_PAYMENTS_ID_LABEL', 'Form ID');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_LABEL', 'Payment purpose');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_PLACEHOLDER', 'Order No. %order_id% Payment via Billing');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_INFO', 'Payment purpose is added to the payment order: specify whatever will help identify the order paid via Billing');
-define('_JSHOP_YM_PAYMENTS_STATUS_LABEL', 'Order status');
-define('_JSHOP_YM_PAYMENTS_STATUS_INFO', 'The status should indicate that the result of the payment is unknown: you can only find out if the customer paid or not by checking the notification sent to your email or by contacting your bank.');
-define('_JSHOP_YM_PAYMENTS_FIO_LABEL', 'Payer\'s full name');
-define('_JSHOP_YM_PAYMENTS_CONFIRM_LABEL', 'Next');
-define('_JSHOP_YM_PAYMENTS_EMPTY_NAME_ERROR', 'Payer\'s full name is empty');
-define('_JSHOP_YM_PAYMENTS_INVALID_NAME_ERROR', 'The payer\'s name should consist of the first, middle, and last name, separated by spaces');
-
-// версия 2.х
-define('_JSHOP_YM_LICENSE','License agreement:');
-define('_JSHOP_YM_LICENSE_TEXT2',"
By using this program in any way, you fully and unconditionally accept the terms of the license agreement as posted at https://money.yandex.ru/doc.xml?id=527132 (hereinafter referred to \"license agreement\"). If you do not accept any part of the terms of the license agreement, you are forbidden to use the program for any purpose.
");
-define('_JSHOP_YM_TESTMODE_DESCRIPTION', 'Enable test mode');
-define('_JSHOP_YM_MODE_DESCRIPTION', 'Payment acceptance settings');
-define('_JSHOP_YM_MODE1_DESCRIPTION', 'Yandex.Money');
-define('_JSHOP_YM_MODE2_DESCRIPTION', 'Yandex.Checkout (On the store\'s site)');
-define('_JSHOP_YM_MODE3_DESCRIPTION', 'Yandex.Checkout (On Yandex.Checkout\'s site)');
-define('_JSHOP_YM_MODE4_DESCRIPTION', 'Billing (bank cards, e-money)');
-define('_JSHOP_YM_REG_IND', 'If you don\'t have a Yandex.Money account, register here - https://money.yandex.ru/ IMPORTANT! Copy this link to the Redirect URL field at the notifications settings page.');
-
-define('_JSHOP_YM_REG_ORG', "To start operating the module, connect your store to Yandex.Checkout. Shop ID, scid, ShopPassword can be found in the Merchant Profile after the onboarding process.");
-define('_JSHOP_YM_METHODS_DESCRIPTION', 'Select payment method');
-define('_JSHOP_YM_PASSWORD', 'Specify shopPassword:');
-define('_JSHOP_YM_SHOPID', 'Specify shopId:');
-define('_JSHOP_YM_SCID', 'Specify scid:');
-define('_JSHOP_YM_PARAM', 'Parameter name');
-define('_JSHOP_YM_VALUE', 'Value');
-define('_JSHOP_YM_RETURNURL', 'Dynamic');
-define('_JSHOP_YM_ACCOUNT_DESCRIPTION', 'Wallet number:');
-
-define('_JSHOP_YM_PAY', 'Pay!');
-define('_JSHOP_YM_TRANSACTION_END', 'Order status after the payment');
-define('_JSHOP_YM_TEXT_MPOS', 'Success page for the Payment by Card on Delivery method');
-
-//updater
-define('_JSHOP_YM_UPDATER_ERROR_RESTORE', 'Unable to restore the data from the backup. ');
-define('_JSHOP_YM_UPDATER_SUCCESS_MESSAGE', 'Module successfully installed ');
-define('_JSHOP_YM_UPDATER_ERROR_REMOVE', 'Unable to delete backup %s.');
-define('_JSHOP_YM_ERROR_BACKUP_NOT_FOUND', 'Unable to delete backup %s.');
-define('_JSHOP_YM_ERROR_REMOVE_BACKUP', 'Unable to delete backup %s.');
-define('_JSHOP_YM_SUCCESS_REMOVE_BECKUP', 'Backup %s successfully deleted');
-define('_JSHOP_YM_SUCCESS_UPDATE_VERSION', 'Module version %s successfully downloaded and installed');
-define('_JSHOP_YM_ERROR_UNPACK_NEW_VERSION', 'Unable to extract archive %s. More about the error in module\'s logs');
-define('_JSHOP_YM_ERROR_CREATE_BACKUP', 'Unable to create a backup copy of the installed module version. More about the error in module\'s logs');
-define('_JSHOP_YM_ERROR_DOWNLOAD_NEW_VERSION', 'Unable to load the archive, please try again. More about the error in module\'s logs');
-define('_JSHOP_YM_FAILED_CREATE_DIRECTORY', 'Unable to create directory ');
-define('_JSHOP_YM_FAILED_DOWNLOAD_UPDATE', 'Unable to load the archive with the update');
-define('_JSHOP_YM_UPDATER_HEADER_TEXT', ' New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
-define('_JSHOP_YM_UPDATER_ABOUT', 'About the module:');
-define('_JSHOP_YM_UPDATER_CURRENT_VERSION', 'Current module version —');
-define('_JSHOP_YM_UPDATER_LAST_VERSION', 'Latest available module version —');
-define('_JSHOP_YM_UPDATER_LAST_CHECK', 'Date of the last check for updates —');
-define('_JSHOP_YM_UPDATER_CHECK', 'Check for updates');
-define('_JSHOP_YM_HISTORY_LABEL', 'Changelog:');
-define('_JSHOP_YM_UPDATE_LABEL', 'Update module');
-define('_JSHOP_YM_INSTALL_MESSAGE', 'You have the latest module version installed.');
-define('_JSHOP_YM_BACKUPS_LABEL', 'Backups');
-define('_JSHOP_YM_MODULE_VERSION_LABEL', 'Module version');
-define('_JSHOP_YM_BACKUP_DATE_CREATE', 'Creation date');
-define('_JSHOP_YM_BACKUP_FILE_NAME', 'File name');
-define('_JSHOP_YM_BACKUP_FILE_SIZE', 'File size');
-define('_JSHOP_YM_UPDATER_RESTORE', 'Restore');
-define('_JSHOP_YM_UPDATER_DELETE', 'Remove');
-define('_JSHOP_YM_UPDATER_APPROVE_ACTION_MESSAGE', 'Do you really want to update module?');
-define('_JSHOP_YM_UPDATER_APPROVE_DELETE_MESSAGE', 'Do you really want to delete the backup copy of this module version ');
-define('_JSHOP_YM_UPDATER_APPROVE_RESTORE_MESSAGE', 'Do you really want to restore the module from the backup copy of this version');
-define('_JSHOP_YM_UPDATER_TEXT_HEADER', 'Module updates');
-define('_JSHOP_YM_UPDATER_ABOUT_TEXT', 'New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
-define('_JSHOP_YM_UPDATER_DISABLED_TEXT', 'Unfortunately, the module update option is unavailable');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP_CURL', 'because the "zip" and "curl" extensions are not installed.');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP', 'because the "zip" extension is not installed.');
-define('_JSHOP_YM_UPDATER_CAUSE_CURL', 'because the "curl" extension is not installed.');
-
-
-
-define('_JSHOP_YM_WAITING_FOR_CAPTURE', 'Waiting for capture');
-define('_JSHOP_YM_CAPTURE_FAILED', 'Capture failed');
-define('_JSHOP_YM_PAYMENT_CAPTURED', 'Payment captured');
-define('_JSHOP_YM_PAYMENT_CAPTURED_TEXT', 'Payment %s captured');
-define('_JSHOP_YM_ERROR_MESSAGE_CREATE_PAYMENT', 'Unable to create the payment, choose another payment method.');
-define('_JSHOP_YM_ALFA_CLICK_TEXT', 'Specify the login, and we\'ll send the bill in Alfa-Click. All you have do after that is confirm the payment online at the bank\'s website.');
-define('_JSHOP_YM_QIWI_PHONE_TEXT', 'Phone number linked to QIWI Wallet');
-define('_JSHOP_YM_FILL_PHONE_MESSAGE', 'Specify phone number');
-define('_JSHOP_YM_FILL_ALFA_CLICK_LOGIN', 'Specify the login for Alfa-Click');
-define('_JSHOP_YM_ENABLE', 'Enable');
-define('_JSHOP_YM_DISABLE', 'Disable');
-define('_JSHOP_YM_DEFAULT_TAX_LABEL', 'Default rate');
-define('_JSHOP_YM_DEFAULT_TAX_DESCRIPTION', 'The default rate applies if another rate is not set on the product\'s page.');
-define('_JSHOP_YM_TAX_RATES_LABEL', 'Compare rates');
-define('_JSHOP_YM_TAX_IN_MODULE', 'Rate at your store');
-define('_JSHOP_YM_TAX_FOR_CHECKOUT', 'Rate for the receipt to the tax service');
-define('_JSHOP_YM_WITHOUT_VAT', 'Without VAT');
-define('_JSHOP_YM_VAT_0', '0%');
-define('_JSHOP_YM_VAT_10', '10%');
-define('_JSHOP_YM_VAT_18', '18%');
-define('_JSHOP_YM_VAT_20', '20%');
-define('_JSHOP_YM_VAT_10_100', 'Applicable rate 10/110');
-define('_JSHOP_YM_VAT_18_118', 'Applicable rate 18/118');
-define('_JSHOP_YM_VAT_20_120', 'Applicable rate 20/120');
-define('_JSHOP_YM_NOTIFICATION_URL_LABEL', 'Address for notifications');
-define('_JSHOP_YM_NOTIFICATION_URL_HELP_TEXT', 'Only required if Yandex.Checkout\'s specialists ask for it');
-define('_JSHOP_YM_LOG_VIEW_LABEL', 'View logs');
-define('_JSHOP_YM_CLEAR_LOGS', 'Clear logs');
-define('_JSHOP_YM_CLOSE', 'Close');
-define('_JSHOP_YM_LOGS_LABEL', 'Logs');
-
-define('_JSHOP_YM_TAB_UPDATE', 'Module update');
-
-define('_JSHOP_YM_BTN_BACK', 'Back');
-
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lang/ru-RU.php b/src/components/com_jshopping/payments/pm_yandex_money/lang/ru-RU.php
deleted file mode 100644
index 3608038..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lang/ru-RU.php
+++ /dev/null
@@ -1,245 +0,0 @@
-Яндекс.Кассе.");
-define('_JSHOP_YM_VERSION_DESCRIPTION','Версия модуля ');
-
-define('_JSHOP_YM_TAB_MONEY', 'Яндекс.Деньги');
-define('_JSHOP_YM_TAB_KASSA', 'Яндекс.Касса');
-define('_JSHOP_YM_TAB_PAYMENTS', 'Платежка');
-
-define('_JSHOP_YM_KASSA_ON', 'Включить приём платежей через Яндекс.Кассу');
-define('_JSHOP_YM_KASSA_TEST', 'Тестовый режим');
-define('_JSHOP_YM_KASSA_WORK', 'Реальный режим');
-define('_JSHOP_YM_KASSA_HELP_CHECKURL', 'Этот адрес понадобится, только если его попросят специалисты Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_HELP_SUCCESSURL', 'Включите «Использовать страницы успеха и ошибки с динамическими адресами» в настройках личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_HELP_DYNAMICURL', 'Страницы с динамическими адресами');
-
-define('_JSHOP_YM_KASSA_HEAD_LK', 'Параметры из личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_SHOP_ID_LABEL', 'shopId');
-define('_JSHOP_YM_KASSA_SHOP_ID_DESCRIPTION', 'Скопируйте shopId из личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_PASSWORD_LABEL', 'Секретный ключ');
-define('_JSHOP_YM_KASSA_PASSWORD_DESCRIPTION', 'Выпустите и активируйте секретный ключ в личном кабинете Яндекс.Кассы. Потом скопируйте его сюда.');
-define('_JSHOP_YM_KASSA_PARAMS', 'Shop ID, scid, ShopPassword можно посмотреть в личном кабинете после подключения Яндекс.Кассы.');
-
-define('_JSHOP_YM_KASSA_PAYMODE_HEAD', 'Настройка сценария оплаты');
-define('_JSHOP_YM_KASSA_PAYMODE_LABEL', 'Выбор способа оплаты');
-define('_JSHOP_YM_KASSA_SEND_RECEIPT_LABEL', 'Отправлять в Яндекс.Кассу данные для чеков (54-ФЗ)');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_LABEL', 'Второй чек:');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_STATUS_LABEL', 'Формировать второй чек при переходе заказа в статус');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_INFO', 'Два чека нужно формировать, если покупатель вносит предоплату и потом получает товар или услугу. Первый чек — когда деньги поступают вам на счёт, второй — при отгрузке товаров или выполнении услуг.');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_HELP_BLOCK', 'Если в заказе будут позиции с признаками «Полная предоплата» — второй чек отправится автоматически, когда заказ перейдёт в выбранный статус.');
-define('_JSHOP_YM_KASSA_SEND_SECOND_RECEIPT_HISTORY', 'Отправлен второй чек. Сумма %s рублей.');
-define('_JSHOP_YM_DESCRIPTION_TITLE', 'Описание платежа');
-define('_JSHOP_YM_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Оплата заказа №%order_id%');
-define('_JSHOP_YM_DESCRIPTION_HELP', 'Это описание транзакции, которое пользователь увидит при оплате, а вы — в личном кабинете Яндекс.Кассы. Например, «Оплата заказа №72».
-Чтобы в описание подставлялся номер заказа (как в примере), поставьте на его месте %order_id% (Оплата заказа №%order_id%).
-Ограничение для описания — 128 символов.');
-define('_JSHOP_YM_ENABLE_HOLD_MODE', 'Включить отложенную оплату');
-define('_JSHOP_YM_ENABLE_HOLD_MODE_HELP', 'Если опция включена, платежи с карт проходят в 2 этапа: у клиента сумма замораживается, и вам вручную нужно подтвердить её списание – через панель администратора. Подробное описание Холдирования.');
-define('_JSHOP_YM_HOLD_MODE_STATUSES', 'Какой статус присваивать заказу, если он:');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS', 'ожидает подтверждения');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS_HELP', 'заказ переходит в этот статус при поступлении и остается в нем пока оператор магазина не подтвердит или не отменит платеж');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS', 'отменён');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS_HELP', 'заказ переходит в этот статус после отмены платежа');
-define('_JSHOP_YM_HOLD_MODE_COMMENT_ON_HOLD', 'Поступил новый платёж. Он ожидает подтверждения до %1$s, после чего автоматически отменится');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'Вы подтвердили платёж в Яндекс.Кассе.');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Платёж не подтвердился. Попробуйте ещё раз.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'Вы отменили платёж в Яндекс.Кассе. Деньги вернутся клиенту.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Платёж не отменился. Попробуйте ещё раз.');
-define('_JSHOP_YM_KASSA_PAYMODE_KASSA', 'На стороне Кассы');
-define('_JSHOP_YM_KASSA_PAYMODE_SHOP', 'На стороне магазина');
-define('_JSHOP_YM_KASSA_PAYMODE_LINK', 'Подробнее о сценариях оплаты');
-define('_JSHOP_YM_KASSA_SELECT_TEXT', 'Отметьте способы оплаты, которые указаны в вашем договоре с Яндекс.Деньгами');
-define('_JSHOP_YM_KASSA_CREDENTIALS_ERROR', 'Проверьте shopId и Секретный ключ — где-то есть ошибка. А лучше скопируйте их прямо из личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_TEST_WARNING', 'Вы включили тестовый режим приема платежей. Проверьте, как проходит оплата, и напишите менеджеру Кассы. Он выдаст рабочие shopId и Секретный ключ. Инструкция');
-
-define('_JSHOP_YM_METHOD_YANDEX_MONEY_DESCRIPTION', 'Яндекс.Деньги');
-define('_JSHOP_YM_METHOD_CARDS_DESCRIPTION', 'Банковские карты');
-define('_JSHOP_YM_METHOD_BANK_CARD_DESCRIPTION', 'Банковские карты');
-define('_JSHOP_YM_METHOD_CASH_DESCRIPTION', 'Наличные через терминалы');
-define('_JSHOP_YM_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Баланс мобильного');
-define('_JSHOP_YM_METHOD_WEBMONEY_DESCRIPTION', 'Кошелек WebMoney');
-define('_JSHOP_YM_METHOD_ALFABANK_DESCRIPTION', 'Альфа-Клик');
-define('_JSHOP_YM_METHOD_SBERBANK_DESCRIPTION', 'Сбербанк Онлайн');
-define('_JSHOP_YM_METHOD_TINKOFF_BANK_DESCRIPTION', 'Интернет-банк Тинькофф');
-define('_JSHOP_YM_METHOD_MA_DESCRIPTION', 'MasterPass');
-define('_JSHOP_YM_METHOD_PB_DESCRIPTION', 'Интернет-банк Промсвязьбанка');
-define('_JSHOP_YM_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
-define('_JSHOP_YM_METHOD_QP_DESCRIPTION', 'Доверительный платеж (Куппи.ру)');
-define('_JSHOP_YM_METHOD_MP_DESCRIPTION', 'Мобильный терминал');
-define('_JSHOP_YM_METHOD_WIDGET_DESCRIPTION', 'Платёжный виджет Кассы (карты, Apple Pay и Google Pay)');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_DESCRIPTION', 'Заплатить по частям');
-
-
-define('_JSHOP_YM_INSTALL_VERIFY_APPLE_PAY_FILE_WARNING', 'Чтобы покупатели могли заплатить вам через Apple Pay, скачайте файл apple-developer-merchantid-domain-association и добавьте его в папку ./well-known на вашем сайте. Если не знаете, как это сделать, обратитесь к администратору сайта или в поддержку хостинга. Не забудьте также подключить оплату через Apple Pay в личном кабинете Кассы. Почитать о подключении Apple Pay в документации Кассы');
-
-define('_JSHOP_YM_METHOD_YANDEX_MONEY_DESCRIPTION_PUBLIC', 'Яндекс.Деньги');
-define('_JSHOP_YM_METHOD_CARDS_DESCRIPTION_PUBLIC', 'Банковские карты');
-define('_JSHOP_YM_METHOD_BANK_CARD_DESCRIPTION_PUBLIC', 'Банковские карты');
-define('_JSHOP_YM_METHOD_CASH_DESCRIPTION_PUBLIC', 'Наличные через терминалы');
-define('_JSHOP_YM_METHOD_MOBILE_BALANCE_DESCRIPTION_PUBLIC', 'Баланс мобильного');
-define('_JSHOP_YM_METHOD_WEBMONEY_DESCRIPTION_PUBLIC', 'Кошелек WebMoney');
-define('_JSHOP_YM_METHOD_ALFABANK_DESCRIPTION_PUBLIC', 'Альфа-Клик');
-define('_JSHOP_YM_METHOD_SBERBANK_DESCRIPTION_PUBLIC', 'Сбербанк Онлайн');
-define('_JSHOP_YM_METHOD_TINKOFF_BANK_DESCRIPTION_PUBLIC', 'Интернет-банк Тинькофф');
-define('_JSHOP_YM_METHOD_MA_DESCRIPTION_PUBLIC', 'MasterPass');
-define('_JSHOP_YM_METHOD_PB_DESCRIPTION_PUBLIC', 'Интернет-банк Промсвязьбанка');
-define('_JSHOP_YM_METHOD_QIWI_DESCRIPTION_PUBLIC', 'QIWI Wallet');
-define('_JSHOP_YM_METHOD_QP_DESCRIPTION_PUBLIC', 'Доверительный платеж (Куппи.ру)');
-define('_JSHOP_YM_METHOD_MP_DESCRIPTION_PUBLIC', 'Мобильный терминал');
-define('_JSHOP_YM_METHOD_WIDGET_DESCRIPTION_PUBLIC', 'Банковские карты, Apple Pay, Google Pay');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_DESCRIPTION_PUBLIC', 'Заплатить по частям');
-
-define('_JSHOP_YM_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ в месяц)');
-define('_JSHOP_YM_KASSA_MPOS_LABEL', 'Страница успеха для способа «Оплата картой при доставке»');
-define('_JSHOP_YM_KASSA_MPOS_HELP', 'Это страница с информацией о доставке. Укажите на ней, когда привезут товар и как его можно будет оплатить');
-
-define('_JSHOP_YM_MONEY_HEAD', 'Для работы с модулем нужно открыть кошелек на Яндексе и
- зарегистрировать приложение на сайте Яндекс.Денег');
-define('_JSHOP_YM_MONEY_ON', 'Включить прием платежей в кошелек на Яндексе');
-define('_JSHOP_YM_MONEY_REDIRECT_HELP', 'Скопируйте эту ссылку в поле Redirect URL на странице регистрации приложения.');
-
-define('_JSHOP_YM_MONEY_SET_HEAD', 'Настройки приема платежей');
-define('_JSHOP_YM_MONEY_WALLET', 'Номер кошелька');
-define('_JSHOP_YM_MONEY_PSW', 'Секретное слово');
-
-define('_JSHOP_YM_MONEY_SELECT_HEAD', 'Настройка сценария оплаты');
-define('_JSHOP_YM_MONEY_SELECT_LABEL', 'Способы оплаты');
-define('_JSHOP_YM_METHOD_YM2_DESCRIPTION', 'Кошелек Яндекс.Деньги');
-define('_JSHOP_YM_METHOD_CARDS2_DESCRIPTION', 'Банковская карта');
-
-define('_JSHOP_YM_METHOD_YM2_DESCRIPTION_PUBLIC', 'Кошелек Яндекс.Деньги');
-define('_JSHOP_YM_METHOD_CARDS2_DESCRIPTION_PUBLIC', 'Банковская карта');
-
-define('_JSHOP_YM_COMMON_HEAD', 'Дополнительные настройки для администратора');
-define('_JSHOP_YM_COMMON_STATUS', 'Статус заказа после оплаты');
-
-define('_JSHOP_YM_PAYMENTS_HEAD', 'Это платежная форма на ваш сайт. Позволяет принимать платежи на счет компании — с
-карт и из кошельков Яндекс.Денег, без договора.
-Для настройки нужен ID формы: он придет в письме, когда вы
-соберете форму в конструкторе.');
-
-define('_JSHOP_YM_PAYMENTS_ON', 'Включить прием платежей через Платежку');
-define('_JSHOP_YM_PAYMENTS_ID_LABEL', 'ID формы');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_LABEL', 'Назначение платежа');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_PLACEHOLDER', 'Номер заказа %order_id%. Оплата через Платежку');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_INFO', 'Назначение будет в платежном поручении от банка. Напишите в нем всё,
-что поможет отличить заказ, который оплатили через Платежку.');
-define('_JSHOP_YM_PAYMENTS_STATUS_LABEL', 'Статус заказа');
-define('_JSHOP_YM_PAYMENTS_STATUS_INFO', 'Статус должен показать, что результат платежа неизвестен: о том, что клиент
-заплатил, можно узнать только из письма от Платежки или в своем банке.');
-define('_JSHOP_YM_PAYMENTS_FIO_LABEL', 'ФИО плательщика');
-define('_JSHOP_YM_PAYMENTS_CONFIRM_LABEL', 'Далее');
-define('_JSHOP_YM_PAYMENTS_EMPTY_NAME_ERROR', 'Укажите ФИО плательщика');
-define('_JSHOP_YM_PAYMENTS_INVALID_NAME_ERROR', 'ФИО плательщика должно состоять из фамилии, имени и отчества, разделённых пробелами');
-
-// версия 2.х
-define('_JSHOP_YM_LICENSE','Лицензионный договор:');
-define('_JSHOP_YM_LICENSE_TEXT2',"
Любое использование Вами программы означает полное и безоговорочное принятие Вами условий лицензионного договора, размещенного по адресу https://money.yandex.ru/doc.xml?id=527132 (далее – «Лицензионный договор»). Если Вы не принимаете условия Лицензионного договора в полном объёме, Вы не имеете права использовать программу в каких-либо целях.
");
-define('_JSHOP_YM_TESTMODE_DESCRIPTION', 'Использовать в тестовом режиме?');
-define('_JSHOP_YM_MODE_DESCRIPTION', 'Способ приема платежей:');
-define('_JSHOP_YM_MODE1_DESCRIPTION', 'Яндекс.Денеги');
-define('_JSHOP_YM_MODE2_DESCRIPTION', 'Яндекс.Касса (выбор оплаты на стороне сайта)');
-define('_JSHOP_YM_MODE3_DESCRIPTION', 'Яндекс.Касса (выбор оплаты на стороне Яндекс.Кассы)');
-define('_JSHOP_YM_MODE4_DESCRIPTION', 'Платежка (банковские карты, кошелек)');
-define('_JSHOP_YM_REG_IND', 'Если у вас нет аккаунта в Яндекс-Деньги, то следует зарегистрироваться тут - https://money.yandex.ru/ ВАЖНО! Вам нужно будет указать ссылку для приема HTTP уведомлений здесь - https://sp-money.yandex.ru/myservices/online.xml');
-
-define('_JSHOP_YM_REG_ORG', 'Для работы с модулем необходимо подключить магазин к Яндек.Кассе. После подключения вы получите параметры для приема платежей (идентификатор магазина — shopId и номер витрины — scid).');
-define('_JSHOP_YM_METHODS_DESCRIPTION', 'Укажите необходимые способы оплаты');
-define('_JSHOP_YM_PASSWORD', 'Секретное слово (shopPassword) для обмена сообщениями:');
-define('_JSHOP_YM_SHOPID', 'Идентификатор вашего магазина в Яндекс.Деньгах (ShopID):');
-define('_JSHOP_YM_SCID', 'Идентификатор витрины вашего магазина в Яндекс.Деньгах (scid):');
-define('_JSHOP_YM_PARAM', 'Название параметра');
-define('_JSHOP_YM_VALUE', 'Значение');
-define('_JSHOP_YM_RETURNURL', 'Динамический');
-define('_JSHOP_YM_ACCOUNT_DESCRIPTION', 'Номер кошелька Яндекс:');
-
-define('_JSHOP_YM_PAY', 'Оплатить!');
-define('_JSHOP_YM_TRANSACTION_END', 'Статус заказа для успешных транзакций');
-define('_JSHOP_YM_TEXT_MPOS', 'Страница с инструкцией для платеждей через мобильный терминал!');
-
-//updater
-define('_JSHOP_YM_UPDATER_ERROR_RESTORE', 'Не удалось восстановить модуль из резервной копии: ');
-define('_JSHOP_YM_UPDATER_SUCCESS_MESSAGE', 'Модуль был успешно восстановлен из резервной копии: ');
-define('_JSHOP_YM_UPDATER_ERROR_REMOVE', 'Не был передан удаляемый файл резервной копии');
-define('_JSHOP_YM_ERROR_BACKUP_NOT_FOUND', 'Файл резервной копии %s не найден');
-define('_JSHOP_YM_ERROR_REMOVE_BACKUP', 'Не удалось удалить файл резервной копии ');
-define('_JSHOP_YM_SUCCESS_REMOVE_BECKUP', 'Файл резервной копии %s был успешно удалён');
-define('_JSHOP_YM_SUCCESS_UPDATE_VERSION', 'Версия модуля %s (%s) была успешно загружена и установлена');
-define('_JSHOP_YM_ERROR_UNPACK_NEW_VERSION', 'Не удалось распаковать загруженный архив %s, подробную информацию о произошедшей ошибке можно найти в логах модуля');
-define('_JSHOP_YM_ERROR_CREATE_BACKUP', 'Не удалось создать резервную копию установленной версии модуля, подробную информацию о произошедшей ошибке можно найти в логах модуля');
-define('_JSHOP_YM_ERROR_DOWNLOAD_NEW_VERSION', 'Не удалось загрузить архив с новой версией, подробную информацию о произошедшей ошибке можно найти в логах модуля');
-define('_JSHOP_YM_FAILED_CREATE_DIRECTORY', 'Не удалось создать директорию ');
-define('_JSHOP_YM_FAILED_DOWNLOAD_UPDATE', 'Не удалось загрузить архив с обновлением');
-define('_JSHOP_YM_UPDATER_HEADER_TEXT', ' Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками. Чтобы установить новую версию модуля, нажмите кнопку «Обновить».');
-define('_JSHOP_YM_UPDATER_ABOUT', 'О модуле:');
-define('_JSHOP_YM_UPDATER_CURRENT_VERSION', 'Установленная версия модуля —');
-define('_JSHOP_YM_UPDATER_LAST_VERSION', 'Последняя версия модуля —');
-define('_JSHOP_YM_UPDATER_LAST_CHECK', 'Последняя проверка наличия новых версий —');
-define('_JSHOP_YM_UPDATER_CHECK', 'Проверить наличие обновлений');
-define('_JSHOP_YM_HISTORY_LABEL', 'История изменений:');
-define('_JSHOP_YM_UPDATE_LABEL', 'Обновить');
-define('_JSHOP_YM_INSTALL_MESSAGE', 'Установлена последняя версия модуля.');
-define('_JSHOP_YM_BACKUPS_LABEL', 'Резервные копии');
-define('_JSHOP_YM_MODULE_VERSION_LABEL', 'Версия модуля');
-define('_JSHOP_YM_BACKUP_DATE_CREATE', 'Дата создания');
-define('_JSHOP_YM_BACKUP_FILE_NAME', 'Имя файла');
-define('_JSHOP_YM_BACKUP_FILE_SIZE', 'Размер файла');
-define('_JSHOP_YM_UPDATER_RESTORE', 'Восстановить');
-define('_JSHOP_YM_UPDATER_DELETE', 'Удалить');
-define('_JSHOP_YM_UPDATER_APPROVE_ACTION_MESSAGE', 'Вы действительно хотите обновить модуль до последней версии?');
-define('_JSHOP_YM_UPDATER_APPROVE_DELETE_MESSAGE', 'Вы действительно хотите удалить резервную копию');
-define('_JSHOP_YM_UPDATER_APPROVE_RESTORE_MESSAGE', 'Вы действительно хотите восстановить резервную копию');
-define('_JSHOP_YM_UPDATER_TEXT_HEADER', 'Обновление модуля');
-define('_JSHOP_YM_UPDATER_ABOUT_TEXT', 'Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками.');
-define('_JSHOP_YM_UPDATER_DISABLED_TEXT', ' К сожалению функция обновления модуля недоступна');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP_CURL', 'так как для не установлены расширения "zip" и "curl".');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP', 'так как для не установлено расширение "zip".');
-define('_JSHOP_YM_UPDATER_CAUSE_CURL', 'так как для не установлено расширение "curl".');
-
-
-
-define('_JSHOP_YM_WAITING_FOR_CAPTURE', 'Ожидается проведение оплаты');
-define('_JSHOP_YM_CAPTURE_FAILED', 'Платёж не был проведён');
-define('_JSHOP_YM_PAYMENT_CAPTURED', 'Оплата была проведена');
-define('_JSHOP_YM_PAYMENT_CAPTURED_TEXT', 'Платёж %s проведён');
-define('_JSHOP_YM_ERROR_MESSAGE_CREATE_PAYMENT', 'Не удалось создать платёж, попробуйте выбрать другой способ оплаты.');
-define('_JSHOP_YM_ALFA_CLICK_TEXT', 'Укажите логин, и мы выставим счет в Альфа-Клике. После этого останется подтвердить платеж на сайте интернет-банка.');
-define('_JSHOP_YM_QIWI_PHONE_TEXT', 'Телефон, который привязан к Qiwi Wallet');
-define('_JSHOP_YM_FILL_PHONE_MESSAGE', 'Укажите телефон');
-define('_JSHOP_YM_FILL_ALFA_CLICK_LOGIN', 'Укажите логин в Альфа-клике');
-define('_JSHOP_YM_ENABLE', 'Включить');
-define('_JSHOP_YM_DISABLE', 'Выключить');
-define('_JSHOP_YM_DEFAULT_TAX_LABEL', 'Ставка по умолчанию');
-define('_JSHOP_YM_DEFAULT_TAX_DESCRIPTION', 'Ставка по умолчанию будет в чеке, если в карточке товара не указана другая ставка.');
-define('_JSHOP_YM_TAX_RATES_LABEL', 'Сопоставьте ставки');
-define('_JSHOP_YM_TAX_IN_MODULE', 'Ставка в вашем магазине');
-define('_JSHOP_YM_TAX_FOR_CHECKOUT', 'Ставка для чека в налоговую');
-define('_JSHOP_YM_WITHOUT_VAT', 'Без НДС');
-define('_JSHOP_YM_VAT_0', '0%');
-define('_JSHOP_YM_VAT_10', '10%');
-define('_JSHOP_YM_VAT_18', '18%');
-define('_JSHOP_YM_VAT_20', '20%');
-define('_JSHOP_YM_VAT_10_100', 'Расчётная ставка 10/110');
-define('_JSHOP_YM_VAT_18_118', 'Расчётная ставка 18/118');
-define('_JSHOP_YM_VAT_20_120', 'Расчётная ставка 20/120');
-define('_JSHOP_YM_NOTIFICATION_URL_LABEL', 'Адрес для уведомлений');
-define('_JSHOP_YM_NOTIFICATION_URL_HELP_TEXT', 'Этот адрес понадобится, только если его попросят специалисты Яндекс.Кассы');
-define('_JSHOP_YM_LOG_VIEW_LABEL', 'Просмотр логов модуля');
-define('_JSHOP_YM_CLEAR_LOGS', 'Очистить журнал');
-define('_JSHOP_YM_CLOSE', 'Закрыть');
-define('_JSHOP_YM_LOGS_LABEL', 'Журнал сообщений модуля');
-
-define('_JSHOP_YM_TAB_UPDATE', 'Обновления');
-
-define('_JSHOP_YM_BTN_BACK', 'Назад');
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/joomshopping.map b/src/components/com_jshopping/payments/pm_yandex_money/lib/joomshopping.map
deleted file mode 100644
index 1514d1e..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/joomshopping.map
+++ /dev/null
@@ -1,3 +0,0 @@
-b:src
-d:components/com_jshopping/images/yandex_money
-d:components/com_jshopping/payments/pm_yandex_money
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/YandexMoneyApi.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/YandexMoneyApi.php
deleted file mode 100644
index 22ee0d1..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/YandexMoneyApi.php
+++ /dev/null
@@ -1,39 +0,0 @@
-_setType(PaymentMethodType::ANDROID_PAY);
- }
-
- /**
- * @return string содержимое поля paymentData объекта PKPaymentToken, закодированное в Base64
- */
- public function getPaymentData()
- {
- return $this->_paymentData;
- }
-
- /**
- * @param string $value содержимое поля paymentData объекта PKPaymentToken, закодированное в Base64
- */
- public function setPaymentData($value)
- {
- if ($value === null || $value === '') {
- throw new EmptyPropertyValueException(
- 'Empty value for paymentData', 0, 'PaymentDataAndroidPay.paymentData'
- );
- } elseif (TypeCast::canCastToString($value)) {
- $this->_paymentData = (string)$value;
- } else {
- throw new InvalidPropertyValueTypeException(
- 'Invalid value type for paymentData', 0, 'PaymentDataAndroidPay.paymentData', $value
- );
- }
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodAndroidPay.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodAndroidPay.php
deleted file mode 100644
index a5488d1..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodAndroidPay.php
+++ /dev/null
@@ -1,42 +0,0 @@
-_setType(PaymentMethodType::ANDROID_PAY);
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Status.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Status.php
deleted file mode 100644
index 81452cf..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Status.php
+++ /dev/null
@@ -1,48 +0,0 @@
- true,
- self::PENDING => true,
- self::CANCELED => true,
- );
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequest.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequest.php
deleted file mode 100644
index bf923e9..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequest.php
+++ /dev/null
@@ -1,281 +0,0 @@
-_accountId;
- }
-
- /**
- * Проверяет, был ли установлен идентификатор магазина
- * @return bool True если идентификатор магазина был установлен, false если нет
- */
- public function hasAccountId()
- {
- return $this->_accountId !== null;
- }
-
- /**
- * Устанавливает идентификатор магазина
- * @param string|null $value Значение идентификатора магазина, null если требуется удалить значение
- */
- public function setAccountId($value)
- {
- if ($value === null || $value === '') {
- $this->_accountId = null;
- } elseif (TypeCast::canCastToString($value)) {
- $this->_accountId = (string)$value;
- } else {
- throw new \InvalidArgumentException('Invalid account_id value type "' . gettype($value) . '"');
- }
- }
-
- /**
- * Возвращает идентификатор шлюза
- * @return string Идентификатор шлюза
- */
- public function getGatewayId()
- {
- return $this->_gatewayId;
- }
-
- /**
- * Проверяет, был ли установлен идентификатор шлюза
- * @return bool True если идентификатор шлюза был установлен, false если нет
- */
- public function hasGatewayId()
- {
- return !empty($this->_gatewayId);
- }
-
- /**
- * Устанавливает идентификатор шлюза
- * @param string|null $value Значение идентификатора шлюза, null если требуется удалить значение
- */
- public function setGatewayId($value)
- {
- if ($value === null || $value === '') {
- $this->_gatewayId = null;
- } elseif (TypeCast::canCastToString($value)) {
- $this->_gatewayId = (string)$value;
- } else {
- throw new \InvalidArgumentException('Invalid gateway_id value type "' . gettype($value) . '"');
- }
- }
-
- /**
- * Возвращает сумму заказа
- * @return string Сумма заказа
- */
- public function getAmount()
- {
- return $this->_amount;
- }
-
- /**
- * Проверяет, была ли установлена сумма заказа
- * @return bool True если сумма заказа была установлена, false если нет
- */
- public function hasAmount()
- {
- return !empty($this->_amount);
- }
-
- /**
- * Устанавливает сумму платежа
- * @param string|null $value Сумма платежа, null если требуется удалить значение
- */
- public function setAmount($value)
- {
- if ($value === null || $value === '') {
- $this->_amount = null;
- } else {
- if (!is_scalar($value)) {
- if (!is_object($value) || !method_exists($value, '__toString')) {
- throw new InvalidPropertyValueTypeException(
- 'Invalid amount value type', 0, 'amount.value', $value
- );
- }
- $value = (string)$value;
- }
- if (!is_numeric($value) || $value < 0.0) {
- throw new InvalidPropertyValueException(
- 'Invalid amount value "' . $value . '"', 0, 'amount.value', $value
- );
- } elseif ($value < 0.01) {
- $this->_amount = null;
- } else {
- $this->_amount = number_format($value, 2, '.', '');
- }
- }
- }
-
- /**
- * Возвращает код валюты, в которой осуществляется покупка
- * @return string Код валюты
- */
- public function getCurrency()
- {
- return $this->_currency;
- }
-
- /**
- * Проверяет был ли установлен код валюты
- * @return bool True если код валюты был установлен, false если нет
- */
- public function hasCurrency()
- {
- return !empty($this->_currency);
- }
-
- /**
- * Устанавливает код валюты в которой требуется провести платёж
- * @param string $value Код валюты, null если требуется удалить значение
- */
- public function setCurrency($value)
- {
- if ($value === null || $value === '') {
- $this->_currency = null;
- } elseif (TypeCast::canCastToEnumString($value)) {
- $value = strtoupper($value);
- if (!CurrencyCode::valueExists($value)) {
- throw new \InvalidArgumentException('Invalid currency value: "' . $value . '"');
- }
- $this->_currency = $value;
- } else {
- throw new \InvalidArgumentException('Invalid currency value type: "' . gettype($value) . '"');
- }
- }
-
- /**
- * Возвращает сценарий подтверждения платежа, для которого запрашивается список способов оплаты
- * @return string Сценарий подтверждения платежа
- */
- public function getConfirmationType()
- {
- return $this->_confirmationTypes;
- }
-
- /**
- * Проверяет был ли установлен сценарий подтверждения платежа
- * @return bool True если сценарий подтверждения платежа был установлен, false если нет
- */
- public function hasConfirmationType()
- {
- return !empty($this->_confirmationTypes);
- }
-
- /**
- * Устанавливает сценарий подтверждения платежа, для которого запрашивается список способов оплаты
- * @param string $value Сценарий подтверждения платежа
- */
- public function setConfirmationType($value)
- {
- if ($value === null || $value === '') {
- $this->_confirmationTypes = null;
- } elseif (TypeCast::canCastToEnumString($value)) {
- if (!ConfirmationType::valueExists((string)$value)) {
- throw new \InvalidArgumentException('Invalid confirmation_type value: "' . $value . '"');
- }
- $this->_confirmationTypes = $value;
- } else {
- throw new \InvalidArgumentException('Invalid confirmation_type value type: "' . gettype($value) . '"');
- }
- }
-
- /**
- * Валидирует текущий запрос, проверяет все ли нужные свойства установлены
- * @return bool True если запрос валиден, false если нет
- */
- public function validate()
- {
- if (empty($this->_accountId)) {
- $this->setValidationError('Account id not specified');
- return false;
- }
- return true;
- }
-
- /**
- * Возвращает инстанс билдера объектов запросов списока способов оплаты
- * @return PaymentOptionsRequestBuilder Билдер запросов списока способов оплаты
- */
- public static function builder()
- {
- return new PaymentOptionsRequestBuilder();
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequestBuilder.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequestBuilder.php
deleted file mode 100644
index 384a797..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequestBuilder.php
+++ /dev/null
@@ -1,126 +0,0 @@
-currentObject->setAccountId($value);
- return $this;
- }
-
- /**
- * Устанавливает идентификатор шлюза
- * @param string|null $value Значение идентификатора шлюза, null если требуется удалить значение
- * @return PaymentOptionsRequestBuilder Инстанс текущего билдера запросов
- */
- public function setGatewayId($value)
- {
- $this->currentObject->setGatewayId($value);
- return $this;
- }
-
- /**
- * Устанавливает сумму платежа
- * @param string|AmountInterface|null $value Сумма платежа, null если требуется удалить значение
- * @return PaymentOptionsRequestBuilder Инстанс текущего билдера запросов
- */
- public function setAmount($value)
- {
- if (empty($value)) {
- $this->currentObject->setAmount(null);
- } elseif ($value instanceof AmountInterface) {
- if ($value->getValue() > 0.0) {
- $this->currentObject->setAmount($value->getValue());
- }
- $this->currentObject->setCurrency($value->getCurrency());
- } else {
- $this->currentObject->setAmount($value);
- }
- return $this;
- }
-
- /**
- * Устанавливает код валюты в которой требуется провести платёж
- * @param string $value Код валюты, null если требуется удалить значение
- * @return PaymentOptionsRequestBuilder Инстанс текущего билдера запросов
- */
- public function setCurrency($value)
- {
- $this->currentObject->setCurrency($value);
- return $this;
- }
-
- /**
- * Устанавливает сценарий подтверждения платежа, для которого запрашивается список способов оплаты
- * @param string $value Сценарий подтверждения платежа
- * @return PaymentOptionsRequestBuilder Инстанс текущего билдера запросов
- */
- public function setConfirmationType($value)
- {
- $this->currentObject->setConfirmationType($value);
- return $this;
- }
-
- /**
- * Собирает и возвращает готовый объект запроса получения списка возможных способов оплаты
- * @param array|null $options Массив для устанавливаемых значений
- * @return PaymentOptionsRequestInterface Инстанс объекта запроса
- */
- public function build(array $options = null)
- {
- return parent::build($options);
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequestInterface.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequestInterface.php
deleted file mode 100644
index 60895c5..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsRequestInterface.php
+++ /dev/null
@@ -1,101 +0,0 @@
- $request->getAccountId(),
- );
- if ($request->hasGatewayId()) {
- $result['gateway_id'] = $request->getGatewayId();
- }
- if ($request->hasAmount()) {
- $result['amount'] = $request->getAmount();
- }
- if ($request->hasCurrency()) {
- $result['currency'] = $request->getCurrency();
- }
- if ($request->hasConfirmationType()) {
- $result['confirmation_types'] = $request->getConfirmationType();
- }
- return $result;
- }
-}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsResponse.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsResponse.php
deleted file mode 100644
index 1a6ae98..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsResponse.php
+++ /dev/null
@@ -1,68 +0,0 @@
-_items = array();
- foreach ($response['items'] as $item) {
- $this->_items[] = new PaymentOptionsResponseItem($item);
- }
- }
-
- /**
- * Возаращает список способов оплаты подходящих для оплаты заказа
- * Если нет ни одного доступного способа оплаты, список будет пустым
- * @return PaymentOptionsResponseItem[] Список способов оплаты
- */
- public function getItems()
- {
- return $this->_items;
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsResponseItem.php b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsResponseItem.php
deleted file mode 100644
index 9c82970..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/PaymentOptionsResponseItem.php
+++ /dev/null
@@ -1,142 +0,0 @@
-_paymentMethodType = $options['payment_method_type'];
- $this->_confirmationTypes = array();
- foreach ($options['confirmation_types'] as $opt) {
- $this->_confirmationTypes[] = $opt;
- }
-
- $this->_charge = new MonetaryAmount($options['charge']['value'], $options['charge']['currency']);
- $this->_fee = new MonetaryAmount();
- if (!empty($options['fee'])) {
- $this->_fee->setValue($options['fee']['value']);
- $this->_fee->setCurrency($options['fee']['currency']);
- } else {
- $this->_fee->setCurrency($options['charge']['currency']);
- }
-
- $this->_extraFee = false;
- if (!empty($options['extra_fee'])) {
- $this->_extraFee = (bool)$options['extra_fee'];
- }
- }
-
- /**
- * Возвращает тип источника средств для проведения платежа
- * @return string Тип источника средств для проведения платежа
- * @see PaymentMethodType
- */
- public function getPaymentMethodType()
- {
- return $this->_paymentMethodType;
- }
-
- /**
- * Возвращает список возможных сценариев подтверждения платежа
- * @return string[] Список возможных сценариев подтверждения платежа
- * @see ConfirmationType
- */
- public function getConfirmationTypes()
- {
- return $this->_confirmationTypes;
- }
-
- /**
- * Возвращает сумму платежа
- * @return AmountInterface Сумма платежа
- */
- public function getCharge()
- {
- return $this->_charge;
- }
-
- /**
- * Возвращает сумму дополнительной комиссии при проведении платежа с помощью текущего способа оплаты
- * @return AmountInterface Сумма комиссии
- */
- public function getFee()
- {
- return $this->_fee;
- }
-
- /**
- * Возвращает признак присутствия дополнительной комиссии на стороне партнера
- * @return bool True если комиссия на стороне партнёра имеется, false если нет
- */
- public function getExtraFee()
- {
- return $this->_extraFee;
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/configuration.json b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/configuration.json
deleted file mode 100644
index 76a5a21..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/configuration.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "url" : "https://payment.yandex.net/api/v3"
-}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/installed.json b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/installed.json
deleted file mode 100644
index 2d7a51c..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/installed.json
+++ /dev/null
@@ -1,51 +0,0 @@
-[
- {
- "name": "psr/log",
- "version": "1.0.2",
- "version_normalized": "1.0.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "time": "2016-10-10T12:19:37+00:00",
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "installation-source": "dist",
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "Psr/Log/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ]
- }
-]
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/.gitignore b/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/.gitignore
deleted file mode 100644
index 22d0d82..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-vendor
diff --git a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/en-GB.php b/src/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/en-GB.php
deleted file mode 100644
index 113f1c9..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/en-GB.php
+++ /dev/null
@@ -1,198 +0,0 @@
-Yandex.Checkout.");
-define('_JSHOP_YM_VERSION_DESCRIPTION','Module version ');
-
-define('_JSHOP_YM_TAB_MONEY', 'Yandex.Money');
-define('_JSHOP_YM_TAB_KASSA', 'Yandex.Checkout');
-define('_JSHOP_YM_TAB_PAYMENTS', 'Billing');
-
-define('_JSHOP_YM_KASSA_ON', 'Enable payment acceptance via Yandex.Checkout');
-define('_JSHOP_YM_KASSA_HELP_CHECKURL', 'Only required if Yandex.Checkout\'s specialists ask for it');
-
-define('_JSHOP_YM_KASSA_HEAD_LK', 'Parameters from Yandex.Checkout\'s Merchant Profile');
-define('_JSHOP_YM_KASSA_SHOP_ID_LABEL', 'shopId');
-define('_JSHOP_YM_KASSA_SHOP_ID_DESCRIPTION', 'Copy your shopId from your Yandex.Checkout\'s Merchant Profile');
-define('_JSHOP_YM_KASSA_PASSWORD_LABEL', 'Secret key');
-define('_JSHOP_YM_KASSA_PASSWORD_DESCRIPTION', 'Issue and activate a secret key under your Yandex.Checkout\'s Merchant Profile. Then copy it here.');
-
-define('_JSHOP_YM_KASSA_PAYMODE_HEAD', 'Check the preferable scenario of selecting the payment method');
-define('_JSHOP_YM_KASSA_PAYMODE_LABEL', 'Select payment method');
-define('_JSHOP_YM_KASSA_SEND_RECEIPT_LABEL', 'Transmit details for receipts to Yandex.Checkout (Federal Law 54-FZ)');
-define('_JSHOP_YM_KASSA_PAYMODE_KASSA', 'On Yandex.Checkout\'s site');
-define('_JSHOP_YM_KASSA_PAYMODE_SHOP', 'On the store\'s site');
-define('_JSHOP_YM_KASSA_PAYMODE_LINK', 'More about payment scenarios');
-define('_JSHOP_YM_KASSA_SELECT_TEXT', 'Check payment methods from the contract');
-define('_JSHOP_YM_KASSA_CREDENTIALS_ERROR', 'Such secret key does not exist. If you are sure you copied the key correctly, this means it does not work for some reason. Issue and activate the key again under your Merchant Profile');
-define('_JSHOP_YM_KASSA_TEST_WARNING', 'You have enabled the test mode. Check the payment making process. Learn more');
-define('_JSHOP_YM_DESCRIPTION_TITLE', 'Transaction data');
-define('_JSHOP_YM_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Payment for order No. %order_id%');
-define('_JSHOP_YM_ENABLE_HOLD_MODE', 'Enable payment holding');
-define('_JSHOP_YM_ENABLE_HOLD_MODE_HELP', 'If the option is enabled, payments are processed in two steps: first, the required amount is blocked on the customer’s card, and then you need to manually capture it via the administrator’s dashboard. Learn more at.');
-define('_JSHOP_YM_HOLD_MODE_STATUSES', 'What status should be assigned to an order if it is:');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS', 'waiting for capture');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS_HELP', 'the order status will be changed to this one after the funds are credited, until the store\'s operator either captures or cancels the payment');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS', 'canceled');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS_HELP', 'the order status will be changed to this one after the payment is canceled');
-define('_JSHOP_YM_HOLD_MODE_COMMENT_ON_HOLD', 'New payment received. Capture until %1$s, after that date it will be automatically canceled');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'You\'ve captured a payment in Yandex.Checkout. ');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Payment wasn\'t captured. Please try again.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'You\'ve canceled a payment in Yandex.Checkout. Money will be returned to the user.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Payment wasn\'t canceled. Please try again.');
-define('_JSHOP_YM_DESCRIPTION_HELP', 'Full description of the transaction that the user will see during the checkout process. You can find it in your Yandex.Checkout Merchant Profile. For example, "Payment for order No. 72 by user@yandex.ru". Limitations: no more than 128 symbols.');
-define('_JSHOP_YM_METHOD_YANDEX_MONEY_DESCRIPTION', 'Yandex.Money');
-define('_JSHOP_YM_METHOD_CARDS_DESCRIPTION', 'Bank cards');
-define('_JSHOP_YM_METHOD_BANK_CARD_DESCRIPTION', 'Bank cards');
-define('_JSHOP_YM_METHOD_CASH_DESCRIPTION', 'Cash via payment kiosks');
-define('_JSHOP_YM_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Direct carrier billing');
-define('_JSHOP_YM_METHOD_WEBMONEY_DESCRIPTION', 'Webmoney');
-define('_JSHOP_YM_METHOD_ALFABANK_DESCRIPTION', 'Alfa-Click');
-define('_JSHOP_YM_METHOD_SBERBANK_DESCRIPTION', 'Sberbank Online');
-define('_JSHOP_YM_METHOD_MA_DESCRIPTION', 'MasterPass');
-define('_JSHOP_YM_METHOD_PB_DESCRIPTION', 'Promsvyazbank');
-define('_JSHOP_YM_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
-define('_JSHOP_YM_METHOD_MP_DESCRIPTION', 'Mobile payment kiosk');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_DESCRIPTION', 'Installments');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ per month)');
-
-define('_JSHOP_YM_KASSA_MPOS_LABEL', 'Success page for the Payment by Card on Delivery method');
-define('_JSHOP_YM_KASSA_MPOS_HELP', 'This page contains delivery information. Specify the terms of the delivery and the payment here');
-
-
-define('_JSHOP_YM_MONEY_HEAD', 'To start operating the module, connect your store to Yandex.Money.');
-define('_JSHOP_YM_MONEY_ON', 'Enable payment acceptance to the Yandex.Money Wallet');
-define('_JSHOP_YM_MONEY_REDIRECT_HELP', "Copy this link to the Redirect URL field at the notifications settings page.");
-
-define('_JSHOP_YM_MONEY_SET_HEAD', 'Payment acceptance settings');
-define('_JSHOP_YM_MONEY_WALLET', 'Wallet number');
-define('_JSHOP_YM_MONEY_PSW', 'Codeword');
-
-define('_JSHOP_YM_MONEY_SELECT_HEAD', 'Check the preferable scenario of selecting the payment method');
-define('_JSHOP_YM_MONEY_SELECT_LABEL', 'Select payment method');
-define('_JSHOP_YM_METHOD_YM2_DESCRIPTION', 'Yandex.Money');
-define('_JSHOP_YM_METHOD_CARDS2_DESCRIPTION', 'Bank cards');
-
-define('_JSHOP_YM_COMMON_HEAD', 'Additional settings for administrator');
-define('_JSHOP_YM_COMMON_STATUS', 'Order status after the payment');
-
-define('_JSHOP_YM_PAYMENTS_HEAD', 'This is a payment form for your website. It allows accepting payments to the company\'s account from
-cards and Yandex.Money wallets, without a contract.
-Setting up requires the form\'s ID: it will be indicated in the email once you
-build the form in the constructor.');
-
-define('_JSHOP_YM_PAYMENTS_ON', 'Activate payments via Billing');
-define('_JSHOP_YM_PAYMENTS_ID_LABEL', 'Form ID');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_LABEL', 'Payment purpose');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_PLACEHOLDER', 'Order No. %order_id% Payment via Billing');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_INFO', 'Payment purpose is added to the payment order: specify whatever will help identify the order paid via Billing');
-define('_JSHOP_YM_PAYMENTS_STATUS_LABEL', 'Order status');
-define('_JSHOP_YM_PAYMENTS_STATUS_INFO', 'The status should indicate that the result of the payment is unknown: you can only find out if the customer paid or not by checking the notification sent to your email or by contacting your bank.');
-define('_JSHOP_YM_PAYMENTS_FIO_LABEL', 'Payer\'s full name');
-define('_JSHOP_YM_PAYMENTS_CONFIRM_LABEL', 'Next');
-define('_JSHOP_YM_PAYMENTS_EMPTY_NAME_ERROR', 'Payer\'s full name is empty');
-define('_JSHOP_YM_PAYMENTS_INVALID_NAME_ERROR', 'The payer\'s name should consist of the first, middle, and last name, separated by spaces');
-
-// версия 2.х
-define('_JSHOP_YM_LICENSE','License agreement:');
-define('_JSHOP_YM_LICENSE_TEXT2',"
By using this program in any way, you fully and unconditionally accept the terms of the license agreement as posted at https://money.yandex.ru/doc.xml?id=527132 (hereinafter referred to \"license agreement\"). If you do not accept any part of the terms of the license agreement, you are forbidden to use the program for any purpose.
");
-define('_JSHOP_YM_TESTMODE_DESCRIPTION', 'Enable test mode');
-define('_JSHOP_YM_MODE_DESCRIPTION', 'Payment acceptance settings');
-define('_JSHOP_YM_MODE1_DESCRIPTION', 'Yandex.Money');
-define('_JSHOP_YM_MODE2_DESCRIPTION', 'Yandex.Checkout (On the store\'s site)');
-define('_JSHOP_YM_MODE3_DESCRIPTION', 'Yandex.Checkout (On Yandex.Checkout\'s site)');
-define('_JSHOP_YM_MODE4_DESCRIPTION', 'Billing (bank cards, e-money)');
-define('_JSHOP_YM_REG_IND', 'If you don\'t have a Yandex.Money account, register here - https://money.yandex.ru/ IMPORTANT! Copy this link to the Redirect URL field at the notifications settings page.');
-
-define('_JSHOP_YM_REG_ORG', "To start operating the module, connect your store to Yandex.Checkout. Shop ID, scid, ShopPassword can be found in the Merchant Profile after the onboarding process.");
-define('_JSHOP_YM_METHODS_DESCRIPTION', 'Select payment method');
-define('_JSHOP_YM_PASSWORD', 'Specify shopPassword:');
-define('_JSHOP_YM_SHOPID', 'Specify shopId:');
-define('_JSHOP_YM_SCID', 'Specify scid:');
-define('_JSHOP_YM_PARAM', 'Parameter name');
-define('_JSHOP_YM_VALUE', 'Value');
-define('_JSHOP_YM_RETURNURL', 'Dynamic');
-define('_JSHOP_YM_ACCOUNT_DESCRIPTION', 'Wallet number:');
-
-define('_JSHOP_YM_PAY', 'Pay!');
-define('_JSHOP_YM_TRANSACTION_END', 'Order status after the payment');
-define('_JSHOP_YM_TEXT_MPOS', 'Success page for the Payment by Card on Delivery method');
-
-//updater
-define('_JSHOP_YM_UPDATER_ERROR_RESTORE', 'Unable to restore the data from the backup. ');
-define('_JSHOP_YM_UPDATER_SUCCESS_MESSAGE', 'Module successfully installed ');
-define('_JSHOP_YM_UPDATER_ERROR_REMOVE', 'Unable to delete backup %s.');
-define('_JSHOP_YM_ERROR_BACKUP_NOT_FOUND', 'Unable to delete backup %s.');
-define('_JSHOP_YM_ERROR_REMOVE_BACKUP', 'Unable to delete backup %s.');
-define('_JSHOP_YM_SUCCESS_REMOVE_BECKUP', 'Backup %s successfully deleted');
-define('_JSHOP_YM_SUCCESS_UPDATE_VERSION', 'Module version %s successfully downloaded and installed');
-define('_JSHOP_YM_ERROR_UNPACK_NEW_VERSION', 'Unable to extract archive %s. More about the error in module\'s logs');
-define('_JSHOP_YM_ERROR_CREATE_BACKUP', 'Unable to create a backup copy of the installed module version. More about the error in module\'s logs');
-define('_JSHOP_YM_ERROR_DOWNLOAD_NEW_VERSION', 'Unable to load the archive, please try again. More about the error in module\'s logs');
-define('_JSHOP_YM_FAILED_CREATE_DIRECTORY', 'Unable to create directory ');
-define('_JSHOP_YM_FAILED_DOWNLOAD_UPDATE', 'Unable to load the archive with the update');
-define('_JSHOP_YM_UPDATER_HEADER_TEXT', ' New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
-define('_JSHOP_YM_UPDATER_ABOUT', 'About the module:');
-define('_JSHOP_YM_UPDATER_CURRENT_VERSION', 'Current module version —');
-define('_JSHOP_YM_UPDATER_LAST_VERSION', 'Latest available module version —');
-define('_JSHOP_YM_UPDATER_LAST_CHECK', 'Date of the last check for updates —');
-define('_JSHOP_YM_UPDATER_CHECK', 'Check for updates');
-define('_JSHOP_YM_HISTORY_LABEL', 'Changelog:');
-define('_JSHOP_YM_UPDATE_LABEL', 'Update module');
-define('_JSHOP_YM_INSTALL_MESSAGE', 'You have the latest module version installed.');
-define('_JSHOP_YM_BACKUPS_LABEL', 'Backups');
-define('_JSHOP_YM_MODULE_VERSION_LABEL', 'Module version');
-define('_JSHOP_YM_BACKUP_DATE_CREATE', 'Creation date');
-define('_JSHOP_YM_BACKUP_FILE_NAME', 'File name');
-define('_JSHOP_YM_BACKUP_FILE_SIZE', 'File size');
-define('_JSHOP_YM_UPDATER_RESTORE', 'Restore');
-define('_JSHOP_YM_UPDATER_DELETE', 'Remove');
-define('_JSHOP_YM_UPDATER_APPROVE_ACTION_MESSAGE', 'Do you really want to update module?');
-define('_JSHOP_YM_UPDATER_APPROVE_DELETE_MESSAGE', 'Do you really want to delete the backup copy of this module version ');
-define('_JSHOP_YM_UPDATER_APPROVE_RESTORE_MESSAGE', 'Do you really want to restore the module from the backup copy of this version');
-define('_JSHOP_YM_UPDATER_TEXT_HEADER', 'Module updates');
-define('_JSHOP_YM_UPDATER_ABOUT_TEXT', 'New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
-define('_JSHOP_YM_UPDATER_DISABLED_TEXT', 'Unfortunately, the module update option is unavailable');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP_CURL', 'because the "zip" and "curl" extensions are not installed.');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP', 'because the "zip" extension is not installed.');
-define('_JSHOP_YM_UPDATER_CAUSE_CURL', 'because the "curl" extension is not installed.');
-
-
-
-define('_JSHOP_YM_WAITING_FOR_CAPTURE', 'Waiting for capture');
-define('_JSHOP_YM_CAPTURE_FAILED', 'Capture failed');
-define('_JSHOP_YM_PAYMENT_CAPTURED', 'Payment captured');
-define('_JSHOP_YM_PAYMENT_CAPTURED_TEXT', 'Payment %s captured');
-define('_JSHOP_YM_ERROR_MESSAGE_CREATE_PAYMENT', 'Unable to create the payment, choose another payment method.');
-define('_JSHOP_YM_ALFA_CLICK_TEXT', 'Specify the login, and we\'ll send the bill in Alfa-Click. All you have do after that is confirm the payment online at the bank\'s website.');
-define('_JSHOP_YM_QIWI_PHONE_TEXT', 'Phone number linked to QIWI Wallet');
-define('_JSHOP_YM_FILL_PHONE_MESSAGE', 'Specify phone number');
-define('_JSHOP_YM_FILL_ALFA_CLICK_LOGIN', 'Specify the login for Alfa-Click');
-define('_JSHOP_YM_ENABLE', 'Enable');
-define('_JSHOP_YM_DISABLE', 'Disable');
-define('_JSHOP_YM_DEFAULT_TAX_LABEL', 'Default rate');
-define('_JSHOP_YM_DEFAULT_TAX_DESCRIPTION', 'The default rate applies if another rate is not set on the product\'s page.');
-define('_JSHOP_YM_TAX_RATES_LABEL', 'Compare rates');
-define('_JSHOP_YM_TAX_IN_MODULE', 'Rate at your store');
-define('_JSHOP_YM_TAX_FOR_CHECKOUT', 'Rate for the receipt to the tax service');
-define('_JSHOP_YM_WITHOUT_VAT', 'Without VAT');
-define('_JSHOP_YM_VAT_10_100', 'Applicable rate 10/110');
-define('_JSHOP_YM_VAT_18_118', 'Applicable rate 18/118');
-define('_JSHOP_YM_NOTIFICATION_URL_LABEL', 'Address for notifications');
-define('_JSHOP_YM_NOTIFICATION_URL_HELP_TEXT', 'Only required if Yandex.Checkout\'s specialists ask for it');
-define('_JSHOP_YM_LOG_VIEW_LABEL', 'View logs');
-define('_JSHOP_YM_CLEAR_LOGS', 'Clear logs');
-define('_JSHOP_YM_CLOSE', 'Close');
-define('_JSHOP_YM_LOGS_LABEL', 'Logs');
-
-define('_JSHOP_YM_TAB_UPDATE', 'Module update');
-define('_JSHOP_YM_SBBOL_HELP_TEXT', 'There is a restriction for payments via Sberbank Business Online: one receipt can only contain products with the same VAT rate. If the client wants to pay for products with different VAT rates at the same time, we will show him the message explaining that it\'s not possible.');
-
diff --git a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/ru-RU.php b/src/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/ru-RU.php
deleted file mode 100644
index 7a40023..0000000
--- a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/ru-RU.php
+++ /dev/null
@@ -1,211 +0,0 @@
-Яндекс.Кассе.");
-define('_JSHOP_YM_VERSION_DESCRIPTION','Версия модуля ');
-
-define('_JSHOP_YM_TAB_MONEY', 'Яндекс.Деньги');
-define('_JSHOP_YM_TAB_KASSA', 'Яндекс.Касса');
-define('_JSHOP_YM_TAB_PAYMENTS', 'Платежка');
-
-define('_JSHOP_YM_KASSA_ON', 'Включить приём платежей через Яндекс.Кассу');
-define('_JSHOP_YM_KASSA_TEST', 'Тестовый режим');
-define('_JSHOP_YM_KASSA_WORK', 'Реальный режим');
-define('_JSHOP_YM_KASSA_HELP_CHECKURL', 'Этот адрес понадобится, только если его попросят специалисты Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_HELP_SUCCESSURL', 'Включите «Использовать страницы успеха и ошибки с динамическими адресами» в настройках личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_HELP_DYNAMICURL', 'Страницы с динамическими адресами');
-
-define('_JSHOP_YM_KASSA_HEAD_LK', 'Параметры из личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_SHOP_ID_LABEL', 'shopId');
-define('_JSHOP_YM_KASSA_SHOP_ID_DESCRIPTION', 'Скопируйте shopId из личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_PASSWORD_LABEL', 'Секретный ключ');
-define('_JSHOP_YM_KASSA_PASSWORD_DESCRIPTION', 'Выпустите и активируйте секретный ключ в личном кабинете Яндекс.Кассы. Потом скопируйте его сюда.');
-define('_JSHOP_YM_KASSA_PARAMS', 'Shop ID, scid, ShopPassword можно посмотреть в личном кабинете после подключения Яндекс.Кассы.');
-
-define('_JSHOP_YM_KASSA_PAYMODE_HEAD', 'Настройка сценария оплаты');
-define('_JSHOP_YM_KASSA_PAYMODE_LABEL', 'Выбор способа оплаты');
-define('_JSHOP_YM_KASSA_SEND_RECEIPT_LABEL', 'Отправлять в Яндекс.Кассу данные для чеков (54-ФЗ)');
-define('_JSHOP_YM_DESCRIPTION_TITLE', 'Описание платежа');
-define('_JSHOP_YM_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Оплата заказа №%order_id%');
-define('_JSHOP_YM_DESCRIPTION_HELP', 'Это описание транзакции, которое пользователь увидит при оплате, а вы — в личном кабинете Яндекс.Кассы. Например, «Оплата заказа №72».
-Чтобы в описание подставлялся номер заказа (как в примере), поставьте на его месте %order_id% (Оплата заказа №%order_id%).
-Ограничение для описания — 128 символов.');
-define('_JSHOP_YM_ENABLE_HOLD_MODE', 'Включить отложенную оплату');
-define('_JSHOP_YM_ENABLE_HOLD_MODE_HELP', 'Если опция включена, платежи с карт проходят в 2 этапа: у клиента сумма замораживается, и вам вручную нужно подтвердить её списание – через панель администратора. Подробное описание Холдирования.');
-define('_JSHOP_YM_HOLD_MODE_STATUSES', 'Какой статус присваивать заказу, если он:');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS', 'ожидает подтверждения');
-define('_JSHOP_YM_HOLD_MODE_ON_HOLD_STATUS_HELP', 'заказ переходит в этот статус при поступлении и остается в нем пока оператор магазина не подтвердит или не отменит платеж');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS', 'отменён');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_STATUS_HELP', 'заказ переходит в этот статус после отмены платежа');
-define('_JSHOP_YM_HOLD_MODE_COMMENT_ON_HOLD', 'Поступил новый платёж. Он ожидает подтверждения до %1$s, после чего автоматически отменится');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'Вы подтвердили платёж в Яндекс.Кассе.');
-define('_JSHOP_YM_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Платёж не подтвердился. Попробуйте ещё раз.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'Вы отменили платёж в Яндекс.Кассе. Деньги вернутся клиенту.');
-define('_JSHOP_YM_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Платёж не отменился. Попробуйте ещё раз.');
-define('_JSHOP_YM_KASSA_PAYMODE_KASSA', 'На стороне Кассы');
-define('_JSHOP_YM_KASSA_PAYMODE_SHOP', 'На стороне магазина');
-define('_JSHOP_YM_KASSA_PAYMODE_LINK', 'Подробнее о сценариях оплаты');
-define('_JSHOP_YM_KASSA_SELECT_TEXT', 'Отметьте способы оплаты, которые указаны в вашем договоре с Яндекс.Деньгами');
-define('_JSHOP_YM_KASSA_CREDENTIALS_ERROR', 'Проверьте shopId и Секретный ключ — где-то есть ошибка. А лучше скопируйте их прямо из личного кабинета Яндекс.Кассы');
-define('_JSHOP_YM_KASSA_TEST_WARNING', 'Вы включили тестовый режим приема платежей. Проверьте, как проходит оплата, и напишите менеджеру Кассы. Он выдаст рабочие shopId и Секретный ключ. Инструкция');
-define('_JSHOP_YM_METHOD_YANDEX_MONEY_DESCRIPTION', 'Яндекс.Деньги');
-define('_JSHOP_YM_METHOD_CARDS_DESCRIPTION', 'Банковские карты');
-define('_JSHOP_YM_METHOD_BANK_CARD_DESCRIPTION', 'Банковские карты');
-define('_JSHOP_YM_METHOD_CASH_DESCRIPTION', 'Наличные через терминалы');
-define('_JSHOP_YM_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Баланс мобильного');
-define('_JSHOP_YM_METHOD_WEBMONEY_DESCRIPTION', 'Кошелек WebMoney');
-define('_JSHOP_YM_METHOD_ALFABANK_DESCRIPTION', 'Альфа-Клик');
-define('_JSHOP_YM_METHOD_SBERBANK_DESCRIPTION', 'Сбербанк Онлайн');
-define('_JSHOP_YM_METHOD_MA_DESCRIPTION', 'MasterPass');
-define('_JSHOP_YM_METHOD_PB_DESCRIPTION', 'Интернет-банк Промсвязьбанка');
-define('_JSHOP_YM_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
-define('_JSHOP_YM_METHOD_QP_DESCRIPTION', 'Доверительный платеж (Куппи.ру)');
-define('_JSHOP_YM_METHOD_MP_DESCRIPTION', 'Мобильный терминал');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_DESCRIPTION', 'Заплатить по частям');
-define('_JSHOP_YM_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ в месяц)');
-define('_JSHOP_YM_KASSA_MPOS_LABEL', 'Страница успеха для способа «Оплата картой при доставке»');
-define('_JSHOP_YM_KASSA_MPOS_HELP', 'Это страница с информацией о доставке. Укажите на ней, когда привезут товар и как его можно будет оплатить');
-
-define('_JSHOP_YM_MONEY_HEAD', 'Для работы с модулем нужно открыть кошелек на Яндексе и
- зарегистрировать приложение на сайте Яндекс.Денег');
-define('_JSHOP_YM_MONEY_ON', 'Включить прием платежей в кошелек на Яндексе');
-define('_JSHOP_YM_MONEY_REDIRECT_HELP', 'Скопируйте эту ссылку в поле Redirect URL на странице регистрации приложения.');
-
-define('_JSHOP_YM_MONEY_SET_HEAD', 'Настройки приема платежей');
-define('_JSHOP_YM_MONEY_WALLET', 'Номер кошелька');
-define('_JSHOP_YM_MONEY_PSW', 'Секретное слово');
-
-define('_JSHOP_YM_MONEY_SELECT_HEAD', 'Настройка сценария оплаты');
-define('_JSHOP_YM_MONEY_SELECT_LABEL', 'Способы оплаты');
-define('_JSHOP_YM_METHOD_YM2_DESCRIPTION', 'Кошелек Яндекс.Деньги');
-define('_JSHOP_YM_METHOD_CARDS2_DESCRIPTION', 'Банковская карта');
-
-define('_JSHOP_YM_COMMON_HEAD', 'Дополнительные настройки для администратора');
-define('_JSHOP_YM_COMMON_STATUS', 'Статус заказа после оплаты');
-
-define('_JSHOP_YM_PAYMENTS_HEAD', 'Это платежная форма на ваш сайт. Позволяет принимать платежи на счет компании — с
-карт и из кошельков Яндекс.Денег, без договора.
-Для настройки нужен ID формы: он придет в письме, когда вы
-соберете форму в конструкторе.');
-
-define('_JSHOP_YM_PAYMENTS_ON', 'Включить прием платежей через Платежку');
-define('_JSHOP_YM_PAYMENTS_ID_LABEL', 'ID формы');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_LABEL', 'Назначение платежа');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_PLACEHOLDER', 'Номер заказа %order_id%. Оплата через Платежку');
-define('_JSHOP_YM_PAYMENTS_DESCRIPTION_INFO', 'Назначение будет в платежном поручении от банка. Напишите в нем всё,
-что поможет отличить заказ, который оплатили через Платежку.');
-define('_JSHOP_YM_PAYMENTS_STATUS_LABEL', 'Статус заказа');
-define('_JSHOP_YM_PAYMENTS_STATUS_INFO', 'Статус должен показать, что результат платежа неизвестен: о том, что клиент
-заплатил, можно узнать только из письма от Платежки или в своем банке.');
-define('_JSHOP_YM_PAYMENTS_FIO_LABEL', 'ФИО плательщика');
-define('_JSHOP_YM_PAYMENTS_CONFIRM_LABEL', 'Далее');
-define('_JSHOP_YM_PAYMENTS_EMPTY_NAME_ERROR', 'Укажите ФИО плательщика');
-define('_JSHOP_YM_PAYMENTS_INVALID_NAME_ERROR', 'ФИО плательщика должно состоять из фамилии, имени и отчества, разделённых пробелами');
-
-// версия 2.х
-define('_JSHOP_YM_LICENSE','Лицензионный договор:');
-define('_JSHOP_YM_LICENSE_TEXT2',"
Любое использование Вами программы означает полное и безоговорочное принятие Вами условий лицензионного договора, размещенного по адресу https://money.yandex.ru/doc.xml?id=527132 (далее – «Лицензионный договор»). Если Вы не принимаете условия Лицензионного договора в полном объёме, Вы не имеете права использовать программу в каких-либо целях.
");
-define('_JSHOP_YM_TESTMODE_DESCRIPTION', 'Использовать в тестовом режиме?');
-define('_JSHOP_YM_MODE_DESCRIPTION', 'Способ приема платежей:');
-define('_JSHOP_YM_MODE1_DESCRIPTION', 'Яндекс.Денеги');
-define('_JSHOP_YM_MODE2_DESCRIPTION', 'Яндекс.Касса (выбор оплаты на стороне сайта)');
-define('_JSHOP_YM_MODE3_DESCRIPTION', 'Яндекс.Касса (выбор оплаты на стороне Яндекс.Кассы)');
-define('_JSHOP_YM_MODE4_DESCRIPTION', 'Платежка (банковские карты, кошелек)');
-define('_JSHOP_YM_REG_IND', 'Если у вас нет аккаунта в Яндекс-Деньги, то следует зарегистрироваться тут - https://money.yandex.ru/ ВАЖНО! Вам нужно будет указать ссылку для приема HTTP уведомлений здесь - https://sp-money.yandex.ru/myservices/online.xml');
-
-define('_JSHOP_YM_REG_ORG', 'Для работы с модулем необходимо подключить магазин к Яндек.Кассе. После подключения вы получите параметры для приема платежей (идентификатор магазина — shopId и номер витрины — scid).');
-define('_JSHOP_YM_METHODS_DESCRIPTION', 'Укажите необходимые способы оплаты');
-define('_JSHOP_YM_PASSWORD', 'Секретное слово (shopPassword) для обмена сообщениями:');
-define('_JSHOP_YM_SHOPID', 'Идентификатор вашего магазина в Яндекс.Деньгах (ShopID):');
-define('_JSHOP_YM_SCID', 'Идентификатор витрины вашего магазина в Яндекс.Деньгах (scid):');
-define('_JSHOP_YM_PARAM', 'Название параметра');
-define('_JSHOP_YM_VALUE', 'Значение');
-define('_JSHOP_YM_RETURNURL', 'Динамический');
-define('_JSHOP_YM_ACCOUNT_DESCRIPTION', 'Номер кошелька Яндекс:');
-
-define('_JSHOP_YM_PAY', 'Оплатить!');
-define('_JSHOP_YM_TRANSACTION_END', 'Статус заказа для успешных транзакций');
-define('_JSHOP_YM_TEXT_MPOS', 'Страница с инструкцией для платеждей через мобильный терминал!');
-
-//updater
-define('_JSHOP_YM_UPDATER_ERROR_RESTORE', 'Не удалось восстановить модуль из резервной копии: ');
-define('_JSHOP_YM_UPDATER_SUCCESS_MESSAGE', 'Модуль был успешно восстановлен из резервной копии: ');
-define('_JSHOP_YM_UPDATER_ERROR_REMOVE', 'Не был передан удаляемый файл резервной копии');
-define('_JSHOP_YM_ERROR_BACKUP_NOT_FOUND', 'Файл резервной копии %s не найден');
-define('_JSHOP_YM_ERROR_REMOVE_BACKUP', 'Не удалось удалить файл резервной копии ');
-define('_JSHOP_YM_SUCCESS_REMOVE_BECKUP', 'Файл резервной копии %s был успешно удалён');
-define('_JSHOP_YM_SUCCESS_UPDATE_VERSION', 'Версия модуля %s (%s) была успешно загружена и установлена');
-define('_JSHOP_YM_ERROR_UNPACK_NEW_VERSION', 'Не удалось распаковать загруженный архив %s, подробную информацию о произошедшей ошибке можно найти в логах модуля');
-define('_JSHOP_YM_ERROR_CREATE_BACKUP', 'Не удалось создать резервную копию установленной версии модуля, подробную информацию о произошедшей ошибке можно найти в логах модуля');
-define('_JSHOP_YM_ERROR_DOWNLOAD_NEW_VERSION', 'Не удалось загрузить архив с новой версией, подробную информацию о произошедшей ошибке можно найти в логах модуля');
-define('_JSHOP_YM_FAILED_CREATE_DIRECTORY', 'Не удалось создать директорию ');
-define('_JSHOP_YM_FAILED_DOWNLOAD_UPDATE', 'Не удалось загрузить архив с обновлением');
-define('_JSHOP_YM_UPDATER_HEADER_TEXT', ' Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками. Чтобы установить новую версию модуля, нажмите кнопку «Обновить».');
-define('_JSHOP_YM_UPDATER_ABOUT', 'О модуле:');
-define('_JSHOP_YM_UPDATER_CURRENT_VERSION', 'Установленная версия модуля —');
-define('_JSHOP_YM_UPDATER_LAST_VERSION', 'Последняя версия модуля —');
-define('_JSHOP_YM_UPDATER_LAST_CHECK', 'Последняя проверка наличия новых версий —');
-define('_JSHOP_YM_UPDATER_CHECK', 'Проверить наличие обновлений');
-define('_JSHOP_YM_HISTORY_LABEL', 'История изменений:');
-define('_JSHOP_YM_UPDATE_LABEL', 'Обновить');
-define('_JSHOP_YM_INSTALL_MESSAGE', 'Установлена последняя версия модуля.');
-define('_JSHOP_YM_BACKUPS_LABEL', 'Резервные копии');
-define('_JSHOP_YM_MODULE_VERSION_LABEL', 'Версия модуля');
-define('_JSHOP_YM_BACKUP_DATE_CREATE', 'Дата создания');
-define('_JSHOP_YM_BACKUP_FILE_NAME', 'Имя файла');
-define('_JSHOP_YM_BACKUP_FILE_SIZE', 'Размер файла');
-define('_JSHOP_YM_UPDATER_RESTORE', 'Восстановить');
-define('_JSHOP_YM_UPDATER_DELETE', 'Удалить');
-define('_JSHOP_YM_UPDATER_APPROVE_ACTION_MESSAGE', 'Вы действительно хотите обновить модуль до последней версии?');
-define('_JSHOP_YM_UPDATER_APPROVE_DELETE_MESSAGE', 'Вы действительно хотите удалить резервную копию');
-define('_JSHOP_YM_UPDATER_APPROVE_RESTORE_MESSAGE', 'Вы действительно хотите восстановить резервную копию');
-define('_JSHOP_YM_UPDATER_TEXT_HEADER', 'Обновление модуля');
-define('_JSHOP_YM_UPDATER_ABOUT_TEXT', 'Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками.');
-define('_JSHOP_YM_UPDATER_DISABLED_TEXT', ' К сожалению функция обновления модуля недоступна');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP_CURL', 'так как для не установлены расширения "zip" и "curl".');
-define('_JSHOP_YM_UPDATER_CAUSE_ZIP', 'так как для не установлено расширение "zip".');
-define('_JSHOP_YM_UPDATER_CAUSE_CURL', 'так как для не установлено расширение "curl".');
-
-
-
-define('_JSHOP_YM_WAITING_FOR_CAPTURE', 'Ожидается проведение оплаты');
-define('_JSHOP_YM_CAPTURE_FAILED', 'Платёж не был проведён');
-define('_JSHOP_YM_PAYMENT_CAPTURED', 'Оплата была проведена');
-define('_JSHOP_YM_PAYMENT_CAPTURED_TEXT', 'Платёж %s проведён');
-define('_JSHOP_YM_ERROR_MESSAGE_CREATE_PAYMENT', 'Не удалось создать платёж, попробуйте выбрать другой способ оплаты.');
-define('_JSHOP_YM_ALFA_CLICK_TEXT', 'Укажите логин, и мы выставим счет в Альфа-Клике. После этого останется подтвердить платеж на сайте интернет-банка.');
-define('_JSHOP_YM_QIWI_PHONE_TEXT', 'Телефон, который привязан к Qiwi Wallet');
-define('_JSHOP_YM_FILL_PHONE_MESSAGE', 'Укажите телефон');
-define('_JSHOP_YM_FILL_ALFA_CLICK_LOGIN', 'Укажите логин в Альфа-клике');
-define('_JSHOP_YM_ENABLE', 'Включить');
-define('_JSHOP_YM_DISABLE', 'Выключить');
-define('_JSHOP_YM_DEFAULT_TAX_LABEL', 'Ставка по умолчанию');
-define('_JSHOP_YM_DEFAULT_TAX_DESCRIPTION', 'Ставка по умолчанию будет в чеке, если в карточке товара не указана другая ставка.');
-define('_JSHOP_YM_TAX_RATES_LABEL', 'Сопоставьте ставки');
-define('_JSHOP_YM_TAX_IN_MODULE', 'Ставка в вашем магазине');
-define('_JSHOP_YM_TAX_FOR_CHECKOUT', 'Ставка для чека в налоговую');
-define('_JSHOP_YM_WITHOUT_VAT', 'Без НДС');
-define('_JSHOP_YM_VAT_10_100', 'Расчётная ставка 10/110');
-define('_JSHOP_YM_VAT_18_118', 'Расчётная ставка 18/118');
-define('_JSHOP_YM_NOTIFICATION_URL_LABEL', 'Адрес для уведомлений');
-define('_JSHOP_YM_NOTIFICATION_URL_HELP_TEXT', 'Этот адрес понадобится, только если его попросят специалисты Яндекс.Кассы');
-define('_JSHOP_YM_LOG_VIEW_LABEL', 'Просмотр логов модуля');
-define('_JSHOP_YM_CLEAR_LOGS', 'Очистить журнал');
-define('_JSHOP_YM_CLOSE', 'Закрыть');
-define('_JSHOP_YM_LOGS_LABEL', 'Журнал сообщений модуля');
-
-define('_JSHOP_YM_TAB_UPDATE', 'Обновления');
-
-define('_JSHOP_YM_KASSA_ENABLE_SBBOL', 'Включить платежи через Сбербанк Бизнес Онлайн');
-define('_JSHOP_YM_SBBOL_HELP_TEXT', 'При оплате через Сбербанк Бизнес Онлайн есть ограничение: в одном заказе могут быть только товары с одинаковой ставкой НДС. Если клиент захочет оплатить за один раз товары с разными ставками — мы покажем ему сообщение, что так сделать не получится.');
-define('_JSHOP_YM_SBBOL_HEAD', 'Чтобы платежи через Сбербанк Бизнес Онлайн работали, магазин должен быть подключен к Яндекс.Кассе.');
-define('_JSHOP_YM_SBBOL_TAX_RATES_HEAD', 'Сопоставьте ставки НДС в вашем магазине со ставками для Сбербанка Бизнес Онлайн');
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/3x/yandex_kassa.php b/src/components/com_jshopping/payments/pm_yoomoney/3x/yookassa.php
similarity index 64%
rename from src/components/com_jshopping/payments/pm_yandex_money/3x/yandex_kassa.php
rename to src/components/com_jshopping/payments/pm_yoomoney/3x/yookassa.php
index 2a7da41..3aa6077 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/3x/yandex_kassa.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/3x/yookassa.php
@@ -3,20 +3,20 @@
/**
* @package JoomShopping for Joomla!
* @subpackage payment
- * @author YandexMoney
- * @copyright Copyright (C) 2012-2017 YandexMoney. All rights reserved.
+ * @author YooMoney
+ * @copyright Copyright (C) 2020 YooMoney. All rights reserved.
*/
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
defined('_JEXEC') or die('Restricted access');
-echo JHtml::_('bootstrap.addTab', 'yamTab', 'kassa-tab', _JSHOP_YM_TAB_KASSA);
+echo JHtml::_('bootstrap.addTab', 'yamTab', 'kassa-tab', _JSHOP_YOO_TAB_KASSA);
?>
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/adminparamsform.php b/src/components/com_jshopping/payments/pm_yoomoney/adminparamsform.php
similarity index 87%
rename from src/components/com_jshopping/payments/pm_yandex_money/adminparamsform.php
rename to src/components/com_jshopping/payments/pm_yoomoney/adminparamsform.php
index e10af8f..7433d2c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/adminparamsform.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/adminparamsform.php
@@ -3,8 +3,8 @@
/**
* @package JoomShopping for Joomla!
* @subpackage payment
- * @author YandexMoney
- * @copyright Copyright (C) 2012-2017 YandexMoney. All rights reserved.
+ * @author YooMoney
+ * @copyright Copyright (C) 2020 YooMoney. All rights reserved.
*/
defined('_JEXEC') or die('Restricted access');
@@ -13,7 +13,7 @@
$liveurlhost = $uri->toString(array("scheme",'host', 'port'));
$sslurlhost = $uri->toString(array('host', 'port'));
-$notify_url = 'https://'.$sslurlhost.SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_yandex_money&no_lang=1");
+$notify_url = 'https://'.$sslurlhost.SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_yoomoney&no_lang=1");
$notify_url = htmlspecialchars_decode($notify_url);
function isSelected($params, $type)
@@ -40,18 +40,17 @@ function escapeValue($value)
?>
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lang/en-GB.php b/src/components/com_jshopping/payments/pm_yoomoney/lang/en-GB.php
new file mode 100644
index 0000000..fccdcf0
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lang/en-GB.php
@@ -0,0 +1,218 @@
+YooMoney.");
+define('_JSHOP_YOO_VERSION_DESCRIPTION','Module version ');
+
+define('_JSHOP_YOO_TAB_MONEY', 'YooMoney');
+define('_JSHOP_YOO_TAB_KASSA', 'YooMoney for business');
+
+define('_JSHOP_YOO_KASSA_ON', 'Enable payment acceptance via YooMoney');
+define('_JSHOP_YOO_KASSA_HELP_CHECKURL', 'Only required if YooMoney\'s specialists ask for it');
+
+define('_JSHOP_YOO_KASSA_HEAD_LK', 'Parameters from YooMoney\'s Merchant Profile');
+define('_JSHOP_YOO_KASSA_SHOP_ID_LABEL', 'shopId');
+define('_JSHOP_YOO_KASSA_SHOP_ID_DESCRIPTION', 'Copy your shopId from your YooMoney\'s Merchant Profile');
+define('_JSHOP_YOO_KASSA_PASSWORD_LABEL', 'Secret key');
+define('_JSHOP_YOO_KASSA_PASSWORD_DESCRIPTION', 'Issue and activate a secret key under your YooMoney\'s Merchant Profile. Then copy it here.');
+
+define('_JSHOP_YOO_KASSA_PAYMODE_HEAD', 'Check the preferable scenario of selecting the payment method');
+define('_JSHOP_YOO_KASSA_PAYMODE_LABEL', 'Select payment method');
+define('_JSHOP_YOO_KASSA_SEND_RECEIPT_LABEL', 'Transmit details for receipts to YooMoney for business (Federal Law 54-FZ)');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_LABEL', 'Второй чек:');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_STATUS_LABEL', 'Формировать второй чек при переходе заказа в статус');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_INFO', 'Два чека нужно формировать, если покупатель вносит предоплату и потом получает товар или услугу. Первый чек — когда деньги поступают вам на счёт, второй — при отгрузке товаров или выполнении услуг.');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_HELP_BLOCK', 'Если в заказе будут позиции с признаками «Полная предоплата» — второй чек отправится автоматически, когда заказ перейдёт в выбранный статус.');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_HISTORY', 'Отправлен второй чек. Сумма %s рублей.');
+define('_JSHOP_YOO_KASSA_PAYMODE_KASSA', 'On YooMoney for business\'s site');
+define('_JSHOP_YOO_KASSA_PAYMODE_SHOP', 'On the store\'s site');
+define('_JSHOP_YOO_KASSA_PAYMODE_LINK', 'More about payment scenarios');
+define('_JSHOP_YOO_KASSA_SELECT_TEXT', 'Check payment methods from the contract');
+define('_JSHOP_YOO_KASSA_CREDENTIALS_ERROR', 'Such secret key does not exist. If you are sure you copied the key correctly, this means it does not work for some reason. Issue and activate the key again under your Merchant Profile');
+define('_JSHOP_YOO_KASSA_TEST_WARNING', 'You have enabled the test mode. Check the payment making process. Learn more');
+define('_JSHOP_YOO_DESCRIPTION_TITLE', 'Transaction data');
+define('_JSHOP_YOO_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Payment for order No. %order_id%');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE', 'Enable payment holding');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE_HELP', 'If the option is enabled, payments are processed in two steps: first, the required amount is blocked on the customer’s card, and then you need to manually capture it via the administrator’s dashboard. Learn more at.');
+define('_JSHOP_YOO_HOLD_MODE_STATUSES', 'What status should be assigned to an order if it is:');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS', 'waiting for capture');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS_HELP', 'the order status will be changed to this one after the funds are credited, until the store\'s operator either captures or cancels the payment');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS', 'canceled');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS_HELP', 'the order status will be changed to this one after the payment is canceled');
+define('_JSHOP_YOO_HOLD_MODE_COMMENT_ON_HOLD', 'New payment received. Capture until %1$s, after that date it will be automatically canceled');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'You\'ve captured a payment in YooMoney for business. ');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Payment wasn\'t captured. Please try again.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'You\'ve canceled a payment in YooMoney for business. Money will be returned to the user.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Payment wasn\'t canceled. Please try again.');
+define('_JSHOP_YOO_DESCRIPTION_HELP', 'Full description of the transaction that the user will see during the checkout process. You can find it in your YooMoney for business Merchant Profile. For example, "Payment for order No. 72 by user@yoomoney.ru". Limitations: no more than 128 symbols.');
+define('_JSHOP_YOO_METHOD_YOO_MONEY_DESCRIPTION', 'YooMoney');
+define('_JSHOP_YOO_METHOD_CARDS_DESCRIPTION', 'Bank cards');
+define('_JSHOP_YOO_METHOD_BANK_CARD_DESCRIPTION', 'Bank cards');
+define('_JSHOP_YOO_METHOD_CASH_DESCRIPTION', 'Cash via payment kiosks');
+define('_JSHOP_YOO_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Direct carrier billing');
+define('_JSHOP_YOO_METHOD_WEBMONEY_DESCRIPTION', 'Webmoney');
+define('_JSHOP_YOO_METHOD_ALFABANK_DESCRIPTION', 'Alfa-Click');
+define('_JSHOP_YOO_METHOD_SBERBANK_DESCRIPTION', 'Sberbank Online');
+define('_JSHOP_YOO_METHOD_MA_DESCRIPTION', 'MasterPass');
+define('_JSHOP_YOO_METHOD_PB_DESCRIPTION', 'Promsvyazbank');
+define('_JSHOP_YOO_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
+define('_JSHOP_YOO_METHOD_TINKOFF_BANK_DESCRIPTION', 'Tinkoff online banking');
+define('_JSHOP_YOO_METHOD_MP_DESCRIPTION', 'Mobile payment kiosk');
+define('_JSHOP_YOO_METHOD_WIDGET_DESCRIPTION', 'Payment widget from YooMoney for business (cards, Apple Pay and Google Play)');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_DESCRIPTION', 'Installments');
+
+define('_JSHOP_YOO_METHOD_YOO_MONEY_DESCRIPTION_PUBLIC', 'YooMoney');
+define('_JSHOP_YOO_METHOD_CARDS_DESCRIPTION_PUBLIC', 'Bank cards');
+define('_JSHOP_YOO_METHOD_BANK_CARD_DESCRIPTION_PUBLIC', 'Bank cards');
+define('_JSHOP_YOO_METHOD_CASH_DESCRIPTION_PUBLIC', 'Cash via payment kiosks');
+define('_JSHOP_YOO_METHOD_MOBILE_BALANCE_DESCRIPTION_PUBLIC', 'Direct carrier billing');
+define('_JSHOP_YOO_METHOD_WEBMONEY_DESCRIPTION_PUBLIC', 'Webmoney');
+define('_JSHOP_YOO_METHOD_ALFABANK_DESCRIPTION_PUBLIC', 'Alfa-Click');
+define('_JSHOP_YOO_METHOD_SBERBANK_DESCRIPTION_PUBLIC', 'Sberbank Online');
+define('_JSHOP_YOO_METHOD_MA_DESCRIPTION_PUBLIC', 'MasterPass');
+define('_JSHOP_YOO_METHOD_PB_DESCRIPTION_PUBLIC', 'Promsvyazbank');
+define('_JSHOP_YOO_METHOD_QIWI_DESCRIPTION_PUBLIC', 'QIWI Wallet');
+define('_JSHOP_YOO_METHOD_TINKOFF_BANK_DESCRIPTION_PUBLIC', 'Tinkoff online banking');
+define('_JSHOP_YOO_METHOD_MP_DESCRIPTION_PUBLIC', 'Mobile payment kiosk');
+define('_JSHOP_YOO_METHOD_WIDGET_DESCRIPTION_PUBLIC', 'Bank cards, Apple Pay, Google Play');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_DESCRIPTION_PUBLIC', 'Installments');
+
+define('_JSHOP_YOO_INSTALL_VERIFY_APPLE_PAY_FILE_WARNING', 'Чтобы покупатели могли заплатить вам через Apple Pay, скачайте файл apple-developer-merchantid-domain-association и добавьте его в папку ./well-known на вашем сайте. Если не знаете, как это сделать, обратитесь к администратору сайта или в поддержку хостинга. Не забудьте также подключить оплату через Apple Pay в личном кабинете ЮKassa. Почитать о подключении Apple Pay в документации ЮKassa');
+
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ per month)');
+
+define('_JSHOP_YOO_KASSA_MPOS_LABEL', 'Success page for the Payment by Card on Delivery method');
+define('_JSHOP_YOO_KASSA_MPOS_HELP', 'This page contains delivery information. Specify the terms of the delivery and the payment here');
+
+
+define('_JSHOP_YOO_MONEY_HEAD', 'To start operating the module, connect your store to YooMoney.');
+define('_JSHOP_YOO_MONEY_ON', 'Enable payment acceptance to the YooMoney Wallet');
+define('_JSHOP_YOO_MONEY_REDIRECT_HELP', "Copy this link to the Redirect URL field at the notifications settings page.");
+
+define('_JSHOP_YOO_MONEY_SET_HEAD', 'Payment acceptance settings');
+define('_JSHOP_YOO_MONEY_WALLET', 'Wallet number');
+define('_JSHOP_YOO_MONEY_PSW', 'Codeword');
+
+define('_JSHOP_YOO_MONEY_SELECT_HEAD', 'Check the preferable scenario of selecting the payment method');
+define('_JSHOP_YOO_MONEY_SELECT_LABEL', 'Select payment method');
+define('_JSHOP_YOO_METHOD_YM2_DESCRIPTION_PUBLIC', 'YooMoney');
+define('_JSHOP_YOO_METHOD_CARDS2_DESCRIPTION_PUBLIC', 'Bank cards');
+
+define('_JSHOP_YOO_COMMON_HEAD', 'Additional settings for administrator');
+define('_JSHOP_YOO_COMMON_STATUS', 'Order status after the payment');
+
+define('_JSHOP_YOO_PAYMENTS_STATUS_LABEL', 'Order status');
+define('_JSHOP_YOO_PAYMENTS_STATUS_INFO', 'The status should indicate that the result of the payment is unknown: you can only find out if the customer paid or not by checking the notification sent to your email or by contacting your bank.');
+define('_JSHOP_YOO_PAYMENTS_FIO_LABEL', 'Payer\'s full name');
+define('_JSHOP_YOO_PAYMENTS_CONFIRM_LABEL', 'Next');
+define('_JSHOP_YOO_PAYMENTS_EMPTY_NAME_ERROR', 'Payer\'s full name is empty');
+define('_JSHOP_YOO_PAYMENTS_INVALID_NAME_ERROR', 'The payer\'s name should consist of the first, middle, and last name, separated by spaces');
+
+// версия 2.х
+define('_JSHOP_YOO_LICENSE','License agreement:');
+define('_JSHOP_YOO_LICENSE_TEXT2',"
By using this program in any way, you fully and unconditionally accept the terms of the license agreement as posted at https://yoomoney.ru/doc.xml?id=527132 (hereinafter referred to \"license agreement\"). If you do not accept any part of the terms of the license agreement, you are forbidden to use the program for any purpose.
");
+define('_JSHOP_YOO_TESTMODE_DESCRIPTION', 'Enable test mode');
+define('_JSHOP_YOO_MODE_DESCRIPTION', 'Payment acceptance settings');
+define('_JSHOP_YOO_MODE1_DESCRIPTION', 'YooMoney');
+define('_JSHOP_YOO_MODE2_DESCRIPTION', 'YooMoney (On the store\'s site)');
+define('_JSHOP_YOO_MODE3_DESCRIPTION', 'YooMoney (On YooMoney\'s site)');
+define('_JSHOP_YOO_REG_IND', 'If you don\'t have a YooMoney account, register here - https://yoomoney.ru/ IMPORTANT! Copy this link to the Redirect URL field at the notifications settings page.');
+
+define('_JSHOP_YOO_REG_ORG', "To start operating the module, connect your store to YooMoney. Shop ID, scid, ShopPassword can be found in the Merchant Profile after the onboarding process.");
+define('_JSHOP_YOO_METHODS_DESCRIPTION', 'Select payment method');
+define('_JSHOP_YOO_PASSWORD', 'Specify shopPassword:');
+define('_JSHOP_YOO_SHOPID', 'Specify shopId:');
+define('_JSHOP_YOO_SCID', 'Specify scid:');
+define('_JSHOP_YOO_PARAM', 'Parameter name');
+define('_JSHOP_YOO_VALUE', 'Value');
+define('_JSHOP_YOO_RETURNURL', 'Dynamic');
+define('_JSHOP_YOO_ACCOUNT_DESCRIPTION', 'Wallet number:');
+
+define('_JSHOP_YOO_PAY', 'Pay!');
+define('_JSHOP_YOO_TRANSACTION_END', 'Order status after the payment');
+define('_JSHOP_YOO_TEXT_MPOS', 'Success page for the Payment by Card on Delivery method');
+
+//updater
+define('_JSHOP_YOO_UPDATER_ERROR_RESTORE', 'Unable to restore the data from the backup. ');
+define('_JSHOP_YOO_UPDATER_SUCCESS_MESSAGE', 'Module successfully installed ');
+define('_JSHOP_YOO_UPDATER_ERROR_REMOVE', 'Unable to delete backup %s.');
+define('_JSHOP_YOO_ERROR_BACKUP_NOT_FOUND', 'Unable to delete backup %s.');
+define('_JSHOP_YOO_ERROR_REMOVE_BACKUP', 'Unable to delete backup %s.');
+define('_JSHOP_YOO_SUCCESS_REMOVE_BECKUP', 'Backup %s successfully deleted');
+define('_JSHOP_YOO_SUCCESS_UPDATE_VERSION', 'Module version %s successfully downloaded and installed');
+define('_JSHOP_YOO_ERROR_UNPACK_NEW_VERSION', 'Unable to extract archive %s. More about the error in module\'s logs');
+define('_JSHOP_YOO_ERROR_CREATE_BACKUP', 'Unable to create a backup copy of the installed module version. More about the error in module\'s logs');
+define('_JSHOP_YOO_ERROR_DOWNLOAD_NEW_VERSION', 'Unable to load the archive, please try again. More about the error in module\'s logs');
+define('_JSHOP_YOO_FAILED_CREATE_DIRECTORY', 'Unable to create directory ');
+define('_JSHOP_YOO_FAILED_DOWNLOAD_UPDATE', 'Unable to load the archive with the update');
+define('_JSHOP_YOO_UPDATER_HEADER_TEXT', ' New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
+define('_JSHOP_YOO_UPDATER_ABOUT', 'About the module:');
+define('_JSHOP_YOO_UPDATER_CURRENT_VERSION', 'Current module version —');
+define('_JSHOP_YOO_UPDATER_LAST_VERSION', 'Latest available module version —');
+define('_JSHOP_YOO_UPDATER_LAST_CHECK', 'Date of the last check for updates —');
+define('_JSHOP_YOO_UPDATER_CHECK', 'Check for updates');
+define('_JSHOP_YOO_HISTORY_LABEL', 'Changelog:');
+define('_JSHOP_YOO_UPDATE_LABEL', 'Update module');
+define('_JSHOP_YOO_INSTALL_MESSAGE', 'You have the latest module version installed.');
+define('_JSHOP_YOO_BACKUPS_LABEL', 'Backups');
+define('_JSHOP_YOO_MODULE_VERSION_LABEL', 'Module version');
+define('_JSHOP_YOO_BACKUP_DATE_CREATE', 'Creation date');
+define('_JSHOP_YOO_BACKUP_FILE_NAME', 'File name');
+define('_JSHOP_YOO_BACKUP_FILE_SIZE', 'File size');
+define('_JSHOP_YOO_UPDATER_RESTORE', 'Restore');
+define('_JSHOP_YOO_UPDATER_DELETE', 'Remove');
+define('_JSHOP_YOO_UPDATER_APPROVE_ACTION_MESSAGE', 'Do you really want to update module?');
+define('_JSHOP_YOO_UPDATER_APPROVE_DELETE_MESSAGE', 'Do you really want to delete the backup copy of this module version ');
+define('_JSHOP_YOO_UPDATER_APPROVE_RESTORE_MESSAGE', 'Do you really want to restore the module from the backup copy of this version');
+define('_JSHOP_YOO_UPDATER_TEXT_HEADER', 'Module updates');
+define('_JSHOP_YOO_UPDATER_ABOUT_TEXT', 'New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
+define('_JSHOP_YOO_UPDATER_DISABLED_TEXT', 'Unfortunately, the module update option is unavailable');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP_CURL', 'because the "zip" and "curl" extensions are not installed.');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP', 'because the "zip" extension is not installed.');
+define('_JSHOP_YOO_UPDATER_CAUSE_CURL', 'because the "curl" extension is not installed.');
+
+
+
+define('_JSHOP_YOO_WAITING_FOR_CAPTURE', 'Waiting for capture');
+define('_JSHOP_YOO_CAPTURE_FAILED', 'Capture failed');
+define('_JSHOP_YOO_PAYMENT_CAPTURED', 'Payment captured');
+define('_JSHOP_YOO_PAYMENT_CAPTURED_TEXT', 'Payment %s captured');
+define('_JSHOP_YOO_ERROR_MESSAGE_CREATE_PAYMENT', 'Unable to create the payment, choose another payment method.');
+define('_JSHOP_YOO_ALFA_CLICK_TEXT', 'Specify the login, and we\'ll send the bill in Alfa-Click. All you have do after that is confirm the payment online at the bank\'s website.');
+define('_JSHOP_YOO_QIWI_PHONE_TEXT', 'Phone number linked to QIWI Wallet');
+define('_JSHOP_YOO_FILL_PHONE_MESSAGE', 'Specify phone number');
+define('_JSHOP_YOO_FILL_ALFA_CLICK_LOGIN', 'Specify the login for Alfa-Click');
+define('_JSHOP_YOO_ENABLE', 'Enable');
+define('_JSHOP_YOO_DISABLE', 'Disable');
+define('_JSHOP_YOO_DEFAULT_TAX_LABEL', 'Default rate');
+define('_JSHOP_YOO_DEFAULT_TAX_DESCRIPTION', 'The default rate applies if another rate is not set on the product\'s page.');
+define('_JSHOP_YOO_TAX_RATES_LABEL', 'Compare rates');
+define('_JSHOP_YOO_TAX_IN_MODULE', 'Rate at your store');
+define('_JSHOP_YOO_TAX_FOR_CHECKOUT', 'Rate for the receipt to the tax service');
+define('_JSHOP_YOO_WITHOUT_VAT', 'Without VAT');
+define('_JSHOP_YOO_VAT_0', '0%');
+define('_JSHOP_YOO_VAT_10', '10%');
+define('_JSHOP_YOO_VAT_18', '18%');
+define('_JSHOP_YOO_VAT_20', '20%');
+define('_JSHOP_YOO_VAT_10_100', 'Applicable rate 10/110');
+define('_JSHOP_YOO_VAT_18_118', 'Applicable rate 18/118');
+define('_JSHOP_YOO_VAT_20_120', 'Applicable rate 20/120');
+define('_JSHOP_YOO_NOTIFICATION_URL_LABEL', 'Address for notifications');
+define('_JSHOP_YOO_NOTIFICATION_URL_HELP_TEXT', 'Only required if YooMoney\'s specialists ask for it');
+define('_JSHOP_YOO_LOG_VIEW_LABEL', 'View logs');
+define('_JSHOP_YOO_CLEAR_LOGS', 'Clear logs');
+define('_JSHOP_YOO_CLOSE', 'Close');
+define('_JSHOP_YOO_LOGS_LABEL', 'Logs');
+
+define('_JSHOP_YOO_TAB_UPDATE', 'Module update');
+
+define('_JSHOP_YOO_BTN_BACK', 'Back');
+
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lang/ru-RU.php b/src/components/com_jshopping/payments/pm_yoomoney/lang/ru-RU.php
new file mode 100644
index 0000000..1ad30c2
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lang/ru-RU.php
@@ -0,0 +1,233 @@
+ЮKassa.");
+define('_JSHOP_YOO_VERSION_DESCRIPTION','Версия модуля ');
+
+define('_JSHOP_YOO_TAB_MONEY', 'ЮMoney');
+define('_JSHOP_YOO_TAB_KASSA', 'ЮKassa');
+
+define('_JSHOP_YOO_KASSA_ON', 'Включить приём платежей через ЮKassa');
+define('_JSHOP_YOO_KASSA_TEST', 'Тестовый режим');
+define('_JSHOP_YOO_KASSA_WORK', 'Реальный режим');
+define('_JSHOP_YOO_KASSA_HELP_CHECKURL', 'Этот адрес понадобится, только если его попросят специалисты ЮKassa');
+define('_JSHOP_YOO_KASSA_HELP_SUCCESSURL', 'Включите «Использовать страницы успеха и ошибки с динамическими адресами» в настройках личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_HELP_DYNAMICURL', 'Страницы с динамическими адресами');
+
+define('_JSHOP_YOO_KASSA_HEAD_LK', 'Параметры из личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_SHOP_ID_LABEL', 'shopId');
+define('_JSHOP_YOO_KASSA_SHOP_ID_DESCRIPTION', 'Скопируйте shopId из личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_PASSWORD_LABEL', 'Секретный ключ');
+define('_JSHOP_YOO_KASSA_PASSWORD_DESCRIPTION', 'Выпустите и активируйте секретный ключ в личном кабинете ЮKassa. Потом скопируйте его сюда.');
+define('_JSHOP_YOO_KASSA_PARAMS', 'Shop ID, scid, ShopPassword можно посмотреть в личном кабинете после подключения ЮKassa.');
+
+define('_JSHOP_YOO_KASSA_PAYMODE_HEAD', 'Настройка сценария оплаты');
+define('_JSHOP_YOO_KASSA_PAYMODE_LABEL', 'Выбор способа оплаты');
+define('_JSHOP_YOO_KASSA_SEND_RECEIPT_LABEL', 'Отправлять в ЮKassa данные для чеков (54-ФЗ)');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_LABEL', 'Второй чек:');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_STATUS_LABEL', 'Формировать второй чек при переходе заказа в статус');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_INFO', 'Два чека нужно формировать, если покупатель вносит предоплату и потом получает товар или услугу. Первый чек — когда деньги поступают вам на счёт, второй — при отгрузке товаров или выполнении услуг.');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_HELP_BLOCK', 'Если в заказе будут позиции с признаками «Полная предоплата» — второй чек отправится автоматически, когда заказ перейдёт в выбранный статус.');
+define('_JSHOP_YOO_KASSA_SEND_SECOND_RECEIPT_HISTORY', 'Отправлен второй чек. Сумма %s рублей.');
+define('_JSHOP_YOO_DESCRIPTION_TITLE', 'Описание платежа');
+define('_JSHOP_YOO_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Оплата заказа №%order_id%');
+define('_JSHOP_YOO_DESCRIPTION_HELP', 'Это описание транзакции, которое пользователь увидит при оплате, а вы — в личном кабинете ЮKassa. Например, «Оплата заказа №72».
+Чтобы в описание подставлялся номер заказа (как в примере), поставьте на его месте %order_id% (Оплата заказа №%order_id%).
+Ограничение для описания — 128 символов.');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE', 'Включить отложенную оплату');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE_HELP', 'Если опция включена, платежи с карт проходят в 2 этапа: у клиента сумма замораживается, и вам вручную нужно подтвердить её списание – через панель администратора. Подробное описание Холдирования.');
+define('_JSHOP_YOO_HOLD_MODE_STATUSES', 'Какой статус присваивать заказу, если он:');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS', 'ожидает подтверждения');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS_HELP', 'заказ переходит в этот статус при поступлении и остается в нем пока оператор магазина не подтвердит или не отменит платеж');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS', 'отменён');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS_HELP', 'заказ переходит в этот статус после отмены платежа');
+define('_JSHOP_YOO_HOLD_MODE_COMMENT_ON_HOLD', 'Поступил новый платёж. Он ожидает подтверждения до %1$s, после чего автоматически отменится');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'Вы подтвердили платёж в ЮKassa.');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Платёж не подтвердился. Попробуйте ещё раз.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'Вы отменили платёж в ЮKassa. Деньги вернутся клиенту.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Платёж не отменился. Попробуйте ещё раз.');
+define('_JSHOP_YOO_KASSA_PAYMODE_KASSA', 'На стороне ЮKassa');
+define('_JSHOP_YOO_KASSA_PAYMODE_SHOP', 'На стороне магазина');
+define('_JSHOP_YOO_KASSA_PAYMODE_LINK', 'Подробнее о сценариях оплаты');
+define('_JSHOP_YOO_KASSA_SELECT_TEXT', 'Отметьте способы оплаты, которые указаны в вашем договоре с ЮMoney');
+define('_JSHOP_YOO_KASSA_CREDENTIALS_ERROR', 'Проверьте shopId и Секретный ключ — где-то есть ошибка. А лучше скопируйте их прямо из личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_TEST_WARNING', 'Вы включили тестовый режим приема платежей. Проверьте, как проходит оплата, и напишите менеджеру ЮKassa. Он выдаст рабочие shopId и Секретный ключ. Инструкция');
+
+define('_JSHOP_YOO_METHOD_YOO_MONEY_DESCRIPTION', 'ЮMoney');
+define('_JSHOP_YOO_METHOD_CARDS_DESCRIPTION', 'Банковские карты');
+define('_JSHOP_YOO_METHOD_BANK_CARD_DESCRIPTION', 'Банковские карты');
+define('_JSHOP_YOO_METHOD_CASH_DESCRIPTION', 'Наличные через терминалы');
+define('_JSHOP_YOO_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Баланс мобильного');
+define('_JSHOP_YOO_METHOD_WEBMONEY_DESCRIPTION', 'Кошелек WebMoney');
+define('_JSHOP_YOO_METHOD_ALFABANK_DESCRIPTION', 'Альфа-Клик');
+define('_JSHOP_YOO_METHOD_SBERBANK_DESCRIPTION', 'Сбербанк Онлайн');
+define('_JSHOP_YOO_METHOD_TINKOFF_BANK_DESCRIPTION', 'Интернет-банк Тинькофф');
+define('_JSHOP_YOO_METHOD_MA_DESCRIPTION', 'MasterPass');
+define('_JSHOP_YOO_METHOD_PB_DESCRIPTION', 'Интернет-банк Промсвязьбанка');
+define('_JSHOP_YOO_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
+define('_JSHOP_YOO_METHOD_QP_DESCRIPTION', 'Доверительный платеж (Куппи.ру)');
+define('_JSHOP_YOO_METHOD_MP_DESCRIPTION', 'Мобильный терминал');
+define('_JSHOP_YOO_METHOD_WIDGET_DESCRIPTION', 'Платёжный виджет ЮKassa (карты, Apple Pay и Google Pay)');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_DESCRIPTION', 'Заплатить по частям');
+
+
+define('_JSHOP_YOO_INSTALL_VERIFY_APPLE_PAY_FILE_WARNING', 'Чтобы покупатели могли заплатить вам через Apple Pay, скачайте файл apple-developer-merchantid-domain-association и добавьте его в папку ./well-known на вашем сайте. Если не знаете, как это сделать, обратитесь к администратору сайта или в поддержку хостинга. Не забудьте также подключить оплату через Apple Pay в личном кабинете ЮKassa. Почитать о подключении Apple Pay в документации ЮKassa');
+
+define('_JSHOP_YOO_METHOD_YOO_MONEY_DESCRIPTION_PUBLIC', 'ЮMoney');
+define('_JSHOP_YOO_METHOD_CARDS_DESCRIPTION_PUBLIC', 'Банковские карты');
+define('_JSHOP_YOO_METHOD_BANK_CARD_DESCRIPTION_PUBLIC', 'Банковские карты');
+define('_JSHOP_YOO_METHOD_CASH_DESCRIPTION_PUBLIC', 'Наличные через терминалы');
+define('_JSHOP_YOO_METHOD_MOBILE_BALANCE_DESCRIPTION_PUBLIC', 'Баланс мобильного');
+define('_JSHOP_YOO_METHOD_WEBMONEY_DESCRIPTION_PUBLIC', 'Кошелек WebMoney');
+define('_JSHOP_YOO_METHOD_ALFABANK_DESCRIPTION_PUBLIC', 'Альфа-Клик');
+define('_JSHOP_YOO_METHOD_SBERBANK_DESCRIPTION_PUBLIC', 'Сбербанк Онлайн');
+define('_JSHOP_YOO_METHOD_TINKOFF_BANK_DESCRIPTION_PUBLIC', 'Интернет-банк Тинькофф');
+define('_JSHOP_YOO_METHOD_MA_DESCRIPTION_PUBLIC', 'MasterPass');
+define('_JSHOP_YOO_METHOD_PB_DESCRIPTION_PUBLIC', 'Интернет-банк Промсвязьбанка');
+define('_JSHOP_YOO_METHOD_QIWI_DESCRIPTION_PUBLIC', 'QIWI Wallet');
+define('_JSHOP_YOO_METHOD_QP_DESCRIPTION_PUBLIC', 'Доверительный платеж (Куппи.ру)');
+define('_JSHOP_YOO_METHOD_MP_DESCRIPTION_PUBLIC', 'Мобильный терминал');
+define('_JSHOP_YOO_METHOD_WIDGET_DESCRIPTION_PUBLIC', 'Банковские карты, Apple Pay, Google Pay');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_DESCRIPTION_PUBLIC', 'Заплатить по частям');
+
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ в месяц)');
+define('_JSHOP_YOO_KASSA_MPOS_LABEL', 'Страница успеха для способа «Оплата картой при доставке»');
+define('_JSHOP_YOO_KASSA_MPOS_HELP', 'Это страница с информацией о доставке. Укажите на ней, когда привезут товар и как его можно будет оплатить');
+
+define('_JSHOP_YOO_MONEY_HEAD', 'Для работы с модулем нужно открыть кошелек на ЮMoney и
+ зарегистрировать приложение на сайте ЮMoney');
+define('_JSHOP_YOO_MONEY_ON', 'Включить прием платежей в кошелек на ЮMoney');
+define('_JSHOP_YOO_MONEY_REDIRECT_HELP', 'Скопируйте эту ссылку в поле Redirect URL на странице регистрации приложения.');
+
+define('_JSHOP_YOO_MONEY_SET_HEAD', 'Настройки приема платежей');
+define('_JSHOP_YOO_MONEY_WALLET', 'Номер кошелька');
+define('_JSHOP_YOO_MONEY_PSW', 'Секретное слово');
+
+define('_JSHOP_YOO_MONEY_SELECT_HEAD', 'Настройка сценария оплаты');
+define('_JSHOP_YOO_MONEY_SELECT_LABEL', 'Способы оплаты');
+define('_JSHOP_YOO_METHOD_YM2_DESCRIPTION', 'Кошелек ЮMoney');
+define('_JSHOP_YOO_METHOD_CARDS2_DESCRIPTION', 'Банковская карта');
+
+define('_JSHOP_YOO_METHOD_YM2_DESCRIPTION_PUBLIC', 'Кошелек ЮMoney');
+define('_JSHOP_YOO_METHOD_CARDS2_DESCRIPTION_PUBLIC', 'Банковская карта');
+
+define('_JSHOP_YOO_COMMON_HEAD', 'Дополнительные настройки для администратора');
+define('_JSHOP_YOO_COMMON_STATUS', 'Статус заказа после оплаты');
+
+
+define('_JSHOP_YOO_PAYMENTS_STATUS_LABEL', 'Статус заказа');
+define('_JSHOP_YOO_PAYMENTS_STATUS_INFO', 'Статус должен показать, что результат платежа неизвестен: о том, что клиент
+заплатил, можно узнать только из письма от Платежки или в своем банке.');
+define('_JSHOP_YOO_PAYMENTS_FIO_LABEL', 'ФИО плательщика');
+define('_JSHOP_YOO_PAYMENTS_CONFIRM_LABEL', 'Далее');
+define('_JSHOP_YOO_PAYMENTS_EMPTY_NAME_ERROR', 'Укажите ФИО плательщика');
+define('_JSHOP_YOO_PAYMENTS_INVALID_NAME_ERROR', 'ФИО плательщика должно состоять из фамилии, имени и отчества, разделённых пробелами');
+
+// версия 2.х
+define('_JSHOP_YOO_LICENSE','Лицензионный договор:');
+define('_JSHOP_YOO_LICENSE_TEXT2',"
Любое использование Вами программы означает полное и безоговорочное принятие Вами условий лицензионного договора, размещенного по адресу https://yoomoney.ru/doc.xml?id=527132 (далее – «Лицензионный договор»). Если Вы не принимаете условия Лицензионного договора в полном объёме, Вы не имеете права использовать программу в каких-либо целях.
");
+define('_JSHOP_YOO_TESTMODE_DESCRIPTION', 'Использовать в тестовом режиме?');
+define('_JSHOP_YOO_MODE_DESCRIPTION', 'Способ приема платежей:');
+define('_JSHOP_YOO_MODE1_DESCRIPTION', 'ЮMoneyи');
+define('_JSHOP_YOO_MODE2_DESCRIPTION', 'ЮKassa (выбор оплаты на стороне сайта)');
+define('_JSHOP_YOO_MODE3_DESCRIPTION', 'ЮKassa (выбор оплаты на стороне ЮKassa)');
+define('_JSHOP_YOO_REG_IND', 'Если у вас нет аккаунта в ЮMoney, то следует зарегистрироваться тут - https://yoomoney.ru/ ВАЖНО! Вам нужно будет указать ссылку для приема HTTP уведомлений здесь - https://sp-yoomoney.ru/myservices/online.xml');
+
+define('_JSHOP_YOO_REG_ORG', 'Для работы с модулем необходимо подключить магазин к YooMoney for business. После подключения вы получите параметры для приема платежей (идентификатор магазина — shopId и номер витрины — scid).');
+define('_JSHOP_YOO_METHODS_DESCRIPTION', 'Укажите необходимые способы оплаты');
+define('_JSHOP_YOO_PASSWORD', 'Секретное слово (shopPassword) для обмена сообщениями:');
+define('_JSHOP_YOO_SHOPID', 'Идентификатор вашего магазина в ЮMoney (ShopID):');
+define('_JSHOP_YOO_SCID', 'Идентификатор витрины вашего магазина в ЮMoney (scid):');
+define('_JSHOP_YOO_PARAM', 'Название параметра');
+define('_JSHOP_YOO_VALUE', 'Значение');
+define('_JSHOP_YOO_RETURNURL', 'Динамический');
+define('_JSHOP_YOO_ACCOUNT_DESCRIPTION', 'Номер кошелька ЮMoney:');
+
+define('_JSHOP_YOO_PAY', 'Оплатить!');
+define('_JSHOP_YOO_TRANSACTION_END', 'Статус заказа для успешных транзакций');
+define('_JSHOP_YOO_TEXT_MPOS', 'Страница с инструкцией для платеждей через мобильный терминал!');
+
+//updater
+define('_JSHOP_YOO_UPDATER_ERROR_RESTORE', 'Не удалось восстановить модуль из резервной копии: ');
+define('_JSHOP_YOO_UPDATER_SUCCESS_MESSAGE', 'Модуль был успешно восстановлен из резервной копии: ');
+define('_JSHOP_YOO_UPDATER_ERROR_REMOVE', 'Не был передан удаляемый файл резервной копии');
+define('_JSHOP_YOO_ERROR_BACKUP_NOT_FOUND', 'Файл резервной копии %s не найден');
+define('_JSHOP_YOO_ERROR_REMOVE_BACKUP', 'Не удалось удалить файл резервной копии ');
+define('_JSHOP_YOO_SUCCESS_REMOVE_BECKUP', 'Файл резервной копии %s был успешно удалён');
+define('_JSHOP_YOO_SUCCESS_UPDATE_VERSION', 'Версия модуля %s (%s) была успешно загружена и установлена');
+define('_JSHOP_YOO_ERROR_UNPACK_NEW_VERSION', 'Не удалось распаковать загруженный архив %s, подробную информацию о произошедшей ошибке можно найти в логах модуля');
+define('_JSHOP_YOO_ERROR_CREATE_BACKUP', 'Не удалось создать резервную копию установленной версии модуля, подробную информацию о произошедшей ошибке можно найти в логах модуля');
+define('_JSHOP_YOO_ERROR_DOWNLOAD_NEW_VERSION', 'Не удалось загрузить архив с новой версией, подробную информацию о произошедшей ошибке можно найти в логах модуля');
+define('_JSHOP_YOO_FAILED_CREATE_DIRECTORY', 'Не удалось создать директорию ');
+define('_JSHOP_YOO_FAILED_DOWNLOAD_UPDATE', 'Не удалось загрузить архив с обновлением');
+define('_JSHOP_YOO_UPDATER_HEADER_TEXT', ' Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками. Чтобы установить новую версию модуля, нажмите кнопку «Обновить».');
+define('_JSHOP_YOO_UPDATER_ABOUT', 'О модуле:');
+define('_JSHOP_YOO_UPDATER_CURRENT_VERSION', 'Установленная версия модуля —');
+define('_JSHOP_YOO_UPDATER_LAST_VERSION', 'Последняя версия модуля —');
+define('_JSHOP_YOO_UPDATER_LAST_CHECK', 'Последняя проверка наличия новых версий —');
+define('_JSHOP_YOO_UPDATER_CHECK', 'Проверить наличие обновлений');
+define('_JSHOP_YOO_HISTORY_LABEL', 'История изменений:');
+define('_JSHOP_YOO_UPDATE_LABEL', 'Обновить');
+define('_JSHOP_YOO_INSTALL_MESSAGE', 'Установлена последняя версия модуля.');
+define('_JSHOP_YOO_BACKUPS_LABEL', 'Резервные копии');
+define('_JSHOP_YOO_MODULE_VERSION_LABEL', 'Версия модуля');
+define('_JSHOP_YOO_BACKUP_DATE_CREATE', 'Дата создания');
+define('_JSHOP_YOO_BACKUP_FILE_NAME', 'Имя файла');
+define('_JSHOP_YOO_BACKUP_FILE_SIZE', 'Размер файла');
+define('_JSHOP_YOO_UPDATER_RESTORE', 'Восстановить');
+define('_JSHOP_YOO_UPDATER_DELETE', 'Удалить');
+define('_JSHOP_YOO_UPDATER_APPROVE_ACTION_MESSAGE', 'Вы действительно хотите обновить модуль до последней версии?');
+define('_JSHOP_YOO_UPDATER_APPROVE_DELETE_MESSAGE', 'Вы действительно хотите удалить резервную копию');
+define('_JSHOP_YOO_UPDATER_APPROVE_RESTORE_MESSAGE', 'Вы действительно хотите восстановить резервную копию');
+define('_JSHOP_YOO_UPDATER_TEXT_HEADER', 'Обновление модуля');
+define('_JSHOP_YOO_UPDATER_ABOUT_TEXT', 'Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками.');
+define('_JSHOP_YOO_UPDATER_DISABLED_TEXT', ' К сожалению функция обновления модуля недоступна');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP_CURL', 'так как для не установлены расширения "zip" и "curl".');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP', 'так как для не установлено расширение "zip".');
+define('_JSHOP_YOO_UPDATER_CAUSE_CURL', 'так как для не установлено расширение "curl".');
+
+
+
+define('_JSHOP_YOO_WAITING_FOR_CAPTURE', 'Ожидается проведение оплаты');
+define('_JSHOP_YOO_CAPTURE_FAILED', 'Платёж не был проведён');
+define('_JSHOP_YOO_PAYMENT_CAPTURED', 'Оплата была проведена');
+define('_JSHOP_YOO_PAYMENT_CAPTURED_TEXT', 'Платёж %s проведён');
+define('_JSHOP_YOO_ERROR_MESSAGE_CREATE_PAYMENT', 'Не удалось создать платёж, попробуйте выбрать другой способ оплаты.');
+define('_JSHOP_YOO_ALFA_CLICK_TEXT', 'Укажите логин, и мы выставим счет в Альфа-Клике. После этого останется подтвердить платеж на сайте интернет-банка.');
+define('_JSHOP_YOO_QIWI_PHONE_TEXT', 'Телефон, который привязан к Qiwi Wallet');
+define('_JSHOP_YOO_FILL_PHONE_MESSAGE', 'Укажите телефон');
+define('_JSHOP_YOO_FILL_ALFA_CLICK_LOGIN', 'Укажите логин в Альфа-клике');
+define('_JSHOP_YOO_ENABLE', 'Включить');
+define('_JSHOP_YOO_DISABLE', 'Выключить');
+define('_JSHOP_YOO_DEFAULT_TAX_LABEL', 'Ставка по умолчанию');
+define('_JSHOP_YOO_DEFAULT_TAX_DESCRIPTION', 'Ставка по умолчанию будет в чеке, если в карточке товара не указана другая ставка.');
+define('_JSHOP_YOO_TAX_RATES_LABEL', 'Сопоставьте ставки');
+define('_JSHOP_YOO_TAX_IN_MODULE', 'Ставка в вашем магазине');
+define('_JSHOP_YOO_TAX_FOR_CHECKOUT', 'Ставка для чека в налоговую');
+define('_JSHOP_YOO_WITHOUT_VAT', 'Без НДС');
+define('_JSHOP_YOO_VAT_0', '0%');
+define('_JSHOP_YOO_VAT_10', '10%');
+define('_JSHOP_YOO_VAT_18', '18%');
+define('_JSHOP_YOO_VAT_20', '20%');
+define('_JSHOP_YOO_VAT_10_100', 'Расчётная ставка 10/110');
+define('_JSHOP_YOO_VAT_18_118', 'Расчётная ставка 18/118');
+define('_JSHOP_YOO_VAT_20_120', 'Расчётная ставка 20/120');
+define('_JSHOP_YOO_NOTIFICATION_URL_LABEL', 'Адрес для уведомлений');
+define('_JSHOP_YOO_NOTIFICATION_URL_HELP_TEXT', 'Этот адрес понадобится, только если его попросят специалисты ЮKassa');
+define('_JSHOP_YOO_LOG_VIEW_LABEL', 'Просмотр логов модуля');
+define('_JSHOP_YOO_CLEAR_LOGS', 'Очистить журнал');
+define('_JSHOP_YOO_CLOSE', 'Закрыть');
+define('_JSHOP_YOO_LOGS_LABEL', 'Журнал сообщений модуля');
+
+define('_JSHOP_YOO_TAB_UPDATE', 'Обновления');
+
+define('_JSHOP_YOO_BTN_BACK', 'Назад');
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/Model/KassaPaymentMethod.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php
similarity index 81%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/Model/KassaPaymentMethod.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php
index e5215ea..1e20540 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/Model/KassaPaymentMethod.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaPaymentMethod.php
@@ -1,27 +1,27 @@
pmconfigs = $pmConfig;
$this->module = $module;
- $this->descriptionTemplate = !empty($pmConfig['ya_kassa_description_template'])
- ? $pmConfig['ya_kassa_description_template']
- : _JSHOP_YM_DESCRIPTION_DEFAULT_PLACEHOLDER;
+ $this->descriptionTemplate = !empty($pmConfig['yookassa_description_template'])
+ ? $pmConfig['yookassa_description_template']
+ : _JSHOP_YOO_DESCRIPTION_DEFAULT_PLACEHOLDER;
$this->defaultTaxRateId = 1;
- if (!empty($pmConfig['ya_kassa_default_tax'])) {
- $this->defaultTaxRateId = $pmConfig['ya_kassa_default_tax'];
+ if (!empty($pmConfig['yookassa_default_tax'])) {
+ $this->defaultTaxRateId = $pmConfig['yookassa_default_tax'];
}
- if (!empty($pmConfig['ya_kassa_default_payment_mode'])) {
- $this->defaultPaymentMode = $pmConfig['ya_kassa_default_payment_mode'];
+ if (!empty($pmConfig['yookassa_default_payment_mode'])) {
+ $this->defaultPaymentMode = $pmConfig['yookassa_default_payment_mode'];
}
- if (!empty($pmConfig['ya_kassa_default_payment_subject'])) {
- $this->defaultPaymentSubject = $pmConfig['ya_kassa_default_payment_subject'];
+ if (!empty($pmConfig['yookassa_default_payment_subject'])) {
+ $this->defaultPaymentSubject = $pmConfig['yookassa_default_payment_subject'];
}
- if (!empty($pmConfig['ya_kassa_default_delivery_payment_mode'])) {
- $this->defaultDeliveryPaymentMode = $pmConfig['ya_kassa_default_delivery_payment_mode'];
+ if (!empty($pmConfig['yookassa_default_delivery_payment_mode'])) {
+ $this->defaultDeliveryPaymentMode = $pmConfig['yookassa_default_delivery_payment_mode'];
}
- if (!empty($pmConfig['ya_kassa_default_delivery_payment_subject'])) {
- $this->defaultDeliveryPaymentSubject = $pmConfig['ya_kassa_default_delivery_payment_subject'];
+ if (!empty($pmConfig['yookassa_default_delivery_payment_subject'])) {
+ $this->defaultDeliveryPaymentSubject = $pmConfig['yookassa_default_delivery_payment_subject'];
}
$this->taxRates = array();
foreach ($pmConfig as $key => $value) {
- if (strncmp('ya_kassa_tax_', $key, 13) === 0) {
+ if (strncmp('yookassa_tax_', $key, 13) === 0) {
$taxRateId = substr($key, 13);
$this->taxRates[$taxRateId] = $value;
}
@@ -100,7 +100,7 @@ public function getPassword()
* @param \jshopCart $cart
* @param $returnUrl
*
- * @return null|\YandexCheckout\Request\Payments\CreatePaymentResponse
+ * @return null|\YooKassa\Request\Payments\CreatePaymentResponse
*
* @throws \Exception
* @since version
@@ -116,8 +116,8 @@ public function createPayment($order, $cart, $returnUrl)
->setDescription($this->createDescription($order))
->setMetadata(array(
'order_id' => $order->order_id,
- 'cms_name' => 'ya_api_joomshopping',
- 'module_version' => _JSHOP_YM_VERSION,
+ 'cms_name' => 'yoo_api_joomshopping',
+ 'module_version' => _JSHOP_YOO_VERSION,
));
$confirmation = array(
@@ -178,8 +178,8 @@ public function createPayment($order, $cart, $returnUrl)
* @param $order
* @param $cart
* @param $returnUrl
- * @return \YandexCheckout\Request\Payments\CreatePaymentResponse|null
- * @throws \SbbolException
+ * @return \YooKassa\Request\Payments\CreatePaymentResponse|null
+ * @throws SbbolException
*/
public function createSbbolPayment($order, $cart, $returnUrl)
{
@@ -191,8 +191,8 @@ public function createSbbolPayment($order, $cart, $returnUrl)
->setClientIp($_SERVER['REMOTE_ADDR'])
->setMetadata(array(
'order_id' => $order->order_id,
- 'cms_name' => 'ya_api_joomshopping',
- 'module_version' => _JSHOP_YM_VERSION,
+ 'cms_name' => 'yoo_api_joomshopping',
+ 'module_version' => _JSHOP_YOO_VERSION,
));
$confirmation = array(
@@ -203,10 +203,10 @@ public function createSbbolPayment($order, $cart, $returnUrl)
$usedTaxes = array();
if (count($cart->products)) {
foreach ($cart->products as $product) {
- if (isset($pmconfigs['ya_sbbol_tax_'.$product['tax_id']])) {
- $usedTaxes[] = $pmconfigs['ya_sbbol_tax_'.$product['tax_id']];
+ if (isset($pmconfigs['yoo_sbbol_tax_'.$product['tax_id']])) {
+ $usedTaxes[] = $pmconfigs['yoo_sbbol_tax_'.$product['tax_id']];
} else {
- $usedTaxes[] = $pmconfigs['ya_sbbol_default_tax'];
+ $usedTaxes[] = $pmconfigs['yoo_sbbol_default_tax'];
}
}
} else {
@@ -215,7 +215,7 @@ public function createSbbolPayment($order, $cart, $returnUrl)
$usedTaxes = array_unique($usedTaxes);
if (count($usedTaxes) !== 1) {
- throw new \SbbolException();
+ throw new SbbolException();
}
$paymentMethodData = new PaymentDataB2bSberbank();
@@ -242,7 +242,7 @@ public function createSbbolPayment($order, $cart, $returnUrl)
$builder->setConfirmation($confirmation);
$builder->setPaymentMethodData($paymentMethodData);
$request = $builder->build();
- } catch (\SbbolException $e) {
+ } catch (SbbolException $e) {
throw $e;
} catch (\Exception $e) {
$this->module->log('error', 'Failed to build request: '.$e->getMessage());
@@ -299,7 +299,7 @@ public function fetchPayment($paymentId)
}
/**
- * @param \YandexCheckout\Request\Payments\CreatePaymentRequestBuilder|CreateCaptureRequestBuilder $builder
+ * @param \YooKassa\Request\Payments\CreatePaymentRequestBuilder|CreateCaptureRequestBuilder $builder
* @param array $products
* @param $order
*/
@@ -373,7 +373,7 @@ public function getClient()
$userAgent = $this->client->getApiClient()->getUserAgent();
$userAgent->setCms('Joomla', \JPlatform::getLongVersion());
$userAgent->setFramework('Joomshopping', \JSFactory::getConfig()->getVersion());
- $userAgent->setModule('Y.CMS Joomshopping ', _JSHOP_YM_VERSION);
+ $userAgent->setModule('Y.CMS Joomshopping ', _JSHOP_YOO_VERSION);
}
return $this->client;
@@ -419,7 +419,7 @@ private function createDescription($order)
*/
public function isEnableHoldMode()
{
- return isset($this->pmconfigs['ya_kassa_enable_hold_mode']) && $this->pmconfigs['ya_kassa_enable_hold_mode'] == '1';
+ return isset($this->pmconfigs['yookassa_enable_hold_mode']) && $this->pmconfigs['yookassa_enable_hold_mode'] == '1';
}
/**
@@ -441,7 +441,7 @@ private function getCaptureValue($paymentMethod)
*/
public function isSendReceipt()
{
- return isset($this->pmconfigs['ya_kassa_send_check']) && $this->pmconfigs['ya_kassa_send_check'] == '1';
+ return isset($this->pmconfigs['yookassa_send_check']) && $this->pmconfigs['yookassa_send_check'] == '1';
}
/**
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/Model/KassaSecondReceiptModel.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaSecondReceiptModel.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/Model/KassaSecondReceiptModel.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaSecondReceiptModel.php
index e21ca11..0d4ce5d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/Model/KassaSecondReceiptModel.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/KassaSecondReceiptModel.php
@@ -1,19 +1,19 @@
log($level, $message, $context);
+ $pm_yoomoney = new \pm_yoomoney();
+ $pm_yoomoney->log($level, $message, $context);
}
}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/Model/OrderModel.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/OrderModel.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/Model/OrderModel.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/Model/OrderModel.php
index 044352f..30ffcaf 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/Model/OrderModel.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Model/OrderModel.php
@@ -1,8 +1,8 @@
_db->getQuery(true);
$query->select('payment_id')
- ->from('#__ya_money_payments')
+ ->from('#__yoomoney_payments')
->where($this->_db->quoteName('order_id') . ' = ' . (int)$orderId);
$this->_db->setQuery($query);
$record = $this->_db->loadRow();
@@ -35,7 +35,7 @@ public function getPaymentIdByOrderId($orderId)
{
$query = $this->_db->getQuery(true);
$query->select('payment_id')
- ->from('#__ya_money_payments')
+ ->from('#__yoomoney_payments')
->where($this->_db->quoteName('order_id') . ' = ' . (int)$orderId);
$this->_db->setQuery($query);
$record = $this->_db->loadRow();
@@ -57,7 +57,7 @@ private function insertPayment($orderId, $payment)
}
$query = $this->_db->getQuery(true);
- $query->clear()->insert('#__ya_money_payments')
+ $query->clear()->insert('#__yoomoney_payments')
->columns(
array(
$this->_db->quoteName('order_id'), $this->_db->quoteName('payment_id'),
@@ -97,7 +97,7 @@ private function updatePayment($orderId, $payment)
}
$query = $this->_db->getQuery(true);
- $query->update('#__ya_money_payments')
+ $query->update('#__yoomoney_payments')
->set(
$this->_db->quoteName('payment_id') . ' = ' . $this->_db->quote($payment->getId()) . ',' .
$this->_db->quoteName('status') . ' = ' . $this->_db->quote($payment->getStatus()) . ',' .
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/Updater/Archive/BackupZip.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/Updater/Archive/BackupZip.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/Updater/Archive/BackupZip.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/Updater/Archive/BackupZip.php
index 5d87b0d..66e4d00 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/Updater/Archive/BackupZip.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/Updater/Archive/BackupZip.php
@@ -1,17 +1,17 @@
apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+ $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
}
/**
@@ -377,11 +377,11 @@ private function findFileWithExtension($class, $ext)
$subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos);
- $search = $subPath.'\\';
+ $search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) {
- $length = $this->prefixLengthsPsr4[$first][$search];
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) {
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
+ if (file_exists($file = $dir . $pathEnd)) {
return $file;
}
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/LICENSE b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/LICENSE
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/LICENSE
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/LICENSE
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_classmap.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_classmap.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_classmap.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_classmap.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_namespaces.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_namespaces.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_namespaces.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_namespaces.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_psr4.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_psr4.php
similarity index 73%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_psr4.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_psr4.php
index 51f3776..2266a4c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_psr4.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_psr4.php
@@ -6,6 +6,6 @@
$baseDir = dirname($vendorDir);
return array(
- 'YandexCheckout\\' => array($baseDir . '/lib'),
+ 'YooKassa\\' => array($vendorDir . '/yoomoney/yookassa-sdk-php/lib'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
);
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_real.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_real.php
similarity index 76%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_real.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_real.php
index 9a446a5..ed124d0 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_real.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit68f155e88739542eafa51e07ced35825
+class ComposerAutoloaderInit7b690e82411dcbcd6afd0ce21e7deadc
{
private static $loader;
@@ -13,21 +13,24 @@ public static function loadClassLoader($class)
}
}
+ /**
+ * @return \Composer\Autoload\ClassLoader
+ */
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit68f155e88739542eafa51e07ced35825', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit7b690e82411dcbcd6afd0ce21e7deadc', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
- spl_autoload_unregister(array('ComposerAutoloaderInit68f155e88739542eafa51e07ced35825', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit7b690e82411dcbcd6afd0ce21e7deadc', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit68f155e88739542eafa51e07ced35825::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInit7b690e82411dcbcd6afd0ce21e7deadc::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_static.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_static.php
similarity index 60%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_static.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_static.php
index 1904a61..f59bafb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/composer/autoload_static.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/autoload_static.php
@@ -4,12 +4,12 @@
namespace Composer\Autoload;
-class ComposerStaticInit68f155e88739542eafa51e07ced35825
+class ComposerStaticInit7b690e82411dcbcd6afd0ce21e7deadc
{
public static $prefixLengthsPsr4 = array (
'Y' =>
array (
- 'YandexCheckout\\' => 15,
+ 'YooKassa\\' => 9,
),
'P' =>
array (
@@ -18,9 +18,9 @@ class ComposerStaticInit68f155e88739542eafa51e07ced35825
);
public static $prefixDirsPsr4 = array (
- 'YandexCheckout\\' =>
+ 'YooKassa\\' =>
array (
- 0 => __DIR__ . '/../..' . '/lib',
+ 0 => __DIR__ . '/..' . '/yoomoney/yookassa-sdk-php/lib',
),
'Psr\\Log\\' =>
array (
@@ -31,8 +31,8 @@ class ComposerStaticInit68f155e88739542eafa51e07ced35825
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit68f155e88739542eafa51e07ced35825::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit68f155e88739542eafa51e07ced35825::$prefixDirsPsr4;
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7b690e82411dcbcd6afd0ce21e7deadc::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit7b690e82411dcbcd6afd0ce21e7deadc::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/installed.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/installed.json
new file mode 100644
index 0000000..36bfccc
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/composer/installed.json
@@ -0,0 +1,106 @@
+[
+ {
+ "name": "psr/log",
+ "version": "1.1.3",
+ "version_normalized": "1.1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
+ "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2020-03-23T09:12:05+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ]
+ },
+ {
+ "name": "yoomoney/yookassa-sdk-php",
+ "version": "2.0.3",
+ "version_normalized": "2.0.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/yoomoney/yookassa-sdk-php.git",
+ "reference": "427c05f0cf31ee0ac3afcaedcc9c9b65ea4f352b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/yoomoney/yookassa-sdk-php/zipball/427c05f0cf31ee0ac3afcaedcc9c9b65ea4f352b",
+ "reference": "427c05f0cf31ee0ac3afcaedcc9c9b65ea4f352b",
+ "shasum": ""
+ },
+ "require": {
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "php": ">=5.3.0",
+ "psr/log": "^1.0"
+ },
+ "require-dev": {
+ "ext-xml": "*",
+ "mockery/mockery": "^0.9.9",
+ "phpunit/phpunit": "^4.8.35 || ^5.7"
+ },
+ "time": "2020-12-10T06:27:14+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "YooKassa\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "YooMoney",
+ "email": "cms@yoomoney.ru"
+ }
+ ],
+ "description": "This is a developer tool for integration with YooMoney.",
+ "homepage": "https://yookassa.ru/developers/api",
+ "keywords": [
+ "api",
+ "payments",
+ "sdk",
+ "yookassa",
+ "yoomoney"
+ ]
+ }
+]
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/LICENSE b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/LICENSE
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/LICENSE
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/LICENSE
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/AbstractLogger.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/AbstractLogger.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/AbstractLogger.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/AbstractLogger.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/InvalidArgumentException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/InvalidArgumentException.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/InvalidArgumentException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/InvalidArgumentException.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LogLevel.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LogLevel.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LogLevel.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LogLevel.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerAwareInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerAwareInterface.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerAwareTrait.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
similarity index 100%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerAwareTrait.php
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerInterface.php
similarity index 79%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerInterface.php
index 5ea7243..2206cfd 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerInterface.php
@@ -22,8 +22,8 @@ interface LoggerInterface
/**
* System is unusable.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -35,8 +35,8 @@ public function emergency($message, array $context = array());
* Example: Entire website down, database unavailable, etc. This should
* trigger the SMS alerts and wake you up.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -47,8 +47,8 @@ public function alert($message, array $context = array());
*
* Example: Application component unavailable, unexpected exception.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -58,8 +58,8 @@ public function critical($message, array $context = array());
* Runtime errors that do not require immediate action but should typically
* be logged and monitored.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -71,8 +71,8 @@ public function error($message, array $context = array());
* Example: Use of deprecated APIs, poor use of an API, undesirable things
* that are not necessarily wrong.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -81,8 +81,8 @@ public function warning($message, array $context = array());
/**
* Normal but significant events.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -93,8 +93,8 @@ public function notice($message, array $context = array());
*
* Example: User logs in, SQL logs.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -103,8 +103,8 @@ public function info($message, array $context = array());
/**
* Detailed debug information.
*
- * @param string $message
- * @param array $context
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
*/
@@ -113,11 +113,13 @@ public function debug($message, array $context = array());
/**
* Logs with an arbitrary level.
*
- * @param mixed $level
- * @param string $message
- * @param array $context
+ * @param mixed $level
+ * @param string $message
+ * @param mixed[] $context
*
* @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, $message, array $context = array());
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerTrait.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerTrait.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerTrait.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerTrait.php
index 867225d..e392fef 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/LoggerTrait.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/LoggerTrait.php
@@ -135,6 +135,8 @@ public function debug($message, array $context = array())
* @param array $context
*
* @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
*/
abstract public function log($level, $message, array $context = array());
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/NullLogger.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/NullLogger.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/NullLogger.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/NullLogger.php
index d8cd682..c8f7293 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/Psr/Log/NullLogger.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/NullLogger.php
@@ -20,6 +20,8 @@ class NullLogger extends AbstractLogger
* @param array $context
*
* @return void
+ *
+ * @throws \Psr\Log\InvalidArgumentException
*/
public function log($level, $message, array $context = array())
{
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/Test/DummyTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/Test/DummyTest.php
new file mode 100644
index 0000000..9638c11
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/Test/DummyTest.php
@@ -0,0 +1,18 @@
+ true,
'null' => null,
@@ -110,6 +114,7 @@ public function testContextCanContainAnything()
'nested' => array('with object' => new DummyTest),
'object' => new \DateTime,
'resource' => fopen('php://memory', 'r'),
+ 'closed' => $closed,
);
$this->getLogger()->warning('Crazy context data', $context);
@@ -131,10 +136,3 @@ public function testContextExceptionKeyCanBeExceptionOrOtherValues()
$this->assertEquals($expected, $this->getLogs());
}
}
-
-class DummyTest
-{
- public function __toString()
- {
- }
-}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php
new file mode 100644
index 0000000..1be3230
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/Psr/Log/Test/TestLogger.php
@@ -0,0 +1,147 @@
+ $level,
+ 'message' => $message,
+ 'context' => $context,
+ ];
+
+ $this->recordsByLevel[$record['level']][] = $record;
+ $this->records[] = $record;
+ }
+
+ public function hasRecords($level)
+ {
+ return isset($this->recordsByLevel[$level]);
+ }
+
+ public function hasRecord($record, $level)
+ {
+ if (is_string($record)) {
+ $record = ['message' => $record];
+ }
+ return $this->hasRecordThatPasses(function ($rec) use ($record) {
+ if ($rec['message'] !== $record['message']) {
+ return false;
+ }
+ if (isset($record['context']) && $rec['context'] !== $record['context']) {
+ return false;
+ }
+ return true;
+ }, $level);
+ }
+
+ public function hasRecordThatContains($message, $level)
+ {
+ return $this->hasRecordThatPasses(function ($rec) use ($message) {
+ return strpos($rec['message'], $message) !== false;
+ }, $level);
+ }
+
+ public function hasRecordThatMatches($regex, $level)
+ {
+ return $this->hasRecordThatPasses(function ($rec) use ($regex) {
+ return preg_match($regex, $rec['message']) > 0;
+ }, $level);
+ }
+
+ public function hasRecordThatPasses(callable $predicate, $level)
+ {
+ if (!isset($this->recordsByLevel[$level])) {
+ return false;
+ }
+ foreach ($this->recordsByLevel[$level] as $i => $rec) {
+ if (call_user_func($predicate, $rec, $i)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public function __call($method, $args)
+ {
+ if (preg_match('/(.*)(Debug|Info|Notice|Warning|Error|Critical|Alert|Emergency)(.*)/', $method, $matches) > 0) {
+ $genericMethod = $matches[1] . ('Records' !== $matches[3] ? 'Record' : '') . $matches[3];
+ $level = strtolower($matches[2]);
+ if (method_exists($this, $genericMethod)) {
+ $args[] = $level;
+ return call_user_func_array([$this, $genericMethod], $args);
+ }
+ }
+ throw new \BadMethodCallException('Call to undefined method ' . get_class($this) . '::' . $method . '()');
+ }
+
+ public function reset()
+ {
+ $this->records = [];
+ $this->recordsByLevel = [];
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/README.md b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/README.md
similarity index 80%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/README.md
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/README.md
index 574bc1c..a9f20c4 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/README.md
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/README.md
@@ -7,6 +7,13 @@ This repository holds all interfaces/classes/traits related to
Note that this is not a logger of its own. It is merely an interface that
describes a logger. See the specification for more details.
+Installation
+------------
+
+```bash
+composer require psr/log
+```
+
Usage
-----
@@ -31,6 +38,12 @@ class Foo
if ($this->logger) {
$this->logger->info('Doing work');
}
+
+ try {
+ $this->doSomethingElse();
+ } catch (Exception $exception) {
+ $this->logger->error('Oh no!', array('exception' => $exception));
+ }
// do something useful
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/composer.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/composer.json
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/composer.json
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/composer.json
index 87934d7..3f6d4ee 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/vendor/psr/log/composer.json
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/psr/log/composer.json
@@ -20,7 +20,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.1.x-dev"
}
}
}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/.gitignore b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/.gitignore
new file mode 100644
index 0000000..e0a6295
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/.gitignore
@@ -0,0 +1,7 @@
+
+/vendor/
+.idea
+composer.lock
+/build/
+phpunit.xml
+lsp
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/.travis.yml b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/.travis.yml
new file mode 100644
index 0000000..aa4ad7d
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/.travis.yml
@@ -0,0 +1,36 @@
+language: php
+
+php:
+ - 5.6
+ - 7.0
+ - 7.1
+ - 7.2
+ - 7.3
+ - 7.4
+
+matrix:
+ fast_finish: true
+ include:
+ - php: 5.3
+ dist: precise
+ - php: 5.4
+ dist: precise
+ - php: 5.5
+ dist: trusty
+
+cache:
+ directories:
+ - $HOME/.composer
+
+before_install:
+ - composer self-update
+ - composer clear-cache
+
+install:
+ composer update --no-interaction --no-ansi --optimize-autoloader --prefer-dist
+
+script:
+ - php vendor/bin/phpunit
+
+# after_success:
+# - travis_retry php vendor/bin/php-coveralls
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md
new file mode 100644
index 0000000..09cd9be
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/CHANGELOG.md
@@ -0,0 +1,11 @@
+### v2.0.3 от 10.12.2020
+* Возвращены методы для email и phone в receipt
+
+### v2.0.2 от 08.12.2020
+* Исправлен autoload.php
+
+### v2.0.1 от 02.12.2020
+* Небольшие исправления
+
+### v2.0.0 от 01.12.2020
+* Обновленная версия SDK
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/LICENSE.md b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/LICENSE.md
new file mode 100644
index 0000000..b07267a
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/LICENSE.md
@@ -0,0 +1,22 @@
+
+The MIT License
+
+Copyright (c) 2020 "YooMoney", NBСO LLC
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/README.en.md b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/README.en.md
new file mode 100644
index 0000000..07b1265
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/README.en.md
@@ -0,0 +1,63 @@
+# The YooKassa API PHP Client Library
+
+[![Build Status](https://travis-ci.org/yoomoney/yookassa-sdk-php.svg?branch=master)](https://travis-ci.org/yoomoney/yookassa-sdk-php)
+[![Latest Stable Version](https://poser.pugx.org/yoomoney/yookassa-sdk-php/v/stable)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
+[![Total Downloads](https://poser.pugx.org/yoomoney/yookassa-sdk-php/downloads)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
+[![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
+
+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.
+
+## Requirements
+PHP 5.3.2 (or later version) with the libcurl library
+
+## Installation
+### Under console using Composer
+
+1. Install Composer, a package manager.
+2. In the console, run the following command:
+```bash
+composer require yoomoney/yookassa-sdk-php
+```
+
+### Do the following for the composer.json file of your project:
+1. Add a string `"yoomoney/yookassa-sdk-php": "^2.0"` to the list of dependencies of your project in the composer.json file
+```
+...
+ "require": {
+ "php": ">=5.3.2",
+ "yoomoney/yookassa-sdk-php": "^2.0"
+...
+```
+2. Refresh the project's dependencies. In the console, navigate to the catalog with composer.json and run the following command:
+```bash
+composer update
+```
+3. Adjust your project's code to activate automated uploading of files for our product:
+```php
+require __DIR__ . '/vendor/autoload.php';
+```
+
+### Manually
+
+1. Download [the YooKassa API PHP Client Library archive](https://github.com/yoomoney/yookassa-sdk-php/archive/master.zip), extract it and copy the lib catalog to the required place of your project.
+2. Adjust your project's code to activate automated uploading of files for our product:
+```php
+require __DIR__ . '/lib/autoload.php';
+```
+
+## Commencing work
+
+1. Import required classes
+```php
+use YooKassa\Client;
+```
+2. Create a sample of a client object, then set the store's identifier and secret key (you can get them under your YooKassa's Merchant Profile). [Issuing a secret key](https://yookassa.ru/docs/support/merchant/payments/implement/keys?lang=en)
+```php
+$client = new Client();
+$client->setAuth('shopId', 'secretKey');
+```
+3. Call the required API method. [More details in our documentation for the YooKassa API](https://yookassa.ru/en/developers/api#create_payment)
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/README.md b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/README.md
new file mode 100644
index 0000000..0cbbdaf
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/README.md
@@ -0,0 +1,63 @@
+# YooKassa API PHP Client Library
+
+[![Build Status](https://travis-ci.org/yoomoney/yookassa-sdk-php.svg?branch=master)](https://travis-ci.org/yoomoney/yookassa-sdk-php)
+[![Latest Stable Version](https://poser.pugx.org/yoomoney/yookassa-sdk-php/v/stable)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
+[![Total Downloads](https://poser.pugx.org/yoomoney/yookassa-sdk-php/downloads)](https://packagist.org/packages/yoomoney/yookassa-sdk-php)
+[![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)
+
+Клиент для работы с платежами по [API ЮKassa](https://yookassa.ru/developers/api)
+Подходит тем, у кого способ подключения к ЮKassa называется API.
+
+## Требования
+PHP 5.3.2 (и выше) с расширением libcurl
+
+## Установка
+### В консоли с помощью Composer
+
+1. Установите менеджер пакетов Composer.
+2. В консоли выполните команду
+```bash
+composer require yoomoney/yookassa-sdk-php
+```
+
+### В файле composer.json своего проекта
+1. Добавьте строку `"yoomoney/yookassa-sdk-php": "^2.0"` в список зависимостей вашего проекта в файле composer.json
+```
+...
+ "require": {
+ "php": ">=5.3.2",
+ "yoomoney/yookassa-sdk-php": "^2.0"
+...
+```
+2. Обновите зависимости проекта. В консоли перейдите в каталог, где лежит composer.json, и выполните команду:
+```bash
+composer update
+```
+3. В коде вашего проекта подключите автозагрузку файлов нашего клиента:
+```php
+require __DIR__ . '/vendor/autoload.php';
+```
+
+### Вручную
+
+1. Скачайте [архив YooKassa API PHP Client Library](https://github.com/yoomoney/yookassa-sdk-php/archive/master.zip), распакуйте его и скопируйте каталог lib в нужное место в вашем проекте.
+2. В коде вашего проекта подключите автозагрузку файлов нашего клиента:
+```php
+require __DIR__ . '/lib/autoload.php';
+```
+
+## Начало работы
+
+1. Импортируйте нужные классы
+```php
+use YooKassa\Client;
+```
+2. Создайте экземпляр объекта клиента и задайте идентификатор магазина и секретный ключ (их можно получить в личном кабинете ЮKassa). [Как выпустить секретный ключ](https://yookassa.ru/docs/support/merchant/payments/implement/keys)
+```php
+$client = new Client();
+$client->setAuth('shopId', 'secretKey');
+```
+3. Вызовите нужный метод API. [Подробнее в документации к API ЮKassa](https://yookassa.ru/developers/api#create_payment)
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/composer.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/composer.json
new file mode 100644
index 0000000..f2eff69
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/composer.json
@@ -0,0 +1,37 @@
+{
+ "name": "yoomoney/yookassa-sdk-php",
+ "description": "This is a developer tool for integration with YooMoney.",
+ "type": "library",
+ "license": "MIT",
+ "homepage": "https://yookassa.ru/developers/api",
+ "keywords": ["yoomoney", "yookassa", "payments", "api", "sdk"],
+ "authors": [
+ {
+ "name": "YooMoney",
+ "email": "cms@yoomoney.ru"
+ }
+ ],
+ "version": "2.0.3",
+ "require": {
+ "php": ">=5.3.0",
+ "ext-curl": "*",
+ "ext-json": "*",
+ "ext-mbstring": "*",
+ "psr/log": "^1.0"
+ },
+ "require-dev": {
+ "ext-xml": "*",
+ "phpunit/phpunit": "^4.8.35 || ^5.7",
+ "mockery/mockery": "^0.9.9"
+ },
+ "autoload": {
+ "psr-4": {
+ "YooKassa\\": "lib/"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "Tests\\YooKassa\\": "tests/"
+ }
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client.php
similarity index 82%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client.php
index dd3ac77..4aa378e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,68 +24,64 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout;
+namespace YooKassa;
use Exception;
use InvalidArgumentException;
-use YandexCheckout\Client\BaseClient;
-use YandexCheckout\Common\Exceptions\ApiException;
-use YandexCheckout\Common\Exceptions\AuthorizeException;
-use YandexCheckout\Common\Exceptions\BadApiRequestException;
-use YandexCheckout\Common\Exceptions\ExtensionNotFoundException;
-use YandexCheckout\Common\Exceptions\ForbiddenException;
-use YandexCheckout\Common\Exceptions\InternalServerError;
-use YandexCheckout\Common\Exceptions\NotFoundException;
-use YandexCheckout\Common\Exceptions\ResponseProcessingException;
-use YandexCheckout\Common\Exceptions\TooManyRequestsException;
-use YandexCheckout\Common\Exceptions\UnauthorizedException;
-use YandexCheckout\Common\HttpVerb;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Helpers\UUID;
-use YandexCheckout\Model\PaymentInterface;
-use YandexCheckout\Model\RefundInterface;
-use YandexCheckout\Model\Webhook\Webhook;
-use YandexCheckout\Request\PaymentOptionsRequest;
-use YandexCheckout\Request\PaymentOptionsRequestInterface;
-use YandexCheckout\Request\PaymentOptionsRequestSerializer;
-use YandexCheckout\Request\PaymentOptionsResponse;
-use YandexCheckout\Request\Payments\CreatePaymentRequest;
-use YandexCheckout\Request\Payments\CreatePaymentRequestInterface;
-use YandexCheckout\Request\Payments\CreatePaymentResponse;
-use YandexCheckout\Request\Payments\CreatePaymentRequestSerializer;
-use YandexCheckout\Request\Payments\Payment\CancelResponse;
-use YandexCheckout\Request\Payments\Payment\CreateCaptureRequest;
-use YandexCheckout\Request\Payments\Payment\CreateCaptureRequestInterface;
-use YandexCheckout\Request\Payments\Payment\CreateCaptureRequestSerializer;
-use YandexCheckout\Request\Payments\Payment\CreateCaptureResponse;
-use YandexCheckout\Request\Payments\PaymentResponse;
-use YandexCheckout\Request\Payments\PaymentsRequest;
-use YandexCheckout\Request\Payments\PaymentsRequestInterface;
-use YandexCheckout\Request\Payments\PaymentsRequestSerializer;
-use YandexCheckout\Request\Payments\PaymentsResponse;
-use YandexCheckout\Request\Receipts\AbstractReceiptResponse;
-use YandexCheckout\Request\Receipts\CreatePostReceiptRequest;
-use YandexCheckout\Request\Receipts\CreatePostReceiptRequestInterface;
-use YandexCheckout\Request\Receipts\CreatePostReceiptRequestSerializer;
-use YandexCheckout\Request\Receipts\ReceiptResponseFactory;
-use YandexCheckout\Request\Receipts\ReceiptsRequest;
-use YandexCheckout\Request\Receipts\ReceiptsRequestSerializer;
-use YandexCheckout\Request\Receipts\ReceiptsResponse;
-use YandexCheckout\Request\Refunds\CreateRefundRequest;
-use YandexCheckout\Request\Refunds\CreateRefundRequestInterface;
-use YandexCheckout\Request\Refunds\CreateRefundRequestSerializer;
-use YandexCheckout\Request\Refunds\CreateRefundResponse;
-use YandexCheckout\Request\Refunds\RefundResponse;
-use YandexCheckout\Request\Refunds\RefundsRequest;
-use YandexCheckout\Request\Refunds\RefundsRequestInterface;
-use YandexCheckout\Request\Refunds\RefundsRequestSerializer;
-use YandexCheckout\Request\Refunds\RefundsResponse;
-use YandexCheckout\Request\Webhook\WebhookListResponse;
+use YooKassa\Client\BaseClient;
+use YooKassa\Common\Exceptions\ApiException;
+use YooKassa\Common\Exceptions\AuthorizeException;
+use YooKassa\Common\Exceptions\BadApiRequestException;
+use YooKassa\Common\Exceptions\ExtensionNotFoundException;
+use YooKassa\Common\Exceptions\ForbiddenException;
+use YooKassa\Common\Exceptions\InternalServerError;
+use YooKassa\Common\Exceptions\NotFoundException;
+use YooKassa\Common\Exceptions\ResponseProcessingException;
+use YooKassa\Common\Exceptions\TooManyRequestsException;
+use YooKassa\Common\Exceptions\UnauthorizedException;
+use YooKassa\Common\HttpVerb;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Helpers\UUID;
+use YooKassa\Model\PaymentInterface;
+use YooKassa\Model\RefundInterface;
+use YooKassa\Model\Webhook\Webhook;
+use YooKassa\Request\Payments\CreatePaymentRequest;
+use YooKassa\Request\Payments\CreatePaymentRequestInterface;
+use YooKassa\Request\Payments\CreatePaymentResponse;
+use YooKassa\Request\Payments\CreatePaymentRequestSerializer;
+use YooKassa\Request\Payments\Payment\CancelResponse;
+use YooKassa\Request\Payments\Payment\CreateCaptureRequest;
+use YooKassa\Request\Payments\Payment\CreateCaptureRequestInterface;
+use YooKassa\Request\Payments\Payment\CreateCaptureRequestSerializer;
+use YooKassa\Request\Payments\Payment\CreateCaptureResponse;
+use YooKassa\Request\Payments\PaymentResponse;
+use YooKassa\Request\Payments\PaymentsRequest;
+use YooKassa\Request\Payments\PaymentsRequestInterface;
+use YooKassa\Request\Payments\PaymentsRequestSerializer;
+use YooKassa\Request\Payments\PaymentsResponse;
+use YooKassa\Request\Receipts\AbstractReceiptResponse;
+use YooKassa\Request\Receipts\CreatePostReceiptRequest;
+use YooKassa\Request\Receipts\CreatePostReceiptRequestInterface;
+use YooKassa\Request\Receipts\CreatePostReceiptRequestSerializer;
+use YooKassa\Request\Receipts\ReceiptResponseFactory;
+use YooKassa\Request\Receipts\ReceiptsRequest;
+use YooKassa\Request\Receipts\ReceiptsRequestSerializer;
+use YooKassa\Request\Receipts\ReceiptsResponse;
+use YooKassa\Request\Refunds\CreateRefundRequest;
+use YooKassa\Request\Refunds\CreateRefundRequestInterface;
+use YooKassa\Request\Refunds\CreateRefundRequestSerializer;
+use YooKassa\Request\Refunds\CreateRefundResponse;
+use YooKassa\Request\Refunds\RefundResponse;
+use YooKassa\Request\Refunds\RefundsRequest;
+use YooKassa\Request\Refunds\RefundsRequestInterface;
+use YooKassa\Request\Refunds\RefundsRequestSerializer;
+use YooKassa\Request\Refunds\RefundsResponse;
+use YooKassa\Request\Webhook\WebhookListResponse;
/**
* Класс клиента API
*
- * @package YandexCheckout
+ * @package YooKassa
*
* @since 1.0.1
*/
@@ -94,7 +90,7 @@ class Client extends BaseClient
/**
* Текущая версия библиотеки
*/
- const SDK_VERSION = '1.6.8';
+ const SDK_VERSION = '2.0.3';
/**
* Получить список платежей магазина.
@@ -139,50 +135,6 @@ public function getPayments($filter = null)
return $paymentResponse;
}
- /**
- * Доступные способы оплаты.
- * Используйте этот метод, чтобы получить способы оплаты и сценарии, доступные для вашего заказа.
- *
- * @param PaymentOptionsRequestInterface|array $paymentOptionsRequest
- *
- * @return PaymentOptionsResponse
- * @throws ApiException
- * @throws BadApiRequestException
- * @throws ForbiddenException
- * @throws InternalServerError
- * @throws NotFoundException
- * @throws ResponseProcessingException
- * @throws TooManyRequestsException
- * @throws UnauthorizedException
- * @throws ExtensionNotFoundException
- */
- public function getPaymentOptions($paymentOptionsRequest = null)
- {
- $path = "/payment_options";
-
- if ($paymentOptionsRequest === null) {
- $queryParams = array();
- } else {
- if (is_array($paymentOptionsRequest)) {
- $paymentOptionsRequest = PaymentOptionsRequest::builder()->build($paymentOptionsRequest);
- }
- $serializer = new PaymentOptionsRequestSerializer();
- $queryParams = $serializer->serialize($paymentOptionsRequest);
- }
-
- $response = $this->execute($path, HttpVerb::GET, $queryParams);
-
- $result = null;
- if ($response->getCode() == 200) {
- $responseArray = $this->decodeData($response);
- $result = new PaymentOptionsResponse($responseArray);
- } else {
- $this->handleError($response);
- }
-
- return $result;
- }
-
/**
* Создание платежа.
*
@@ -192,7 +144,7 @@ public function getPaymentOptions($paymentOptionsRequest = null)
*
* Необходимо указать один из параметров:
*
- *
payment_token — оплата по одноразовому PaymentToken, сформированному виджетом Yandex.Checkout JS;
+ *
payment_token — оплата по одноразовому PaymentToken, сформированному виджетом YooKassa JS;
*
payment_method_id — оплата по сохраненным платежным данным;
*
payment_method_data — оплата по новым платежным данным.
*
@@ -207,7 +159,7 @@ public function getPaymentOptions($paymentOptionsRequest = null)
*
*
* @param CreatePaymentRequestInterface|array $payment
- * @param string|null $idempotenceKey {@link https://kassa.yandex.ru/docs/checkout-api/?php#idempotentnost}
+ * @param string|null $idempotenceKey {@link https://yookassa.ru/developers/using-api/basics?lang=php#idempotence}
*
* @return CreatePaymentResponse
* @throws ApiException
@@ -301,14 +253,14 @@ public function getPaymentInfo($paymentId)
* Подтверждает вашу готовность принять платеж. Платеж можно подтвердить, только если он находится
* в статусе `waiting_for_capture`. Если платеж подтвержден успешно — значит, оплата прошла, и вы можете выдать
* товар или оказать услугу пользователю. На следующий день после подтверждения платеж попадет в реестр,
- * и Яндекс.Касса переведет деньги на ваш расчетный счет. Если вы не подтверждаете платеж до момента, указанного
+ * и ЮKassa переведет деньги на ваш расчетный счет. Если вы не подтверждаете платеж до момента, указанного
* в `expire_at`, по умолчанию он отменяется, а деньги возвращаются пользователю. При оплате банковской картой
* у вас есть 7 дней на подтверждение платежа. Для остальных способов оплаты платеж необходимо подтвердить
* в течение 6 часов.
*
* @param CreateCaptureRequestInterface|array $captureRequest
* @param $paymentId
- * @param $idempotencyKey {@link https://kassa.yandex.ru/docs/checkout-api/?php#idempotentnost}
+ * @param $idempotencyKey {@link https://yookassa.ru/developers/using-api/basics?lang=php#idempotence}
*
* @return CreateCaptureResponse
* @throws ApiException
@@ -370,7 +322,7 @@ public function capturePayment($captureRequest, $paymentId, $idempotencyKey = nu
* Для остальных способов оплаты возврат может занимать до нескольких дней.
*
* @param $paymentId
- * @param $idempotencyKey {@link https://kassa.yandex.ru/docs/checkout-api/?php#idempotentnost}
+ * @param $idempotencyKey {@link https://yookassa.ru/developers/using-api/basics?lang=php#idempotence}
*
* @return CancelResponse
* @throws ApiException
@@ -462,10 +414,10 @@ public function getRefunds($filter = null)
*
* Создает объект возврата — `Refund`. Возвращает успешно завершенный платеж по уникальному идентификатору
* этого платежа. Создание возврата возможно только для платежей в статусе `succeeded`. Комиссии за проведение
- * возврата нет. Комиссия, которую Яндекс.Касса берёт за проведение исходного платежа, не возвращается.
+ * возврата нет. Комиссия, которую ЮKassa берёт за проведение исходного платежа, не возвращается.
*
* @param CreateRefundRequestInterface|array $request
- * @param null $idempotencyKey {@link https://kassa.yandex.ru/docs/checkout-api/?php#idempotentnost}
+ * @param null $idempotencyKey {@link https://yookassa.ru/developers/using-api/basics?lang=php#idempotence}
*
* @return CreateRefundResponse
* @throws ApiException
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/ApiClientInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/ApiClientInterface.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/ApiClientInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/ApiClientInterface.php
index b460a53..40a0f26 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/ApiClientInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/ApiClientInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Client;
+namespace YooKassa\Client;
use Psr\Log\LoggerInterface;
/**
* Interface ApiClientInterface
- * @package YandexCheckout\Client
+ * @package YooKassa\Client
*/
interface ApiClientInterface
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/BaseClient.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/BaseClient.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php
index 5d6d95e..228b959 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/BaseClient.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/BaseClient.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,27 +23,27 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Client;
+namespace YooKassa\Client;
use Exception;
use Psr\Log\LoggerInterface;
-use YandexCheckout\Common\Exceptions\ApiConnectionException;
-use YandexCheckout\Common\Exceptions\ApiException;
-use YandexCheckout\Common\Exceptions\AuthorizeException;
-use YandexCheckout\Common\Exceptions\BadApiRequestException;
-use YandexCheckout\Common\Exceptions\ExtensionNotFoundException;
-use YandexCheckout\Common\Exceptions\ForbiddenException;
-use YandexCheckout\Common\Exceptions\InternalServerError;
-use YandexCheckout\Common\Exceptions\JsonException;
-use YandexCheckout\Common\Exceptions\NotFoundException;
-use YandexCheckout\Common\Exceptions\ResponseProcessingException;
-use YandexCheckout\Common\Exceptions\TooManyRequestsException;
-use YandexCheckout\Common\Exceptions\UnauthorizedException;
-use YandexCheckout\Common\LoggerWrapper;
-use YandexCheckout\Common\ResponseObject;
-use YandexCheckout\Helpers\Config\ConfigurationLoader;
-use YandexCheckout\Helpers\Config\ConfigurationLoaderInterface;
+use YooKassa\Common\Exceptions\ApiConnectionException;
+use YooKassa\Common\Exceptions\ApiException;
+use YooKassa\Common\Exceptions\AuthorizeException;
+use YooKassa\Common\Exceptions\BadApiRequestException;
+use YooKassa\Common\Exceptions\ExtensionNotFoundException;
+use YooKassa\Common\Exceptions\ForbiddenException;
+use YooKassa\Common\Exceptions\InternalServerError;
+use YooKassa\Common\Exceptions\JsonException;
+use YooKassa\Common\Exceptions\NotFoundException;
+use YooKassa\Common\Exceptions\ResponseProcessingException;
+use YooKassa\Common\Exceptions\TooManyRequestsException;
+use YooKassa\Common\Exceptions\UnauthorizedException;
+use YooKassa\Common\LoggerWrapper;
+use YooKassa\Common\ResponseObject;
+use YooKassa\Helpers\Config\ConfigurationLoader;
+use YooKassa\Helpers\Config\ConfigurationLoaderInterface;
class BaseClient
{
@@ -97,7 +97,6 @@ class BaseClient
/**
* Время через которое будут осуществляться повторные запросы
* Значение по умолчанию - 1800 миллисекунд.
- * @link https://kassa.yandex.ru/docs/checkout-api/?php#asinhronnost
* @var int значение в миллисекундах
*/
protected $timeout;
@@ -105,7 +104,6 @@ class BaseClient
/**
* Количество повторных запросов при ответе API статусом 202
* Значение по умолчанию 3
- * @link https://kassa.yandex.ru/docs/checkout-api/?php#asinhronnost
* @var int
*/
protected $attempts;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/CurlClient.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/CurlClient.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/CurlClient.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/CurlClient.php
index 13d9513..a2ccf25 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/CurlClient.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/CurlClient.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +24,19 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Client;
+namespace YooKassa\Client;
use Psr\Log\LoggerInterface;
-use YandexCheckout\Common\Exceptions\ApiConnectionException;
-use YandexCheckout\Common\Exceptions\ApiException;
-use YandexCheckout\Common\Exceptions\AuthorizeException;
-use YandexCheckout\Common\Exceptions\ExtensionNotFoundException;
-use YandexCheckout\Common\ResponseObject;
-use YandexCheckout\Helpers\RawHeadersParser;
+use YooKassa\Common\Exceptions\ApiConnectionException;
+use YooKassa\Common\Exceptions\ApiException;
+use YooKassa\Common\Exceptions\AuthorizeException;
+use YooKassa\Common\Exceptions\ExtensionNotFoundException;
+use YooKassa\Common\ResponseObject;
+use YooKassa\Helpers\RawHeadersParser;
/**
* Class CurlClient
- * @package YandexCheckout\Client
+ * @package YooKassa\Client
*/
class CurlClient implements ApiClientInterface
{
@@ -364,7 +364,7 @@ private function handleCurlError($error, $errno)
case CURLE_COULDNT_CONNECT:
case CURLE_COULDNT_RESOLVE_HOST:
case CURLE_OPERATION_TIMEOUTED:
- $msg = 'Could not connect to Yandex Money API. Please check your internet connection and try again.';
+ $msg = 'Could not connect to YooKassa API. Please check your internet connection and try again.';
break;
case CURLE_SSL_CACERT:
case CURLE_SSL_PEER_CERTIFICATE:
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/UserAgent.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/UserAgent.php
similarity index 97%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/UserAgent.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/UserAgent.php
index ae3187e..5447461 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Client/UserAgent.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Client/UserAgent.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Client;
+namespace YooKassa\Client;
-use YandexCheckout\Client;
+use YooKassa\Client;
/**
* Class UserAgent
- * @package YandexCheckout\Client
+ * @package YooKassa\Client
*/
class UserAgent
{
@@ -57,7 +57,7 @@ public function __construct()
if ($php = $this->definePhp()) {
$this->setPhp($php['name'], $php['version']);
}
- $this->setSdk('YandexCheckout.PHP', Client::SDK_VERSION);
+ $this->setSdk('YooKassa.PHP', Client::SDK_VERSION);
}
/**
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractEnum.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractEnum.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractEnum.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractEnum.php
index 4cf70cd..ee44841 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractEnum.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractEnum.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
/**
* Базовый класс генерируемых enum'ов
*
- * @package YandexCheckout\Common
+ * @package YooKassa\Common
*/
abstract class AbstractEnum
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractObject.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractObject.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractObject.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractObject.php
index ca90b3c..a9e11ad 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractObject.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractObject.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
if (!interface_exists('JsonSerializable')) {
require_once dirname(__FILE__) . '/legacy_json_serializable.php';
@@ -33,7 +33,7 @@
/**
* Базовый класс генерируемых объектов
*
- * @package YandexCheckout\Common
+ * @package YooKassa\Common
*/
abstract class AbstractObject implements \ArrayAccess, \JsonSerializable
{
@@ -42,6 +42,17 @@ abstract class AbstractObject implements \ArrayAccess, \JsonSerializable
*/
private $unknownProperties = array();
+ /**
+ * AbstractObject constructor.
+ * @param array $data
+ */
+ public function __construct($data = array())
+ {
+ if (!empty($data) && is_array($data)) {
+ $this->fromArray($data);
+ }
+ }
+
/**
* Проверяет наличие свойства
* @param string $offset Имя проверяемого свойства
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractPaymentRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractPaymentRequest.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractPaymentRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractPaymentRequest.php
index 1ce77d4..a36369a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractPaymentRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractPaymentRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\Receipt;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\Transfer;
-use YandexCheckout\Model\TransferInterface;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\Receipt;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\Transfer;
+use YooKassa\Model\TransferInterface;
/**
* Класс объекта запроса к API
@@ -199,9 +199,9 @@ public function validate()
}
}
- if ($this->_receipt !== null && $this->_receipt->notEmpty()) {
- $email = $this->_receipt->getEmail();
- $phone = $this->_receipt->getPhone();
+ if ($this->getReceipt() && $this->getReceipt()->notEmpty()) {
+ $email = $this->getReceipt()->getCustomer()->getEmail();
+ $phone = $this->getReceipt()->getCustomer()->getPhone();
if (empty($email) && empty($phone)) {
$this->setValidationError('Both email and phone values are empty in receipt');
return false;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractPaymentRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractPaymentRequestBuilder.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractPaymentRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractPaymentRequestBuilder.php
index 82ac781..6f17d5e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractPaymentRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractPaymentRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,25 +24,25 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
-
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\Receipt;
-use YandexCheckout\Model\Receipt\ReceiptItemAmount;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\ReceiptItem;
-use YandexCheckout\Model\ReceiptItemInterface;
-use YandexCheckout\Model\SourceInterface;
-use YandexCheckout\Model\Transfer;
-use YandexCheckout\Model\TransferInterface;
+namespace YooKassa\Common;
+
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\Receipt;
+use YooKassa\Model\Receipt\ReceiptItemAmount;
+use YooKassa\Model\ReceiptCustomer;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\ReceiptItem;
+use YooKassa\Model\ReceiptItemInterface;
+use YooKassa\Model\Transfer;
+use YooKassa\Model\TransferInterface;
/**
* Базовый класс объекта платежного запроса, передаваемого в методы клиента API
*
- * @package YandexCheckout\Common
+ * @package YooKassa\Common
*
* @since 1.0.18
*/
@@ -124,6 +124,9 @@ public function setTransfers($value)
if ($item instanceof TransferInterface) {
$transfer->setAmount($item->getAmount());
$transfer->setAccountId($item->getAccountId());
+ if ($item->hasPlatformFeeAmount()) {
+ $transfer->setPlatformFeeAmount($item->getPlatformFeeAmount());
+ }
} elseif (is_array($item)) {
$transfer->fromArray($item);
}
@@ -230,10 +233,10 @@ public function setReceiptItems($value)
* @param int $vatCode Ставка НДС
*
* @param null|string $paymentSubject значение перечисления PaymentSubject
- * @see \YandexCheckout\Model\Receipt\PaymentSubject::class
+ * @see \YooKassa\Model\Receipt\PaymentSubject::class
*
* @param null|string $paymentMode значение перечисления PaymentMode
- * @see \YandexCheckout\Model\Receipt\PaymentMode::class
+ * @see \YooKassa\Model\Receipt\PaymentMode::class
*
* @return self Инстанс билдера запросов
*/
@@ -259,10 +262,10 @@ public function addReceiptItem($title, $price, $quantity, $vatCode, $paymentMode
* @param int $vatCode Ставка НДС
*
* @param null|string $paymentSubject значение перечисления PaymentSubject
- * @see \YandexCheckout\Model\Receipt\PaymentSubject::class
+ * @see \YooKassa\Model\Receipt\PaymentSubject::class
*
* @param null|string $paymentMode значение перечисления PaymentMode
- * @see \YandexCheckout\Model\Receipt\PaymentMode::class
+ * @see \YooKassa\Model\Receipt\PaymentMode::class
*
* @return self Инстанс билдера запросов
*/
@@ -290,7 +293,10 @@ public function addReceiptShipping($title, $price, $vatCode, $paymentMode = null
*/
public function setReceiptEmail($value)
{
- $this->receipt->setEmail($value);
+ if (!$this->receipt->getCustomer()) {
+ $this->receipt->setCustomer(new ReceiptCustomer());
+ }
+ $this->receipt->getCustomer()->setEmail($value);
return $this;
}
@@ -305,7 +311,10 @@ public function setReceiptEmail($value)
*/
public function setReceiptPhone($value)
{
- $this->receipt->setPhone($value);
+ if (!$this->receipt->getCustomer()) {
+ $this->receipt->setCustomer(new ReceiptCustomer());
+ }
+ $this->receipt->getCustomer()->setPhone($value);
return $this;
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractRequest.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractRequest.php
index f22a563..de642bb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
/**
* Базовый класс объекта запроса, передаваемого в методы клиента API
*
- * @package YandexCheckout\Common
+ * @package YooKassa\Common
*/
abstract class AbstractRequest extends AbstractObject
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractRequestBuilder.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractRequestBuilder.php
index 88f9468..d669fa3 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/AbstractRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/AbstractRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
-use YandexCheckout\Common\Exceptions\InvalidPropertyException;
-use YandexCheckout\Common\Exceptions\InvalidRequestException;
+use YooKassa\Common\Exceptions\InvalidPropertyException;
+use YooKassa\Common\Exceptions\InvalidRequestException;
/**
* Базовый класс билдера запросов
*
- * @package YandexCheckout\Common
+ * @package YooKassa\Common
*/
abstract class AbstractRequestBuilder
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ApiConnectionException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ApiConnectionException.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ApiConnectionException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ApiConnectionException.php
index 700fd6e..f0de7d8 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ApiConnectionException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ApiConnectionException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class ApiConnectionException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ApiException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ApiException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ApiException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ApiException.php
index 03dad5a..d6e64ab 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ApiException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ApiException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
use Exception;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/AuthorizeException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/AuthorizeException.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/AuthorizeException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/AuthorizeException.php
index 7ff2292..25a283b 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/AuthorizeException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/AuthorizeException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class AuthorizeException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/BadApiRequestException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/BadApiRequestException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/BadApiRequestException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/BadApiRequestException.php
index da9ef5b..ae2d2b6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/BadApiRequestException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/BadApiRequestException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class BadApiRequestException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/EmptyPropertyValueException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/EmptyPropertyValueException.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/EmptyPropertyValueException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/EmptyPropertyValueException.php
index c718239..b54c39c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/EmptyPropertyValueException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/EmptyPropertyValueException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class EmptyPropertyValueException extends InvalidPropertyException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ExtensionNotFoundException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ExtensionNotFoundException.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ExtensionNotFoundException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ExtensionNotFoundException.php
index f0807bf..eca3acf 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ExtensionNotFoundException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ExtensionNotFoundException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
use Exception;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ForbiddenException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ForbiddenException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ForbiddenException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ForbiddenException.php
index 498d8b4..14502df 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ForbiddenException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ForbiddenException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class ForbiddenException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InternalServerError.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InternalServerError.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InternalServerError.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InternalServerError.php
index f14959d..ee1b2f7 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InternalServerError.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InternalServerError.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class InternalServerError extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyException.php
index cf47587..ffb5f52 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class InvalidPropertyException extends \InvalidArgumentException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyValueException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyValueException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyValueException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyValueException.php
index 887c340..11fa9ec 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyValueException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyValueException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class InvalidPropertyValueException extends InvalidPropertyException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyValueTypeException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyValueTypeException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyValueTypeException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyValueTypeException.php
index a58828c..bb54de4 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidPropertyValueTypeException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidPropertyValueTypeException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class InvalidPropertyValueTypeException extends InvalidPropertyException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidRequestException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidRequestException.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidRequestException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidRequestException.php
index 45cf475..65e6511 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/InvalidRequestException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/InvalidRequestException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
-use YandexCheckout\Common\AbstractRequest;
+use YooKassa\Common\AbstractRequest;
class InvalidRequestException extends \RuntimeException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/JsonException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/JsonException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/JsonException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/JsonException.php
index 641ecf3..5771894 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/JsonException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/JsonException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class JsonException extends \UnexpectedValueException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/NotFoundException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/NotFoundException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/NotFoundException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/NotFoundException.php
index d95f09b..409ceb8 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/NotFoundException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/NotFoundException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class NotFoundException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ResponseProcessingException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ResponseProcessingException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ResponseProcessingException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ResponseProcessingException.php
index f731fec..62ecc1b 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/ResponseProcessingException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/ResponseProcessingException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class ResponseProcessingException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/TooManyRequestsException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/TooManyRequestsException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/TooManyRequestsException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/TooManyRequestsException.php
index a378db1..aa94567 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/TooManyRequestsException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/TooManyRequestsException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class TooManyRequestsException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/UnauthorizedException.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/UnauthorizedException.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/UnauthorizedException.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/UnauthorizedException.php
index 84dab65..647c3c6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/Exceptions/UnauthorizedException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/Exceptions/UnauthorizedException.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common\Exceptions;
+namespace YooKassa\Common\Exceptions;
class UnauthorizedException extends ApiException
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/HttpVerb.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/HttpVerb.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/HttpVerb.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/HttpVerb.php
index c9ced6b..eb04e5d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/HttpVerb.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/HttpVerb.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
class HttpVerb extends AbstractEnum
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/LoggerWrapper.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/LoggerWrapper.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/LoggerWrapper.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/LoggerWrapper.php
index 57d0353..85df21d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/LoggerWrapper.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/LoggerWrapper.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
use Psr\Log\InvalidArgumentException;
use Psr\Log\LoggerInterface;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/ResponseObject.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/ResponseObject.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/ResponseObject.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/ResponseObject.php
index b09ffa0..f062468 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/ResponseObject.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/ResponseObject.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Common;
+namespace YooKassa\Common;
class ResponseObject
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/legacy_json_serializable.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/legacy_json_serializable.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/legacy_json_serializable.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/legacy_json_serializable.php
index e0e385a..e8d8210 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Common/legacy_json_serializable.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Common/legacy_json_serializable.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Config/ConfigurationLoader.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Config/ConfigurationLoader.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Config/ConfigurationLoader.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Config/ConfigurationLoader.php
index 228958f..473876e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Config/ConfigurationLoader.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Config/ConfigurationLoader.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Helpers\Config;
+namespace YooKassa\Helpers\Config;
class ConfigurationLoader implements ConfigurationLoaderInterface
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Config/ConfigurationLoaderInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Config/ConfigurationLoaderInterface.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Config/ConfigurationLoaderInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Config/ConfigurationLoaderInterface.php
index 7cf0e83..50a3cd1 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Config/ConfigurationLoaderInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Config/ConfigurationLoaderInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Helpers\Config;
+namespace YooKassa\Helpers\Config;
interface ConfigurationLoaderInterface
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Random.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Random.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Random.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Random.php
index 96d3ec8..b0d80d3 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/Random.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/Random.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Helpers;
+namespace YooKassa\Helpers;
/**
* Класс хэлпера для генерации случайных значений, используется в тестах
*
- * @package YandexCheckout\Helpers
+ * @package YooKassa\Helpers
*/
class Random
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/RawHeadersParser.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/RawHeadersParser.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/RawHeadersParser.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/RawHeadersParser.php
index c1e085b..cfb6857 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/RawHeadersParser.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/RawHeadersParser.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Helpers;
+namespace YooKassa\Helpers;
class RawHeadersParser
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/StringObject.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/StringObject.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/StringObject.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/StringObject.php
index 5b15fd1..1c1a080 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/StringObject.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/StringObject.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Helpers;
+namespace YooKassa\Helpers;
/**
* Класс объекта, кастящегося в строку, используется только в тестах
*
- * @package YandexCheckout\Helpers
+ * @package YooKassa\Helpers
*/
class StringObject
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/TypeCast.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/TypeCast.php
similarity index 97%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/TypeCast.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/TypeCast.php
index 3068790..8cc4367 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/TypeCast.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/TypeCast.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Helpers;
+namespace YooKassa\Helpers;
use DateTime;
use Exception;
@@ -32,7 +32,7 @@
/**
* Класс хэлпер для преобразования типов значений
*
- * @package YandexCheckout\Helpers
+ * @package YooKassa\Helpers
*/
class TypeCast
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/UUID.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/UUID.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/UUID.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/UUID.php
index bb8b392..cc30453 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Helpers/UUID.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Helpers/UUID.php
@@ -1,6 +1,6 @@
true,
- self::YANDEX_CHECKOUT => true,
+ self::YOO_KASSA => true,
self::PAYMENT_NETWORK => true,
);
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/CancellationDetailsReasonCode.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/CancellationDetailsReasonCode.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/CancellationDetailsReasonCode.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/CancellationDetailsReasonCode.php
index e149702..58f5cef 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/CancellationDetailsReasonCode.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/CancellationDetailsReasonCode.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* CancellationDetailsReasonCode - Возможные причины отмены платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/AbstractConfirmation.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/AbstractConfirmation.php
similarity index 85%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/AbstractConfirmation.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/AbstractConfirmation.php
index de2457c..ac1dc98 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/AbstractConfirmation.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/AbstractConfirmation.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ConfirmationType;
/**
* Способ подтверждения платежа.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationCodeVerification.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationCodeVerification.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationCodeVerification.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationCodeVerification.php
index 865c8b5..9b4afac 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationCodeVerification.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationCodeVerification.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Сценарий при котором необходимо получить одноразовый код от плательщика для подтверждения платежа
*
- * @package YandexCheckout\Model\Confirmation
+ * @package YooKassa\Model\Confirmation
*/
class ConfirmationCodeVerification extends AbstractConfirmation
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationDeepLink.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationDeepLink.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationDeepLink.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationDeepLink.php
index 01170a8..4cf5e28 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationDeepLink.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationDeepLink.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Сценарий при котором необходимо направить плательщика в приложение партнера
*
- * @package YandexCheckout\Model\Confirmation
+ * @package YooKassa\Model\Confirmation
*/
class ConfirmationDeepLink extends AbstractConfirmation
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationEmbedded.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationEmbedded.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationEmbedded.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationEmbedded.php
index 037d45b..3cfa394 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationEmbedded.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationEmbedded.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,12 +23,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ConfirmationType;
/**
* @property string $confirmationToken Токен для checkout.js
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationExternal.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationExternal.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationExternal.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationExternal.php
index acd4190..54cb895 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationExternal.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationExternal.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Сценарий при котором необходимо ожидать пока пользователь самостоятельно подтвердит платеж. Например,
* пользователь подтверждает платеж ответом на SMS или в приложении партнера
*
- * @package YandexCheckout\Model\Confirmation
+ * @package YooKassa\Model\Confirmation
*/
class ConfirmationExternal extends AbstractConfirmation
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationFactory.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationFactory.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationFactory.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationFactory.php
index 61570e8..faf4dc6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationFactory.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationFactory.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Class ConfirmationFactory
*
- * @package YandexCheckout\Model\Confirmation
+ * @package YooKassa\Model\Confirmation
*/
class ConfirmationFactory
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationQr.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationQr.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationQr.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationQr.php
index 7b51dd6..9310f12 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationQr.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationQr.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,12 +23,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ConfirmationType;
/**
* @property string $confirmationData URL для создания QR-кода
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationRedirect.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationRedirect.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationRedirect.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationRedirect.php
index 2ee96cf..b041d5d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Confirmation/ConfirmationRedirect.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Confirmation/ConfirmationRedirect.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Confirmation;
+namespace YooKassa\Model\Confirmation;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ConfirmationType;
/**
- * Сценарий, при котором необходимо отправить плательщика на веб-страницу Яндекс Кассы или партнера для
+ * Сценарий, при котором необходимо отправить плательщика на веб-страницу ЮKassa или партнера для
* подтверждения платежа
*
* @property bool $enforce Требование принудительного подтверждения платежа покупателем, требование 3-D Secure для
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/AbstractConfirmationAttributes.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/AbstractConfirmationAttributes.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/AbstractConfirmationAttributes.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/AbstractConfirmationAttributes.php
index 3e82bac..1e9b1c0 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/AbstractConfirmationAttributes.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/AbstractConfirmationAttributes.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ConfirmationType;
/**
* Способ подтверждения платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerification.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerification.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerification.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerification.php
index 4859c3f..d63942a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerification.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerification.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Сценарий при котором необходимо получить одноразовый код от плательщика для подтверждения платежа
*
- * @package YandexCheckout\Model\ConfirmationAttributes
+ * @package YooKassa\Model\ConfirmationAttributes
*/
class ConfirmationAttributesCodeVerification extends AbstractConfirmationAttributes
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesDeepLink.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesDeepLink.php
similarity index 87%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesDeepLink.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesDeepLink.php
index 04b0823..36b1ddd 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesDeepLink.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesDeepLink.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Сценарий при котором необходимо направить плательщика в приложение партнера
*
- * @package YandexCheckout\Model\ConfirmationAttributes
+ * @package YooKassa\Model\ConfirmationAttributes
*/
class ConfirmationAttributesDeepLink extends AbstractConfirmationAttributes
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesEmbedded.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesEmbedded.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesEmbedded.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesEmbedded.php
index 3c1ba62..de36f19 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesEmbedded.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesEmbedded.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,10 +23,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
class ConfirmationAttributesEmbedded extends AbstractConfirmationAttributes
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesExternal.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesExternal.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesExternal.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesExternal.php
index f677aa4..14cddf0 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesExternal.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesExternal.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Сценарий при котором необходимо ожидать пока пользователь самостоятельно подтвердит платеж. Например,
* пользователь подтверждает платеж ответом на SMS или в приложении партнера
- * @package YandexCheckout\Model\ConfirmationAttributes
+ * @package YooKassa\Model\ConfirmationAttributes
*/
class ConfirmationAttributesExternal extends AbstractConfirmationAttributes
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesFactory.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesFactory.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesFactory.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesFactory.php
index cfc3309..e1ae429 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesFactory.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesFactory.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
/**
* Class ConfirmationAttributesFactory
*
- * @package YandexCheckout\Model\ConfirmationAttributes
+ * @package YooKassa\Model\ConfirmationAttributes
*/
class ConfirmationAttributesFactory
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesQr.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesQr.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesQr.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesQr.php
index 5255069..3949666 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesQr.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesQr.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,10 +23,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Model\ConfirmationType;
class ConfirmationAttributesQr extends AbstractConfirmationAttributes
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesRedirect.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesRedirect.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesRedirect.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesRedirect.php
index 76c0f9f..f2c585c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationAttributes/ConfirmationAttributesRedirect.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationAttributes/ConfirmationAttributesRedirect.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\ConfirmationAttributes;
+namespace YooKassa\Model\ConfirmationAttributes;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ConfirmationType;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ConfirmationType;
/**
* @property bool $enforce Требование принудительного подтверждения платежа покупателем, требование 3-D Secure для
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationType.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationType.php
index 0035c77..1a81d07 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ConfirmationType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ConfirmationType.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* ConfirmationType - Тип пользовательского процесса подтверждения платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/CurrencyCode.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/CurrencyCode.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/CurrencyCode.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/CurrencyCode.php
index 7c68932..6b18310 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/CurrencyCode.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/CurrencyCode.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* CurrencyCode - Код валюты, ISO-4217 3-alpha currency symbol
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Leg.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Leg.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Leg.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Leg.php
index 6ded097..92250eb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Leg.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Leg.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
class Leg extends AbstractObject implements LegInterface
{
@@ -108,6 +108,7 @@ public function getDepartureDate()
/**
* @param \DateTime|string $value
+ * @throws \Exception
*/
public function setDepartureDate($value)
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/LegInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/LegInterface.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/LegInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/LegInterface.php
index b003868..417cb7b 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/LegInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/LegInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
interface LegInterface
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Metadata.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Metadata.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Metadata.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Metadata.php
index 3cea6e5..94d0dcb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Metadata.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Metadata.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
+use YooKassa\Common\AbstractObject;
/**
* Metadata - Метаданные платежа указанные мерчантом.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/MonetaryAmount.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/MonetaryAmount.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/MonetaryAmount.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/MonetaryAmount.php
index 38376cd..fb16930 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/MonetaryAmount.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/MonetaryAmount.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* MonetaryAmount - Сумма определенная в валюте
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/AbstractNotification.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/AbstractNotification.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/AbstractNotification.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/AbstractNotification.php
index a123539..30b7ecb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/AbstractNotification.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/AbstractNotification.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,20 +24,20 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Notification;
+namespace YooKassa\Model\Notification;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\NotificationEventType;
-use YandexCheckout\Model\NotificationType;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\NotificationEventType;
+use YooKassa\Model\NotificationType;
/**
* Базовый класс уведомлений
*
- * @package YandexCheckout\Model\Notification
+ * @package YooKassa\Model\Notification
*
* @property-read string $type Тип уведомления в виде строки
* @property-read string $event Тип события
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationCanceled.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationCanceled.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationCanceled.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationCanceled.php
index 86439b4..57bdad0 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationCanceled.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationCanceled.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,16 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Notification;
+namespace YooKassa\Model\Notification;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Model\NotificationEventType;
-use YandexCheckout\Model\NotificationType;
-use YandexCheckout\Model\Payment;
-use YandexCheckout\Model\PaymentInterface;
-use YandexCheckout\Request\Payments\PaymentResponse;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Model\NotificationEventType;
+use YooKassa\Model\NotificationType;
+use YooKassa\Model\Payment;
+use YooKassa\Model\PaymentInterface;
+use YooKassa\Request\Payments\PaymentResponse;
class NotificationCanceled extends AbstractNotification
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationFactory.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationFactory.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationFactory.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationFactory.php
index 74c9036..7146109 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationFactory.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationFactory.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,10 +24,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Notification;
+namespace YooKassa\Model\Notification;
-use YandexCheckout\Model\Notification\AbstractNotification;
-use YandexCheckout\Model\NotificationEventType;
+use YooKassa\Model\Notification\AbstractNotification;
+use YooKassa\Model\NotificationEventType;
class NotificationFactory
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationRefundSucceeded.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationRefundSucceeded.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationRefundSucceeded.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationRefundSucceeded.php
index 236b0ad..92afbda 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationRefundSucceeded.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationRefundSucceeded.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,16 +23,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Notification;
+namespace YooKassa\Model\Notification;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Model\NotificationEventType;
-use YandexCheckout\Model\NotificationType;
-use YandexCheckout\Model\Refund;
-use YandexCheckout\Model\RefundInterface;
-use YandexCheckout\Request\Refunds\RefundResponse;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Model\NotificationEventType;
+use YooKassa\Model\NotificationType;
+use YooKassa\Model\Refund;
+use YooKassa\Model\RefundInterface;
+use YooKassa\Request\Refunds\RefundResponse;
class NotificationRefundSucceeded extends AbstractNotification
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationSucceeded.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationSucceeded.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationSucceeded.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationSucceeded.php
index ef773ad..623dc00 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationSucceeded.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationSucceeded.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,20 +24,20 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Notification;
+namespace YooKassa\Model\Notification;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Model\NotificationEventType;
-use YandexCheckout\Model\NotificationType;
-use YandexCheckout\Model\Payment;
-use YandexCheckout\Model\PaymentInterface;
-use YandexCheckout\Request\Payments\PaymentResponse;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Model\NotificationEventType;
+use YooKassa\Model\NotificationType;
+use YooKassa\Model\Payment;
+use YooKassa\Model\PaymentInterface;
+use YooKassa\Request\Payments\PaymentResponse;
/**
* Класс объекта, присылаемого API при изменении статуса платежа на "succeeded"
*
- * @package YandexCheckout\Model\Notification
+ * @package YooKassa\Model\Notification
*
* @property-read PaymentInterface $object Объект с информацией о платеже
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationWaitingForCapture.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationWaitingForCapture.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationWaitingForCapture.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationWaitingForCapture.php
index 93e8f4e..307b9f3 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Notification/NotificationWaitingForCapture.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Notification/NotificationWaitingForCapture.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Notification;
+namespace YooKassa\Model\Notification;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Model\NotificationEventType;
-use YandexCheckout\Model\NotificationType;
-use YandexCheckout\Model\Payment;
-use YandexCheckout\Model\PaymentInterface;
-use YandexCheckout\Request\Payments\PaymentResponse;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Model\NotificationEventType;
+use YooKassa\Model\NotificationType;
+use YooKassa\Model\Payment;
+use YooKassa\Model\PaymentInterface;
+use YooKassa\Request\Payments\PaymentResponse;
/**
* Класс объекта, присылаемого API при изменении статуса платежа на "waiting_for_capture"
@@ -41,7 +41,7 @@
* указанный в настройках API посылается уведомление о том, что платёж теперь может быть проведён. В классе описана
* структура такого объекта для магазинов, которые получают уведомления на HTTPS endpoint.
*
- * @package YandexCheckout\Model\Notification
+ * @package YooKassa\Model\Notification
*
* @property-read PaymentInterface $object Объект с информацией о платеже, который можно подтвердить или отменить
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/NotificationEventType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/NotificationEventType.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/NotificationEventType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/NotificationEventType.php
index bee059d..280585a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/NotificationEventType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/NotificationEventType.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
class NotificationEventType extends AbstractEnum
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/NotificationType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/NotificationType.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/NotificationType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/NotificationType.php
index 9821cc9..d4809a1 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/NotificationType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/NotificationType.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
class NotificationType extends AbstractEnum
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Passenger.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Passenger.php
similarity index 77%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Passenger.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Passenger.php
index c1ff520..ff0ceaf 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Passenger.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Passenger.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
class Passenger extends AbstractObject implements PassengerInterface
{
@@ -57,7 +57,11 @@ public function getFirstName()
*/
public function setFirstName($value)
{
- if (TypeCast::canCastToString($value)) {
+ if (empty($value) || is_numeric($value)) {
+ throw new InvalidPropertyValueTypeException(
+ 'Invalid first_name value type in Passenger object', 0, 'airline.passengers', $value
+ );
+ } else if (TypeCast::canCastToString($value)) {
$length = mb_strlen((string)$value, 'utf-8');
if ($length > 64) {
throw new InvalidPropertyValueException(
@@ -86,7 +90,11 @@ public function getLastName()
*/
public function setLastName($value)
{
- if (TypeCast::canCastToString($value)) {
+ if (empty($value) || is_numeric($value)) {
+ throw new InvalidPropertyValueTypeException(
+ 'Invalid last_name value type in Passenger object', 0, 'airline.passengers', $value
+ );
+ } else if (TypeCast::canCastToString($value)) {
$length = mb_strlen((string)$value, 'utf-8');
if ($length > 64) {
throw new InvalidPropertyValueException(
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PassengerInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PassengerInterface.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PassengerInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PassengerInterface.php
index e1cb6cd..9721c2e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PassengerInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PassengerInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
interface PassengerInterface
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Payment.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Payment.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Payment.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Payment.php
index 5cdb64b..fb3a435 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Payment.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Payment.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethod\AbstractPaymentMethod;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethod\AbstractPaymentMethod;
/**
* Payment - Данные о платеже
@@ -345,7 +345,7 @@ public function getCreatedAt()
*
* @throws EmptyPropertyValueException Выбрасывается если в метод была передана пустая дата
* @throws InvalidPropertyValueException Выбрасвается если передали строку, которую не удалось привести к дате
- * @throws InvalidPropertyValueTypeException Выбрасывается если был передан аргумент, который невозможно
+ * @throws InvalidPropertyValueTypeException|\Exception Выбрасывается если был передан аргумент, который невозможно
* интерпретировать как дату или время
*/
public function setCreatedAt($value)
@@ -377,7 +377,7 @@ public function getCapturedAt()
* @param \DateTime|string|int|null $value Время подтверждения платежа магазином
*
* @throws InvalidPropertyValueException Выбрасвается если передали строку, которую не удалось привести к дате
- * @throws InvalidPropertyValueTypeException Выбрасывается если был передан аргумент, который невозможно
+ * @throws InvalidPropertyValueTypeException|\Exception Выбрасывается если был передан аргумент, который невозможно
* интерпретировать как дату или время
*/
public function setCapturedAt($value)
@@ -558,7 +558,7 @@ public function getExpiresAt()
* @param \DateTime|string|int|null $value Время, до которого можно бесплатно отменить или подтвердить платеж
*
* @throws InvalidPropertyValueException Выбрасывается если передали строку, которую не удалось привести к дате
- * @throws InvalidPropertyValueTypeException Выбрасывается если был передан аргумент, который невозможно
+ * @throws InvalidPropertyValueTypeException|\Exception Выбрасывается если был передан аргумент, который невозможно
* интерпретировать как дату или время
*
* @since 1.0.2
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/AbstractPaymentData.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/AbstractPaymentData.php
similarity index 84%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/AbstractPaymentData.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/AbstractPaymentData.php
index 179ef99..bb91a54 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/AbstractPaymentData.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/AbstractPaymentData.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* Данные используемые для создания метода оплаты.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatData.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatData.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatData.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatData.php
index 26a6fc4..7e94f4a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatData.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatData.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData\B2b\Sberbank;
+namespace YooKassa\Model\PaymentData\B2b\Sberbank;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\MonetaryAmount;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\MonetaryAmount;
/**
* Данные об НДС
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataInterface.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataInterface.php
index 9bf6910..74ddbe6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData\B2b\Sberbank;
+namespace YooKassa\Model\PaymentData\B2b\Sberbank;
-use YandexCheckout\Model\AmountInterface;
+use YooKassa\Model\AmountInterface;
/**
* Interface VatDataInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $type Способ расчёта НДС
* @property-read string $rate Данные об НДС в случае, если сумма НДС включена в сумму платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataRate.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataRate.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataRate.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataRate.php
index 61f2182..de5d8c9 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataRate.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataRate.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData\B2b\Sberbank;
+namespace YooKassa\Model\PaymentData\B2b\Sberbank;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* PaymentDataB2bSberbankVatDataRate - Налоговая ставка НДС
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataType.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataType.php
index b3a0bd5..edc3575 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/B2b/Sberbank/VatDataType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/B2b/Sberbank/VatDataType.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData\B2b\Sberbank;
+namespace YooKassa\Model\PaymentData\B2b\Sberbank;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* PaymentDataB2bSberbankVatDataType - Способ расчёта НДС
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataAlfabank.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataAlfabank.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataAlfabank.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataAlfabank.php
index 3f0f742..655ed30 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataAlfabank.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataAlfabank.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataAlfabank
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataApplePay.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataApplePay.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataApplePay.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataApplePay.php
index f1121c1..fc60948 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataApplePay.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataApplePay.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataApplePay
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataB2bSberbank.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataB2bSberbank.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataB2bSberbank.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataB2bSberbank.php
index 8e657c9..b55caf7 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataB2bSberbank.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataB2bSberbank.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentData\B2b\Sberbank\VatData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentData\B2b\Sberbank\VatData;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataB2BSberbank
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataBankCard.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataBankCard.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataBankCard.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataBankCard.php
index c9604da..597b860 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataBankCard.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataBankCard.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,10 +24,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataBankCard
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataBankCardCard.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataBankCardCard.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataBankCardCard.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataBankCardCard.php
index 43e45d1..b5898cb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataBankCardCard.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataBankCardCard.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Данные банковской карты
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataCash.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataCash.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataCash.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataCash.php
index f1c2d63..86c06be 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataCash.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataCash.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataCash
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataFactory.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataFactory.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataFactory.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataFactory.php
index 978d4a5..f309d8d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataFactory.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataFactory.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
class PaymentDataFactory
{
private $typeClassMap = array(
- PaymentMethodType::YANDEX_MONEY => 'PaymentDataYandexWallet',
+ PaymentMethodType::YOO_MONEY => 'PaymentDataYooMoney',
PaymentMethodType::BANK_CARD => 'PaymentDataBankCard',
PaymentMethodType::SBERBANK => 'PaymentDataSberbank',
PaymentMethodType::CASH => 'PaymentDataCash',
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataGooglePay.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataGooglePay.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataGooglePay.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataGooglePay.php
index 0c1a78e..6465dfd 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataGooglePay.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataGooglePay.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataGooglePay
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataInstallments.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataInstallments.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataInstallments.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataInstallments.php
index b60d9c1..e103542 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataInstallments.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataInstallments.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* Данные для проведения оплаты по частям
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataMobileBalance.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataMobileBalance.php
similarity index 87%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataMobileBalance.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataMobileBalance.php
index 07df184..f26bff7 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataMobileBalance.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataMobileBalance.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataMobileBalance
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataQiwi.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataQiwi.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataQiwi.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataQiwi.php
index 1ea35a2..5f6542f 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataQiwi.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataQiwi.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataQiwi
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataSberbank.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataSberbank.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataSberbank.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataSberbank.php
index 2b0069e..57cf11a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataSberbank.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataSberbank.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataSberbank
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataTinkoffBank.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataTinkoffBank.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataTinkoffBank.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataTinkoffBank.php
index 8fe0b03..b5a2fc5 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataTinkoffBank.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataTinkoffBank.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,10 +23,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
class PaymentDataTinkoffBank extends AbstractPaymentData
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataWebmoney.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWebmoney.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataWebmoney.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWebmoney.php
index 8310614..7a4a68a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataWebmoney.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWebmoney.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentDataWebmoney
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataWechat.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWechat.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataWechat.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWechat.php
index b978dab..39a2690 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataWechat.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataWechat.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,10 +23,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* @deprecated Класс будет удалён в одной из будущих версий.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataYandexWallet.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataYooMoney.php
similarity index 81%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataYandexWallet.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataYooMoney.php
index afa0829..d6c4016 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentData/PaymentDataYandexWallet.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentData/PaymentDataYooMoney.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,17 +24,17 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentData;
+namespace YooKassa\Model\PaymentData;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
- * Данные для проведения оплаты через Яндекс.Деньги
+ * Данные для проведения оплаты через ЮMoney
*/
-class PaymentDataYandexWallet extends AbstractPaymentData
+class PaymentDataYooMoney extends AbstractPaymentData
{
public function __construct()
{
- $this->_setType(PaymentMethodType::YANDEX_MONEY);
+ $this->_setType(PaymentMethodType::YOO_MONEY);
}
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentInterface.php
similarity index 97%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentInterface.php
index 82d3bd5..a1183d6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Model\PaymentMethod\AbstractPaymentMethod;
+use YooKassa\Model\PaymentMethod\AbstractPaymentMethod;
/**
* Interface PaymentInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $id Идентификатор платежа
* @property-read string $status Текущее состояние платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/AbstractPaymentMethod.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/AbstractPaymentMethod.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/AbstractPaymentMethod.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/AbstractPaymentMethod.php
index 3e0e895..d50457e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/AbstractPaymentMethod.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/AbstractPaymentMethod.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* @property string $id Идентификатор записи о сохраненных платежных данных
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetails.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetails.php
similarity index 97%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetails.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetails.php
index 3b0082e..d75afec 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetails.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetails.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod\B2b\Sberbank;
+namespace YooKassa\Model\PaymentMethod\B2b\Sberbank;
-use YandexCheckout\Common\AbstractObject;
+use YooKassa\Common\AbstractObject;
/**
* Банковские реквизиты плательщика
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsInterface.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsInterface.php
index 86c0cda..6e797bb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod\B2b\Sberbank;
+namespace YooKassa\Model\PaymentMethod\B2b\Sberbank;
/**
* Interface PayerBankDetailsInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $fullName Полное наименование организации
* @property-read string $shortName Сокращенное наименование организации
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/BankCardSource.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/BankCardSource.php
similarity index 85%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/BankCardSource.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/BankCardSource.php
index b76f32e..8101bc9 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/BankCardSource.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/BankCardSource.php
@@ -1,10 +1,10 @@
true,
@@ -49,7 +57,7 @@ class PaymentMethodCardType extends AbstractEnum
self::UNION_PAY => true,
self::JCB => true,
self::AMERICAN_EXPRESS => true,
- self::UNKNOWN => true,
self::DINERS_CLUB => true,
+ self::UNKNOWN => true,
);
}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodCash.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodCash.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodCash.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodCash.php
index 3fd8c38..9f054f6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodCash.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodCash.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodCash
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodFactory.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodFactory.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodFactory.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodFactory.php
index 1fb2bd9..3bdff07 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodFactory.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodFactory.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
class PaymentMethodFactory
{
private $typeClassMap = array(
- PaymentMethodType::YANDEX_MONEY => 'PaymentMethodYandexWallet',
+ PaymentMethodType::YOO_MONEY => 'PaymentMethodYooMoney',
PaymentMethodType::BANK_CARD => 'PaymentMethodBankCard',
PaymentMethodType::SBERBANK => 'PaymentMethodSberbank',
PaymentMethodType::CASH => 'PaymentMethodCash',
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodGooglePay.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodGooglePay.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodGooglePay.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodGooglePay.php
index a7f7491..53db42e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodGooglePay.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodGooglePay.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodGooglePay
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodInstallments.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodInstallments.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodInstallments.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodInstallments.php
index 1ecf117..df11007 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodInstallments.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodInstallments.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodInstallments
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodMobileBalance.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodMobileBalance.php
similarity index 87%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodMobileBalance.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodMobileBalance.php
index 514fb3e..291ce37 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodMobileBalance.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodMobileBalance.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodMobileBalance
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodPsb.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodPsb.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodPsb.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodPsb.php
index 4523b80..704ed65 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodPsb.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodPsb.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,10 +23,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
class PaymentMethodPsb extends AbstractPaymentMethod
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodQiwi.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodQiwi.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodQiwi.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodQiwi.php
index 8b763fc..b5032c5 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodQiwi.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodQiwi.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodQiwi
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodSberbank.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodSberbank.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodSberbank.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodSberbank.php
index 41e4ada..b079672 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodSberbank.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodSberbank.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodSberbank
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodTinkoffBank.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodTinkoffBank.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodTinkoffBank.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodTinkoffBank.php
index 6ed5d16..d4cce22 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodTinkoffBank.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodTinkoffBank.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -22,10 +22,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
class PaymentMethodTinkoffBank extends AbstractPaymentMethod
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodWebmoney.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodWebmoney.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodWebmoney.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodWebmoney.php
index 15337fb..1523970 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodWebmoney.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodWebmoney.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* PaymentMethodWebmoney
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodWechat.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodWechat.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodWechat.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodWechat.php
index e57d3e7..2e2d1b4 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodWechat.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodWechat.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,10 +23,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
/**
* @deprecated Класс будет удалён в одной из будущих версий.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodYandexWallet.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodYooMoney.php
similarity index 61%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodYandexWallet.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodYooMoney.php
index 85db89a..5a80847 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethod/PaymentMethodYandexWallet.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethod/PaymentMethodYooMoney.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,35 +24,35 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\PaymentMethod;
+namespace YooKassa\Model\PaymentMethod;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
/**
- * PaymentMethodYandexWallet
- * Объект, описывающий метод оплаты, при оплате через Яндекс Деньги
+ * PaymentMethodYooMoney
+ * Объект, описывающий метод оплаты, при оплате через ЮMoney
* @property string $type Тип объекта
- * @property string $accountNumber Номер кошелька в Яндекс.Деньгах с которого была произведена оплата.
- * @property string $account_number Номер кошелька в Яндекс.Деньгах с которого была произведена оплата.
+ * @property string $accountNumber Номер кошелька в ЮMoney с которого была произведена оплата.
+ * @property string $account_number Номер кошелька в ЮMoney с которого была произведена оплата.
*/
-class PaymentMethodYandexWallet extends AbstractPaymentMethod
+class PaymentMethodYooMoney extends AbstractPaymentMethod
{
/**
- * @var string Номер кошелька в Яндекс.Деньгах с которого была произведена оплата.
+ * @var string Номер кошелька в ЮMoney с которого была произведена оплата.
*/
private $_accountNumber;
public function __construct()
{
- $this->_setType(PaymentMethodType::YANDEX_MONEY);
+ $this->_setType(PaymentMethodType::YOO_MONEY);
}
/**
- * @return string Номер кошелька в Яндекс.Деньгах с которого была произведена оплата.
+ * @return string Номер кошелька в ЮMoney с которого была произведена оплата.
*/
public function getAccountNumber()
{
@@ -60,25 +60,25 @@ public function getAccountNumber()
}
/**
- * @param string $value Номер кошелька в Яндекс.Деньгах с которого была произведена оплата.
+ * @param string $value Номер кошелька в ЮMoney с которого была произведена оплата.
*/
public function setAccountNumber($value)
{
if ($value === null || $value === '') {
throw new EmptyPropertyValueException(
- 'Empty accountNumber value', 0, 'PaymentMethodYandexWallet.accountNumber'
+ 'Empty accountNumber value', 0, 'PaymentMethodYooMoney.accountNumber'
);
} elseif (TypeCast::canCastToString($value)) {
if (preg_match('/^[0-9]{11,33}$/', $value)) {
$this->_accountNumber = (string)$value;
} else {
throw new InvalidPropertyValueException(
- 'Invalid accountNumber value', 0, 'PaymentMethodYandexWallet.accountNumber', $value
+ 'Invalid accountNumber value', 0, 'PaymentMethodYooMoney.accountNumber', $value
);
}
} else {
throw new InvalidPropertyValueTypeException(
- 'Invalid accountNumber value type', 0, 'PaymentMethodYandexWallet.accountNumber', $value
+ 'Invalid accountNumber value type', 0, 'PaymentMethodYooMoney.accountNumber', $value
);
}
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethodType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethodType.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethodType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethodType.php
index 4436808..f8c82cb 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentMethodType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentMethodType.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* PaymentMethodType - Тип источника средств для проведения платежа
* |Код|Описание|
* --- | ---
- * |yandex_money|Платеж из кошелька Яндекс.Деньги|
+ * |yoo_money|Платеж из кошелька ЮMoney|
* |bank_card|Платеж с произвольной банковской карты|
* |sberbank|Платеж СбербанкОнлайн|
* |cash|Платеж наличными|
@@ -48,7 +48,7 @@
*/
class PaymentMethodType extends AbstractEnum
{
- const YANDEX_MONEY = 'yandex_money';
+ const YOO_MONEY = 'yoo_money';
const BANK_CARD = 'bank_card';
const SBERBANK = 'sberbank';
const CASH = 'cash';
@@ -62,13 +62,11 @@ class PaymentMethodType extends AbstractEnum
const B2B_SBERBANK = 'b2b_sberbank';
const TINKOFF_BANK = 'tinkoff_bank';
const PSB = 'psb';
- /**
- * @deprecated Будет удален в следующих версиях
- */
+ /** @deprecated Будет удален в следующих версиях */
const WECHAT = 'wechat';
protected static $validValues = array(
- self::YANDEX_MONEY => true,
+ self::YOO_MONEY => true,
self::BANK_CARD => true,
self::SBERBANK => true,
self::CASH => true,
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentStatus.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentStatus.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentStatus.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentStatus.php
index dfb0c16..eed5509 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/PaymentStatus.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/PaymentStatus.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* PaymentStatus - Состояние платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Receipt.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Receipt.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Receipt.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Receipt.php
index a387171..b9427c3 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Receipt.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Receipt.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,22 +24,21 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
/**
* Класс данных для формирования чека в онлайн-кассе (для соблюдения 54-ФЗ)
*
- * @property-read ReceiptCustomer $customer Информация о плательщике
+ * @property ReceiptCustomer $customer Информация о плательщике
* @property ReceiptItemInterface[] $items Список товаров в заказе
+ * @property SettlementInterface[] $settlements Массив оплат, обеспечивающих выдачу товара
* @property int $taxSystemCode Код системы налогообложения. Число 1-6.
* @property int $tax_system_code Код системы налогообложения. Число 1-6.
- * @property string $phone Номер телефона плательщика в формате ITU-T E.164 на который будет выслан чек.
- * @property string $email E-mail адрес плательщика на который будет выслан чек.
*/
class Receipt extends AbstractObject implements ReceiptInterface
{
@@ -75,6 +74,9 @@ class Receipt extends AbstractObject implements ReceiptInterface
*/
public function getCustomer()
{
+ if (!$this->_customer) {
+ $this->_customer = new ReceiptCustomer();
+ }
return $this->_customer;
}
@@ -228,60 +230,6 @@ public function setTaxSystemCode($value)
}
}
- /**
- * @deprecated 1.3.0 Устарел — данные рекомендуется брать в параметре receipt.customer.phone.
- * Возвращает номер телефона плательщика в формате ITU-T E.164 на который будет выслан чек
- *
- * @return string Номер телефона плательщика
- */
- public function getPhone()
- {
- return $this->getCustomer() ? $this->getCustomer()->getPhone() : null;
- }
-
- /**
- * @deprecated 1.3.0 Устарел — данные рекомендуется передавать в параметре receipt.customer.phone.
- * Устанавливливает номер телефона плательщика в формате ITU-T E.164 на который будет выслан чек
- *
- * @param string $value Номер телефона плательщика в формате ITU-T E.164
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если в качестве значения была передана не строка
- */
- public function setPhone($value)
- {
- if (!$this->getCustomer()) {
- $this->setCustomer(new ReceiptCustomer());
- }
- $this->getCustomer()->setPhone($value);
- }
-
- /**
- * @deprecated 1.3.0 Устарел — данные рекомендуется брать в параметре receipt.customer.email.
- * Возвращает адрес электронной почты на который будет выслан чек
- *
- * @return string E-mail адрес плательщика
- */
- public function getEmail()
- {
- return $this->getCustomer() ? $this->getCustomer()->getEmail() : null;
- }
-
- /**
- * @deprecated 1.3.0 Устарел — данные рекомендуется передавать в параметре receipt.customer.email.
- * Устанавливает адрес электронной почты на который будет выслан чек
- *
- * @param string $value E-mail адрес плательщика
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если в качестве значения была передана не строка
- */
- public function setEmail($value)
- {
- if (!$this->getCustomer()) {
- $this->setCustomer(new ReceiptCustomer());
- }
- $this->getCustomer()->setEmail($value);
- }
-
/**
* Проверяет есть ли в чеке хотя бы одна позиция
*
@@ -416,6 +364,60 @@ public function normalize(AmountInterface $orderAmount, $withShipping = false)
}
}
+ /**
+ * @deprecated 1.3.0 Устарел — данные рекомендуется брать в параметре receipt.customer.phone.
+ * Возвращает номер телефона плательщика в формате ITU-T E.164 на который будет выслан чек
+ *
+ * @return string Номер телефона плательщика
+ */
+ public function getPhone()
+ {
+ return $this->getCustomer() ? $this->getCustomer()->getPhone() : null;
+ }
+
+ /**
+ * @deprecated 1.3.0 Устарел — данные рекомендуется передавать в параметре receipt.customer.phone.
+ * Устанавливливает номер телефона плательщика в формате ITU-T E.164 на который будет выслан чек
+ *
+ * @param string $value Номер телефона плательщика в формате ITU-T E.164
+ *
+ * @throws InvalidPropertyValueTypeException Выбрасывается если в качестве значения была передана не строка
+ */
+ public function setPhone($value)
+ {
+ if (!$this->getCustomer()) {
+ $this->setCustomer(new ReceiptCustomer());
+ }
+ $this->getCustomer()->setPhone($value);
+ }
+
+ /**
+ * @deprecated 1.3.0 Устарел — данные рекомендуется брать в параметре receipt.customer.email.
+ * Возвращает адрес электронной почты на который будет выслан чек
+ *
+ * @return string E-mail адрес плательщика
+ */
+ public function getEmail()
+ {
+ return $this->getCustomer() ? $this->getCustomer()->getEmail() : null;
+ }
+
+ /**
+ * @deprecated 1.3.0 Устарел — данные рекомендуется передавать в параметре receipt.customer.email.
+ * Устанавливает адрес электронной почты на который будет выслан чек
+ *
+ * @param string $value E-mail адрес плательщика
+ *
+ * @throws InvalidPropertyValueTypeException Выбрасывается если в качестве значения была передана не строка
+ */
+ public function setEmail($value)
+ {
+ if (!$this->getCustomer()) {
+ $this->setCustomer(new ReceiptCustomer());
+ }
+ $this->getCustomer()->setEmail($value);
+ }
+
/**
* Устанавливает значения свойств текущего объекта из массива
* @param array|\Traversable $sourceArray Ассоциативный массив с настройками
@@ -423,9 +425,7 @@ public function normalize(AmountInterface $orderAmount, $withShipping = false)
public function fromArray($sourceArray)
{
if (!empty($sourceArray['customer'])) {
- $customer = new ReceiptCustomer();
- $customer->fromArray($sourceArray['customer']);
- $sourceArray['customer'] = $customer;
+ $sourceArray['customer'] = new ReceiptCustomer($sourceArray['customer']);
}
if (!empty($sourceArray['items'])) {
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Receipt/AgentType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Receipt/AgentType.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Receipt/AgentType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Receipt/AgentType.php
index a44b4d8..580c9d9 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Receipt/AgentType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Receipt/AgentType.php
@@ -1,10 +1,10 @@
fromArray($data);
- }
- }
-
/**
* Возвращает для юрлица — название организации, для ИП и физического лица — ФИО
* @return string Название организации или ФИО
@@ -189,6 +178,16 @@ public function setInn($value)
}
}
+ /**
+ * Проверка на заполненность объекта
+ * @return bool
+ */
+ public function isEmpty()
+ {
+ $data = $this->getFullName() . $this->getEmail() . $this->getPhone() . $this->getInn();
+ return empty($data);
+ }
+
/**
* @return array
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptCustomerInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptCustomerInterface.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptCustomerInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptCustomerInterface.php
index 3e65b2f..f33fd41 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptCustomerInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptCustomerInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface ReceiptCustomerInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $fullName Для юрлица — название организации, для ИП и физического лица — ФИО.
* @property-read string $full_name Для юрлица — название организации, для ИП и физического лица — ФИО.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptInterface.php
similarity index 87%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptInterface.php
index 17e718f..0b37f67 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface ReceiptInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read ReceiptCustomerInterface $customer Информация о плательщике
* @property-read ReceiptItemInterface[] $items Список товаров в заказе
@@ -52,22 +52,6 @@ public function getObjectId();
*/
public function getCustomer();
- /**
- * Возвращает телефон плательщика
- *
- * @deprecated
- * @return string Телефон плательщика
- */
- public function getPhone();
-
- /**
- * Возвращает email плательщика
- *
- * @deprecated
- * @return string Email плательщика
- */
- public function getEmail();
-
/**
* Возвращает список позиций в текущем чеке
*
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptItem.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptItem.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptItem.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptItem.php
index 8e0da2d..397e390 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptItem.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptItem.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\Receipt\AgentType;
-use YandexCheckout\Model\Receipt\ReceiptItemAmount;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\Receipt\AgentType;
+use YooKassa\Model\Receipt\ReceiptItemAmount;
/**
* Информация о товарной позиции в заказе, позиция фискального чека
@@ -487,6 +487,8 @@ public function setIsShipping($value)
'Invalid isShipping value in ReceiptItem', 0, 'ReceiptItem.isShipping', $value
);
}
+
+ return $this;
}
/**
@@ -591,6 +593,8 @@ public function increasePrice($value)
*
* @param float $count Количество на которое уменьшаем позицию в чеке
*
+ * @return ReceiptItem
+ *
* @throws EmptyPropertyValueException Выбрасывается если было передано пустое значение
* @throws InvalidPropertyValueException Выбрасывается если в качестве аргумента был передан ноль
* или отрицательное число, или число больше текущего количества покупаемого товара
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptItemInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptItemInterface.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptItemInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptItemInterface.php
index feb2e7c..a39e770 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptItemInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptItemInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface ReceiptItemInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $description Наименование товара
* @property-read float $quantity Количество
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptRegistrationStatus.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptRegistrationStatus.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptRegistrationStatus.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptRegistrationStatus.php
index e4785f0..97a4828 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptRegistrationStatus.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptRegistrationStatus.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* Класс с перечислением статусов доставки данных для чека в онлайн-кассу (`pending`, `succeeded` или `canceled`)
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptType.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptType.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptType.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptType.php
index 180d63d..b1a44a6 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/ReceiptType.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/ReceiptType.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* ReceiptType - Тип чека в онлайн-кассе.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Recipient.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Recipient.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Recipient.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Recipient.php
index 0de1dc8..e909244 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Recipient.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Recipient.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Класс получателя платежа.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RecipientInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RecipientInterface.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RecipientInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RecipientInterface.php
index a5b7e35..84b936c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RecipientInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RecipientInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Интерфейс получателя платежа.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Refund.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Refund.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Refund.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Refund.php
index afe54b2..5cdec14 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Refund.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Refund.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Класс объекта с информацией о возврате платежа
@@ -219,7 +219,7 @@ public function getCreatedAt()
* @throws EmptyPropertyValueException Выбрасывается если быо передано пустое значение
* @throws InvalidPropertyValueException Выбрасывается если переданную строку или число не удалось интерпретировать
* как дату и время
- * @throws InvalidPropertyValueTypeException Выбрасывается если было передано значение невалидного типа
+ * @throws InvalidPropertyValueTypeException|\Exception Выбрасывается если было передано значение невалидного типа
*/
public function setCreatedAt($value)
{
@@ -296,16 +296,6 @@ public function setReceiptRegistration($value)
}
}
- /**
- * Возвращает комментарий к возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @return string Комментарий, основание для возврата средств покупателю
- */
- public function getComment()
- {
- return $this->_description;
- }
-
/**
* Возвращает комментарий к возврату
* @return string Комментарий, основание для возврата средств покупателю
@@ -315,20 +305,6 @@ public function getDescription()
return $this->_description;
}
- /**
- * Устанавливает комментарий к возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @param string $value Комментарий, основание для возврата средств покупателю
- *
- * @throws EmptyPropertyValueException Выбрасывается если был передан пустой аргумент
- * @throws InvalidPropertyValueException Выбрасывается если було передано невалидное значение
- * @throws InvalidPropertyValueTypeException Выбрасывается если аргумент не является строкой
- */
- public function setComment($value)
- {
- $this->setDescription($value);
- }
-
/**
* Устанавливает комментарий к возврату
* @param string $value Комментарий, основание для возврата средств покупателю
@@ -348,7 +324,15 @@ public function setDescription($value)
}
/**
- * Устанавливает transfers (массив распределения денег между магазинами)
+ * @return SourceInterface[]
+ */
+ public function getSources()
+ {
+ return $this->_sources;
+ }
+
+ /**
+ * Устанавливает sources (массив распределения денег между магазинами)
* @param SourceInterface[]|array $value
*/
public function setSources($value)
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RefundInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RefundInterface.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RefundInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RefundInterface.php
index 28ebff3..b810eb0 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RefundInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RefundInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface RefundInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $id Идентификатор возврата платежа
* @property-read string $paymentId Идентификатор платежа
@@ -80,13 +80,6 @@ function getAmount();
*/
function getReceiptRegistration();
- /**
- * Возвращает комментарий к возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @return string Комментарий, основание для возврата средств покупателю
- */
- function getComment();
-
/**
* Возвращает комментарий к возврату
* @return string Комментарий, основание для возврата средств покупателю
@@ -98,4 +91,10 @@ function getDescription();
* @return RequestorInterface
*/
function getRequestor();
+
+ /**
+ * Возвращает информацию о распределении денег — сколько и в какой магазин нужно перевести
+ * @return SourceInterface[]
+ */
+ function getSources();
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RefundStatus.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RefundStatus.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RefundStatus.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RefundStatus.php
index 2d6fd4c..5bc0242 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/RefundStatus.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/RefundStatus.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,9 +24,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* RefundStatus - Состояние возврата платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Requestor.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Requestor.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Requestor.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Requestor.php
index 20f6522..303b529 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Requestor.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Requestor.php
@@ -1,13 +1,13 @@
setAmount($this->factoryAmount($data['amount']));
}
+ if (!empty($data['platform_fee_amount'])) {
+ $this->setPlatformFeeAmount($this->factoryAmount($data['platform_fee_amount']));
+ }
}
}
@@ -125,6 +132,42 @@ public function setAmount($value)
}
}
+ /**
+ * @inheritDoc
+ */
+ public function getPlatformFeeAmount()
+ {
+ return $this->_platform_fee_amount;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function hasPlatformFeeAmount()
+ {
+ return !empty($this->_platform_fee_amount);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function setPlatformFeeAmount($value)
+ {
+ if ($value === null || $value === '') {
+ throw new EmptyPropertyValueException(
+ 'Empty value for "platform_fee_amount" parameter in Source', 0, 'source.platform_fee_amount'
+ );
+ } elseif (is_array($value)) {
+ $this->_platform_fee_amount = $this->factoryAmount($value);
+ } elseif ($value instanceof AmountInterface) {
+ $this->_platform_fee_amount = $value;
+ } else {
+ throw new InvalidPropertyValueTypeException(
+ 'Invalid value type for "platform_fee_amount" parameter in Source', 0, 'source.platform_fee_amount', $value
+ );
+ }
+ }
+
/**
* Фабричный метод создания суммы
*
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/SourceInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/SourceInterface.php
similarity index 65%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/SourceInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/SourceInterface.php
index 0291377..f9e4874 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/SourceInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/SourceInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface TransferInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property AmountInterface $amount
+ * @property AmountInterface $platform_fee_amount
* @property string $accountId
*/
interface SourceInterface
@@ -71,4 +72,24 @@ public function hasAmount();
* @param AmountInterface|array $value Сумма оплаты
*/
public function setAmount($value);
+
+ /**
+ * Возвращает комиссию за проданные товары и услуги, которая удерживается с магазина в вашу пользу
+ *
+ * @return AmountInterface Сумма комиссии
+ */
+ public function getPlatformFeeAmount();
+
+ /**
+ * Проверяет была ли установлена комиссия за проданные товары и услуги, которая удерживается с магазина в вашу пользу
+ *
+ * @return bool True если комиссия была установлена, false если нет
+ */
+ public function hasPlatformFeeAmount();
+
+ /**
+ * Устанавливает комиссию за проданные товары и услуги, которая удерживается с магазина в вашу пользу
+ * @param AmountInterface|array $value Сумма комиссии
+ */
+ public function setPlatformFeeAmount($value);
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Supplier.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Supplier.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Supplier.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Supplier.php
index f594569..055525c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Supplier.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Supplier.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,18 +24,18 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Информация о поставщике товара или услуги.
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*/
class Supplier extends AbstractObject implements SupplierInterface
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/SupplierInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/SupplierInterface.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/SupplierInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/SupplierInterface.php
index ebd0af3..96e2dcc 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/SupplierInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/SupplierInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface SupplierInterface
@@ -32,7 +32,7 @@
* Информация о поставщике товара или услуги. Можно передавать,
* если вы отправляете данные для формирования чека по сценарию - сначала платеж, потом чек.
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*/
interface SupplierInterface
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Transfer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Transfer.php
similarity index 73%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Transfer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Transfer.php
index b6178f8..a8c8f82 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Transfer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Transfer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,13 +24,13 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Класс объекта распределения денег в магазин
@@ -47,6 +47,11 @@ class Transfer extends AbstractObject implements TransferInterface
*/
private $_amount;
+ /**
+ * @var AmountInterface
+ */
+ private $_platform_fee_amount;
+
/**
* @var string
*/
@@ -65,6 +70,12 @@ public function __construct($data = null)
if (!empty($data['amount'])) {
$this->setAmount($this->factoryAmount($data['amount']));
}
+ if (!empty($data['platform_fee_amount'])) {
+ $this->setPlatformFeeAmount($this->factoryAmount($data['platform_fee_amount']));
+ }
+ if (!empty($data['status'])) {
+ $this->setStatus($data['status']);
+ }
}
}
@@ -130,6 +141,42 @@ public function setAmount($value)
}
}
+ /**
+ * @inheritDoc
+ */
+ public function getPlatformFeeAmount()
+ {
+ return $this->_platform_fee_amount;
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function hasPlatformFeeAmount()
+ {
+ return !empty($this->_platform_fee_amount);
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function setPlatformFeeAmount($value)
+ {
+ if ($value === null || $value === '') {
+ throw new EmptyPropertyValueException(
+ 'Empty value for "platform_fee_amount" parameter in Transfer', 0, 'transfer.platform_fee_amount'
+ );
+ } elseif (is_array($value)) {
+ $this->_platform_fee_amount = $this->factoryAmount($value);
+ } elseif ($value instanceof AmountInterface) {
+ $this->_platform_fee_amount = $value;
+ } else {
+ throw new InvalidPropertyValueTypeException(
+ 'Invalid value type for "platform_fee_amount" parameter in Transfer', 0, 'transfer.platform_fee_amount', $value
+ );
+ }
+ }
+
/**
* @param $value
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/TransferInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/TransferInterface.php
similarity index 66%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/TransferInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/TransferInterface.php
index e47d3a1..8c4dc6f 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/TransferInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/TransferInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,17 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
/**
* Interface TransferInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property AmountInterface $amount
+ * @property AmountInterface $platform_fee_amount
* @property string $accountId
+ * @property string $status
*/
interface TransferInterface
{
@@ -72,6 +74,26 @@ public function hasAmount();
*/
public function setAmount($value);
+ /**
+ * Возвращает комиссию за проданные товары и услуги, которая удерживается с магазина в вашу пользу
+ *
+ * @return AmountInterface Сумма комиссии
+ */
+ public function getPlatformFeeAmount();
+
+ /**
+ * Проверяет была ли установлена комиссия за проданные товары и услуги, которая удерживается с магазина в вашу пользу
+ *
+ * @return bool True если комиссия была установлена, false если нет
+ */
+ public function hasPlatformFeeAmount();
+
+ /**
+ * Устанавливает комиссию за проданные товары и услуги, которая удерживается с магазина в вашу пользу
+ * @param AmountInterface|array $value Сумма комиссии
+ */
+ public function setPlatformFeeAmount($value);
+
/**
* @return string|null статус операции распределения средств конечному получателю
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/TransferStatus.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/TransferStatus.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/TransferStatus.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/TransferStatus.php
index 104919b..ae788a2 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/TransferStatus.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/TransferStatus.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,10 +24,10 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model;
+namespace YooKassa\Model;
-use YandexCheckout\Common\AbstractEnum;
+use YooKassa\Common\AbstractEnum;
/**
* PaymentStatus - Статус операции распределения средств конечному получателю
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Webhook/Webhook.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Webhook/Webhook.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Webhook/Webhook.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Webhook/Webhook.php
index cd04973..f5e8ba5 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Model/Webhook/Webhook.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Model/Webhook/Webhook.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Model\Webhook;
+namespace YooKassa\Model\Webhook;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Model\NotificationEventType;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Model\NotificationEventType;
/**
* Class Webhook
@@ -42,14 +42,14 @@ class Webhook extends AbstractObject
private $id;
/**
- * Событие, о котором уведомляет Яндекс.Касса
+ * Событие, о котором уведомляет ЮKassa
* @see NotificationEventType
* @var string
*/
private $event;
/**
- * URL, на который Яндекс.Касса будет отправлять уведомления
+ * URL, на который ЮKassa будет отправлять уведомления
* @var string
*/
private $url;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/AbstractPaymentResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php
similarity index 84%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/AbstractPaymentResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php
index ea7136a..3cde612 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/AbstractPaymentResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/AbstractPaymentResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,32 +24,32 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
use InvalidArgumentException;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\AuthorizationDetails;
-use YandexCheckout\Model\CancellationDetails;
-use YandexCheckout\Model\Confirmation\ConfirmationCodeVerification;
-use YandexCheckout\Model\Confirmation\ConfirmationDeepLink;
-use YandexCheckout\Model\Confirmation\ConfirmationEmbedded;
-use YandexCheckout\Model\Confirmation\ConfirmationQr;
-use YandexCheckout\Model\Confirmation\ConfirmationRedirect;
-use YandexCheckout\Model\Confirmation\ConfirmationExternal;
-use YandexCheckout\Model\ConfirmationType;
-use YandexCheckout\Model\Metadata;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\Payment;
-use YandexCheckout\Model\PaymentInterface;
-use YandexCheckout\Model\PaymentMethod\AbstractPaymentMethod;
-use YandexCheckout\Model\PaymentMethod\PaymentMethodFactory;
-use YandexCheckout\Model\Recipient;
-use YandexCheckout\Model\Transfer;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\AuthorizationDetails;
+use YooKassa\Model\CancellationDetails;
+use YooKassa\Model\Confirmation\ConfirmationCodeVerification;
+use YooKassa\Model\Confirmation\ConfirmationDeepLink;
+use YooKassa\Model\Confirmation\ConfirmationEmbedded;
+use YooKassa\Model\Confirmation\ConfirmationQr;
+use YooKassa\Model\Confirmation\ConfirmationRedirect;
+use YooKassa\Model\Confirmation\ConfirmationExternal;
+use YooKassa\Model\ConfirmationType;
+use YooKassa\Model\Metadata;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\Payment;
+use YooKassa\Model\PaymentInterface;
+use YooKassa\Model\PaymentMethod\AbstractPaymentMethod;
+use YooKassa\Model\PaymentMethod\PaymentMethodFactory;
+use YooKassa\Model\Recipient;
+use YooKassa\Model\Transfer;
/**
* Абстрактный класс ответа от API, возвращающего информацию о платеже
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
abstract class AbstractPaymentResponse extends Payment implements PaymentInterface
{
@@ -57,6 +57,7 @@ abstract class AbstractPaymentResponse extends Payment implements PaymentInterfa
* Конструктор, устанавливает настройки платежа из ассоциативного массива
*
* @param array $paymentInfo Массив с информацией о платеже, пришедший от API
+ * @throws \Exception
*/
public function __construct($paymentInfo)
{
@@ -172,18 +173,7 @@ public function __construct($paymentInfo)
if (!empty($paymentInfo['transfers'])) {
$transfers = array();
foreach ($paymentInfo['transfers'] as $transferDefinition) {
- $amount = new MonetaryAmount();
- $amount->setValue($transferDefinition['amount']['value']);
- if (!empty($transferDefinition['amount']['currency'])) {
- $amount->setCurrency($transferDefinition['amount']['currency']);
- }
-
- $transfer = new Transfer();
- $transfer->setAccountId($transferDefinition['account_id']);
- $transfer->setAmount($amount);
- $transfer->setStatus($transferDefinition['status']);
-
- $transfers[] = $transfer;
+ $transfers[] = new Transfer($transferDefinition);
}
$this->setTransfers($transfers);
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequest.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequest.php
index ec3f488..60f6dee 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,32 +24,32 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
-
-use YandexCheckout\Common\AbstractPaymentRequest;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\AirlineInterface;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\Payment;
-use YandexCheckout\Model\PaymentData\AbstractPaymentData;
-use YandexCheckout\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
-use YandexCheckout\Model\Metadata;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\RecipientInterface;
+namespace YooKassa\Request\Payments;
+
+use YooKassa\Common\AbstractPaymentRequest;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\AirlineInterface;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\Payment;
+use YooKassa\Model\PaymentData\AbstractPaymentData;
+use YooKassa\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
+use YooKassa\Model\Metadata;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\RecipientInterface;
/**
* Класс объекта запроса к API на проведение нового платежа
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*
* @property RecipientInterface $recipient Получатель платежа, если задан
* @property AmountInterface $amount Сумма создаваемого платежа
* @property string $description Описание транзакции
* @property ReceiptInterface $receipt Данные фискального чека 54-ФЗ
- * @property string $paymentToken Одноразовый токен для проведения оплаты, сформированный Yandex.Checkout JS widget
- * @property string $payment_token Одноразовый токен для проведения оплаты, сформированный Yandex.Checkout JS widget
+ * @property string $paymentToken Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
+ * @property string $payment_token Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
* @property string $paymentMethodId Идентификатор записи о сохраненных платежных данных покупателя
* @property string $payment_method_id Идентификатор записи о сохраненных платежных данных покупателя
* @property AbstractPaymentData $paymentMethodData Данные используемые для создания метода оплаты
@@ -79,7 +79,7 @@ class CreatePaymentRequest extends AbstractPaymentRequest implements CreatePayme
private $_description;
/**
- * @var string Одноразовый токен для проведения оплаты, сформированный Yandex.Checkout JS widget
+ * @var string Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
*/
private $_paymentToken;
@@ -202,7 +202,7 @@ public function setRecipient($value)
/**
* Возвращает одноразовый токен для проведения оплаты
- * @return string Одноразовый токен для проведения оплаты, сформированный Yandex.Checkout JS widget
+ * @return string Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
*/
public function getPaymentToken()
{
@@ -219,7 +219,7 @@ public function hasPaymentToken()
}
/**
- * Устанавливает одноразовый токен для проведения оплаты, сформированный Yandex.Checkout JS widget
+ * Устанавливает одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
* @param string $value Одноразовый токен для проведения оплаты
*
* @throws InvalidPropertyValueException Выбрасывается если переданное значение превышает допустимую длину
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestBuilder.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestBuilder.php
index 2a73056..0b94904 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,27 +24,27 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
-
-use YandexCheckout\Common\AbstractPaymentRequestBuilder;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Common\Exceptions\InvalidRequestException;
-use YandexCheckout\Model\Airline;
-use YandexCheckout\Model\AirlineInterface;
-use YandexCheckout\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationAttributes\ConfirmationAttributesFactory;
-use YandexCheckout\Model\Metadata;
-use YandexCheckout\Model\PaymentData\AbstractPaymentData;
-use YandexCheckout\Model\PaymentData\PaymentDataFactory;
-use YandexCheckout\Model\Recipient;
-use YandexCheckout\Model\RecipientInterface;
+namespace YooKassa\Request\Payments;
+
+use YooKassa\Common\AbstractPaymentRequestBuilder;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Common\Exceptions\InvalidRequestException;
+use YooKassa\Model\Airline;
+use YooKassa\Model\AirlineInterface;
+use YooKassa\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
+use YooKassa\Model\ConfirmationAttributes\ConfirmationAttributesFactory;
+use YooKassa\Model\Metadata;
+use YooKassa\Model\PaymentData\AbstractPaymentData;
+use YooKassa\Model\PaymentData\PaymentDataFactory;
+use YooKassa\Model\Recipient;
+use YooKassa\Model\RecipientInterface;
/**
* Класс билдера объектов запрсов к API на создание платежа
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class CreatePaymentRequestBuilder extends AbstractPaymentRequestBuilder
{
@@ -298,7 +298,7 @@ public function setDescription($value)
}
/**
- * Строит и возвращает объект запроса для отправки в API яндекс денег
+ * Строит и возвращает объект запроса для отправки в API ЮKassa
* @param array|null $options Массив параметров для установки в объект запроса
* @return CreatePaymentRequestInterface Инстанс объекта запроса
*
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestInterface.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestInterface.php
index 66b360b..e483490 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,29 +24,27 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
-use YandexCheckout\Model\Airline;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
-use YandexCheckout\Model\Metadata;
-use YandexCheckout\Model\PaymentData\AbstractPaymentData;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\RecipientInterface;
-use YandexCheckout\Model\TransferInterface;
+use YooKassa\Model\Airline;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
+use YooKassa\Model\Metadata;
+use YooKassa\Model\PaymentData\AbstractPaymentData;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\RecipientInterface;
+use YooKassa\Model\TransferInterface;
/**
* Interface CreatePaymentRequestInterface
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*
* @property-read RecipientInterface|null $recipient Получатель платежа, если задан
* @property-read AmountInterface $amount Сумма создаваемого платежа
* @property-read ReceiptInterface $receipt Данные фискального чека 54-ФЗ
- * @property-read string $paymentToken Одноразовый токен для проведения оплаты, сформированный
- * Yandex.Checkout JS widget
- * @property-read string $payment_token Одноразовый токен для проведения оплаты, сформированный
- * Yandex.Checkout JS widget
+ * @property-read string $paymentToken Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
+ * @property-read string $payment_token Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
* @property-read string $paymentMethodId Идентификатор записи о сохраненных платежных данных покупателя
* @property-read string $payment_method_id Идентификатор записи о сохраненных платежных данных покупателя
* @property-read AbstractPaymentData $paymentMethodData Данные используемые для создания метода оплаты
@@ -107,7 +105,7 @@ function hasReceipt();
/**
* Возвращает одноразовый токен для проведения оплаты
- * @return string Одноразовый токен для проведения оплаты, сформированный Yandex.Checkout JS widget
+ * @return string Одноразовый токен для проведения оплаты, сформированный YooKassa JS widget
*/
function getPaymentToken();
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestSerializer.php
similarity index 89%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestSerializer.php
index 270331a..ddb495e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,30 +24,30 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
-
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
-use YandexCheckout\Model\ConfirmationAttributes\ConfirmationAttributesRedirect;
-use YandexCheckout\Model\ConfirmationType;
-use YandexCheckout\Model\LegInterface;
-use YandexCheckout\Model\PassengerInterface;
-use YandexCheckout\Model\PaymentData\AbstractPaymentData;
-use YandexCheckout\Model\PaymentData\PaymentDataAlfabank;
-use YandexCheckout\Model\PaymentData\PaymentDataB2bSberbank;
-use YandexCheckout\Model\PaymentData\PaymentDataBankCard;
-use YandexCheckout\Model\PaymentData\PaymentDataGooglePay;
-use YandexCheckout\Model\PaymentData\PaymentDataSberbank;
-use YandexCheckout\Model\PaymentData\PaymentDataYandexWallet;
-use YandexCheckout\Model\PaymentMethodType;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\ReceiptItem;
-use YandexCheckout\Model\TransferInterface;
+namespace YooKassa\Request\Payments;
+
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ConfirmationAttributes\AbstractConfirmationAttributes;
+use YooKassa\Model\ConfirmationAttributes\ConfirmationAttributesRedirect;
+use YooKassa\Model\ConfirmationType;
+use YooKassa\Model\LegInterface;
+use YooKassa\Model\PassengerInterface;
+use YooKassa\Model\PaymentData\AbstractPaymentData;
+use YooKassa\Model\PaymentData\PaymentDataAlfabank;
+use YooKassa\Model\PaymentData\PaymentDataB2bSberbank;
+use YooKassa\Model\PaymentData\PaymentDataBankCard;
+use YooKassa\Model\PaymentData\PaymentDataGooglePay;
+use YooKassa\Model\PaymentData\PaymentDataSberbank;
+use YooKassa\Model\PaymentData\PaymentDataYooMoney;
+use YooKassa\Model\PaymentMethodType;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\ReceiptItem;
+use YooKassa\Model\TransferInterface;
/**
* Класс сериалайзера объекта запроса к API на проведение платежа
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class CreatePaymentRequestSerializer
{
@@ -60,7 +60,7 @@ class CreatePaymentRequestSerializer
private static $paymentDataSerializerMap = array(
PaymentMethodType::BANK_CARD => 'serializePaymentDataBankCard',
- PaymentMethodType::YANDEX_MONEY => 'serializePaymentDataYandexWallet',
+ PaymentMethodType::YOO_MONEY => 'serializePaymentDataYooMoney',
PaymentMethodType::APPLE_PAY => 'serializePaymentDataMobile',
PaymentMethodType::GOOGLE_PAY => 'serializePaymentDataGooglePay',
PaymentMethodType::SBERBANK => 'serializePaymentDataSberbank',
@@ -130,7 +130,6 @@ public function serialize(CreatePaymentRequestInterface $request)
$result['airline']['booking_reference'] = $bookingReference;
}
- /** @var PassengerInterface $passenger */
foreach ($airline->getPassengers() as $passenger) {
$result['airline']['passengers'][] = array(
'first_name' => $passenger->getFirstName(),
@@ -138,7 +137,6 @@ public function serialize(CreatePaymentRequestInterface $request)
);
}
- /** @var LegInterface $leg */
foreach ($airline->getLegs() as $leg) {
$result['airline']['legs'][] = array(
'departure_airport' => $leg->getDepartureAirport(),
@@ -225,7 +223,7 @@ private function serializePaymentDataBankCard(PaymentDataBankCard $paymentData)
return $result;
}
- private function serializePaymentDataYandexWallet(PaymentDataYandexWallet $paymentData)
+ private function serializePaymentDataYooMoney(PaymentDataYooMoney $paymentData)
{
$result = array(
'type' => $paymentData->getType(),
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentResponse.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentResponse.php
index dc5dd1f..1204603 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/CreatePaymentResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/CreatePaymentResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
/**
* Класс объекта ответа возвращаемого API при запросе на создание платежа
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class CreatePaymentResponse extends AbstractPaymentResponse
{}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CancelResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CancelResponse.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CancelResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CancelResponse.php
index b602930..555d83d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CancelResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CancelResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments\Payment;
+namespace YooKassa\Request\Payments\Payment;
-use YandexCheckout\Request\Payments\AbstractPaymentResponse;
+use YooKassa\Request\Payments\AbstractPaymentResponse;
/**
* Класс объекта ответа от API на запрос отмены платежа
*
- * @package YandexCheckout\Request\Payments\Payment
+ * @package YooKassa\Request\Payments\Payment
*/
class CancelResponse extends AbstractPaymentResponse
{}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequest.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequest.php
index de5f882..78764c4 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments\Payment;
+namespace YooKassa\Request\Payments\Payment;
-use YandexCheckout\Common\AbstractPaymentRequest;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ReceiptInterface;
+use YooKassa\Common\AbstractPaymentRequest;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ReceiptInterface;
/**
* Класс объекта запроса к API на подтверждение оплаты
@@ -52,9 +52,9 @@ public function validate()
return false;
}
}
- if ($this->_receipt !== null && $this->_receipt->notEmpty()) {
- $email = $this->_receipt->getEmail();
- $phone = $this->_receipt->getPhone();
+ if ($this->getReceipt() && $this->getReceipt()->notEmpty()) {
+ $email = $this->getReceipt()->getCustomer()->getEmail();
+ $phone = $this->getReceipt()->getCustomer()->getPhone();
if (empty($email) && empty($phone)) {
$this->setValidationError('Both email and phone values are empty in receipt');
return false;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestBuilder.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestBuilder.php
index b8d3dd2..1c4303f 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments\Payment;
+namespace YooKassa\Request\Payments\Payment;
-use YandexCheckout\Common\AbstractPaymentRequestBuilder;
-use YandexCheckout\Common\Exceptions\InvalidPropertyException;
-use YandexCheckout\Common\Exceptions\InvalidRequestException;
+use YooKassa\Common\AbstractPaymentRequestBuilder;
+use YooKassa\Common\Exceptions\InvalidPropertyException;
+use YooKassa\Common\Exceptions\InvalidRequestException;
class CreateCaptureRequestBuilder extends AbstractPaymentRequestBuilder
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestInterface.php
similarity index 88%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestInterface.php
index 59ef324..a5d1f11 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,17 +24,17 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments\Payment;
+namespace YooKassa\Request\Payments\Payment;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\TransferInterface;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\TransferInterface;
/**
* Interface CreateCaptureRequestInterface
*
- * @package YandexCheckout\Request\Payments\Payment
+ * @package YooKassa\Request\Payments\Payment
*
* @property-read MonetaryAmount $amount Подтверждаемая сумма оплаты
* @property-read ReceiptInterface $receipt Данные фискального чека 54-ФЗ
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
index e25b820..baf6cf3 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,16 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments\Payment;
+namespace YooKassa\Request\Payments\Payment;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ReceiptItem;
-use YandexCheckout\Model\TransferInterface;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ReceiptItem;
+use YooKassa\Model\TransferInterface;
/**
* Класс объекта осуществляющего сериализацию запроса к API на подтверждение заказа
*
- * @package YandexCheckout\Request\Payments\Payment
+ * @package YooKassa\Request\Payments\Payment
*/
class CreateCaptureRequestSerializer
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureResponse.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureResponse.php
index 545e529..7e4c49a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/Payment/CreateCaptureResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/Payment/CreateCaptureResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments\Payment;
+namespace YooKassa\Request\Payments\Payment;
-use YandexCheckout\Request\Payments\AbstractPaymentResponse;
+use YooKassa\Request\Payments\AbstractPaymentResponse;
/**
* Класс объекта ответа от API на запрос подтверждения платежа
*
- * @package YandexCheckout\Request\Payments\Payment
+ * @package YooKassa\Request\Payments\Payment
*/
class CreateCaptureResponse extends AbstractPaymentResponse
{}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentResponse.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentResponse.php
index b5d363e..3701182 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
/**
* Класс объекта ответа, возвращаемого API при запросе конкретного платежа
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class PaymentResponse extends AbstractPaymentResponse
{}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequest.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequest.php
index 2e13dbc..944d142 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
use Exception;
-use YandexCheckout\Common\AbstractRequest;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\PaymentMethodType;
-use YandexCheckout\Model\PaymentStatus;
+use YooKassa\Common\AbstractRequest;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\PaymentMethodType;
+use YooKassa\Model\PaymentStatus;
/**
* Класс объекта запроса к API для получения списка платежей магазина
@@ -482,36 +482,6 @@ public function setCapturedAtLt($value)
}
}
- /**
- * Возвращает идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @return string|null Идентификатор шлюза
- */
- public function getRecipientGatewayId()
- {
- return null;
- }
-
- /**
- * Проверяет был ли установлен идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @return bool True если идентификатор шлюза был установлен, false если нет
- */
- public function hasRecipientGatewayId()
- {
- return false;
- }
-
- /**
- * Устанавливает идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @param string|null $value Идентификатор шлюза или null чтобы удалить значение
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если в метод была передана не строка
- */
- public function setRecipientGatewayId($value)
- {}
-
/**
* Возвращает статус выбираемых платежей или null если он до этого не был установлен
* @return string|null Статус выбираемых платежей
@@ -679,33 +649,6 @@ public function setCursor($value)
}
}
- /**
- * @deprecated Будет удален в следующих версиях
- * @return string|null
- */
- public function getPage()
- {
- return $this->_cursor;
- }
-
- /**
- * @deprecated Будет удален в следующих версиях
- * @return bool
- */
- public function hasPage()
- {
- return $this->_cursor !== null;
- }
-
- /**
- * @deprecated Будет удален в следующих версиях
- * @param string $value
- */
- public function setPage($value)
- {
- $this->setCursor($value);
- }
-
/**
* Проверяет валидность текущего объекта запроса
* @return bool True если объект валиден, false если нет
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestBuilder.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestBuilder.php
index f19d3e4..1dbe406 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +24,19 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
use DateTime;
use Exception;
-use YandexCheckout\Common\AbstractRequest;
-use YandexCheckout\Common\AbstractRequestBuilder;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Common\AbstractRequest;
+use YooKassa\Common\AbstractRequestBuilder;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
/**
* Билдер объектов запросов к API для пролучения списка платежей магазина
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class PaymentsRequestBuilder extends AbstractRequestBuilder
{
@@ -67,16 +67,6 @@ public function setCursor($value)
return $this;
}
- /**
- * @deprecated Будет удален в следующих версиях
- * @param $value
- * @return PaymentsRequestBuilder
- */
- public function setPage($value)
- {
- return $this->setCursor($value);
- }
-
/**
* Устанавливает дату создания от которой выбираются платежи
* @param DateTime|string|int|null $value Время создания, от (не включая) или null чтобы удалить значение
@@ -218,19 +208,6 @@ public function setLimit($value)
return $this;
}
- /**
- * Устанавливает идентификатор шлюза
- * @param string|null $value Идентификатор шлюза или null чтобы удалить значение
- * @return PaymentsRequestBuilder Инстанс текущего билдера
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если в метод была передана не строка
- */
- public function setRecipientGatewayId($value)
- {
- $this->currentObject->setRecipientGatewayId($value);
- return $this;
- }
-
/**
* Устанавливает статус выбираемых платежей
* @param string $value Статус выбираемых платежей или null чтобы удалить значение
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestInterface.php
similarity index 80%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestInterface.php
index b70921e..f1a918c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
/**
* Interface PaymentsRequestInterface
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*
* @property-read string|null $cursor Страница выдачи результатов, которую необходимо отобразить
* @property-read \DateTime|null $createdAtGte Время создания, от (включительно)
@@ -58,6 +58,13 @@ function getCursor();
*/
function hasCursor();
+ /**
+ * Устанавливает страницу выдачи результатов
+ * @param string $value Страница
+ * @return void
+ */
+ function setCursor($value);
+
/**
* Возвращает дату создания от которой будут возвращены платежи или null если дата не была установлена
* @return \DateTime|null Время создания, от (включительно)
@@ -70,6 +77,13 @@ function getCreatedAtGte();
*/
function hasCreatedAtGte();
+ /**
+ * Устанавливает дату создания от которой выбираются платежи
+ * @param \DateTime $value Дата
+ * @return void
+ */
+ function setCreatedAtGte($value);
+
/**
* Возвращает дату создания от которой будут возвращены платежи или null если дата не была установлена
* @return \DateTime|null Время создания, от (не включая)
@@ -82,6 +96,13 @@ function getCreatedAtGt();
*/
function hasCreatedAtGt();
+ /**
+ * Устанавливает дату создания от которой выбираются платежи
+ * @param \DateTime $value Дата
+ * @return void
+ */
+ function setCreatedAtGt($value);
+
/**
* Возвращает дату создания до которой будут возвращены платежи или null если дата не была установлена
* @return \DateTime|null Время создания, до (включительно)
@@ -94,6 +115,13 @@ function getCreatedAtLte();
*/
function hasCreatedAtLte();
+ /**
+ * Устанавливает дату создания до которой выбираются платежи
+ * @param \DateTime $value Дата
+ * @return void
+ */
+ function setCreatedAtLte($value);
+
/**
* Возвращает дату создания до которой будут возвращены платежи или null если дата не была установлена
* @return \DateTime|null Время создания, до (не включая)
@@ -106,6 +134,13 @@ function getCreatedAtLt();
*/
function hasCreatedAtLt();
+ /**
+ * Устанавливает дату создания до которой выбираются платежи
+ * @param \DateTime $value Дата
+ * @return void
+ */
+ function setCreatedAtLt($value);
+
/**
* Возвращает ограничение количества объектов платежа или null если оно до этого не было установлено
* @return string|null Ограничение количества объектов платежа
@@ -119,16 +154,11 @@ function getLimit();
function hasLimit();
/**
- * Возвращает идентификатор шлюза
- * @return string|null Идентификатор шлюза
+ * Устанавливает ограничение количества объектов платежа
+ * @param int $value Количества объектов платежа на странице
+ * @return void
*/
- function getRecipientGatewayId();
-
- /**
- * Проверяет был ли установлен идентификатор шлюза
- * @return bool True если идентификатор шлюза был установлен, false если нет
- */
- function hasRecipientGatewayId();
+ function setLimit($value);
/**
* Возвращает статус выбираемых платежей или null если он до этого не был установлен
@@ -142,4 +172,10 @@ function getStatus();
*/
function hasStatus();
+ /**
+ * Устанавливает статус выбираемых платежей
+ * @param string $value Статус платежей
+ * @return void
+ */
+ function setStatus($value);
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestSerializer.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestSerializer.php
index bfafdc0..15a0efe 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
/**
* Класс сериализатора объектов запросов к API для получения списка платежей
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class PaymentsRequestSerializer
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsResponse.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsResponse.php
index 16d294d..822975a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Payments/PaymentsResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Payments/PaymentsResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,25 +24,25 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Payments;
+namespace YooKassa\Request\Payments;
-use YandexCheckout\Model\AuthorizationDetails;
-use YandexCheckout\Model\CancellationDetails;
-use YandexCheckout\Model\Confirmation\ConfirmationRedirect;
-use YandexCheckout\Model\Confirmation\ConfirmationExternal;
-use YandexCheckout\Model\ConfirmationType;
-use YandexCheckout\Model\Metadata;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\Payment;
-use YandexCheckout\Model\PaymentInterface;
-use YandexCheckout\Model\PaymentMethod\AbstractPaymentMethod;
-use YandexCheckout\Model\PaymentMethod\PaymentMethodFactory;
-use YandexCheckout\Model\Recipient;
+use YooKassa\Model\AuthorizationDetails;
+use YooKassa\Model\CancellationDetails;
+use YooKassa\Model\Confirmation\ConfirmationRedirect;
+use YooKassa\Model\Confirmation\ConfirmationExternal;
+use YooKassa\Model\ConfirmationType;
+use YooKassa\Model\Metadata;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\Payment;
+use YooKassa\Model\PaymentInterface;
+use YooKassa\Model\PaymentMethod\AbstractPaymentMethod;
+use YooKassa\Model\PaymentMethod\PaymentMethodFactory;
+use YooKassa\Model\Recipient;
/**
* Класс объекта ответа от API со списком платежей магазина
*
- * @package YandexCheckout\Request\Payments
+ * @package YooKassa\Request\Payments
*/
class PaymentsResponse
{
@@ -60,6 +60,7 @@ class PaymentsResponse
* Конструктор, устанавливает свойства объекта из пришедшего из API ассоциативного массива
*
* @param array $options Массив настроек, пришедший от API
+ * @throws \Exception
*/
public function __construct($options)
{
@@ -168,24 +169,6 @@ public function hasNextCursor()
return $this->nextCursor !== null;
}
- /**
- * @deprecated Будет удален в следующих версиях
- * @return string|null
- */
- public function getNextPage()
- {
- return $this->nextCursor;
- }
-
- /**
- * @deprecated Будет удален в следующих версиях
- * @return bool
- */
- public function hasNextPage()
- {
- return $this->nextCursor !== null;
- }
-
/**
* Фабричный метод для создания объектов методов оплаты
*
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/AbstractReceiptResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/AbstractReceiptResponse.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/AbstractReceiptResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/AbstractReceiptResponse.php
index 5002c22..c9b4b57 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/AbstractReceiptResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/AbstractReceiptResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,28 +24,26 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
use DateTime;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ReceiptRegistrationStatus;
-use YandexCheckout\Model\ReceiptType;
-use YandexCheckout\Model\Settlement;
-use YandexCheckout\Model\SettlementInterface;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ReceiptRegistrationStatus;
+use YooKassa\Model\ReceiptType;
+use YooKassa\Model\Settlement;
+use YooKassa\Model\SettlementInterface;
/**
* Class AbstractReceipt
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
- * @property string $id Идентификатор чека в Яндекс.Кассе.
+ * @property string $id Идентификатор чека в ЮKassa.
* @property string $type Тип чека в онлайн-кассе: приход "payment" или возврат "refund".
- * @property string $receiptRegistration Статус доставки данных для чека в онлайн-кассу ("pending", "succeeded" или "canceled").
- * @property string $receipt_registration Статус доставки данных для чека в онлайн-кассу ("pending", "succeeded" или "canceled").
* @property string $status Статус доставки данных для чека в онлайн-кассу ("pending", "succeeded" или "canceled").
* @property string $fiscalAttribute Фискальный признак чека. Формируется фискальным накопителем на основе данных, переданных для регистрации чека.
* @property string $fiscal_attribute Фискальный признак чека. Формируется фискальным накопителем на основе данных, переданных для регистрации чека.
@@ -67,7 +65,7 @@ abstract class AbstractReceiptResponse extends AbstractObject implements Receipt
{
const LENGTH_RECEIPT_ID = 39;
- /** @var string Идентификатор чека в Яндекс.Кассе. */
+ /** @var string Идентификатор чека в ЮKassa. */
private $_id;
/** @var string Тип чека в онлайн-кассе: приход "payment" или возврат "refund". */
@@ -308,28 +306,6 @@ public function setStatus($value)
return $this;
}
- /**
- * @deprecated since 1.2.6
- * @return string
- */
- public function getReceiptRegistration()
- {
- return $this->getStatus();
- }
-
- /**
- * @deprecated since 1.2.6
- * Устанавливает состояние регистрации фискального чека
- * @param string $value Состояние регистрации фискального чека
- *
- * @throws InvalidPropertyValueException Выбрасывается если переданное состояние регистрации не существует
- * @throws InvalidPropertyValueTypeException Выбрасывается если переданный аргумент не строка
- */
- public function setReceiptRegistration($value)
- {
- $this->setStatus($value);
- }
-
/**
* @return string
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequest.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequest.php
index 3c70588..1317bfa 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,27 +24,25 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Common\AbstractRequest;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\ReceiptCustomer;
-use YandexCheckout\Model\ReceiptCustomerInterface;
-use YandexCheckout\Model\ReceiptItem;
-use YandexCheckout\Model\ReceiptItemInterface;
-use YandexCheckout\Model\ReceiptType;
-use YandexCheckout\Model\Settlement;
-use YandexCheckout\Model\SettlementInterface;
-use YandexCheckout\Model\Supplier;
-use YandexCheckout\Model\SupplierInterface;
+use YooKassa\Common\AbstractRequest;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\ReceiptCustomer;
+use YooKassa\Model\ReceiptCustomerInterface;
+use YooKassa\Model\ReceiptItem;
+use YooKassa\Model\ReceiptItemInterface;
+use YooKassa\Model\ReceiptType;
+use YooKassa\Model\Settlement;
+use YooKassa\Model\SettlementInterface;
/**
* Class AbstractPostReceiptRequest
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*/
class CreatePostReceiptRequest extends AbstractRequest implements CreatePostReceiptRequestInterface
{
@@ -69,7 +67,7 @@ class CreatePostReceiptRequest extends AbstractRequest implements CreatePostRece
/** @var string Идентификатор объекта оплаты */
private $_object_id;
- /** @var string Идентификатор магазина в Яндекс.Кассе */
+ /** @var string Идентификатор магазина в ЮKassa */
private $_onBehalfOf;
/**
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestBuilder.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestBuilder.php
index 9a595cc..424e4c7 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +24,17 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Common\AbstractRequestBuilder;
-use YandexCheckout\Common\Exceptions\InvalidRequestException;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\ReceiptCustomer;
-use YandexCheckout\Model\ReceiptCustomerInterface;
-use YandexCheckout\Model\ReceiptItemInterface;
-use YandexCheckout\Model\ReceiptType;
-use YandexCheckout\Model\SettlementInterface;
-use YandexCheckout\Model\SupplierInterface;
+use YooKassa\Common\AbstractRequestBuilder;
+use YooKassa\Common\Exceptions\InvalidRequestException;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\ReceiptCustomer;
+use YooKassa\Model\ReceiptCustomerInterface;
+use YooKassa\Model\ReceiptItemInterface;
+use YooKassa\Model\SettlementInterface;
class CreatePostReceiptRequestBuilder extends AbstractRequestBuilder
{
@@ -187,7 +185,7 @@ public function setObjectId($value)
}
/**
- * Строит и возвращает объект запроса для отправки в API яндекс денег
+ * Строит и возвращает объект запроса для отправки в API ЮKassa
* @param array|null $options Массив параметров для установки в объект запроса
* @return CreatePostReceiptRequest Инстанс объекта запроса
*
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestInterface.php
similarity index 94%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestInterface.php
index 9c596bf..a8980a5 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,18 +24,18 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Model\ReceiptCustomer;
-use YandexCheckout\Model\ReceiptCustomerInterface;
-use YandexCheckout\Model\ReceiptItemInterface;
-use YandexCheckout\Model\SettlementInterface;
-use YandexCheckout\Model\SupplierInterface;
+use YooKassa\Model\ReceiptCustomer;
+use YooKassa\Model\ReceiptCustomerInterface;
+use YooKassa\Model\ReceiptItemInterface;
+use YooKassa\Model\SettlementInterface;
+use YooKassa\Model\SupplierInterface;
/**
* Interface CreateReceiptRequestInterface
*
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*
* @property string $objectId Идентификатор объекта ("payment" или "refund), для которого формируется чек.
* @property string $object_id Идентификатор объекта ("payment" или "refund), для которого формируется чек.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestSerializer.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestSerializer.php
index 656b752..e8be496 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/CreatePostReceiptRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/CreatePostReceiptRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,17 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Model\ReceiptItem;
-use YandexCheckout\Model\ReceiptType;
-use YandexCheckout\Model\Settlement;
-use YandexCheckout\Model\Supplier;
+use YooKassa\Model\ReceiptItem;
+use YooKassa\Model\ReceiptType;
+use YooKassa\Model\Settlement;
/**
* Класс сериалайзера объекта запроса к API создание чека
*
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*/
class CreatePostReceiptRequestSerializer
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/PaymentReceiptResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/PaymentReceiptResponse.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/PaymentReceiptResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/PaymentReceiptResponse.php
index a71416e..efe1e1d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/PaymentReceiptResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/PaymentReceiptResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,18 +24,18 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Class PaymentReceipt
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
- * @property string $payment_id Идентификатор платежа в Яндекс.Кассе.
- * @property string $paymentId Идентификатор платежа в Яндекс.Кассе.
+ * @property string $payment_id Идентификатор платежа в ЮKassa.
+ * @property string $paymentId Идентификатор платежа в ЮKassa.
*/
class PaymentReceiptResponse extends AbstractReceiptResponse
{
@@ -64,9 +64,9 @@ public function getPaymentId()
}
/**
- * Устанавливает идентификатор платежа в Яндекс.Кассе
+ * Устанавливает идентификатор платежа в ЮKassa
*
- * @param string $value Идентификатор платежа в Яндекс.Кассе
+ * @param string $value Идентификатор платежа в ЮKassa
*
* @throws InvalidPropertyValueTypeException Выбрасывается если в качестве значения была передана не строка
* @throws InvalidPropertyValueException Выбрасывается если длина переданной строки не равна 36
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseFactory.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseFactory.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseFactory.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseFactory.php
index 008ff7f..5e53f19 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseFactory.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseFactory.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Model\ReceiptType;
+use YooKassa\Model\ReceiptType;
/**
* Class ReceiptResponseFactory
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*/
class ReceiptResponseFactory
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseInterface.php
similarity index 85%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseInterface.php
index b18de11..0eaec09 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,16 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Model\SettlementInterface;
+use YooKassa\Model\SettlementInterface;
/**
* Interface ReceiptInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
- * @property-read string $id Идентификатор чека в Яндекс.Кассе.
+ * @property-read string $id Идентификатор чека в ЮKassa.
* @property-read string $type Тип чека в онлайн-кассе: приход "payment" или возврат "refund".
* @property-read string $receiptRegistration Статус доставки данных для чека в онлайн-кассу ("pending", "succeeded" или "canceled").
* @property-read string $receipt_registration Статус доставки данных для чека в онлайн-кассу ("pending", "succeeded" или "canceled").
@@ -46,9 +46,9 @@
interface ReceiptResponseInterface
{
/**
- * Возвращает идентификатор чека в Яндекс.Кассе
+ * Возвращает идентификатор чека в ЮKassa
*
- * @return string Идентификатор чека в Яндекс.Кассе.
+ * @return string Идентификатор чека в ЮKassa.
*/
public function getId();
@@ -66,14 +66,6 @@ public function getType();
*/
public function getStatus();
- /**
- * @deprecated since 1.2.6
- * Возвращает статус доставки данных для чека в онлайн-кассу
- *
- * @return string Статус доставки данных для чека в онлайн-кассу ("pending", "succeeded" или "canceled").
- */
- public function getReceiptRegistration();
-
/**
* Возвращает код системы налогообложения
*
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseItem.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseItem.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php
index d1d3a2d..d8bf46a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseItem.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItem.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,23 +24,23 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Common\AbstractObject;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\Receipt\ReceiptItemAmount;
-use YandexCheckout\Model\Supplier;
-use YandexCheckout\Model\SupplierInterface;
+use YooKassa\Common\AbstractObject;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\Receipt\ReceiptItemAmount;
+use YooKassa\Model\Supplier;
+use YooKassa\Model\SupplierInterface;
/**
* Interface ReceiptItemInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property string $description Название товара (не более 128 символов).
* @property float $quantity Количество товара. Максимально возможное значение зависит от модели вашей онлайн-кассы.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseItemInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseItemInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php
index 802f749..d53572d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptResponseItemInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptResponseItemInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,15 +24,15 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\SupplierInterface;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\SupplierInterface;
/**
* Interface ReceiptItemInterface
*
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* @property-read string $description Название товара (не более 128 символов).
* @property-read float $quantity Количество товара. Максимально возможное значение зависит от модели вашей онлайн-кассы.
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequest.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequest.php
index 81a64a0..fa72f9e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +24,19 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
use Exception;
-use YandexCheckout\Common\AbstractRequest;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\RefundStatus;
+use YooKassa\Common\AbstractRequest;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\RefundStatus;
/**
* Класс объекта запроса к API списка возвратов магазина
*
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*
* @property \DateTime $createdAtGte Время создания, от (включительно)
* @property \DateTime $createdAtGt Время создания, от (не включая)
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestBuilder.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestBuilder.php
index 9c8b426..ad04733 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,16 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Common\AbstractRequestBuilder;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Common\AbstractRequestBuilder;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
/**
* Класс билдера объектов запросов к API списка чеков
*
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*/
class ReceiptsRequestBuilder extends AbstractRequestBuilder
{
@@ -126,7 +126,7 @@ public function setCursor($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtGt($value)
@@ -142,7 +142,7 @@ public function setCreatedAtGt($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtGte($value)
@@ -158,7 +158,7 @@ public function setCreatedAtGte($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtLt($value)
@@ -174,7 +174,7 @@ public function setCreatedAtLt($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtLte($value)
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestInterface.php
similarity index 98%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestInterface.php
index 052d277..c0d013d 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
/**
* Интерфейс объекта запроса списка возвратов
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*
* @property-read string $paymentId Идентификатор платежа
* @property-read string $refundId Идентификатор возврата
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestSerializer.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestSerializer.php
index a4aa3b2..1eac4e7 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
/**
* Класс сериализатора объектов запросов к API для получения списка возвратов
*
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*/
class ReceiptsRequestSerializer
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsResponse.php
similarity index 96%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsResponse.php
index 93834e6..cca3a9c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/ReceiptsResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/ReceiptsResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
/**
* Class ReceiptsResponse
- * @package YandexCheckout\Request\Receipts
+ * @package YooKassa\Request\Receipts
*/
class ReceiptsResponse
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/RefundReceiptResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/RefundReceiptResponse.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/RefundReceiptResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/RefundReceiptResponse.php
index f21b20b..e3bef1e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/RefundReceiptResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/RefundReceiptResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,18 +24,18 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
/**
* Class RefundReceipt
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
- * @property string $refund_id Идентификатор возврата в Яндекс.Кассе.
- * @property string $refundId Идентификатор возврата в Яндекс.Кассе.
+ * @property string $refund_id Идентификатор возврата в ЮKassa.
+ * @property string $refundId Идентификатор возврата в ЮKassa.
*/
class RefundReceiptResponse extends AbstractReceiptResponse
{
@@ -64,9 +64,9 @@ public function getRefundId()
}
/**
- * Устанавливает идентификатор возврата в Яндекс.Кассе
+ * Устанавливает идентификатор возврата в ЮKassa
*
- * @param string $value идентификатор возврата в Яндекс.Кассе
+ * @param string $value идентификатор возврата в ЮKassa
*
* @throws InvalidPropertyValueTypeException Выбрасывается если в качестве значения была передана не строка
* @throws InvalidPropertyValueException Выбрасывается если длина переданной строки не равна 36
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/SimpleReceiptResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/SimpleReceiptResponse.php
similarity index 92%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/SimpleReceiptResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/SimpleReceiptResponse.php
index f2edbea..88e1125 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Receipts/SimpleReceiptResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Receipts/SimpleReceiptResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,11 +24,11 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Receipts;
+namespace YooKassa\Request\Receipts;
/**
* Class SimpleReceiptResponse
- * @package YandexCheckout\Model
+ * @package YooKassa\Model
*
* Чек, не привязанный ни к платежу, ни к возврату
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/AbstractRefundResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/AbstractRefundResponse.php
similarity index 86%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/AbstractRefundResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/AbstractRefundResponse.php
index fcafb9a..72e3f7c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/AbstractRefundResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/AbstractRefundResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,23 +24,24 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Model\MonetaryAmount;
-use YandexCheckout\Model\Refund;
+use YooKassa\Model\MonetaryAmount;
+use YooKassa\Model\Refund;
/**
* Абстрактный класс ответа от API с информацией о возврате
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
abstract class AbstractRefundResponse extends Refund
{
/**
* Конструктор
* @param array $options Ассоциативный массив с информацией, вернувшейся от API
+ * @throws \Exception
*/
- public function __construct(array $options)
+ public function __construct($options)
{
$this->setId(empty($options['id']) ? null : $options['id']);
$this->setPaymentId(empty($options['payment_id']) ? null : $options['payment_id']);
@@ -52,6 +53,10 @@ public function __construct(array $options)
$this->setRequestor($options['requestor']);
}
+ if (!empty($options['sources'])) {
+ $this->setSources($options['sources']);
+ }
+
if (!empty($options['receipt_registration'])) {
$this->setReceiptRegistration($options['receipt_registration']);
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequest.php
similarity index 78%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequest.php
index 1b5aab1..3660470 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,17 +24,17 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Common\AbstractPaymentRequest;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\Source;
-use YandexCheckout\Model\SourceInterface;
+use YooKassa\Common\AbstractPaymentRequest;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\Source;
+use YooKassa\Model\SourceInterface;
/**
* Класс объекта запроса для создания возврата
@@ -100,16 +100,6 @@ public function setPaymentId($value)
}
}
- /**
- * Возвращает комментарий к возврату или null, если комментарий не задан
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @return string Комментарий к операции возврата, основание для возврата средств покупателю.
- */
- public function getComment()
- {
- return $this->getDescription();
- }
-
/**
* Возвращает комментарий к возврату или null, если комментарий не задан
* @return string Комментарий к операции возврата, основание для возврата средств покупателю.
@@ -119,16 +109,6 @@ public function getDescription()
return $this->_description;
}
- /**
- * Проверяет задан ли комментарий к создаваемому возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @return bool True если комментарий установлен, false если нет
- */
- public function hasComment()
- {
- return $this->hasDescription();
- }
-
/**
* Проверяет задан ли комментарий к создаваемому возврату
* @return bool True если комментарий установлен, false если нет
@@ -138,18 +118,6 @@ public function hasDescription()
return $this->_description !== null;
}
- /**
- * Устанавливает комментарий к возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @param string $value Комментарий к операции возврата, основание для возврата средств покупателю
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если была передана не строка
- */
- public function setComment($value)
- {
- $this->setDescription($value);
- }
-
/**
* Устанавливает комментарий к возврату
* @param string $value Комментарий к операции возврата, основание для возврата средств покупателю
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestBuilder.php
similarity index 74%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestBuilder.php
index 578d565..cd197e2 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,25 +24,21 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Common\AbstractPaymentRequestBuilder;
-use YandexCheckout\Common\Exceptions\EmptyPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Model\SourceInterface;
+use YooKassa\Common\AbstractPaymentRequestBuilder;
+use YooKassa\Common\Exceptions\EmptyPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Model\SourceInterface;
/**
* Класс билдера запросов к API на создание возврата средств
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class CreateRefundRequestBuilder extends AbstractPaymentRequestBuilder
{
- /**
- * @var SourceInterface[] Данные о распределении денег — сколько и в какой магазин нужно перевести
- */
- private $sources;
/**
* @var CreateRefundRequest Собираемый объет запроса к API
@@ -56,8 +52,7 @@ class CreateRefundRequestBuilder extends AbstractPaymentRequestBuilder
protected function initCurrentObject()
{
parent::initCurrentObject();
- $request = new CreateRefundRequest();
- return $request;
+ return new CreateRefundRequest();
}
/**
@@ -76,20 +71,6 @@ public function setPaymentId($value)
return $this;
}
- /**
- * Устанавливает комментарий к возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @param string $value Комментарий к возврату
- * @return CreateRefundRequestBuilder Инстанс текущего билдера
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если была передана не строка
- */
- public function setComment($value)
- {
- $this->currentObject->setDescription($value);
- return $this;
- }
-
/**
* Устанавливает комментарий к возврату
* @param string $value Комментарий к возврату
@@ -106,7 +87,7 @@ public function setDescription($value)
/**
* Устанавливает источники возврата
*
- * @param array|string $value Массив трансферов
+ * @param SourceInterface[]|array $value Массив трансферов
*
* @return self Инстанс билдера запросов
*/
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestInterface.php
similarity index 74%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestInterface.php
index 31f5778..9943d65 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,17 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ReceiptInterface;
-use YandexCheckout\Model\SourceInterface;
-use YandexCheckout\Model\TransferInterface;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ReceiptInterface;
+use YooKassa\Model\SourceInterface;
/**
* Интерфейс объекта запроса на возврат
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*
* @property-read string $paymentId Айди платежа для которого создаётся возврат
* @property-read AmountInterface $amount Сумма возврата
@@ -55,26 +54,12 @@ function getPaymentId();
*/
function getAmount();
- /**
- * Возвращает комментарий к возврату или null, если комментарий не задан
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @return string Комментарий к операции возврата, основание для возврата средств покупателю.
- */
- function getComment();
-
/**
* Возвращает комментарий к возврату или null, если комментарий не задан
* @return string Комментарий к операции возврата, основание для возврата средств покупателю.
*/
function getDescription();
- /**
- * Проверяет задан ли комментарий к создаваемому возврату
- * @deprecated Устарел. Будет удален в одной из следующих версий
- * @return bool True если комментарий установлен, false если нет
- */
- function hasComment();
-
/**
* Проверяет задан ли комментарий к создаваемому возврату
* @return bool True если комментарий установлен, false если нет
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestSerializer.php
similarity index 93%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestSerializer.php
index 249e2a4..c454eaa 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,17 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Model\AmountInterface;
-use YandexCheckout\Model\ReceiptItem;
-use YandexCheckout\Model\SourceInterface;
-use YandexCheckout\Model\TransferInterface;
+use YooKassa\Model\AmountInterface;
+use YooKassa\Model\ReceiptItem;
+use YooKassa\Model\SourceInterface;
/**
* Класс сериалайзера запросов к API на создание нового возврата средств
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class CreateRefundRequestSerializer
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundResponse.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundResponse.php
index fd186a1..466c539 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/CreateRefundResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/CreateRefundResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
/**
* Класс объекта ответа от API при создании нового возврата
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class CreateRefundResponse extends AbstractRefundResponse
{}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundResponse.php
similarity index 91%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundResponse.php
index 8e14273..bdd3d37 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
/**
* Класс объекта ответа от API при запросе одного конкретного возврата
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class RefundResponse extends AbstractRefundResponse
{}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequest.php
similarity index 67%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequest.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequest.php
index 5360d5e..cd97d7e 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequest.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequest.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,19 +24,19 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
use Exception;
-use YandexCheckout\Common\AbstractRequest;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
-use YandexCheckout\Helpers\TypeCast;
-use YandexCheckout\Model\RefundStatus;
+use YooKassa\Common\AbstractRequest;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Helpers\TypeCast;
+use YooKassa\Model\RefundStatus;
/**
* Класс объекта запроса к API списка возвратов магазина
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*
* @property \DateTime $createdAtGte Время создания, от (включительно)
* @property \DateTime $createdAtGt Время создания, от (не включая)
@@ -91,34 +91,6 @@ class RefundsRequest extends AbstractRequest implements RefundsRequestInterface
*/
private $_cursor;
- /**
- * Возвращает идентификатор возврата
- * @deprecated Будет удален в следующих версиях
- * @return string Идентификатор возврата
- */
- public function getRefundId()
- {
- return null;
- }
-
- /**
- * Проверяет был ли установлен идентификатор возврата
- * @deprecated Будет удален в следующих версиях
- * @return bool True если идентификатор возврата был установлен, false если не был
- */
- public function hasRefundId()
- {
- return false;
- }
-
- /**
- * Устанавливает идентификатор возврата
- * @deprecated Будет удален в следующих версиях
- * @param string $value Идентификатор возврата, который ищется в API
- */
- public function setRefundId($value)
- {}
-
/**
* Возвращает идентификатор платежа если он задан или null
* @return string|null Идентификатор платежа
@@ -163,62 +135,6 @@ public function setPaymentId($value)
}
}
- /**
- * Возвращает идентификатор магазина, если он был задан
- * @deprecated Будет удален в следующих версиях
- * @return string|null Идентификатор магазина
- */
- public function getAccountId()
- {
- return null;
- }
-
- /**
- * Проверяет, был ли установлен идентификатор магазина
- * @deprecated Будет удален в следующих версиях
- * @return bool True если идентификатор магазина был установлен, false если нет
- */
- public function hasAccountId()
- {
- return false;
- }
-
- /**
- * Устанавлвиает идентификатор магазина
- * @deprecated Будет удален в следующих версиях
- * @param string $value Идентификатор магазина или null чтобы удалить значение
- */
- public function setAccountId($value)
- {}
-
- /**
- * Возвращает идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @return string|null Идентификатор шлюза
- */
- public function getGatewayId()
- {
- return null;
- }
-
- /**
- * Проверяет был ли установлен идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @return bool True если идентификатор шлюза был установлен, false если нет
- */
- public function hasGatewayId()
- {
- return false;
- }
-
- /**
- * Устанавливает идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @param string|null $value Идентификатор шлюза или null чтобы удалить значение
- */
- public function setGatewayId($value)
- {}
-
/**
* Возвращает дату создания от которой будут возвращены возвраты или null если дата не была установлена
* @return \DateTime|null Время создания, от (включительно)
@@ -403,120 +319,6 @@ public function setCreatedAtLt($value)
}
}
- /**
- * Возвращает дату проведения от которой будут возвращены возвраты или null если дата не была установлена
- * @deprecated Будет удален в следующих версиях
- * @return \DateTime|null Время проведения операции, от (включительно)
- */
- public function getAuthorizedGte()
- {
- return null;
- }
-
- /**
- * Проверяет была ли установлена дата проведения от которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @return bool True если дата была установлена, false если нет
- */
- public function hasAuthorizedGte()
- {
- return false;
- }
-
- /**
- * Устанавливает дату проведения от которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения операции, от (не включая) или null чтобы удалить
- * значение
- */
- public function setAuthorizedGte($value)
- {}
-
- /**
- * Возвращает дату проведения от которой будут возвращены возвраты или null если дата не была установлена
- * @deprecated Будет удален в следующих версиях
- * @return \DateTime|null Время проведения операции, от (не включая)
- */
- public function getAuthorizedGt()
- {
- return null;
- }
-
- /**
- * Проверяет была ли установлена дата проведения от которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @return bool True если дата была установлена, false если нет
- */
- public function hasAuthorizedGt()
- {
- return false;
- }
-
- /**
- * Устанавливает дату проведения от которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения операции, от (не включая) или null чтобы удалить
- * значение
- */
- public function setAuthorizedGt($value)
- {}
-
- /**
- * Возвращает дату проведения до которой будут возвращены возвраты или null если дата не была установлена
- * @deprecated Будет удален в следующих версиях
- * @return \DateTime|null Время проведения, до (включительно)
- */
- public function getAuthorizedLte()
- {
- return null;
- }
-
- /**
- * Проверяет была ли установлена дата проведения до которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @return bool True если дата была установлена, false если нет
- */
- public function hasAuthorizedLte()
- {
- return false;
- }
-
- /**
- * Устанавливает дату проведения до которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения, до (включительно) или null чтобы удалить значение
- */
- public function setAuthorizedLte($value)
- {}
-
- /**
- * Возвращает дату проведения до которой будут возвращены платежи возвраты или null если она не была установлена
- * @deprecated Будет удален в следующих версиях
- * @return \DateTime|null Время проведения, до (не включая)
- */
- public function getAuthorizedLt()
- {
- return null;
- }
-
- /**
- * Проверяет была ли установлена дата проведения до которой выбираются вовзраты
- * @deprecated Будет удален в следующих версиях
- * @return bool True если дата была установлена, false если нет
- */
- public function hasAuthorizedLt()
- {
- return false;
- }
-
- /**
- * Устанавливает дату проведения до которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения, до (не включая) или null чтобы удалить значение
- */
- public function setAuthorizedLt($value)
- {}
-
/**
* Возвращает статус выбираемых возвратов или null если он до этого не был установлен
* @return string|null Статус выбираемых возвратов
@@ -598,33 +400,6 @@ public function setCursor($value)
}
}
- /**
- * @deprecated Будет удален в следующих версиях
- * @return string
- */
- public function getNextPage()
- {
- return $this->_cursor;
- }
-
- /**
- * @deprecated Будет удален в следующих версиях
- * @return bool
- */
- public function hasNextPage()
- {
- return !empty($this->_cursor);
- }
-
- /**
- * @deprecated Будет удален в следующих версиях
- * @param $value
- */
- public function setNextPage($value)
- {
- $this->setCursor($value);
- }
-
/**
* Ограничение количества объектов платежа
* @return integer|null Ограничение количества объектов платежа
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestBuilder.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestBuilder.php
similarity index 51%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestBuilder.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestBuilder.php
index 94b5a25..8d0c4bc 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestBuilder.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestBuilder.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,16 +24,16 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Common\AbstractRequestBuilder;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueException;
-use YandexCheckout\Common\Exceptions\InvalidPropertyValueTypeException;
+use YooKassa\Common\AbstractRequestBuilder;
+use YooKassa\Common\Exceptions\InvalidPropertyValueException;
+use YooKassa\Common\Exceptions\InvalidPropertyValueTypeException;
/**
* Класс билдера объектов запросов к API списка возвратов
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class RefundsRequestBuilder extends AbstractRequestBuilder
{
@@ -51,21 +51,6 @@ protected function initCurrentObject()
return new RefundsRequest();
}
- /**
- * Устанавливает идентификатор возврата
- * @deprecated Будет удален в следующих версиях
- * @param string $value Идентификатор возврата, который ищется в API
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueException Выбрасывается если длина переданного значения не равна 36
- * @throws InvalidPropertyValueTypeException Выбрасывается если в метод была передана не строка
- */
- public function setRefundId($value)
- {
- $this->currentObject->setRefundId($value);
- return $this;
- }
-
/**
* Устанавливает идентификатор платежа или null если требуется его удалить
* @param string|null $value Идентификатор платежа
@@ -80,34 +65,6 @@ public function setPaymentId($value)
return $this;
}
- /**
- * Устанавлвиает идентификатор магазина
- * @deprecated Будет удален в следующих версиях
- * @param string $value Идентификатор магазина или null чтобы удалить значение
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если в метод была передана не строка
- */
- public function setAccountId($value)
- {
- $this->currentObject->setAccountId($value);
- return $this;
- }
-
- /**
- * Устанавливает идентификатор шлюза
- * @deprecated Будет удален в следующих версиях
- * @param string|null $value Идентификатор шлюза или null чтобы удалить значение
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueTypeException Выбрасывается если в метод была передана не строка
- */
- public function setGatewayId($value)
- {
- $this->currentObject->setGatewayId($value);
- return $this;
- }
-
/**
* Устанавливает статус выбираемых возвратов
* @param string $value Статус выбираемых платежей или null чтобы удалить значение
@@ -148,16 +105,6 @@ public function setCursor($value)
return $this;
}
- /**
- * @deprecated Будет удален в следующих версиях
- * @param $value
- * @return $RefundsRequestBuilder
- */
- public function setNextPage($value)
- {
- return $this->setCursor($value);
- }
-
/**
* Устанавливает дату создания от которой выбираются возвраты
* @param \DateTime|string|int|null $value Время создания, от (не включая) или null чтобы удалить значение
@@ -165,7 +112,7 @@ public function setNextPage($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtGt($value)
@@ -181,7 +128,7 @@ public function setCreatedAtGt($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtGte($value)
@@ -197,7 +144,7 @@ public function setCreatedAtGte($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtLt($value)
@@ -213,7 +160,7 @@ public function setCreatedAtLt($value)
*
* @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
* строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
+ * @throws InvalidPropertyValueTypeException|\Exception Генерируется если была передана дата с не тем типом (передана не
* строка, не число и не значение типа \DateTime)
*/
public function setCreatedAtLte($value)
@@ -222,76 +169,6 @@ public function setCreatedAtLte($value)
return $this;
}
- /**
- * Устанавливает дату проведения от которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения операции, от (не включая) или null чтобы удалить
- * значение
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
- * строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
- * строка, не число и не значение типа \DateTime)
- */
- public function setAuthorizedGt($value)
- {
- $this->currentObject->setAuthorizedGt($value);
- return $this;
- }
-
- /**
- * Устанавливает дату проведения от которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения операции, от (не включая) или null чтобы удалить
- * значение
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
- * строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
- * строка, не число и не значение типа \DateTime)
- */
- public function setAuthorizedGte($value)
- {
- $this->currentObject->setAuthorizedGte($value);
- return $this;
- }
-
- /**
- * Устанавливает дату проведения до которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения, до (не включая) или null чтобы удалить значение
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
- * строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
- * строка, не число и не значение типа \DateTime)
- */
- public function setAuthorizedLt($value)
- {
- $this->currentObject->setAuthorizedLt($value);
- return $this;
- }
-
- /**
- * Устанавливает дату проведения до которой выбираются возвраты
- * @deprecated Будет удален в следующих версиях
- * @param \DateTime|string|int|null $value Время проведения, до (включительно) или null чтобы удалить значение
- * @return RefundsRequestBuilder Инстанс текущего объекта билдера
- *
- * @throws InvalidPropertyValueException Генерируется если была передана дата в невалидном формате (была передана
- * строка или число, которые не удалось преобразовать в валидную дату)
- * @throws InvalidPropertyValueTypeException Генерируется если была передана дата с не тем типом (передана не
- * строка, не число и не значение типа \DateTime)
- */
- public function setAuthorizedLte($value)
- {
- $this->currentObject->setAuthorizedLte($value);
- return $this;
- }
-
/**
* Собирает и возвращает объект запроса списка возвратов магазина
* @param array|null $options Массив с настройками запроса
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestInterface.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestInterface.php
similarity index 79%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestInterface.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestInterface.php
index cc9cc2e..b620887 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestInterface.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestInterface.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
/**
* Интерфейс объекта запроса списка возвратов
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*
* @property-read string $paymentId Идентификатор платежа
* @property-read \DateTime $createdAtGte Время создания, от (включительно)
@@ -42,18 +42,6 @@
*/
interface RefundsRequestInterface
{
- /**
- * Возвращает идентификатор возврата
- * @return string Идентификатор возврата
- */
- function getRefundId();
-
- /**
- * Проверяет был ли установлен идентификатор возврата
- * @return bool True если идентификатор возврата был установлен, false если не был
- */
- function hasRefundId();
-
/**
* Возвращает идентификатор платежа если он задан или null
* @return string|null Идентификатор платежа
@@ -66,30 +54,6 @@ function getPaymentId();
*/
function hasPaymentId();
- /**
- * Возвращает идентификатор магазина, если он был задан
- * @return string|null Идентификатор магазина
- */
- function getAccountId();
-
- /**
- * Проверяет, был ли установлен идентификатор магазина
- * @return bool True если идентификатор магазина был установлен, false если нет
- */
- function hasAccountId();
-
- /**
- * Возвращает идентификатор шлюза
- * @return string|null Идентификатор шлюза
- */
- function getGatewayId();
-
- /**
- * Проверяет был ли установлен идентификатор шлюза
- * @return bool True если идентификатор шлюза был установлен, false если нет
- */
- function hasGatewayId();
-
/**
* Возвращает дату создания от которой будут возвращены возвраты или null если дата не была установлена
* @return \DateTime|null Время создания, от (включительно)
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestSerializer.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestSerializer.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestSerializer.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestSerializer.php
index e3a3713..00039e5 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsRequestSerializer.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsRequestSerializer.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,12 +24,12 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
/**
* Класс сериализатора объектов запросов к API для получения списка возвратов
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class RefundsRequestSerializer
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsResponse.php
similarity index 83%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsResponse.php
index 917a976..c46ad3c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Refunds/RefundsResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Refunds/RefundsResponse.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,14 +24,14 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Refunds;
+namespace YooKassa\Request\Refunds;
-use YandexCheckout\Model\RefundInterface;
+use YooKassa\Model\RefundInterface;
/**
* Класс объекта ответа от API со списком возвратов магазина
*
- * @package YandexCheckout\Request\Refunds
+ * @package YooKassa\Request\Refunds
*/
class RefundsResponse
{
@@ -87,21 +87,4 @@ public function hasNextCursor()
return $this->nextCursor !== null;
}
- /**
- * @deprecated Будет удален в следующих версиях
- * @return string|null
- */
- public function getNextPage()
- {
- return $this->nextCursor;
- }
-
- /**
- * @deprecated Будет удален в следующих версиях
- * @return bool
- */
- public function hasNextPage()
- {
- return $this->nextCursor !== null;
- }
}
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Webhook/WebhookListResponse.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Webhook/WebhookListResponse.php
similarity index 95%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Webhook/WebhookListResponse.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Webhook/WebhookListResponse.php
index 4148374..8da52e0 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/Request/Webhook/WebhookListResponse.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/Request/Webhook/WebhookListResponse.php
@@ -2,7 +2,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,9 +23,9 @@
* THE SOFTWARE.
*/
-namespace YandexCheckout\Request\Webhook;
+namespace YooKassa\Request\Webhook;
-use YandexCheckout\Model\Webhook\Webhook;
+use YooKassa\Model\Webhook\Webhook;
class WebhookListResponse
{
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/autoload.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/autoload.php
similarity index 74%
rename from src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/autoload.php
rename to src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/autoload.php
index 7965a63..718384f 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/lib/yandex-checkout-sdk/lib/autoload.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/autoload.php
@@ -3,7 +3,7 @@
/**
* The MIT License
*
- * Copyright (c) 2017 NBCO Yandex.Money LLC
+ * Copyright (c) 2020 "YooMoney", NBСO LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -24,16 +24,16 @@
* THE SOFTWARE.
*/
-define('YANDEX_CHECKOUT_SDK_ROOT_PATH', dirname(__FILE__));
-define('YANDEX_CHECKOUT_PSR_LOG_PATH', dirname(__FILE__).'/../vendor/psr/log/Psr/Log');
+define('YOOKASSA_SDK_ROOT_PATH', dirname(__FILE__));
+define('YOOKASSA_SDK_PSR_LOG_PATH', dirname(__FILE__).'/../vendor/psr/log/Psr/Log');
-function yandexCheckoutLoadClass($className)
+function yookassaSdkLoadClass($className)
{
- if (strncmp('YandexCheckout', $className, 14) === 0) {
- $path = YANDEX_CHECKOUT_SDK_ROOT_PATH;
- $length = 14;
+ if (strncmp('YooKassa', $className, 8) === 0) {
+ $path = YOOKASSA_SDK_ROOT_PATH;
+ $length = 8;
} elseif (strncmp('Psr\Log', $className, 7) === 0) {
- $path = YANDEX_CHECKOUT_PSR_LOG_PATH;
+ $path = YOOKASSA_SDK_PSR_LOG_PATH;
$length = 7;
} else {
return;
@@ -44,4 +44,4 @@ function yandexCheckoutLoadClass($className)
}
}
-spl_autoload_register('yandexCheckoutLoadClass');
+spl_autoload_register('yookassaSdkLoadClass');
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/configuration.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/configuration.json
new file mode 100644
index 0000000..0d6a819
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/lib/configuration.json
@@ -0,0 +1,3 @@
+{
+ "url" : "https://api.yookassa.ru/v3"
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/phpunit.xml.dist b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/phpunit.xml.dist
new file mode 100644
index 0000000..0657c9d
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/phpunit.xml.dist
@@ -0,0 +1,28 @@
+
+
+
+
+
+ tests
+
+
+
+
+
+
+
+
+
+
+ ./lib
+
+
+
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/AutoloadTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/AutoloadTest.php
new file mode 100644
index 0000000..5c87ad5
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/AutoloadTest.php
@@ -0,0 +1,65 @@
+walkDirectoriesAndTest(YOOKASSA_SDK_ROOT_PATH, 'YooKassa');
+// $this->walkDirectoriesAndTest(YOOKASSA_SDK_PSR_LOG_PATH, 'Psr\Log');
+//
+// self::assertFalse(class_exists('Unknown\\Class\\Name'));
+//
+// spl_autoload_unregister($lastFunction);
+// foreach ($functions as $function) {
+// spl_autoload_register($function);
+// }
+// }
+//
+// private function walkDirectoriesAndTest($directoryName, $namespace)
+// {
+// $dir = opendir($directoryName);
+// while (($entry = readdir($dir)) !== false) {
+// if ($entry === '.' || $entry === '..') {
+// continue;
+// }
+// $path = $directoryName . DIRECTORY_SEPARATOR . $entry;
+// if (is_dir($entry)) {
+// $this->walkDirectoriesAndTest($path, $namespace . '\\' . $entry);
+// } else {
+// $extension = pathinfo($entry, PATHINFO_EXTENSION);
+// if ($extension === 'php' && strtoupper($entry[0]) === $entry[0]) {
+// $className = $namespace . '\\' . pathinfo($entry, PATHINFO_FILENAME);
+// if (!$this->classExists($className)) {
+// yookassaSdkLoadClass($className);
+// self::assertTrue($this->classExists($className), 'Class "' . $className . '" not exists');
+// }
+// }
+// }
+// }
+// closedir($dir);
+// }
+//
+// private function classExists($className)
+// {
+// return class_exists($className, false) || interface_exists($className, false) || trait_exists($className, false);
+// }
+//}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/ClientTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/ClientTest.php
new file mode 100644
index 0000000..05e4046
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/ClientTest.php
@@ -0,0 +1,1360 @@
+setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createPaymentFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment);
+
+ self::assertSame($curlClientStub, $apiClient->getApiClient());
+ self::assertTrue($response instanceof CreatePaymentResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createPaymentFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment(array(
+ 'amount' => array(
+ 'value' => 123,
+ 'currency' => 'USD',
+ ),
+ 'payment_token' => Random::str(36),
+ ), 123);
+
+ self::assertSame($curlClientStub, $apiClient->getApiClient());
+ self::assertTrue($response instanceof CreatePaymentResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"type":"error","code":"request_accepted","retry_after":1800}',
+ array('http_code' => 202)
+ ));
+
+ try {
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ self::fail('Исключение не было выброшено');
+ } catch (ApiException $e) {
+ self::assertInstanceOf('YooKassa\Common\Exceptions\ResponseProcessingException', $e);
+ return;
+ }
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"type":"error","code":"request_accepted"}',
+ array('http_code' => 202)
+ ));
+
+ try {
+ $apiClient->setRetryTimeout(0);
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ self::fail('Исключение не было выброшено');
+ } catch (ResponseProcessingException $e) {
+ self::assertEquals(Client::DEFAULT_DELAY, $e->retryAfter);
+ return;
+ }
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ * @throws Exception
+ */
+ public function testInvalidCreatePayment($httpCode, $errorResponse, $requiredException)
+ {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->createPayment($payment,123);
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider paymentsListDataProvider
+ * @param mixed $request
+ * @throws ApiException
+ * @throws ResponseProcessingException
+ * @throws BadApiRequestException
+ * @throws ForbiddenException
+ * @throws InternalServerError
+ * @throws NotFoundException
+ * @throws TooManyRequestsException
+ * @throws UnauthorizedException
+ */
+ public function testPaymentsList($request)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('getPaymentsFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPayments($request);
+
+ $this->assertTrue($response instanceof PaymentsResponse);
+ }
+
+ public function paymentsListDataProvider()
+ {
+ return array(
+ array(null),
+ array(PaymentsRequest::builder()->build()),
+ array(array(
+ 'account_id' => 12,
+ ))
+ );
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ */
+ public function testInvalidPaymentsList($httpCode, $errorResponse, $requiredException)
+ {
+ $payments = PaymentsRequest::builder()->build();
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->getPayments($payments);
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider paymentInfoDataProvider
+ * @param mixed $paymentId
+ * @param string $exceptionClassName
+ * @throws ApiException
+ * @throws ResponseProcessingException
+ * @throws BadApiRequestException
+ * @throws ForbiddenException
+ * @throws InternalServerError
+ * @throws NotFoundException
+ * @throws TooManyRequestsException
+ * @throws UnauthorizedException
+ */
+ public function testGetPaymentInfo($paymentId, $exceptionClassName = null)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($exceptionClassName !== null ? self::never() : self::once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('paymentInfoFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+
+ if ($exceptionClassName !== null) {
+ $this->setExpectedException($exceptionClassName);
+ }
+
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPaymentInfo($paymentId);
+
+ self::assertTrue($response instanceof PaymentResponse);
+ }
+
+ public function paymentInfoDataProvider()
+ {
+ return array(
+ array(null, '\InvalidArgumentException'),
+ array(Random::str(36)),
+ array(new StringObject(Random::str(36))),
+ array(true, '\InvalidArgumentException'),
+ array(false, '\InvalidArgumentException'),
+ array(0, '\InvalidArgumentException'),
+ array(1, '\InvalidArgumentException'),
+ array(0.1, '\InvalidArgumentException'),
+ array(Random::str(35), '\InvalidArgumentException'),
+ array(Random::str(37), '\InvalidArgumentException'),
+ array(new DateTime(), '\InvalidArgumentException'),
+ array(array(), '\InvalidArgumentException'),
+ );
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ * @throws Exception
+ */
+ public function testInvalidGetPaymentInfo($httpCode, $errorResponse, $requiredException)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->getPaymentInfo(Random::str(36));
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ public function testCapturePayment()
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('capturePaymentFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $capturePaymentRequest = array(
+ 'amount' => array(
+ 'value' => 123,
+ 'currency' => 'EUR',
+ )
+ );
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->capturePayment($capturePaymentRequest, '1ddd77af-0bd7-500d-895b-c475c55fdefc', 123);
+
+ $this->assertTrue($response instanceof CreateCaptureResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('capturePaymentFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $capturePaymentRequest = CreateCaptureRequest::builder()->setAmount(10)->build();
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->capturePayment($capturePaymentRequest, '1ddd77af-0bd7-500d-895b-c475c55fdefc');
+
+ $this->assertTrue($response instanceof CreateCaptureResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"type":"error","code":"request_accepted","retry_after":123}',
+ array('http_code' => 202)
+ ));
+
+ try {
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->capturePayment($capturePaymentRequest, '1ddd77af-0bd7-500d-895b-c475c55fdefc', 123);
+ self::fail('Exception not thrown');
+ } catch (ApiException $e) {
+ self::assertInstanceOf('YooKassa\Common\Exceptions\ResponseProcessingException', $e);
+ }
+
+ try {
+ $apiClient->capturePayment($capturePaymentRequest, null, 123);
+ } catch (InvalidArgumentException $e) {
+ // it's ok
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ * @throws Exception
+ */
+ public function testInvalidCapturePayment($httpCode, $errorResponse, $requiredException)
+ {
+ $capturePaymentRequest = CreateCaptureRequest::builder()->setAmount(10)->build();
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->capturePayment($capturePaymentRequest, '1ddd77af-0bd7-500d-895b-c475c55fdefc', 123);
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider paymentInfoDataProvider
+ * @param mixed $paymentId
+ * @param string|null $exceptionClassName
+ */
+ public function testPaymentIdCapturePayment($paymentId, $exceptionClassName = null)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($exceptionClassName === null ? self::once() : self::never())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('capturePaymentFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $capturePaymentRequest = array(
+ 'amount' => array(
+ 'value' => 123,
+ 'currency' => 'EUR',
+ )
+ );
+
+ if ($exceptionClassName !== null) {
+ $this->setExpectedException($exceptionClassName);
+ }
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->capturePayment($capturePaymentRequest, $paymentId, 123);
+
+ self::assertTrue($response instanceof CreateCaptureResponse);
+ }
+
+ /**
+ * @dataProvider paymentInfoDataProvider
+ * @param mixed $paymentId
+ * @param string $exceptionClassName
+ */
+ public function testCancelPayment($paymentId, $exceptionClassName = null)
+ {
+ $invalid = $exceptionClassName !== null;
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($invalid ? self::never() : self::once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('cancelPaymentFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ if ($invalid) {
+ $this->setExpectedException($exceptionClassName);
+ }
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->cancelPayment($paymentId, 123);
+
+ $this->assertTrue($response instanceof CancelResponse);
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ */
+ public function testInvalidCancelPayment($httpCode, $errorResponse, $requiredException)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->cancelPayment(Random::str(36));
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider refundsDataProvider
+ * @param mixed $refundsRequest
+ */
+ public function testGetRefunds($refundsRequest)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects(self::once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('refundsInfoFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getRefunds($refundsRequest);
+
+ $this->assertTrue($response instanceof RefundsResponse);
+ }
+
+ public function refundsDataProvider()
+ {
+ return array(
+ array(null),
+ array(RefundsRequest::builder()->build()),
+ array(array(
+ 'account_id' => 123,
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ */
+ public function testInvalidGetRefunds($httpCode, $errorResponse, $requiredException)
+ {
+ $refundsRequest = RefundsRequest::builder()->build();
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->getRefunds($refundsRequest);
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ public function testCreateRefund()
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createRefundFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $refundRequest = CreateRefundRequest::builder()->setPaymentId('1ddd77af-0bd7-500d-895b-c475c55fdefc')->setAmount(123)->build();
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createRefund($refundRequest, 123);
+
+ $this->assertTrue($response instanceof CreateRefundResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createRefundFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $refundRequest = array(
+ 'payment_id' => '1ddd77af-0bd7-500d-895b-c475c55fdefc',
+ 'amount' => array(
+ 'value' => 321,
+ 'currency' => 'RUB',
+ )
+ );
+
+ $apiClient = new Client();
+
+ $response = $apiClient
+ ->setMaxRequestAttempts(2)
+ ->setRetryTimeout(1000)
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createRefund($refundRequest);
+
+ $this->assertTrue($response instanceof CreateRefundResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"type":"error","code":"request_accepted","retry_after":1800}',
+ array('http_code' => 202)
+ ));
+
+ try {
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createRefund($refundRequest, 123);
+ } catch (ApiException $e) {
+ self::assertInstanceOf('YooKassa\Common\Exceptions\ResponseProcessingException', $e);
+ return;
+ }
+
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ * @throws Exception
+ */
+ public function testInvalidCreateRefund($httpCode, $errorResponse, $requiredException)
+ {
+ $refundRequest = CreateRefundRequest::builder()->setPaymentId('1ddd77af-0bd7-500d-895b-c475c55fdefc')->setAmount(123)->build();
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->createRefund($refundRequest, 123);
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider paymentInfoDataProvider
+ *
+ * @param mixed $refundId
+ * @param string $exceptionClassName
+ * @throws ApiException
+ * @throws BadApiRequestException
+ * @throws ForbiddenException
+ * @throws InternalServerError
+ * @throws NotFoundException
+ * @throws ResponseProcessingException
+ * @throws TooManyRequestsException
+ * @throws UnauthorizedException
+ */
+ public function testRefundInfo($refundId, $exceptionClassName = null)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($exceptionClassName === null ? self::once() : self::never())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('refundInfoFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ if ($exceptionClassName !== null) {
+ $this->setExpectedException($exceptionClassName);
+ }
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getRefundInfo($refundId);
+
+ $this->assertTrue($response instanceof RefundResponse);
+
+ try {
+ $apiClient->getRefundInfo(null);
+ } catch (InvalidArgumentException $e) {
+ // it's ok
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider errorResponseDataProvider
+ * @param $httpCode
+ * @param $errorResponse
+ * @param $requiredException
+ * @throws Exception
+ */
+ public function testInvalidRefundInfo($httpCode, $errorResponse, $requiredException)
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $errorResponse,
+ array('http_code' => $httpCode)
+ ));
+
+ $apiClient = new Client();
+ $apiClient->setApiClient($curlClientStub)->setAuth('shopId', 'shopPassword');
+ try {
+ $apiClient->getRefundInfo(Random::str(36));
+ } catch (ApiException $e) {
+ self::assertInstanceOf($requiredException, $e);
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ public function testApiException()
+ {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ 'unknown response here',
+ array('http_code' => 444)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\ApiException');
+
+ $apiClient = new Client();
+ $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ }
+
+ public function testBadRequestException()
+ {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"description": "error_msg", "code": "error_code", "parameter_name": "parameter_name"}',
+ array('http_code' => 400)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\BadApiRequestException');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ }
+
+ public function testTechnicalErrorException()
+ {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"description": "error_msg", "code": "error_code"}',
+ array('http_code' => 500)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\InternalServerError');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ }
+
+ public function testUnauthorizedException()
+ {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"description": "error_msg"}',
+ array('http_code' => 401)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\UnauthorizedException');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ }
+
+ public function testForbiddenException()
+ {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"description": "error_msg","error_code": "error_code", "parameter_name": "parameter_name", "operation_name": "operation_name"}',
+ array('http_code' => 403)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\ForbiddenException');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment, 123);
+ }
+
+ public function testNotFoundException()
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"description": "error_msg","error_code": "error_code", "parameter_name": "parameter_name", "operation_name": "operation_name"}',
+ array('http_code' => 404)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\NotFoundException');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPaymentInfo(Random::str(36));
+ }
+
+ public function testToManyRequestsException()
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"description": "error_msg","error_code": "error_code", "parameter_name": "parameter_name", "operation_name": "operation_name"}',
+ array('http_code' => 429)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\TooManyRequestsException');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPaymentInfo(Random::str(36));
+ }
+
+ public function testAnotherExceptions()
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{}',
+ array('http_code' => 322)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPaymentInfo(Random::str(36));
+
+ self::assertNull($response);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{}',
+ array('http_code' => 402)
+ ));
+
+ $apiClient = new Client();
+
+ $this->setExpectedException('YooKassa\Common\Exceptions\ApiException');
+
+ $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPaymentInfo(Random::str(36));
+
+ }
+
+ public function testConfig()
+ {
+ $apiClient = new Client();
+ $apiClient->setConfig(array(
+ 'url' => 'test'
+ ));
+
+ $this->assertEquals(array('url' => 'test'), $apiClient->getConfig());
+ }
+
+ public function testSetLogger()
+ {
+ $wrapped = new ArrayLogger();
+ $logger = new LoggerWrapper($wrapped);
+
+ $apiClient = new Client();
+ $apiClient->setLogger($logger);
+
+ $clientMock = $this->getMockBuilder('YooKassa\Client\ApiClientInterface')
+ ->setMethods(array('setLogger', 'setConfig', 'call', 'setShopId', 'getUserAgent', 'setBearerToken', 'setShopPassword'))
+ ->disableOriginalConstructor()
+ ->getMock();
+ $expectedLoggers = array();
+ $clientMock->expects(self::exactly(3))->method('setLogger')->willReturnCallback(function ($logger) use(&$expectedLoggers) {
+ $expectedLoggers[] = $logger;
+ });
+ $clientMock->expects(self::once())->method('setConfig')->willReturn($clientMock);
+
+ $apiClient->setApiClient($clientMock);
+ self::assertSame($expectedLoggers[0], $logger);
+
+ $apiClient->setLogger($wrapped);
+ $apiClient->setLogger(function ($level, $log, $context = array()) use ($wrapped) {
+ $wrapped->log($level, $log, $context);
+ });
+ }
+
+ public function testDecodeInvalidData()
+ {
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects(self::any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"invalid":"json"',
+ array('http_code' => 200)
+ ));
+ $this->setExpectedException('YooKassa\Common\Exceptions\JsonException');
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->getPaymentInfo(Random::str(36));
+ }
+
+ public function testEncodeInvalidData()
+ {
+ $instance = new TestClient();
+
+ if (version_compare(PHP_VERSION, '5.5') >= 0) {
+ $value = array('test' => 'test', 'val' => null);
+ $value['val'] = &$value;
+ try {
+ $instance->encode($value);
+ self::fail('Exception not thrown');
+ } catch (JsonException $e) {
+ self::assertEquals(JSON_ERROR_RECURSION, $e->getCode());
+ self::assertEquals('Failed serialize json. Unknown error', $e->getMessage());
+ }
+
+ $value = array('test' => iconv('utf-8', 'windows-1251', 'абвгдеёжз'));
+ try {
+ $instance->encode($value);
+ self::fail('Exception not thrown');
+ } catch (JsonException $e) {
+ self::assertEquals(JSON_ERROR_UTF8, $e->getCode());
+ self::assertEquals('Failed serialize json. Malformed UTF-8 characters, possibly incorrectly encoded',
+ $e->getMessage());
+ }
+ } else {
+ $value = array('test' => iconv('utf-8', 'windows-1251', 'абвгдеёжз'));
+ $decoded = json_decode(json_encode($value), true);
+ self::assertNotSame($decoded, $value);
+ }
+ }
+
+ public function testCreatePaymentErrors() {
+ $payment = CreatePaymentRequest::builder()
+ ->setAmount(123)
+ ->setPaymentToken(Random::str(36))
+ ->build();
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createPaymentErrorsGeneralFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createPayment($payment);
+
+ self::assertSame($curlClientStub, $apiClient->getApiClient());
+ self::assertTrue($response instanceof CreatePaymentResponse);
+ self::assertEquals("canceled", $response->getStatus());
+ self::assertEquals("general_decline", $response->getCancellationDetails()->getReason());
+ }
+
+ /**
+ * @throws ApiException
+ * @throws BadApiRequestException
+ * @throws ForbiddenException
+ * @throws InternalServerError
+ * @throws NotFoundException
+ * @throws ResponseProcessingException
+ * @throws TooManyRequestsException
+ * @throws UnauthorizedException
+ * @throws ApiConnectionException
+ * @throws AuthorizeException
+ */
+ public function testCreateReceipt()
+ {
+ // Create Receipt via object
+ $receipt = $this->createReceiptViaObject();
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createReceiptFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createReceipt($receipt);
+
+ self::assertSame($curlClientStub, $apiClient->getApiClient());
+ self::assertTrue($response instanceof AbstractReceiptResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->once())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ $this->getFixtures('createReceiptFixtures.json'),
+ array('http_code' => 200)
+ ));
+
+ // Create Receipt via array
+ $receipt = $this->createReceiptViaArray();
+ $apiClient = new Client();
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createReceipt($receipt, 123);
+
+ self::assertSame($curlClientStub, $apiClient->getApiClient());
+ self::assertTrue($response instanceof AbstractReceiptResponse);
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"type":"error","code":"request_accepted","retry_after":1800}',
+ array('http_code' => 202)
+ ));
+
+ try {
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createReceipt($receipt, 123);
+ self::fail('Исключение не было выброшено');
+ } catch (ApiException $e) {
+ self::assertInstanceOf('YooKassa\Common\Exceptions\ResponseProcessingException', $e);
+ return;
+ }
+
+ $curlClientStub = $this->getCurlClientStub();
+ $curlClientStub
+ ->expects($this->any())
+ ->method('sendRequest')
+ ->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{"type":"error","code":"request_accepted"}',
+ array('http_code' => 202)
+ ));
+
+ try {
+ $apiClient->setRetryTimeout(0);
+ $response = $apiClient
+ ->setApiClient($curlClientStub)
+ ->setAuth('shopId', 'shopPassword')
+ ->createReceipt($receipt, 123);
+ self::fail('Исключение не было выброшено');
+ } catch (ResponseProcessingException $e) {
+ self::assertEquals(Client::DEFAULT_DELAY, $e->retryAfter);
+ return;
+ }
+ }
+
+ /**
+ * @return array
+ */
+ private function createReceiptViaArray()
+ {
+ return array(
+ 'customer' => array(
+ 'full_name' => 'Иванов Иван Иванович',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000'
+ ),
+ 'items' => array(
+ array(
+ 'description' => 'string',
+ 'quantity' => 1,
+ 'amount' => array(
+ 'value' => '10.00',
+ 'currency' => 'RUB'
+ ),
+ 'vat_code' => 1,
+ 'payment_subject' => 'commodity',
+ 'payment_mode' => 'full_prepayment',
+ 'product_code' => '00 00 00 01 00 21 FA 41 00 23 05 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 AB 00',
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => '10714040/140917/0090376',
+ 'excise' => '20.00'
+ )
+ ),
+ 'tax_system_code' => 1,
+ 'type' => 'payment',
+ 'send' => true,
+ 'settlements' => array(
+ array(
+ 'type' => 'cashless',
+ 'amount' => array(
+ 'value' => '10.00',
+ 'currency' => 'RUB'
+ )
+ )
+ ),
+ 'payment_id' => '1da5c87d-0984-50e8-a7f3-8de646dd9ec9'
+ );
+ }
+
+ /**
+ * @return CreatePostReceiptRequest
+ */
+ private function createReceiptViaObject()
+ {
+ $customer = new ReceiptCustomer(array(
+ 'full_name' => 'Иванов Иван Иванович',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000'
+ ));
+ $settlement = new Settlement(array(
+ 'type' => 'cashless',
+ 'amount' => array(
+ 'value' => '10.00',
+ 'currency' => 'RUB'
+ )
+ ));
+ $receiptItem = new ReceiptItem(array(
+ 'description' => 'string',
+ 'quantity' => 1,
+ 'amount' => array(
+ 'value' => '10.00',
+ 'currency' => 'RUB'
+ ),
+ 'vat_code' => 1,
+ 'payment_subject' => 'commodity',
+ 'payment_mode' => 'full_prepayment',
+ 'product_code' => '00 00 00 01 00 21 FA 41 00 23 05 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00 AB 00',
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => '10714040/140917/0090376',
+ 'excise' => '20.00'
+ ));
+
+ return CreatePostReceiptRequest::builder()
+ ->setCustomer($customer)
+ ->setType(ReceiptType::PAYMENT)
+ ->setObjectId('1da5c87d-0984-50e8-a7f3-8de646dd9ec9')
+ ->setSend(true)
+ ->setSettlements(array($settlement))
+ ->setOnBehalfOf('545665')
+ ->setItems(array($receiptItem))
+ ->build();
+ }
+
+ /**
+ * @return PHPUnit_Framework_MockObject_MockObject
+ */
+ public function getCurlClientStub()
+ {
+ $clientStub = $this->getMockBuilder('YooKassa\Client\CurlClient')
+ ->setMethods(array('sendRequest'))
+ ->getMock();
+
+ return $clientStub;
+ }
+
+ public function errorResponseDataProvider()
+ {
+ return array(
+ array(NotFoundException::HTTP_CODE, '{}', 'YooKassa\Common\Exceptions\NotFoundException'),
+ array(BadApiRequestException::HTTP_CODE, '{}', 'YooKassa\Common\Exceptions\BadApiRequestException'),
+ array(BadApiRequestException::HTTP_CODE, '{}', 'YooKassa\Common\Exceptions\BadApiRequestException'),
+ array(ForbiddenException::HTTP_CODE, '{}', 'YooKassa\Common\Exceptions\ForbiddenException'),
+ array(UnauthorizedException::HTTP_CODE, '{}', 'YooKassa\Common\Exceptions\UnauthorizedException'),
+ array(TooManyRequestsException::HTTP_CODE, '{}', 'YooKassa\Common\Exceptions\TooManyRequestsException'),
+ );
+ }
+
+ /**
+ * @return bool|string
+ */
+ private function getFixtures($fileName)
+ {
+ return file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'fixtures' . DIRECTORY_SEPARATOR . $fileName);
+ }
+}
+
+class ArrayLogger
+{
+ private $lastLog;
+
+ public function log($level, $message, $context)
+ {
+ $this->lastLog = array($level, $message, $context);
+ }
+
+ public function getLastLog()
+ {
+ return $this->lastLog;
+ }
+}
+
+class TestClient extends Client
+{
+ public function encode($data)
+ {
+ $refl = new ReflectionMethod($this, 'encodeData');
+ $refl->setAccessible(true);
+ return $refl->invoke($this, $data);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/CurlClientTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/CurlClientTest.php
new file mode 100644
index 0000000..8267585
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/CurlClientTest.php
@@ -0,0 +1,91 @@
+setConnectionTimeout(10);
+ $this->assertEquals(10, $client->getConnectionTimeout());
+ }
+
+ public function testTimeout()
+ {
+ $client = new CurlClient();
+ $client->setTimeout(10);
+ $this->assertEquals(10, $client->getTimeout());
+ }
+
+ public function testProxy()
+ {
+ $client = new CurlClient();
+ $client->setProxy('proxy_url:8889');
+ $this->assertEquals('proxy_url:8889', $client->getProxy());
+ }
+
+ /**
+ * @dataProvider curlErrorCodeProvider
+ * @expectedException \YooKassa\Common\Exceptions\ApiConnectionException
+ */
+ public function testHandleCurlError($error, $errn)
+ {
+ $client = new CurlClient();
+ $reflector = new \ReflectionClass('\YooKassa\Client\CurlClient');
+ $method = $reflector->getMethod('handleCurlError');
+ $method->setAccessible(true);
+ $method->invokeArgs($client, array($error, $errn));
+ }
+
+ public function testConfig()
+ {
+ $config = array('url' => 'test:url');
+ $client = new CurlClient();
+ $client->setConfig($config);
+ $this->assertEquals($config, $client->getConfig());
+ }
+
+ public function testCloseConnection()
+ {
+ $wrapped = new \Tests\YooKassa\Client\ArrayLogger();
+ $logger = new \YooKassa\Common\LoggerWrapper($wrapped);
+ $curlClientMock = $this->getMockBuilder('YooKassa\Client\CurlClient')
+ ->setMethods(array('closeCurlConnection', 'sendRequest'))
+ ->getMock();
+ $curlClientMock->setLogger($logger);
+ $curlClientMock->setConfig(array('url' => 'test:url'));
+ $curlClientMock->setKeepAlive(false);
+ $curlClientMock->setShopId(123);
+ $curlClientMock->setShopPassword(234);
+ $curlClientMock->expects($this->once())->method('sendRequest')->willReturn(array(
+ array('Header-Name' => 'HeaderValue'),
+ '{body:sample}',
+ array('http_code' => 200),
+ ));
+ $curlClientMock->expects($this->once())->method('closeCurlConnection');
+ $curlClientMock->call('', HttpVerb::HEAD, array('queryParam' => 'value'), 'testBodyValue',
+ array('testHeader' => 'testValue'));
+ }
+
+ public function testAuthorizeException()
+ {
+ $this->setExpectedException('YooKassa\Common\Exceptions\AuthorizeException');
+ $client = new CurlClient();
+ $client->call('', HttpVerb::HEAD, array('queryParam' => 'value'), array('httpBody' => 'testValue'),
+ array('testHeader' => 'testValue'));
+ }
+
+ public function curlErrorCodeProvider()
+ {
+ return array(
+ array('error message', CURLE_SSL_CACERT),
+ array('error message', CURLE_COULDNT_CONNECT),
+ array('error message', 0),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/UserAgentTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/UserAgentTest.php
new file mode 100644
index 0000000..b7532ec
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/UserAgentTest.php
@@ -0,0 +1,122 @@
+getMethod('setOs');
+ $method->setAccessible(true);
+ $method->invokeArgs($agent, array('name' => 'CentOS', 'version' => '6.7'));
+ $method = $reflector->getMethod('setPhp');
+ $method->setAccessible(true);
+ $method->invokeArgs($agent, array('name' => 'PHP', 'version' => '5.4.45'));
+ $method = $reflector->getMethod('setSdk');
+ $method->setAccessible(true);
+ $method->invokeArgs($agent, array('name' => 'YooKassa.PHP', 'version' => '1.4.1'));
+ $agent->setCms('Wordpress','2.0.4');
+ $agent->setModule('Woocommerce','1.2.3');
+ $this->assertEquals('CentOS/6.7 PHP/5.4.45 Wordpress/2.0.4 Woocommerce/1.2.3 YooKassa.PHP/1.4.1', $agent->getHeaderString());
+ }
+
+ /**
+ * @throws ReflectionException
+ */
+ public function testSetGetOs()
+ {
+ $agent = new UserAgent();
+ $reflector = new ReflectionClass('\YooKassa\Client\UserAgent');
+ $method = $reflector->getMethod('setOs');
+ $method->setAccessible(true);
+ $method->invokeArgs($agent, array('name' => 'CentOS', 'version' => '6.7'));
+ $this->assertEquals('CentOS/6.7', $agent->getOs());
+ }
+
+ /**
+ * @throws ReflectionException
+ */
+ public function testSetGetPhp()
+ {
+ $agent = new UserAgent();
+ $reflector = new ReflectionClass('\YooKassa\Client\UserAgent');
+ $method = $reflector->getMethod('setPhp');
+ $method->setAccessible(true);
+ $method->invokeArgs($agent, array('name' => 'PHP', 'version' => '5.4.45'));
+ $this->assertEquals('PHP/5.4.45', $agent->getPhp());
+ }
+
+ public function testSetGetFramework()
+ {
+ $agent = new UserAgent();
+ $agent->setFramework('Yii', '2.4.1');
+ $this->assertEquals('Yii/2.4.1', $agent->getFramework());
+ }
+
+ public function testSetGetCms()
+ {
+ $agent = new UserAgent();
+ $agent->setCms('Wordpress', '2.0.4');
+ $this->assertEquals('Wordpress/2.0.4', $agent->getCms());
+ }
+
+ public function testSetGetModule()
+ {
+ $agent = new UserAgent();
+ $agent->setModule('Woocommerce', '1.2.3');
+ $this->assertEquals('Woocommerce/1.2.3', $agent->getModule());
+ }
+
+ /**
+ * @throws ReflectionException
+ */
+ public function testSetGetSdk()
+ {
+ $agent = new UserAgent();
+ $reflector = new ReflectionClass('\YooKassa\Client\UserAgent');
+ $method = $reflector->getMethod('setSdk');
+ $method->setAccessible(true);
+ $method->invokeArgs($agent, array('name' => 'YooKassa.PHP', 'version' => '1.4.1'));
+ $this->assertEquals('YooKassa.PHP/1.4.1', $agent->getSdk());
+ }
+
+ /**
+ * @dataProvider validVersionDataProvider
+ * @param $input
+ * @param $output
+ */
+ public function testCreateVersion($input, $output)
+ {
+ $agent = new UserAgent();
+ $this->assertEquals($agent->createVersion($input['name'], $input['version']), $output);
+ }
+
+ public function validVersionDataProvider()
+ {
+ return array(
+ array(
+ array('name' => 'PHP ', 'version' => '1.2.3 '),
+ 'PHP/1.2.3'
+ ),
+ array(
+ array('name' => 'Ubuntu GNU/Linux', 'version' => ' 14.04'),
+ 'Ubuntu.GNU.Linux/14.04'
+ ),
+ array(
+ array('name' => 'YooKassa PHP', 'version' => '1/4.3'),
+ 'YooKassa.PHP/1.4.3'
+ ),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/cancelPaymentFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/cancelPaymentFixtures.json
new file mode 100644
index 0000000..b4e0525
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/cancelPaymentFixtures.json
@@ -0,0 +1,35 @@
+{
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "insufficient_funds",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "recipient": {
+ "account_id": "123",
+ "gateway_id": "456"
+ },
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "payment_method": {
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "saved": true,
+ "title": "Основная карта",
+ "type": "qiwi"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "captured_at": "2015-11-19T17:05:31+03:00",
+ "confirmation": {
+ "type": "redirect"
+ },
+ "refunded_amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "paid": true,
+ "refundable": true,
+ "receipt_registration": "succeeded",
+ "metadata": {}
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/capturePaymentFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/capturePaymentFixtures.json
new file mode 100644
index 0000000..680973a
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/capturePaymentFixtures.json
@@ -0,0 +1,39 @@
+{
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "insufficient_funds",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "recipient": {
+ "account_id": "123",
+ "gateway_id": "456"
+ },
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "payment_method": {
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "saved": true,
+ "title": "Основная карта",
+ "type": "bank_card",
+ "last4": "3563",
+ "expiry_year": "2023",
+ "expiry_month": "05",
+ "card_type": "MasterCard"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "captured_at": "2015-11-19T17:05:31+03:00",
+ "confirmation": {
+ "type": "embedded"
+ },
+ "refunded_amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "paid": true,
+ "refundable": true,
+ "receipt_registration": "succeeded",
+ "metadata": {}
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createPaymentErrorsGeneralFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createPaymentErrorsGeneralFixtures.json
new file mode 100644
index 0000000..8a9ff3c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createPaymentErrorsGeneralFixtures.json
@@ -0,0 +1,34 @@
+{
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "canceled",
+ "paid": false,
+ "refundable": false,
+ "amount": {
+ "value": "20.00",
+ "currency": "RUB"
+ },
+ "created_at": "2018-07-17T11:14:53.131Z",
+ "metadata": {},
+ "payment_method": {
+ "type": "bank_card",
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "saved": false,
+ "card": {
+ "first6": "111111",
+ "last4": "1026",
+ "expiry_month": "12",
+ "expiry_year": "2022",
+ "card_type": "Unknown"
+ },
+ "title": "Bank card *1026"
+ },
+ "recipient": {
+ "account_id": "123",
+ "gateway_id": "456"
+ },
+ "test": true,
+ "cancellation_details": {
+ "party": "yoo_money",
+ "reason": "general_decline"
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createPaymentFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createPaymentFixtures.json
new file mode 100644
index 0000000..8e9f60e
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createPaymentFixtures.json
@@ -0,0 +1,39 @@
+{
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "insufficient_funds",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "recipient": {
+ "account_id": "123",
+ "gateway_id": "456"
+ },
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "captured_at": "2015-11-19T17:05:31+03:00",
+ "payment_method": {
+ "type": "yoo_money",
+ "phone": "89990110101",
+ "account_number": "123456789123"
+ },
+ "confirmation": {
+ "type": "redirect",
+ "locale": "ru_RU",
+ "enforce": true,
+ "return_url": "string",
+ "confirmation_url": "string"
+ },
+ "refunded_amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "paid": true,
+ "refundable": true,
+ "test": true,
+ "receipt_registration": "succeeded",
+ "metadata": {}
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createReceiptFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createReceiptFixtures.json
new file mode 100644
index 0000000..9c9adc8
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createReceiptFixtures.json
@@ -0,0 +1,49 @@
+{
+ "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "type": "payment",
+ "payment_id": "215d8da0-000f-50be-b000-0003308c89be",
+ "status": "pending",
+ "items": [
+ {
+ "description": "Мобильный телефон Хувей",
+ "quantity": "1.00",
+ "amount": {
+ "value": "14000.00",
+ "currency": "RUB"
+ },
+ "vat_code": "2",
+ "payment_mode": "full_payment",
+ "payment_subject": "commodity",
+ "country_of_origin_code": "CN"
+ },
+ {
+ "description": "Переносное зарядное устройство Хувей",
+ "quantity": "1.00",
+ "amount": {
+ "value": "1000.00",
+ "currency": "RUB"
+ },
+ "vat_code": "2",
+ "payment_mode": "full_payment",
+ "payment_subject": "commodity",
+ "country_of_origin_code": "CN"
+ }
+ ],
+ "settlements": [
+ {
+ "type": "prepayment",
+ "amount": {
+ "value": "8000.00",
+ "currency": "RUB"
+ }
+ },
+ {
+ "type": "prepayment",
+ "amount": {
+ "value": "7000.00",
+ "currency": "RUB"
+ }
+ }
+ ],
+ "tax_system_code": 1
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createRefundFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createRefundFixtures.json
new file mode 100644
index 0000000..7bb2abb
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/createRefundFixtures.json
@@ -0,0 +1,17 @@
+{
+ "id": "1ddd77af-0bd7-500d-895b-c475c55fdefc",
+ "payment_id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "authorization_rejected",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "authorized_at": "2015-11-19T17:05:31+03:00",
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "receipt_registered": "succeeded",
+ "description": "string"
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/getPaymentsFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/getPaymentsFixtures.json
new file mode 100644
index 0000000..261044e
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/getPaymentsFixtures.json
@@ -0,0 +1,52 @@
+{
+ "items": [
+ {
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "insufficient_funds",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "recipient": {
+ "account_id": "123",
+ "gateway_id": "456"
+ },
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "reference_id": "719505144571",
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "captured_at": "2015-11-19T17:05:31+03:00",
+ "payment_method": {
+ "type": "yoo_money",
+ "phone": "79990110101",
+ "account_number": "123456789123"
+ },
+ "confirmation": {
+ "type": "redirect",
+ "enforce": true,
+ "return_url": "string",
+ "confirmation_url": "string"
+ },
+ "charge": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "income": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "refunded_amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "paid": true,
+ "refundable": true,
+ "test": true,
+ "receipt_registration": "succeeded",
+ "metadata": {}
+ }
+ ],
+ "next_page": "01234567890ABCDEF"
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/paymentInfoFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/paymentInfoFixtures.json
new file mode 100644
index 0000000..5ab5474
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/paymentInfoFixtures.json
@@ -0,0 +1,36 @@
+{
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "insufficient_funds",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "recipient": {
+ "account_id": "123",
+ "gateway_id": "456"
+ },
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "payment_method": {
+ "id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "saved": true,
+ "title": "Основная карта",
+ "type": "qiwi"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "captured_at": "2015-11-19T17:05:31+03:00",
+ "confirmation": {
+ "type": "external"
+ },
+ "refunded_amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "paid": true,
+ "refundable": true,
+ "test": true,
+ "receipt_registration": "succeeded",
+ "metadata": {}
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/paymentOptionsFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/paymentOptionsFixtures.json
new file mode 100644
index 0000000..ee06a0e
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/paymentOptionsFixtures.json
@@ -0,0 +1,19 @@
+{
+ "items": [
+ {
+ "payment_method_type": "yoo_money",
+ "confirmation_types": [
+ "redirect"
+ ],
+ "charge": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "fee": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "extra_fee": true
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/refundInfoFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/refundInfoFixtures.json
new file mode 100644
index 0000000..7bb2abb
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/refundInfoFixtures.json
@@ -0,0 +1,17 @@
+{
+ "id": "1ddd77af-0bd7-500d-895b-c475c55fdefc",
+ "payment_id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "authorization_rejected",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "authorized_at": "2015-11-19T17:05:31+03:00",
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "receipt_registered": "succeeded",
+ "description": "string"
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/refundsInfoFixtures.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/refundsInfoFixtures.json
new file mode 100644
index 0000000..06f7d5a
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Client/fixtures/refundsInfoFixtures.json
@@ -0,0 +1,27 @@
+{
+ "items": [
+ {
+ "id": "1ddd77af-0bd7-500d-895b-c475c55fdefc",
+ "payment_id": "1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
+ "status": "succeeded",
+ "error": {
+ "code": "authorization_rejected",
+ "description": "Съешь еще этих мягких французских булок"
+ },
+ "created_at": "2015-11-19T17:05:07+03:00",
+ "authorized_at": "2015-11-19T17:05:31+03:00",
+ "amount": {
+ "value": "10.00",
+ "currency": "RUB"
+ },
+ "receipt_registered": "succeeded",
+ "description": "string",
+ "requestor": {
+ "type": "RequestorThirdPartyService",
+ "client_id": "12345",
+ "client_name": "test"
+ }
+ }
+ ],
+ "next_page": "01234567890ABCDEF"
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractEnumTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractEnumTest.php
new file mode 100644
index 0000000..90ff1aa
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractEnumTest.php
@@ -0,0 +1,67 @@
+ true,
+ self::ENUM_VALUE_2 => true,
+ self::ENUM_DISABLED_VALUE_1 => false,
+ self::ENUM_DISABLED_VALUE_2 => false,
+ );
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractObjectTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractObjectTest.php
new file mode 100644
index 0000000..45e801f
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractObjectTest.php
@@ -0,0 +1,236 @@
+getTestInstance();
+ if ($exists) {
+ self::assertTrue($instance->offsetExists($value));
+ self::assertTrue(isset($instance[$value]));
+ self::assertTrue(isset($instance->{$value}));
+ } else {
+ self::assertFalse($instance->offsetExists($value));
+ self::assertFalse(isset($instance[$value]));
+ self::assertFalse(isset($instance->{$value}));
+
+ $instance->offsetSet($value, $value);
+ self::assertTrue($instance->offsetExists($value));
+ self::assertTrue(isset($instance[$value]));
+ self::assertTrue(isset($instance->{$value}));
+ }
+ }
+
+ /**
+ * @dataProvider offsetDataProvider
+ * @param $value
+ */
+ public function testOffsetGet($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $tmp = $instance->offsetGet($value);
+ self::assertNull($tmp);
+ $tmp = $instance[$value];
+ self::assertNull($tmp);
+ $tmp = $instance->{$value};
+ self::assertNull($tmp);
+
+ $instance->offsetSet($value, $value);
+
+ $tmp = $instance->offsetGet($value);
+ self::assertEquals($value, $tmp);
+ $tmp = $instance[$value];
+ self::assertEquals($value, $tmp);
+ $tmp = $instance->{$value};
+ self::assertEquals($value, $tmp);
+ }
+
+ /**
+ * @dataProvider offsetDataProvider
+ * @param $value
+ * @param $exists
+ */
+ public function testOffsetUnset($value, $exists)
+ {
+ $instance = $this->getTestInstance();
+ if ($exists) {
+ self::assertTrue($instance->offsetExists($value));
+ $instance->offsetUnset($value);
+ self::assertTrue($instance->offsetExists($value));
+ unset($instance[$value]);
+ self::assertTrue($instance->offsetExists($value));
+ unset($instance->{$value});
+ self::assertTrue($instance->offsetExists($value));
+ } else {
+ self::assertFalse($instance->offsetExists($value));
+ $instance->offsetUnset($value);
+ self::assertFalse($instance->offsetExists($value));
+ unset($instance[$value]);
+ self::assertFalse($instance->offsetExists($value));
+ unset($instance->{$value});
+ self::assertFalse($instance->offsetExists($value));
+
+ $instance->{$value} = $value;
+ self::assertTrue($instance->offsetExists($value));
+ $instance->offsetUnset($value);
+ self::assertFalse($instance->offsetExists($value));
+
+ $instance->{$value} = $value;
+ self::assertTrue($instance->offsetExists($value));
+ unset($instance[$value]);
+ self::assertFalse($instance->offsetExists($value));
+
+ $instance->{$value} = $value;
+ self::assertTrue($instance->offsetExists($value));
+ unset($instance->{$value});
+ self::assertFalse($instance->offsetExists($value));
+ }
+ }
+
+ public function offsetDataProvider()
+ {
+ return array(
+ array('property', true),
+ array('propertyCamelCase', true),
+ array('property_camel_case', true),
+ array('Property', true),
+ array('PropertyCamelCase', true),
+ array('Property_Camel_Case', true),
+ array('not_exists', false),
+ );
+ }
+
+ public function testJsonSerialize()
+ {
+ $instance = $this->getTestInstance();
+
+ $data = $instance->jsonSerialize();
+ $expected = array();
+ self::assertEquals($expected, $data);
+
+ $instance->setProperty('propertyValue');
+ $data = $instance->jsonSerialize();
+ $expected = array(
+ 'property' => 'propertyValue',
+ );
+ self::assertEquals($expected, $data);
+
+ $instance->setPropertyCamelCase($this->getTestInstance());
+ $data = $instance->jsonSerialize();
+ $expected = array(
+ 'property' => 'propertyValue',
+ 'property_camel_case' => array(),
+ );
+ self::assertEquals($expected, $data);
+
+ $instance->getPropertyCamelCase()->setProperty(array('test', 1, 2, 3));
+ $data = $instance->jsonSerialize();
+ $expected = array(
+ 'property' => 'propertyValue',
+ 'property_camel_case' => array(
+ 'property' => array('test', 1, 2, 3),
+ ),
+ );
+ self::assertEquals($expected, $data);
+
+ $date = new \DateTime();
+ $instance->getPropertyCamelCase()->setPropertyCamelCase($date);
+ $data = $instance->jsonSerialize();
+ $expected = array(
+ 'property' => 'propertyValue',
+ 'property_camel_case' => array(
+ 'property' => array('test', 1, 2, 3),
+ 'property_camel_case' => $date->format(DATE_ATOM),
+ ),
+ );
+ self::assertEquals($expected, $data);
+
+ $instance->getPropertyCamelCase()->unknown_obj = $this->getTestInstance();
+ $data = $instance->jsonSerialize();
+ $expected = array(
+ 'property' => 'propertyValue',
+ 'property_camel_case' => array(
+ 'property' => array('test', 1, 2, 3),
+ 'property_camel_case' => $date->format(DATE_ATOM),
+ 'unknown_obj' => array(),
+ ),
+ );
+ self::assertEquals($expected, $data);
+
+ $instance->unknown_property = true;
+ $data = $instance->jsonSerialize();
+ $expected['unknown_property'] = true;
+ self::assertEquals($expected, $data);
+
+ $instance->unknown_array = array(false);
+ $data = $instance->jsonSerialize();
+ $expected['unknown_array'] = array(false);
+ self::assertEquals($expected, $data);
+
+ $instance->unknown_date = $date;
+ $data = $instance->jsonSerialize();
+ $expected['unknown_date'] = $date->format(DATE_ATOM);
+ self::assertEquals($expected, $data);
+
+ $obj = new \stdClass();
+ $obj->test = 'test1';
+ $instance->unknown_obj = $obj;
+ $data = $instance->jsonSerialize();
+ $expected['unknown_obj'] = $obj;
+ self::assertEquals($expected, $data);
+
+ $obj = new \stdClass();
+ $obj->test = 'test2';
+ $instance->property_camel_case = $obj;
+ $data = $instance->jsonSerialize();
+ $expected['property_camel_case'] = $obj;
+ self::assertEquals($expected, $data);
+
+ $instance->property_camel_case = null;
+ $data = $instance->jsonSerialize();
+ unset($expected['property_camel_case']);
+ self::assertEquals($expected, $data);
+ }
+}
+
+class TestAbstractObject extends AbstractObject
+{
+ private $_property;
+ private $_anotherProperty;
+
+ public function getProperty()
+ {
+ return $this->_property;
+ }
+
+ public function setProperty($value)
+ {
+ $this->_property = $value;
+ }
+
+ public function getPropertyCamelCase()
+ {
+ return $this->_anotherProperty;
+ }
+
+ public function setPropertyCamelCase($value)
+ {
+ $this->_anotherProperty = $value;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractRequestBuilderTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractRequestBuilderTest.php
new file mode 100644
index 0000000..c25f6cf
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/AbstractRequestBuilderTest.php
@@ -0,0 +1,139 @@
+build(array());
+ } catch (InvalidRequestException $e) {
+ $request = $builder->build(array(
+ 'isValid' => true,
+ ));
+ self::assertTrue($request->isValid());
+
+ $mess = 'test message';
+ try {
+ $builder->build(array(
+ 'throwException' => new \Exception($mess),
+ ));
+ } catch (\Exception $e) {
+ self::assertEquals($mess, $e->getPrevious()->getMessage());
+ return;
+ }
+ self::fail('Exception not thrown in setThrowException method');
+ return;
+ }
+ self::fail('Exception not thrown in build method');
+ }
+
+ public function testSetOptions()
+ {
+ $builder = new TestAbstractRequestBuilder();
+
+ $builder->setOptions(array());
+ try {
+ $builder->build();
+ } catch (InvalidRequestException $e) {
+ $builder->setOptions(array(
+ 'is_valid' => true,
+ ));
+ self::assertTrue($builder->build()->isValid());
+
+ try {
+ $builder->setOptions('test');
+ } catch (\Exception $e) {
+ self::assertTrue($e instanceof \InvalidArgumentException);
+ return;
+ }
+ self::fail('Exception not thrown in setOptions method');
+ return;
+ }
+ self::fail('Exception not thrown in build method');
+ }
+}
+
+class TestAbstractRequestBuilder extends AbstractRequestBuilder
+{
+ /**
+ * Инициализирует пустой запрос
+ * @return TestAbstractRequestClass Инстанс запроса который будем собирать
+ */
+ protected function initCurrentObject()
+ {
+ return new TestAbstractRequestClass();
+ }
+
+ public function setIsValid($value)
+ {
+ $this->currentObject->setIsValid($value);
+ return $this;
+ }
+
+ /**
+ * @param \Exception $e
+ * @return TestAbstractRequestBuilder
+ * @throws \Exception
+ */
+ public function setThrowException(\Exception $e)
+ {
+ $this->currentObject->setThrowException($e);
+ return $this;
+ }
+}
+
+class TestAbstractRequestClass extends AbstractRequest
+{
+ private $valid = false;
+
+ /**
+ * @var \Exception|null
+ */
+ private $exception = null;
+
+ /**
+ * @param \Exception $e
+ * @throws \Exception
+ */
+ public function setThrowException(\Exception $e)
+ {
+ $this->exception = $e;
+ }
+
+ /**
+ * @param bool $value
+ */
+ public function setIsValid($value)
+ {
+ $this->valid = $value ? true : false;
+ }
+
+ /**
+ * @return bool
+ */
+ public function isValid()
+ {
+ return $this->valid;
+ }
+
+ /**
+ * Валидирует текущий запрос, проверяет все ли нужные свойства установлены
+ * @return bool True если запрос валиден, false если нет
+ */
+ public function validate()
+ {
+ if ($this->exception !== null) {
+ $this->setValidationError($this->exception->getMessage());
+ throw $this->exception;
+ }
+ return $this->valid;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/AbstractApiRequestExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/AbstractApiRequestExceptionTest.php
new file mode 100644
index 0000000..aef0bfa
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/AbstractApiRequestExceptionTest.php
@@ -0,0 +1,178 @@
+getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['description'])) {
+ self::assertEquals('', $instance->getMessage());
+ } else {
+ self::assertEquals($tmp['description'] . '.', $instance->getMessage());
+ }
+ }
+
+ public function descriptionDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"description":"test"}'),
+ array('{"description":"У попа была собака"}'),
+ );
+ }
+
+ /**
+ * @dataProvider codeDataProvider
+ * @param string $body
+ */
+ public function testCode($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['code'])) {
+ self::assertEquals('', $instance->getMessage());
+ } else {
+ self::assertEquals('Error code: ' . $tmp['code'] . '.', $instance->getMessage());
+ }
+ }
+
+ public function codeDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"code":"123"}'),
+ array('{"code":"server_error"}'),
+ );
+ }
+
+ /**
+ * @dataProvider parameterDataProvider
+ * @param string $body
+ */
+ public function testParameter($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['parameter'])) {
+ self::assertEquals('', $instance->getMessage());
+ } else {
+ self::assertEquals('Parameter name: ' . $tmp['parameter'] . '.', $instance->getMessage());
+ }
+ }
+
+ public function parameterDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"parameter":"parameter_name"}'),
+ array('{"parameter":null}'),
+ );
+ }
+
+ /**
+ * @dataProvider retryAfterDataProvider
+ * @param string $body
+ */
+ public function testRetryAfter($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['retry_after'])) {
+ self::assertNull($instance->retryAfter);
+ } else {
+ self::assertEquals($tmp['retry_after'], $instance->retryAfter);
+ }
+ }
+
+ public function retryAfterDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"retry_after":-20}'),
+ array('{"retry_after":123}'),
+ );
+ }
+
+ /**
+ * @dataProvider typeDataProvider
+ * @param string $body
+ */
+ public function testType($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['type'])) {
+ self::assertNull($instance->type);
+ } else {
+ self::assertEquals($tmp['type'], $instance->type);
+ }
+ }
+
+ public function typeDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"type":"server_error"}'),
+ array('{"type":"error"}'),
+ );
+ }
+
+ /**
+ * @dataProvider messageDataProvider
+ * @param $body
+ */
+ public function testMessage($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+
+ $tmp = json_decode($body, true);
+ $message = '';
+ if (!empty($tmp['description'])) {
+ $message = $tmp['description'] . '. ';
+ }
+ if (!empty($tmp['code'])) {
+ $message .= 'Error code: ' . $tmp['code'] . '. ';
+ }
+ if (!empty($tmp['parameter'])) {
+ $message .= 'Parameter name: ' . $tmp['parameter'] . '. ';
+ }
+ self::assertEquals(trim($message), $instance->getMessage());
+
+ if (empty($tmp['retry_after'])) {
+ self::assertNull($instance->retryAfter);
+ } else {
+ self::assertEquals($tmp['retry_after'], $instance->retryAfter);
+ }
+ if (empty($tmp['type'])) {
+ self::assertNull($instance->type);
+ } else {
+ self::assertEquals($tmp['type'], $instance->type);
+ }
+ }
+
+ public function messageDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"code":"server_error","description":"Internal server error"}'),
+ array('{"code":"server_error","description":"Invalid parameter value","parameter":"shop_id"}'),
+ array('{"code":"server_error","description":"Invalid parameter value","parameter":"shop_id","type":"test"}'),
+ array('{"code":"server_error","description":"Invalid parameter value","parameter":"shop_id","retry_after":333}'),
+ );
+ }
+
+ abstract public function expectedHttpCode();
+
+ public function testExceptionCode()
+ {
+ $instance = $this->getTestInstance();
+ self::assertEquals($this->expectedHttpCode(), $instance->getCode());
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/ApiExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/ApiExceptionTest.php
new file mode 100644
index 0000000..b1efc55
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/ApiExceptionTest.php
@@ -0,0 +1,74 @@
+getTestInstance('', 0, $headers);
+ self::assertEquals($headers, $instance->getResponseHeaders());
+ }
+
+ public function responseHeadersDataProvider()
+ {
+ return array(
+ array(
+ array(),
+ ),
+ array(
+ array('HTTP/1.1 200 Ok'),
+ ),
+ array(
+ array(
+ 'HTTP/1.1 200 Ok',
+ 'Content-length: 0',
+ ),
+ ),
+ array(
+ array(
+ 'HTTP/1.1 200 Ok',
+ 'Content-length: 0',
+ 'Connection: close',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider responseBodyDataProvider
+ * @param string $body
+ */
+ public function testGetResponseBody($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ self::assertEquals($body, $instance->getResponseBody());
+ }
+
+ public function responseBodyDataProvider()
+ {
+ return array(
+ array(
+ '',
+ ),
+ array(
+ '{"success":true}',
+ ),
+ array(
+ '',
+ ),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/AuthorizeExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/AuthorizeExceptionTest.php
new file mode 100644
index 0000000..a1fb5c4
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/AuthorizeExceptionTest.php
@@ -0,0 +1,13 @@
+getTestInstance($name);
+
+ self::assertEquals($excepted, $instance->getMessage());
+ }
+
+ public function messageDataProvider()
+ {
+ return array(
+ array("json", "json extension is not loaded!"),
+ array("curl", "curl extension is not loaded!"),
+ array("gd", "gd extension is not loaded!"),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/ForbiddenExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/ForbiddenExceptionTest.php
new file mode 100644
index 0000000..5a574df
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/ForbiddenExceptionTest.php
@@ -0,0 +1,18 @@
+getTestInstance('', $property);
+ self::assertEquals((string)$property, $instance->getProperty());
+ }
+
+ public function validPropertyDataProvider()
+ {
+ return array(
+ array(''),
+ array('property'),
+ array(new StringObject('property')),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyValueExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyValueExceptionTest.php
new file mode 100644
index 0000000..e8e205b
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyValueExceptionTest.php
@@ -0,0 +1,39 @@
+getTestInstance('', '', $value);
+ if ($value !== null) {
+ self::assertEquals($value, $instance->getValue());
+ } else {
+ self::assertNull($instance->getValue());
+ }
+ }
+
+ public function validValueDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array('value'),
+ array(array('test')),
+ array(new \stdClass()),
+ array(new \DateTime()),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyValueTypeExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyValueTypeExceptionTest.php
new file mode 100644
index 0000000..db74b3e
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidPropertyValueTypeExceptionTest.php
@@ -0,0 +1,49 @@
+getTestInstance('', '', $value);
+ self::assertEquals($type, $instance->getType());
+ }
+
+ public function validTypeDataProvider()
+ {
+ return array(
+ array(null, 'null'),
+ array('', 'string'),
+ array('value', 'string'),
+ array(array('test'), 'array'),
+ array(new \stdClass(), 'stdClass'),
+ array(new \DateTime(), 'DateTime'),
+ array(new InvalidPropertyException(), 'YooKassa\\Common\\Exceptions\\InvalidPropertyException'),
+ array(fopen(__FILE__, 'r'), 'resource'),
+ array(true, 'boolean'),
+ array(false, 'boolean'),
+ array(0, 'integer'),
+ array(0.01, 'double'),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidRequestExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidRequestExceptionTest.php
new file mode 100644
index 0000000..c1e2baa
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/InvalidRequestExceptionTest.php
@@ -0,0 +1,39 @@
+getRequestObject());
+ $message = 'Failed to build request "' . get_class($requestObject) . '": ""';
+ self::assertEquals($message, $instance->getMessage());
+ } else {
+ self::assertNull($instance->getRequestObject());
+ self::assertEquals($requestObject, $instance->getMessage());
+ }
+ }
+
+ public function requestObjectDataProvider()
+ {
+ return array(
+ array(''),
+ array('test'),
+ array(new PaymentsRequest()),
+ array(new CreatePaymentRequest()),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/JsonExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/JsonExceptionTest.php
new file mode 100644
index 0000000..ecf11b5
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/JsonExceptionTest.php
@@ -0,0 +1,36 @@
+getMessage());
+ }
+
+ public function messageDataProvider()
+ {
+ $result = array();
+ foreach (JsonException::$errorLabels as $code => $message) {
+ $result[] = array($message, $code);
+ }
+ $result[] = array('Test error', -1);
+ return $result;
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/NotFoundExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/NotFoundExceptionTest.php
new file mode 100644
index 0000000..978f7d4
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/NotFoundExceptionTest.php
@@ -0,0 +1,18 @@
+getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['description'])) {
+ self::assertEquals('', $instance->getMessage());
+ } else {
+ self::assertEquals($tmp['description'].'.', $instance->getMessage());
+ }
+ }
+
+ public function descriptionDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"description":"test"}'),
+ array('{"description":"У попа была собака"}'),
+ );
+ }
+
+ /**
+ * @dataProvider retryAfterDataProvider
+ * @param string $body
+ */
+ public function testRetryAfter($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['retry_after'])) {
+ self::assertNull($instance->retryAfter);
+ } else {
+ self::assertEquals($tmp['retry_after'], $instance->retryAfter);
+ }
+ }
+
+ public function retryAfterDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"retry_after":-20}'),
+ array('{"retry_after":123}'),
+ );
+ }
+
+ /**
+ * @dataProvider typeDataProvider
+ * @param string $body
+ */
+ public function testType($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+ $tmp = json_decode($body, true);
+ if (empty($tmp['type'])) {
+ self::assertNull($instance->type);
+ } else {
+ self::assertEquals($tmp['type'], $instance->type);
+ }
+ }
+
+ public function typeDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"type":"server_error"}'),
+ array('{"type":"error"}'),
+ );
+ }
+
+ /**
+ * @dataProvider messageDataProvider
+ * @param $body
+ */
+ public function testMessage($body)
+ {
+ $instance = $this->getTestInstance('', 0, array(), $body);
+
+ $tmp = json_decode($body, true);
+ $message = '';
+ if (!empty($tmp['description'])) {
+ $message = $tmp['description'].'.';
+ }
+ self::assertEquals($message, $instance->getMessage());
+
+ if (empty($tmp['retry_after'])) {
+ self::assertNull($instance->retryAfter);
+ } else {
+ self::assertEquals($tmp['retry_after'], $instance->retryAfter);
+ }
+ if (empty($tmp['type'])) {
+ self::assertNull($instance->type);
+ } else {
+ self::assertEquals($tmp['type'], $instance->type);
+ }
+ }
+
+ public function messageDataProvider()
+ {
+ return array(
+ array('{}'),
+ array('{"code":"server_error","description":"Internal server error"}'),
+ array('{"code":"server_error","description":"Invalid parameter value","parameter":"shop_id"}'),
+ array('{"code":"server_error","description":"Invalid parameter value","parameter":"shop_id","type":"test"}'),
+ array('{"code":"server_error","description":"Invalid parameter value","parameter":"shop_id","retry_after":333}'),
+ );
+ }
+
+ public function testExceptionCode()
+ {
+ $instance = $this->getTestInstance();
+ self::assertEquals($this->expectedHttpCode(), $instance->getCode());
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/TooManyRequestsExceptionTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/TooManyRequestsExceptionTest.php
new file mode 100644
index 0000000..54e9c9c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/Exceptions/TooManyRequestsExceptionTest.php
@@ -0,0 +1,18 @@
+isInterface());
+ if (version_compare('5.4', PHP_VERSION) < 0) {
+ self::assertTrue($reflection->isInternal());
+ } else {
+ self::assertTrue($reflection->isUserDefined());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/LoggerWrapperTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/LoggerWrapperTest.php
new file mode 100644
index 0000000..1aead0c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Common/LoggerWrapperTest.php
@@ -0,0 +1,125 @@
+log($level, $message, $context);
+ $expected = array($level, $message, $context);
+ self::assertEquals($expected, $wrapped->getLastLog());
+
+ $wrapped = new ArrayLogger();
+ $instance = new LoggerWrapper(function ($level, $message, $context) use($wrapped) {
+ $wrapped->log($level, $message, $context);
+ });
+ $instance->log($level, $message, $context);
+ $expected = array($level, $message, $context);
+ self::assertEquals($expected, $wrapped->getLastLog());
+ }
+
+ /**
+ * @dataProvider validLoggerDataProvider
+ * @param string $notUsed
+ * @param string $message
+ * @param array $context
+ */
+ public function testLogMethods($notUsed, $message, $context)
+ {
+ $methodsMap = array(
+ LogLevel::EMERGENCY => 'emergency',
+ LogLevel::ALERT => 'alert',
+ LogLevel::CRITICAL => 'critical',
+ LogLevel::ERROR => 'error',
+ LogLevel::WARNING => 'warning',
+ LogLevel::NOTICE => 'notice',
+ LogLevel::INFO => 'info',
+ LogLevel::DEBUG => 'debug',
+ );
+
+ $wrapped = new ArrayLogger();
+ $instance = new LoggerWrapper($wrapped);
+ foreach ($methodsMap as $level => $method) {
+ $instance->{$method} ($message, $context);
+ $expected = array($level, $message, $context);
+ self::assertEquals($expected, $wrapped->getLastLog());
+ }
+ }
+
+ public function validLoggerDataProvider()
+ {
+ return array(
+ array(LogLevel::EMERGENCY, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::ALERT, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::CRITICAL, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::ERROR, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::WARNING, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::NOTICE, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::INFO, Random::str(10, 20), array(Random::str(10, 20))),
+ array(LogLevel::DEBUG, Random::str(10, 20), array(Random::str(10, 20))),
+ );
+ }
+}
+
+class ArrayLogger
+{
+ private $lastLog;
+
+ public function log($level, $message, $context)
+ {
+ $this->lastLog = array($level, $message, $context);
+ }
+
+ public function getLastLog()
+ {
+ return $this->lastLog;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/Config/ConfigurationLoaderTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/Config/ConfigurationLoaderTest.php
new file mode 100644
index 0000000..9a5b19c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/Config/ConfigurationLoaderTest.php
@@ -0,0 +1,33 @@
+load($fileName);
+ if (empty($fileName)) {
+ $fileName = __DIR__ . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "lib" . DIRECTORY_SEPARATOR . "configuration.json";
+ }
+ $data = file_get_contents($fileName);
+ self::assertEquals(json_decode($data, true), $loader->getConfig());
+ }
+
+ public function validDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(__DIR__ . DIRECTORY_SEPARATOR . 'test_config.json'),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/Config/test_config.json b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/Config/test_config.json
new file mode 100644
index 0000000..ea33874
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/Config/test_config.json
@@ -0,0 +1,4 @@
+{
+ "test":"test",
+ "array":[1,2,3,4]
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/RandomTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/RandomTest.php
new file mode 100644
index 0000000..eba7992
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/RandomTest.php
@@ -0,0 +1,192 @@
+assertEquals($expected, RawHeadersParser::parse($rawHeaders));
+ }
+
+ public function headersDataProvider()
+ {
+ return array(
+ array(
+ 'Server: nginx
+ Date: Thu, 03 Dec 2020 16:04:35 GMT
+ Content-Type: text/html
+ Content-Length: 178
+ Connection: keep-alive
+ Location: https://yoomoney.ru/',
+ array(
+ 'Server' => 'nginx',
+ 'Date' => 'Thu, 03 Dec 2020 16:04:35 GMT',
+ 'Content-Type' => 'text/html',
+ 'Content-Length' => '178',
+ 'Connection' => 'keep-alive',
+ 'Location' => 'https://yoomoney.ru/'
+ ),
+ ),
+ array(
+ "HTTP/1.1 200 Ok\r\n" .
+ "Server: nginx\r\n" .
+ "Date: Thu, 03 Dec 2020 16:04:35 GMT\r\n" .
+ "Content-Type: text/html\r\n" .
+ "Content-Length: 178\r\n" .
+ "Array-Header: value1\r\n" .
+ "Connection: keep-alive\r\n" .
+ "Array-Header: value2\r\n" .
+ "Location: https://yoomoney.ru/\r\n" .
+ "\r\n" .
+ "Content-Length: 132",
+ array(
+ 0 => 'HTTP/1.1 200 Ok',
+ 'Server' => 'nginx',
+ 'Date' => 'Thu, 03 Dec 2020 16:04:35 GMT',
+ 'Content-Type' => 'text/html',
+ 'Content-Length' => '178',
+ 'Array-Header' => array(
+ 'value1', 'value2'
+ ),
+ 'Connection' => 'keep-alive',
+ 'Location' => 'https://yoomoney.ru/'
+ ),
+ ),
+ array(
+ "HTTP/1.1 200 Ok\r\n" .
+ "Server: nginx\r\n" .
+ "\tversion 1.3.4\r\n" .
+ "Date: Thu, 03 Dec 2020 16:04:35 GMT\r\n" .
+ "Content-Type: text/html\r\n" .
+ "Content-Length: 178\r\n" .
+ "Array-Header: value1\r\n" .
+ "Connection: keep-alive\r\n" .
+ "Array-Header: value2\r\n" .
+ "Location: https://yoomoney.ru/\r\n" .
+ "Array-Header: value3\r\n" .
+ "\r\n" .
+ "Content-Length: 132",
+ array(
+ 0 => 'HTTP/1.1 200 Ok',
+ 'Server' => "nginx\r\n\tversion 1.3.4",
+ 'Date' => 'Thu, 03 Dec 2020 16:04:35 GMT',
+ 'Content-Type' => 'text/html',
+ 'Content-Length' => '178',
+ 'Array-Header' => array(
+ 'value1', 'value2', 'value3',
+ ),
+ 'Connection' => 'keep-alive',
+ 'Location' => 'https://yoomoney.ru/'
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/StringObjectTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/StringObjectTest.php
new file mode 100644
index 0000000..7277b7d
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/StringObjectTest.php
@@ -0,0 +1,27 @@
+__toString());
+ }
+
+ public function dataProvider()
+ {
+ return array(
+ array(''),
+ array('value'),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/TypeCastTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/TypeCastTest.php
new file mode 100644
index 0000000..adb84ae
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/TypeCastTest.php
@@ -0,0 +1,151 @@
+getTimestamp(), $instance->getTimestamp());
+ self::assertNotSame($value, $instance);
+ } else {
+ self::assertEquals($expected, $instance->getTimestamp());
+ }
+ } else {
+ self::assertNull($instance);
+ }
+ }
+
+ public function canCastToStringDataProvider()
+ {
+ return array(
+ array('', true),
+ array('test_string', true),
+ array(0, true),
+ array(1, true),
+ array(-1, true),
+ array(0.0, true),
+ array(-0.001, true),
+ array(0.001, true),
+ array(true, false),
+ array(false, false),
+ array(null, false),
+ array(array(), false),
+ array(new \stdClass(), false),
+ array(fopen(__FILE__, 'r'), false),
+ array(new StringObject('test'), true),
+ );
+ }
+
+ public function canCastToEnumStringDataProvider()
+ {
+ return array(
+ array('', false),
+ array('test_string', true),
+ array(0, false),
+ array(1, false),
+ array(-1, false),
+ array(0.0, false),
+ array(-0.001, false),
+ array(0.001, false),
+ array(true, false),
+ array(false, false),
+ array(null, false),
+ array(array(), false),
+ array(new \stdClass(), false),
+ array(fopen(__FILE__, 'r'), false),
+ array(new StringObject('test'), true),
+ );
+ }
+
+ public function canCastToDateTimeDataProvider()
+ {
+ return array(
+ array('', false),
+ array('test_string', true),
+ array(0, true),
+ array(1, true),
+ array(-1, false),
+ array(0.0, true),
+ array(-0.001, false),
+ array(0.001, true),
+ array(true, false),
+ array(false, false),
+ array(null, false),
+ array(array(), false),
+ array(new \stdClass(), false),
+ array(fopen(__FILE__, 'r'), false),
+ array(new StringObject('test'), true),
+ array(new \DateTime(), true),
+ );
+ }
+
+ public function castToDateTimeDataProvider()
+ {
+ $result = array();
+
+ $time = time();
+ $result[] = array($time, $time, true);
+ $result[] = array(date(DATE_ATOM, $time), $time, true);
+ $result[] = array(new \DateTime(date(DATE_ATOM, $time)), $time, true);
+ $result[] = array('3234-234-23', $time, false);
+ $result[] = array(array(), $time, false);
+
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/UUIDTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/UUIDTest.php
new file mode 100644
index 0000000..5f34d3d
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Helpers/UUIDTest.php
@@ -0,0 +1,16 @@
+notEmpty());
+
+ $airline->setBookingReference($data['booking_reference']);
+ $airline->setTicketNumber($data['ticket_number']);
+ $airline->setPassengers($data['passengers']);
+ $airline->setLegs($data['legs']);
+
+ self::assertEquals($airline->getBookingReference(), $data['booking_reference']);
+ self::assertEquals($airline->getTicketNumber(), $data['ticket_number']);
+ self::assertTrue(is_array($airline->getPassengers()));
+ self::assertTrue(is_array($airline->getLegs()));
+
+ foreach ($airline->getLegs() as $leg) {
+ self::assertTrue($leg instanceof LegInterface);
+ }
+
+ foreach ($airline->getPassengers() as $passenger) {
+ self::assertTrue($passenger instanceof PassengerInterface);
+ }
+
+ self::assertTrue($airline->notEmpty());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $data
+ */
+ public function testFromArrayInstantiate($data)
+ {
+ $airline = new Airline();
+ $airline->fromArray($data);
+
+ self::assertEquals($airline->getBookingReference(), $data['booking_reference']);
+ self::assertEquals($airline->getTicketNumber(), $data['ticket_number']);
+ self::assertTrue(is_array($airline->getPassengers()));
+ self::assertTrue(is_array($airline->getLegs()));
+
+ foreach ($airline->getLegs() as $leg) {
+ self::assertTrue($leg instanceof LegInterface);
+ }
+
+ foreach ($airline->getPassengers() as $passenger) {
+ self::assertTrue($passenger instanceof PassengerInterface);
+ }
+
+ self::assertTrue($airline->notEmpty());
+ }
+
+
+ /**
+ * @dataProvider exceptionDataProvider
+ */
+ public function testAirlinePassengersDataValidate($data)
+ {
+ $airline = new Airline();
+
+ $this->setExpectedException($data['exception']);
+
+ $airline->setPassengers($data['value']);
+ }
+
+ /**
+ * @dataProvider exceptionDataProvider
+ */
+ public function testAirlineLegsDataValidate($data)
+ {
+ $airline = new Airline();
+
+ $this->setExpectedException($data['exception']);
+
+ $airline->setLegs($data['value']);
+ }
+
+ /**
+ * @dataProvider stringsExceptionDataProvider
+ */
+ public function testBookingReferenceValidate($data)
+ {
+ $airline = new Airline();
+
+ $this->setExpectedException($data['exception']);
+
+ $airline->setBookingReference($data['value']);
+ }
+
+ /**
+ * @dataProvider stringsExceptionDataProvider
+ */
+ public function testTicketNumberValidate($data)
+ {
+ $airline = new Airline();
+
+ $this->setExpectedException($data['exception']);
+
+ $airline->setTicketNumber($data['value']);
+ }
+
+ public function validDataProvider()
+ {
+ $passenger = new Passenger();
+ $passenger->setFirstName("SERGEI");
+ $passenger->setLastName("IVANOV");
+
+ $leg = new Leg();
+ $leg->setDepartureAirport('LED');
+ $leg->setDestinationAirport("AMS");
+ $leg->setDepartureDate("2018-06-20");
+
+ return array(
+ array(
+ array(
+ "booking_reference" => "IIIKRV",
+ "ticket_number" => '12342123413',
+ "passengers" => array(
+ array(
+ "first_name" => "SERGEI",
+ "last_name" => "IVANOV",
+ ),
+ ),
+ "legs" => array(
+ array(
+ "departure_airport" => "LED",
+ "destination_airport" => "AMS",
+ "departure_date" => "2018-06-20",
+ ),
+ ),
+ ),
+ ),
+ array(
+ array(
+ "booking_reference" => "",
+ "ticket_number" => '',
+ "passengers" => array(
+ $passenger,
+ ),
+ "legs" => array(
+ $leg,
+ ),
+ ),
+ ),
+ );
+ }
+
+ public function exceptionDataProvider()
+ {
+ return array(
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\EmptyPropertyValueException',
+ "value" => '',
+ ),
+ ),
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\EmptyPropertyValueException',
+ "value" => null,
+ ),
+ ),
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\InvalidPropertyValueTypeException',
+ "value" => new \stdClass(),
+ ),
+ ),
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\InvalidPropertyValueTypeException',
+ "value" => array(1, 2, 3),
+ ),
+ ),
+ );
+ }
+
+ public function stringsExceptionDataProvider()
+ {
+ return array(
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\InvalidPropertyValueTypeException',
+ "value" => array(),
+ ),
+ ),
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\InvalidPropertyValueException',
+ "value" => 'stringThatGreaterThanNeededCharsLongAndActuallyNotValidAtAll123',
+ ),
+ ),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php
new file mode 100644
index 0000000..cff3ff3
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/AuthorizationDetailsTest.php
@@ -0,0 +1,152 @@
+getRrn());
+ self::assertEquals($authCode, $instance->getAuthCode());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $rrn
+ * @param $authCode
+ */
+ public function testGetSetRrn($rrn = null, $authCode = null)
+ {
+ $instance = self::getInstance($rrn, $authCode);
+ self::assertEquals($rrn, $instance->getRrn());
+
+ $instance = self::getInstance();
+ $instance->setRrn($rrn);
+ self::assertEquals($rrn, $instance->getRrn());
+ self::assertEquals($rrn, $instance->rrn);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param null $rrn
+ * @param null $authCode
+ */
+ public function testGetSetAuthCode($rrn = null, $authCode = null)
+ {
+ $instance = self::getInstance($rrn, $authCode);
+ self::assertEquals($authCode, $instance->getAuthCode());
+
+ $instance = self::getInstance();
+ $instance->setAuthCode($authCode);
+ self::assertEquals($authCode, $instance->getAuthCode());
+ self::assertEquals($authCode, $instance->authCode);
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetInvalidRrn($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setRrn($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetterInvalidAuthCode($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setAuthCode($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ 'rrn' => null,
+ 'authCode' => null,
+ ),
+ array(
+ 'rrn' => '',
+ 'authCode' => '',
+ ),
+ array(
+ 'rrn' => Random::str(32),
+ 'authCode' => Random::str(32),
+ ),
+ );
+
+ return $result;
+ }
+
+ 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(true, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(false, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param null $rrn
+ * @param null $authCode
+ */
+ public function testJsonSerialize($rrn = null, $authCode = null)
+ {
+ $instance = new AuthorizationDetails($rrn, $authCode);
+ $expected = array(
+ 'rrn' => $rrn,
+ 'auth_code' => $authCode,
+ );
+ self::assertEquals($expected, $instance->jsonSerialize());
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/CancellationDetailsTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/CancellationDetailsTest.php
new file mode 100644
index 0000000..ae7cadc
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/CancellationDetailsTest.php
@@ -0,0 +1,148 @@
+getParty());
+ self::assertEquals($reason, $instance->getReason());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $party
+ * @param $reason
+ */
+ public function testGetSetParty($party = null, $reason = null)
+ {
+ $instance = self::getInstance($party, $reason);
+ self::assertEquals($party, $instance->getParty());
+
+ $instance = self::getInstance();
+ $instance->setParty($party);
+ self::assertEquals($party, $instance->getParty());
+ self::assertEquals($party, $instance->party);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param null $party
+ * @param null $reason
+ */
+ public function testGetSetReason($party = null, $reason = null)
+ {
+ $instance = self::getInstance($party, $reason);
+ self::assertEquals($reason, $instance->getReason());
+
+ $instance = self::getInstance();
+ $instance->setReason($reason);
+ self::assertEquals($reason, $instance->getReason());
+ self::assertEquals($reason, $instance->reason);
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetInvalidParty($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setParty($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetterInvalidReason($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->reason = $value;
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ $cancellationDetailsParties = CancellationDetailsPartyCode::getValidValues();
+ $countCancellationDetailsParties = count($cancellationDetailsParties);
+ $cancellationDetailsReasons = CancellationDetailsReasonCode::getValidValues();
+ $countCancellationDetailsReasons = count($cancellationDetailsReasons);
+ for ($i = 0; $i < 20; $i++) {
+ $result[] = array(
+ 'party' => $cancellationDetailsParties[$i % $countCancellationDetailsParties],
+ 'reason' => $cancellationDetailsReasons[$i % $countCancellationDetailsReasons]
+ );
+ }
+ return $result;
+
+ }
+
+ public function invalidValueDataProvider()
+ {
+ $exceptionNamespace = 'YooKassa\\Common\\Exceptions\\';
+ return array(
+ array(null, $exceptionNamespace.'EmptyPropertyValueException'),
+ array('', $exceptionNamespace.'EmptyPropertyValueException'),
+ array(array(), $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(fopen(__FILE__, 'r'), $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(true, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(false, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param null $party
+ * @param null $reason
+ */
+ public function testJsonSerialize($party = null, $reason = null)
+ {
+ $instance = new CancellationDetails($party, $reason);
+ $expected = array(
+ 'party' => $party,
+ 'reason' => $reason,
+ );
+ self::assertEquals($expected, $instance->jsonSerialize());
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/AbstractConfirmationTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/AbstractConfirmationTest.php
new file mode 100644
index 0000000..e886f36
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/AbstractConfirmationTest.php
@@ -0,0 +1,63 @@
+getTestInstance();
+ self::assertEquals($this->getExpectedType(), $instance->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testInvalidType($value)
+ {
+ new TestConfirmation($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(40)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
+
+class TestConfirmation extends AbstractConfirmation
+{
+ public function __construct($type)
+ {
+ $this->_setType($type);
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationCodeVerificationTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationCodeVerificationTest.php
new file mode 100644
index 0000000..bc1c2d8
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationCodeVerificationTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+
+ self::assertNull($instance->getConfirmationToken());
+ self::assertNull($instance->confirmationToken);
+
+ $instance->setConfirmationToken($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationToken());
+ self::assertNull($instance->confirmationToken);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationToken());
+ self::assertEquals($value, $instance->confirmationToken);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->confirmationToken = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationToken());
+ self::assertNull($instance->confirmationToken);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationToken());
+ self::assertEquals($value, $instance->confirmationToken);
+ }
+ }
+
+ public function validConfirmationTokenDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array('ct-2454fc2d-000f-5000-9000-12a816bfbb35'),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationExternalTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationExternalTest.php
new file mode 100644
index 0000000..2849f31
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationExternalTest.php
@@ -0,0 +1,26 @@
+getTestInstance();
+ $confirmation = $instance->factory($type);
+ self::assertNotNull($confirmation);
+ self::assertTrue($confirmation instanceof AbstractConfirmation);
+ self::assertEquals($type, $confirmation->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $type
+ */
+ public function testInvalidFactory($type)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factory($type);
+ }
+
+ /**
+ * @dataProvider validArrayDataProvider
+ * @param array $options
+ */
+ public function testFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $confirmation = $instance->factoryFromArray($options);
+ self::assertNotNull($confirmation);
+ self::assertTrue($confirmation instanceof AbstractConfirmation);
+
+ foreach ($options as $property => $value) {
+ self::assertEquals($confirmation->{$property}, $value);
+ }
+
+ $type = $options['type'];
+ unset($options['type']);
+ $confirmation = $instance->factoryFromArray($options, $type);
+ self::assertNotNull($confirmation);
+ self::assertTrue($confirmation instanceof AbstractConfirmation);
+
+ self::assertEquals($type, $confirmation->getType());
+ foreach ($options as $property => $value) {
+ self::assertEquals($confirmation->{$property}, $value);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataArrayDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $options
+ */
+ public function testInvalidFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factoryFromArray($options);
+ }
+
+ public function validTypeDataProvider()
+ {
+ $result = array();
+ foreach (ConfirmationType::getValidValues() as $value) {
+ $result[] = array($value);
+ }
+ return $result;
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ );
+ }
+
+ public function validArrayDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'enforce' => false,
+ 'returnUrl' => Random::str(10),
+ 'confirmationUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'enforce' => true,
+ 'returnUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'returnUrl' => Random::str(10),
+ 'confirmationUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmationUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'returnUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'enforce' => true,
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::QR,
+ 'confirmation_data' => Random::str(30),
+ ),
+ ),
+ );
+ foreach (ConfirmationType::getValidValues() as $value) {
+ $result[] = array(array('type' => $value));
+ }
+ return $result;
+ }
+
+ public function invalidDataArrayDataProvider()
+ {
+ return array(
+ array(array()),
+ array(array('type' => 'test')),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationQrTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationQrTest.php
new file mode 100644
index 0000000..e86f831
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationQrTest.php
@@ -0,0 +1,152 @@
+getTestInstance();
+
+ self::assertNull($instance->getConfirmationData());
+ self::assertNull($instance->confirmationData);
+ self::assertNull($instance->confirmation_data);
+
+ $instance->setConfirmationData($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationData());
+ self::assertNull($instance->confirmationData);
+ self::assertNull($instance->confirmation_data);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationData());
+ self::assertEquals($value, $instance->confirmationData);
+ self::assertEquals($value, $instance->confirmation_data);
+ }
+
+ $instance->setConfirmationData(null);
+ self::assertNull($instance->getConfirmationData());
+ self::assertNull($instance->confirmationData);
+ self::assertNull($instance->confirmation_data);
+
+ $instance->confirmationData = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationData());
+ self::assertNull($instance->confirmationData);
+ self::assertNull($instance->confirmation_data);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationData());
+ self::assertEquals($value, $instance->confirmationData);
+ self::assertEquals($value, $instance->confirmation_data);
+ }
+
+ $instance->confirmation_data = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationData());
+ self::assertNull($instance->confirmationData);
+ self::assertNull($instance->confirmation_data);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationData());
+ self::assertEquals($value, $instance->confirmationData);
+ self::assertEquals($value, $instance->confirmation_data);
+ }
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidConfirmationData($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setConfirmationData($value);
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidConfirmationData($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->confirmationData = $value;
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidConfirmation_data($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->confirmation_data = $value;
+ }
+
+ public function validEnforceDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(null),
+ array(''),
+ array(0),
+ array(1),
+ array(100),
+ );
+ }
+
+ public function invalidEnforceDataProvider()
+ {
+ return array(
+ array('true'),
+ array('false'),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function validUrlDataProvider()
+ {
+ return array(
+ array('wechat://pay/testurl?pr=xXxXxX'),
+ array('http://test.ru'),
+ array(null),
+ array(''),
+ );
+ }
+
+ public function invalidUrlDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationRedirectTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationRedirectTest.php
new file mode 100644
index 0000000..00a80b0
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Confirmation/ConfirmationRedirectTest.php
@@ -0,0 +1,288 @@
+getTestInstance();
+
+ self::assertNull($instance->getEnforce());
+ self::assertNull($instance->enforce);
+
+ $instance->setEnforce($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getEnforce());
+ self::assertNull($instance->enforce);
+ } else {
+ self::assertEquals((bool)$value, $instance->getEnforce());
+ self::assertEquals((bool)$value, $instance->enforce);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->enforce = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getEnforce());
+ self::assertNull($instance->enforce);
+ } else {
+ self::assertEquals((bool)$value, $instance->getEnforce());
+ self::assertEquals((bool)$value, $instance->enforce);
+ }
+ }
+
+ /**
+ * @dataProvider invalidEnforceDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidEnforce($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setEnforce($value);
+ }
+
+ /**
+ * @dataProvider invalidEnforceDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidEnforce($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->enforce = $value;
+ }
+
+ /**
+ * @dataProvider validUrlDataProvider
+ * @param $value
+ */
+ public function testGetSetReturnUrl($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+
+ $instance->setReturnUrl($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+ } else {
+ self::assertEquals($value, $instance->getReturnUrl());
+ self::assertEquals($value, $instance->returnUrl);
+ self::assertEquals($value, $instance->return_url);
+ }
+
+ $instance->setReturnUrl(null);
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+
+ $instance->returnUrl = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+ } else {
+ self::assertEquals($value, $instance->getReturnUrl());
+ self::assertEquals($value, $instance->returnUrl);
+ self::assertEquals($value, $instance->return_url);
+ }
+
+ $instance->return_url = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+ } else {
+ self::assertEquals($value, $instance->getReturnUrl());
+ self::assertEquals($value, $instance->returnUrl);
+ self::assertEquals($value, $instance->return_url);
+ }
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidReturnUrl($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setReturnUrl($value);
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReturnUrl($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->returnUrl = $value;
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReturn_url($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->return_url = $value;
+ }
+
+ /**
+ * @dataProvider validUrlDataProvider
+ * @param $value
+ */
+ public function testGetSetConfirmationUrl($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getConfirmationUrl());
+ self::assertNull($instance->confirmationUrl);
+ self::assertNull($instance->confirmation_url);
+
+ $instance->setConfirmationUrl($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationUrl());
+ self::assertNull($instance->confirmationUrl);
+ self::assertNull($instance->confirmation_url);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationUrl());
+ self::assertEquals($value, $instance->confirmationUrl);
+ self::assertEquals($value, $instance->confirmation_url);
+ }
+
+ $instance->setConfirmationUrl(null);
+ self::assertNull($instance->getConfirmationUrl());
+ self::assertNull($instance->confirmationUrl);
+ self::assertNull($instance->confirmation_url);
+
+ $instance->confirmationUrl = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationUrl());
+ self::assertNull($instance->confirmationUrl);
+ self::assertNull($instance->confirmation_url);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationUrl());
+ self::assertEquals($value, $instance->confirmationUrl);
+ self::assertEquals($value, $instance->confirmation_url);
+ }
+
+ $instance->confirmation_url = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getConfirmationUrl());
+ self::assertNull($instance->confirmationUrl);
+ self::assertNull($instance->confirmation_url);
+ } else {
+ self::assertEquals($value, $instance->getConfirmationUrl());
+ self::assertEquals($value, $instance->confirmationUrl);
+ self::assertEquals($value, $instance->confirmation_url);
+ }
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidConfirmationUrl($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setConfirmationUrl($value);
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidConfirmationUrl($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->confirmationUrl = $value;
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidConfirmation_url($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->confirmation_url = $value;
+ }
+
+ public function validEnforceDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(null),
+ array(''),
+ array(0),
+ array(1),
+ array(100),
+ );
+ }
+
+ public function invalidEnforceDataProvider()
+ {
+ return array(
+ array('true'),
+ array('false'),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function validUrlDataProvider()
+ {
+ return array(
+ array('http://test.ru'),
+ array(null),
+ array(''),
+ );
+ }
+
+ public function invalidUrlDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/AbstractConfirmationAttributesTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/AbstractConfirmationAttributesTest.php
new file mode 100644
index 0000000..e5f7e4f
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/AbstractConfirmationAttributesTest.php
@@ -0,0 +1,122 @@
+getTestInstance();
+ self::assertEquals($this->getExpectedType(), $instance->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testInvalidType($value)
+ {
+ new TestConfirmation($value);
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(40)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+
+ /**
+ * @dataProvider validLocaleDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterLocale($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setLocale($value);
+ self::assertEquals((string)$value, $instance->getLocale());
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validLocaleDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(
+ Random::str(2, 2, 'abcdefghijklmnopqrtuvwxyz')
+ . '_' .
+ Random::str(2, 2, 'ABCDEFGHIJKLMNOPQRTUVWXYZ')
+ ),
+ array('ru_RU'),
+ array('en_US'),
+ );
+ }
+
+ /**
+ * @dataProvider invalidLocaleDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidLocale($value)
+ {
+ $this->getTestInstance()->setLocale($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidLocaleDataProvider()
+ {
+ return array(
+ array(Random::str(4)),
+ array(Random::str(6)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ array(
+ Random::str(2, 2, 'ABCDEFGHIJKLMNOPQRTUVWXYZ')
+ . '_' .
+ Random::str(2, 2, 'abcdefghijklmnopqrtuvwxyz')
+ ),
+ );
+ }
+}
+
+class TestConfirmation extends AbstractConfirmationAttributes
+{
+ public function __construct($type)
+ {
+ $this->_setType($type);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerificationTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerificationTest.php
new file mode 100644
index 0000000..9156f4f
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/ConfirmationAttributesCodeVerificationTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+ $confirmation = $instance->factory($type);
+ self::assertNotNull($confirmation);
+ self::assertTrue($confirmation instanceof AbstractConfirmationAttributes);
+ self::assertEquals($type, $confirmation->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $type
+ */
+ public function testInvalidFactory($type)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factory($type);
+ }
+
+ /**
+ * @dataProvider validArrayDataProvider
+ * @param array $options
+ */
+ public function testFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $confirmation = $instance->factoryFromArray($options);
+ self::assertNotNull($confirmation);
+ self::assertTrue($confirmation instanceof AbstractConfirmationAttributes);
+
+ foreach ($options as $property => $value) {
+ self::assertEquals($confirmation->{$property}, $value);
+ }
+
+ $type = $options['type'];
+ unset($options['type']);
+ $confirmation = $instance->factoryFromArray($options, $type);
+ self::assertNotNull($confirmation);
+ self::assertTrue($confirmation instanceof AbstractConfirmationAttributes);
+
+ self::assertEquals($type, $confirmation->getType());
+ foreach ($options as $property => $value) {
+ self::assertEquals($confirmation->{$property}, $value);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataArrayDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $options
+ */
+ public function testInvalidFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factoryFromArray($options);
+ }
+
+ public function validTypeDataProvider()
+ {
+ $result = array();
+ foreach (ConfirmationType::getValidValues() as $value) {
+ $result[] = array($value);
+ }
+ return $result;
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ );
+ }
+
+ public function validArrayDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'enforce' => false,
+ 'returnUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'enforce' => true,
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'returnUrl' => Random::str(10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ ),
+ ),
+ );
+ foreach (ConfirmationType::getValidValues() as $value) {
+ $result[] = array(array('type' => $value));
+ }
+ return $result;
+ }
+
+ public function invalidDataArrayDataProvider()
+ {
+ return array(
+ array(array()),
+ array(array('type' => 'test')),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/ConfirmationAttributesQrTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/ConfirmationAttributesQrTest.php
new file mode 100644
index 0000000..61178b0
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ConfirmationAttributes/ConfirmationAttributesQrTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+
+ self::assertNull($instance->getEnforce());
+ self::assertNull($instance->enforce);
+
+ $instance->setEnforce($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getEnforce());
+ self::assertNull($instance->enforce);
+ } else {
+ self::assertEquals((bool)$value, $instance->getEnforce());
+ self::assertEquals((bool)$value, $instance->enforce);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->enforce = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getEnforce());
+ self::assertNull($instance->enforce);
+ } else {
+ self::assertEquals((bool)$value, $instance->getEnforce());
+ self::assertEquals((bool)$value, $instance->enforce);
+ }
+ }
+
+ /**
+ * @dataProvider invalidEnforceDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidEnforce($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setEnforce($value);
+ }
+
+ /**
+ * @dataProvider invalidEnforceDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidEnforce($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->enforce = $value;
+ }
+
+ /**
+ * @dataProvider validUrlDataProvider
+ * @param $value
+ */
+ public function testGetSetReturnUrl($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+
+ $instance->setReturnUrl($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+ } else {
+ self::assertEquals($value, $instance->getReturnUrl());
+ self::assertEquals($value, $instance->returnUrl);
+ self::assertEquals($value, $instance->return_url);
+ }
+
+ $instance->setReturnUrl(null);
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+
+ $instance->returnUrl = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+ } else {
+ self::assertEquals($value, $instance->getReturnUrl());
+ self::assertEquals($value, $instance->returnUrl);
+ self::assertEquals($value, $instance->return_url);
+ }
+
+ $instance->setReturnUrl(null);
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+
+ $instance->return_url = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getReturnUrl());
+ self::assertNull($instance->returnUrl);
+ self::assertNull($instance->return_url);
+ } else {
+ self::assertEquals($value, $instance->getReturnUrl());
+ self::assertEquals($value, $instance->returnUrl);
+ self::assertEquals($value, $instance->return_url);
+ }
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidReturnUrl($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setReturnUrl($value);
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReturnUrl($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->returnUrl = $value;
+ }
+
+ /**
+ * @dataProvider invalidUrlDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReturn_url($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->return_url = $value;
+ }
+
+ public function validEnforceDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(null),
+ array(''),
+ array(0),
+ array(1),
+ array(100),
+ );
+ }
+
+ public function invalidEnforceDataProvider()
+ {
+ return array(
+ array('true'),
+ array('false'),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function validUrlDataProvider()
+ {
+ return array(
+ array('http://test.ru'),
+ array(null),
+ array(''),
+ );
+ }
+
+ public function invalidUrlDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/LegTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/LegTest.php
new file mode 100644
index 0000000..29e8592
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/LegTest.php
@@ -0,0 +1,109 @@
+setDepartureAirport($data["departure_airport"]);
+ $leg->setDestinationAirport($data["destination_airport"]);
+ $leg->setDepartureDate($data["departure_date"]);
+
+ self::assertEquals($data["departure_airport"], $leg->getDepartureAirport());
+ self::assertEquals($data["destination_airport"], $leg->getDestinationAirport());
+ self::assertEquals($data["departure_date"], $leg->getDepartureDate());
+
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ *
+ * @param $data
+ */
+ public function testDepartureAirportValidate($data)
+ {
+ $leg = new Leg();
+
+ $this->setExpectedException($data['exception']);
+
+ $leg->setDepartureAirport($data['value']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ *
+ * @param $data
+ */
+ public function testDestinationAirportValidate($data)
+ {
+ $leg = new Leg();
+
+ $this->setExpectedException($data['exception']);
+
+ $leg->setDestinationAirport($data['value']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ *
+ * @param $data
+ */
+ public function testDepartureDateValidate($data)
+ {
+ $leg = new Leg();
+
+ $this->setExpectedException($data['exception']);
+
+ $leg->setDepartureDate($data['value']);
+ }
+
+ public function validDataProvider()
+ {
+ return array(
+ array(
+ array(
+ "departure_airport" => "LED",
+ "destination_airport" => "AMS",
+ "departure_date" => "2018-06-20",
+ ),
+ ),
+ array(
+ array(
+ "departure_airport" => "UGR",
+ "destination_airport" => "IVA",
+ "departure_date" => "2018-06-21",
+ ),
+ ),
+ );
+ }
+
+ public function invalidDataProvider()
+ {
+ return array(
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\InvalidPropertyValueTypeException',
+ "value" => array(),
+ ),
+ ),
+ array(
+ array(
+ "exception" => 'YooKassa\Common\Exceptions\InvalidPropertyValueException',
+ "value" => 'stringThatGreaterThanNeededCharsLongAndActuallyNotValidAtAll123',
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/MetadataTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/MetadataTest.php
new file mode 100644
index 0000000..e1103a2
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/MetadataTest.php
@@ -0,0 +1,89 @@
+ $value) {
+ $instance->offsetSet($key, $value);
+ }
+ self::assertEquals($source, $instance->toArray());
+ }
+
+ /**
+ * @dataProvider dataProvider
+ * @param array $source
+ */
+ public function testCount($source)
+ {
+ $instance = new Metadata();
+ $count = 0;
+ self::assertEquals($count, $instance->count());
+ foreach ($source as $key => $value) {
+ $instance->offsetSet($key, $value);
+ $count++;
+ self::assertEquals($count, $instance->count());
+ }
+ }
+
+ /**
+ * @dataProvider dataProvider
+ * @param array $source
+ */
+ public function testGetIterator($source)
+ {
+ $instance = new Metadata();
+ foreach ($source as $key => $value) {
+ $instance->offsetSet($key, $value);
+ }
+
+ $iterator = $instance->getIterator();
+ $tmp = $source;
+ for ($iterator->rewind(); $iterator->valid(); $iterator->next()) {
+ self::assertArrayHasKey($iterator->key(), $source);
+ self::assertEquals($source[$iterator->key()], $iterator->current());
+ unset($tmp[$iterator->key()]);
+ }
+ self::assertEquals(0, count($tmp));
+
+ $tmp = $source;
+ foreach ($instance as $key => $value) {
+ self::assertArrayHasKey($key, $source);
+ self::assertEquals($source[$key], $value);
+ unset($tmp[$key]);
+ }
+ self::assertEquals(0, count($tmp));
+ }
+
+ public function dataProvider()
+ {
+ return array(
+ array(
+ array('testKey' => 'testValue'),
+ ),
+ array(
+ array(
+ 'testKey1' => 'testValue1',
+ 'testKey2' => 'testValue2',
+ ),
+ ),
+ array(
+ array(
+ 'testKey1' => 'testValue1',
+ 'testKey2' => 'testValue2',
+ 'testKey3' => 'testValue3',
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/MonetaryAmountTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/MonetaryAmountTest.php
new file mode 100644
index 0000000..b973db5
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/MonetaryAmountTest.php
@@ -0,0 +1,335 @@
+getValue());
+ self::assertEquals(self::DEFAULT_CURRENCY, $instance->getCurrency());
+
+ $instance = new MonetaryAmount($value, $currency);
+
+ self::assertEquals(number_format($value, 2, '.', ''), $instance->getValue());
+ self::assertEquals(strtoupper($currency), $instance->getCurrency());
+ }
+
+ /**
+ * @dataProvider validValueDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetValue($value)
+ {
+ $expected = number_format($value, 2, '.', '');
+
+ $instance = self::getInstance();
+ self::assertEquals(self::DEFAULT_VALUE, $instance->getValue());
+ self::assertEquals(self::DEFAULT_VALUE, $instance->value);
+ $instance->setValue($value);
+ self::assertEquals($expected, $instance->getValue());
+ self::assertEquals($expected, $instance->value);
+
+ $instance = self::getInstance();
+ $instance->value = $value;
+ self::assertEquals($expected, $instance->getValue());
+ self::assertEquals($expected, $instance->value);
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetInvalidValue($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setValue($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetterInvalidValue($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->value = $value;
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @dataProvider validCurrencyDataProvider
+ * @param string $currency
+ */
+ public function testGetSetCurrency($currency)
+ {
+ $instance = self::getInstance();
+
+ self::assertEquals(self::DEFAULT_CURRENCY, $instance->getCurrency());
+ self::assertEquals(self::DEFAULT_CURRENCY, $instance->currency);
+ $instance->setCurrency($currency);
+ self::assertEquals(strtoupper($currency), $instance->getCurrency());
+ self::assertEquals(strtoupper($currency), $instance->currency);
+ }
+
+ /**
+ * @dataProvider invalidCurrencyDataProvider
+ * @param string $currency
+ * @param string $exceptionClassName
+ */
+ public function testSetInvalidCurrency($currency, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setCurrency($currency);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @dataProvider invalidCurrencyDataProvider
+ * @param string $currency
+ * @param string $exceptionClassName
+ */
+ public function testSetterInvalidCurrency($currency, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->currency = $currency;
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $result = $this->validValueDataProvider();
+ foreach ($this->validCurrencyDataProvider() as $index => $tmp) {
+ if (isset($result[$index])) {
+ $result[$index][] = $tmp[0];
+ }
+ }
+ return $result;
+ }
+
+ public function validValueDataProvider()
+ {
+ $result = array(
+ array(0.01),
+ array(0.1),
+ array(0.11),
+ array(0.1111),
+ array(0.1166),
+ array('0.01'),
+ array(1),
+ array('1'),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::float(0, 9999999));
+ }
+ return $result;
+ }
+
+ public function validCurrencyDataProvider()
+ {
+ $result = array();
+ foreach (CurrencyCode::getValidValues() as $value) {
+ $result[] = array($value);
+ $result[] = array(strtolower($value[0]) . $value[1] . $value[2]);
+ $result[] = array($value[0] . strtolower($value[1]) . $value[2]);
+ $result[] = array($value[0] . $value[1] . strtolower($value[2]));
+ $result[] = array(strtolower($value[0]) . strtolower($value[1]) . $value[2]);
+ $result[] = array(strtolower($value[0]) . $value[1] . strtolower($value[2]));
+ $result[] = array(strtolower($value));
+ }
+ return $result;
+ }
+
+ public function invalidValueDataProvider()
+ {
+ $exceptionNamespace = 'YooKassa\\Common\\Exceptions\\';
+ return array(
+ array(null, $exceptionNamespace . 'EmptyPropertyValueException'),
+ array('', $exceptionNamespace . 'EmptyPropertyValueException'),
+ array(array(), $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(fopen(__FILE__, 'r'), $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array('invalid_value', $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(-1, $exceptionNamespace . 'InvalidPropertyValueException'),
+ array(-0.01, $exceptionNamespace . 'InvalidPropertyValueException'),
+ array(0.0, $exceptionNamespace . 'InvalidPropertyValueException'),
+ array(0, $exceptionNamespace . 'InvalidPropertyValueException'),
+ array(0.001, $exceptionNamespace . 'InvalidPropertyValueException'),
+ array(true, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(false, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ );
+ }
+
+ public function invalidCurrencyDataProvider()
+ {
+ $exceptionNamespace = 'YooKassa\\Common\\Exceptions\\';
+ return array(
+ array(null, $exceptionNamespace . 'EmptyPropertyValueException'),
+ array('', $exceptionNamespace . 'EmptyPropertyValueException'),
+ array(array(), $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(fopen(__FILE__, 'r'), $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array('invalid_value', $exceptionNamespace . 'InvalidPropertyValueException'),
+ array('III', $exceptionNamespace . 'InvalidPropertyValueException'),
+ array(-0.01, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(0.0, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(0, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(0.01, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(true, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ array(false, $exceptionNamespace . 'InvalidPropertyValueTypeException'),
+ );
+ }
+
+ /**
+ * @dataProvider validMultiplyDataProvider
+ * @param $source
+ * @param $coefficient
+ * @param $expected
+ */
+ public function testMultiply($source, $coefficient, $expected)
+ {
+ $instance = new MonetaryAmount($source);
+ $instance->multiply($coefficient);
+ self::assertEquals($expected, $instance->getIntegerValue());
+ }
+
+ public function validMultiplyDataProvider()
+ {
+ return array(
+ array(1, 0.5, 50),
+ array(1.01, 0.5, 51),
+ array(1.00, 0.01, 1),
+ array(0.99, 0.01, 1),
+ );
+ }
+
+ /**
+ * @dataProvider invalidMultiplyDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $source
+ * @param $coefficient
+ */
+ public function testInvalidMultiply($source, $coefficient)
+ {
+ $instance = new MonetaryAmount($source);
+ $instance->multiply($coefficient);
+ }
+
+ public function invalidMultiplyDataProvider()
+ {
+ return array(
+ array(1, null),
+ array(1.01, ''),
+ array(1.00, true),
+ array(0.99, false),
+ array(0.99, array()),
+ array(0.99, new \stdClass()),
+ array(0.99, 'test'),
+ array(0.99, -1.0),
+ array(0.99, -0.0),
+ array(0.99, -0.00001),
+ array(0.99, 0.000001),
+ );
+ }
+
+ /**
+ * @dataProvider validIncreaseDataProvider
+ * @param $source
+ * @param $amount
+ * @param $expected
+ */
+ public function testIncrease($source, $amount, $expected)
+ {
+ $instance = new MonetaryAmount($source);
+ $instance->increase($amount);
+ self::assertEquals($expected, $instance->getIntegerValue());
+ }
+
+ public function validIncreaseDataProvider()
+ {
+ return array(
+ array(1, 0.5, 150),
+ array(1.01, -0.5, 51),
+ array(1.00, -0.001, 100),
+ array(0.99, 0.01, 100),
+ );
+ }
+
+ /**
+ * @dataProvider invalidIncreaseDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $source
+ * @param $amount
+ */
+ public function testInvalidIncrease($source, $amount)
+ {
+ $instance = new MonetaryAmount($source);
+ $instance->increase($amount);
+ }
+
+ public function invalidIncreaseDataProvider()
+ {
+ return array(
+ array(1, null),
+ array(1.01, ''),
+ array(1.00, true),
+ array(0.99, false),
+ array(0.99, array()),
+ array(0.99, new \stdClass()),
+ array(0.99, 'test'),
+ array(0.99, -1.0),
+ array(0.99, -0.99),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $value
+ * @param $currency
+ */
+ public function testJsonSerialize($value, $currency)
+ {
+ $instance = new MonetaryAmount($value, $currency);
+ $expected = array(
+ 'value' => number_format($value, 2, '.', ''),
+ 'currency' => strtoupper($currency),
+ );
+ self::assertEquals($expected, $instance->jsonSerialize());
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/AbstractNotificationTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/AbstractNotificationTest.php
new file mode 100644
index 0000000..b6a01a6
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/AbstractNotificationTest.php
@@ -0,0 +1,146 @@
+getTestInstance($value);
+ self::assertEquals($this->getExpectedType(), $instance->getType());
+ }
+
+ /**
+ * @dataProvider invalidConstructorTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param array $source
+ */
+ public function testInvalidTypeInConstructor(array $source)
+ {
+ $this->getTestInstance($source);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $value
+ */
+ public function testGetEvent(array $value)
+ {
+ $instance = $this->getTestInstance($value);
+ self::assertEquals($this->getExpectedEvent(), $instance->getEvent());
+ }
+
+ /**
+ * @dataProvider invalidConstructorEventDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param array $source
+ */
+ public function testInvalidEventInConstructor(array $source)
+ {
+ $this->getTestInstance($source);
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testInvalidType($value)
+ {
+ new TestNotification($value, $this->getExpectedEvent());
+ }
+
+ /**
+ * @dataProvider invalidEventDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testInvalidEvent($value)
+ {
+ new TestNotification($this->getExpectedType(), $value);
+ }
+
+ public function invalidConstructorTypeDataProvider()
+ {
+ return array(
+ array(array('event' => $this->getExpectedEvent(), 'type' => 'test')),
+ array(array('event' => $this->getExpectedEvent(), 'type' => null)),
+ array(array('event' => $this->getExpectedEvent(), 'type' => '')),
+ array(array('event' => $this->getExpectedEvent(), 'type' => 1)),
+ array(array('event' => $this->getExpectedEvent(), 'type' => array())),
+ );
+ }
+
+ public function invalidConstructorEventDataProvider()
+ {
+ return array(
+ array(array('type' => $this->getExpectedType(), 'event' => 'test')),
+ array(array('type' => $this->getExpectedType(), 'event' => null)),
+ array(array('type' => $this->getExpectedType(), 'event' => '')),
+ array(array('type' => $this->getExpectedType(), 'event' => 1)),
+ array(array('type' => $this->getExpectedType(), 'event' => array())),
+ );
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(40)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidEventDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(40)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
+
+class TestNotification extends AbstractNotification
+{
+ public function __construct($type, $event)
+ {
+ $this->_setType($type);
+ $this->_setEvent($event);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationCanceledTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationCanceledTest.php
new file mode 100644
index 0000000..b60ffc3
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationCanceledTest.php
@@ -0,0 +1,117 @@
+getTestInstance($value);
+ self::assertTrue($instance->getObject() instanceof PaymentInterface);
+ self::assertEquals($value['object']['id'], $instance->getObject()->getId());
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ $statuses = PaymentStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ $confirmations = array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ 'return_url' => Random::str(10),
+ 'enforce' => false,
+ ),
+ array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ );
+
+ for ($i = 0; $i < 10; $i++) {
+ $payment = array(
+ 'id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'recipient' => array(
+ 'account_id' => Random::str(1, 64, '0123456789'),
+ 'gateway_id' => Random::str(1, 256),
+ ),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'captured_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'confirmation' => Random::value($confirmations),
+ 'refunded' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'paid' => $i % 2 ? true : false,
+ 'refundable' => $i % 2 ? true : false,
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'metadata' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::str(1, 256),
+ ),
+ );
+ $result[] = array(
+ array(
+ 'type' => $this->getExpectedType(),
+ 'event' => $this->getExpectedEvent(),
+ 'object' => $payment,
+ ),
+ );
+ }
+ return $result;
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationFactoryTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationFactoryTest.php
new file mode 100644
index 0000000..eafff55
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationFactoryTest.php
@@ -0,0 +1,214 @@
+getTestInstance();
+ $instance->factory($options);
+ }
+
+ /**
+ * @dataProvider validArrayDataProvider
+ * @param array $options
+ */
+ public function testFactory($options)
+ {
+ $instance = $this->getTestInstance();
+ $event = $options['event'];
+ $notification = $instance->factory($options);
+ self::assertNotNull($notification);
+ self::assertTrue($notification instanceof AbstractNotification);
+
+ self::assertEquals($event, $notification->getEvent());
+ foreach ($options as $property => $value) {
+ if ($property !== 'object') {
+ self::assertEquals($notification->{$property}, $value);
+ } else {
+ $this->assertObject($event, $notification->{$property}, $value);
+ }
+ }
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validArrayDataProvider()
+ {
+ $result = array();
+
+ for ($i = 0; $i < 12; $i++) {
+ $eventType = Random::value(NotificationEventType::getEnabledValues());
+ switch($eventType) {
+ case NotificationEventType::REFUND_SUCCEEDED:
+ $notification = $this->getRefundNotification();
+ break;
+ default:
+ $notification = $this->getPaymentNotification($eventType);
+ }
+
+ $result[] = $notification;
+ }
+
+ return $result;
+ }
+
+ public function invalidDataArrayDataProvider()
+ {
+ return array(
+ array(array()),
+ array(array('type' => 'test')),
+ array(array('event' => 'test')),
+ );
+ }
+
+ private function getRefundNotification()
+ {
+ $statuses = RefundStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ $refund = array(
+ 'id' => Random::str(36),
+ 'payment_id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'description' => Random::str(1, 128),
+ );
+
+ return array(
+ array(
+ 'type' => $this->getExpectedType(),
+ 'event' => NotificationEventType::REFUND_SUCCEEDED,
+ 'object' => $refund,
+ ),
+ );
+ }
+
+ private function getPaymentNotification($type)
+ {
+ $statuses = PaymentStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ $trueFalse = Random::bool();
+ $confirmations = array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ 'return_url' => Random::str(10),
+ 'enforce' => false,
+ ),
+ array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ );
+
+ $payment = array(
+ 'id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'recipient' => array(
+ 'account_id' => Random::str(1, 64, '0123456789'),
+ 'gateway_id' => Random::str(1, 256),
+ ),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'captured_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'confirmation' => Random::value($confirmations),
+ 'refunded' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'paid' => $trueFalse,
+ 'refundable' => $trueFalse,
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'metadata' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::str(1, 256),
+ ),
+ );
+
+ return array(
+ array(
+ 'type' => $this->getExpectedType(),
+ 'event' => $type,
+ 'object' => $payment,
+ ),
+ );
+ }
+
+ /**
+ * @return string
+ */
+ protected function getExpectedType()
+ {
+ return NotificationType::NOTIFICATION;
+ }
+
+ /**
+ * @return mixed
+ * @throws \Exception
+ */
+ protected function getExpectedEvent()
+ {
+ return Random::value(NotificationEventType::getEnabledValues());
+ }
+
+ private function assertObject($event, $object, $value)
+ {
+ self::assertNotNull($object);
+ switch ($event) {
+ case NotificationEventType::REFUND_SUCCEEDED:
+ self::assertTrue($object instanceof RefundResponse);
+ self::assertEquals($object, new RefundResponse($value));
+ break;
+ case NotificationEventType::PAYMENT_SUCCEEDED:
+ case NotificationEventType::PAYMENT_WAITING_FOR_CAPTURE:
+ case NotificationEventType::PAYMENT_CANCELED:
+ self::assertTrue($object instanceof PaymentResponse);
+ self::assertEquals($object, new PaymentResponse($value));
+ break;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationRefundSucceededTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationRefundSucceededTest.php
new file mode 100644
index 0000000..6be06b5
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationRefundSucceededTest.php
@@ -0,0 +1,90 @@
+getTestInstance($value);
+ self::assertTrue($instance->getObject() instanceof RefundInterface);
+ self::assertEquals($value['object']['id'], $instance->getObject()->getId());
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ $statuses = RefundStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ for ($i = 0; $i < 10; $i++) {
+ $refund = array(
+ 'id' => Random::str(36),
+ 'payment_id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'description' => Random::str(1, 128),
+ );
+ $result[] = array(
+ array(
+ 'type' => $this->getExpectedType(),
+ 'event' => $this->getExpectedEvent(),
+ 'object' => $refund,
+ ),
+ );
+ }
+
+ return $result;
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationSucceededTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationSucceededTest.php
new file mode 100644
index 0000000..90340bd
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationSucceededTest.php
@@ -0,0 +1,117 @@
+getTestInstance($value);
+ self::assertTrue($instance->getObject() instanceof PaymentInterface);
+ self::assertEquals($value['object']['id'], $instance->getObject()->getId());
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ $statuses = PaymentStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ $confirmations = array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ 'return_url' => Random::str(10),
+ 'enforce' => false,
+ ),
+ array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ );
+
+ for ($i = 0; $i < 10; $i++) {
+ $payment = array(
+ 'id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'recipient' => array(
+ 'account_id' => Random::str(1, 64, '0123456789'),
+ 'gateway_id' => Random::str(1, 256),
+ ),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'captured_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'confirmation' => Random::value($confirmations),
+ 'refunded' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'paid' => $i % 2 ? true : false,
+ 'refundable' => $i % 2 ? true : false,
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'metadata' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::str(1, 256),
+ ),
+ );
+ $result[] = array(
+ array(
+ 'type' => $this->getExpectedType(),
+ 'event' => $this->getExpectedEvent(),
+ 'object' => $payment,
+ ),
+ );
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationWaitingForCaptureTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationWaitingForCaptureTest.php
new file mode 100644
index 0000000..acadf86
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Notification/NotificationWaitingForCaptureTest.php
@@ -0,0 +1,113 @@
+getTestInstance($value);
+ self::assertTrue($instance->getObject() instanceof PaymentInterface);
+ self::assertEquals($value['object']['id'], $instance->getObject()->getId());
+ }
+
+ public function validDataProvider()
+ {
+ $result = array();
+ $statuses = PaymentStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ $confirmations = array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ 'return_url' => Random::str(10),
+ 'enforce' => false,
+ ),
+ array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ );
+
+ for ($i = 0; $i < 10; $i++) {
+ $payment = array(
+ 'id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'recipient' => array(
+ 'account_id' => Random::str(1, 64, '0123456789'),
+ 'gateway_id' => Random::str(1, 256),
+ ),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'captured_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'confirmation' => Random::value($confirmations),
+ 'refunded' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'paid' => $i % 2 ? true : false,
+ 'refundable' => $i % 2 ? true : false,
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'metadata' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::str(1, 256),
+ ),
+ );
+ $result[] = array(
+ array(
+ 'type' => $this->getExpectedType(),
+ 'event' => $this->getExpectedEvent(),
+ 'object' => $payment,
+ ),
+ );
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PassengerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PassengerTest.php
new file mode 100644
index 0000000..75f1929
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PassengerTest.php
@@ -0,0 +1,134 @@
+setFirstName($name);
+ self::assertEquals($name, $instance->getFirstName());
+ self::assertEquals($name, $instance->firstName);
+ self::assertEquals($name, $instance->first_name);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $name
+ */
+ public function testGetSetLastName($name)
+ {
+ $instance = self::getInstance();
+ $instance->setLastName($name);
+ self::assertEquals($name, $instance->getLastName());
+ self::assertEquals($name, $instance->lastName);
+ self::assertEquals($name, $instance->last_name);
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetInvalidFirstName($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setFirstName($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @dataProvider invalidValueDataProvider
+ * @param mixed $value
+ * @param string $exceptionClassName
+ */
+ public function testSetterInvalidLastName($value, $exceptionClassName)
+ {
+ $instance = self::getInstance();
+ try {
+ $instance->setLastName($value);
+ } catch (\Exception $e) {
+ self::assertInstanceOf($exceptionClassName, $e);
+ }
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
+ return array(
+ array(
+ 'firstName' => Random::str(1, null, $alphabet),
+ 'lastName' => Random::str(1, null, $alphabet),
+ ),
+ array(
+ 'firstName' => Random::str(64, null, $alphabet),
+ 'lastName' => Random::str(64, null, $alphabet),
+ )
+ );
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidValueDataProvider()
+ {
+ $exceptionNamespace = 'YooKassa\\Common\\Exceptions\\';
+ return array(
+ array(null, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array('', $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(array(), $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(fopen(__FILE__, 'r'), $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(Random::str(65), $exceptionNamespace.'InvalidPropertyValueException'),
+ array(-1, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(-0.01, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(0.0, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(true, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ array(false, $exceptionNamespace.'InvalidPropertyValueTypeException'),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param string $firstName
+ * @param string $lastName
+ */
+ public function testJsonSerialize($firstName, $lastName)
+ {
+ $instance = self::getInstance();
+ $instance->setFirstName($firstName);
+ $instance->setLastName($lastName);
+
+ $expected = array(
+ 'first_name' => $firstName,
+ 'last_name' => $lastName,
+ );
+ self::assertEquals($expected, $instance->jsonSerialize());
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataApplePayTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataApplePayTest.php
new file mode 100644
index 0000000..f06b892
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataApplePayTest.php
@@ -0,0 +1,115 @@
+getTestInstance();
+
+ self::assertNull($instance->getPaymentData());
+ self::assertNull($instance->paymentData);
+ self::assertNull($instance->payment_data);
+
+ $instance->setPaymentData($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentData());
+ self::assertNull($instance->paymentData);
+ self::assertNull($instance->payment_data);
+ } else {
+ self::assertEquals($value, $instance->getPaymentData());
+ self::assertEquals($value, $instance->paymentData);
+ self::assertEquals($value, $instance->payment_data);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->paymentData = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentData());
+ self::assertNull($instance->paymentData);
+ self::assertNull($instance->payment_data);
+ } else {
+ self::assertEquals($value, $instance->getPaymentData());
+ self::assertEquals($value, $instance->paymentData);
+ self::assertEquals($value, $instance->payment_data);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->payment_data = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentData());
+ self::assertNull($instance->paymentData);
+ self::assertNull($instance->payment_data);
+ } else {
+ self::assertEquals($value, $instance->getPaymentData());
+ self::assertEquals($value, $instance->paymentData);
+ self::assertEquals($value, $instance->payment_data);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPaymentDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentData($value)
+ {
+ /** @var PaymentDataApplePay $instance */
+ $instance = $this->getTestInstance();
+ $instance->setPaymentData($value);
+ }
+
+ /**
+ * @dataProvider invalidPaymentDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPaymentData($value)
+ {
+ /** @var PaymentDataApplePay $instance */
+ $instance = $this->getTestInstance();
+ $instance->paymentData = $value;
+ }
+
+ /**
+ * @dataProvider invalidPaymentDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPayment_data($value)
+ {
+ /** @var PaymentDataApplePay $instance */
+ $instance = $this->getTestInstance();
+ $instance->payment_data = $value;
+ }
+
+ public function validPaymentDataDataProvider()
+ {
+ return array(
+ array('http://test.ru'),
+ array(Random::str(256)),
+ array(Random::str(1024)),
+ );
+ }
+
+ public function invalidPaymentDataDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataGooglePayTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataGooglePayTest.php
new file mode 100644
index 0000000..5f68755
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataGooglePayTest.php
@@ -0,0 +1,93 @@
+getTestInstance();
+
+ self::assertNull($instance->getPaymentMethodToken());
+
+ $instance->setPaymentMethodToken($data);
+ self::assertEquals($data, $instance->getPaymentMethodToken());
+
+
+ $instance = $this->getTestInstance();
+ $instance->paymentMethodToken = $data;
+ self::assertEquals($data, $instance->getPaymentMethodToken());
+ }
+
+ /**
+ * @dataProvider validPaymentDataDataProvider
+ * @param string $data
+ */
+ public function testGetSetGoogleTransactionId($data)
+ {
+ /** @var PaymentDataGooglePay $instance */
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getGoogleTransactionId());
+
+ $instance->setGoogleTransactionId($data);
+ self::assertEquals($data, $instance->getGoogleTransactionId());
+
+ $instance = $this->getTestInstance();
+ $instance->googleTransactionId = $data;
+ self::assertEquals($data, $instance->getGoogleTransactionId());
+ }
+
+ /**
+ * @dataProvider invalidPaymentDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $data
+ */
+ public function testSetPaymentMethodToken($data)
+ {
+ /** @var PaymentDataGooglePay $instance */
+ $instance = $this->getTestInstance();
+ $instance->setPaymentMethodToken($data);
+ }
+
+
+ /**
+ * @dataProvider invalidPaymentDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $data
+ */
+ public function testSetGoogleTransactionId($data)
+ {
+ /** @var PaymentDataGooglePay $instance */
+ $instance = $this->getTestInstance();
+ $instance->setGoogleTransactionId($data);
+ }
+
+ public function validPaymentDataDataProvider()
+ {
+ return array(
+ array(Random::str(256)),
+ array(Random::str(1024)),
+ );
+ }
+
+ public function invalidPaymentDataDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataPhoneTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataPhoneTest.php
new file mode 100644
index 0000000..bcd78e0
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataPhoneTest.php
@@ -0,0 +1,85 @@
+getTestInstance();
+
+ self::assertNull($instance->getPhone());
+ self::assertNull($instance->phone);
+
+ $instance->setPhone($value);
+ self::assertEquals($value, $instance->getPhone());
+ self::assertEquals($value, $instance->phone);
+
+ $instance = $this->getTestInstance();
+ $instance->phone = $value;
+ self::assertEquals($value, $instance->getPhone());
+ self::assertEquals($value, $instance->phone);
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPhone($value)
+ {
+ /** @var PaymentDataMobileBalance $instance */
+ $instance = $this->getTestInstance();
+ $instance->setPhone($value);
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPhone($value)
+ {
+ /** @var PaymentDataMobileBalance $instance */
+ $instance = $this->getTestInstance();
+ $instance->phone = $value;
+ }
+
+ public function validPhoneDataProvider()
+ {
+ return array(
+ array('0123'),
+ array('45678'),
+ array('901234'),
+ array('5678901'),
+ array('23456789'),
+ array('012345678'),
+ array('9012345678'),
+ array('90123456789'),
+ array('012345678901'),
+ array('5678901234567'),
+ array('89012345678901'),
+ array('234567890123456'),
+ );
+ }
+
+ public function invalidPhoneDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array('2345678901234567'),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataTest.php
new file mode 100644
index 0000000..e27fa2c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/AbstractPaymentDataTest.php
@@ -0,0 +1,59 @@
+getTestInstance();
+ self::assertEquals($this->getExpectedType(), $instance->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testInvalidType($value)
+ {
+ new TestPaymentData($value);
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(40)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
+
+class TestPaymentData extends AbstractPaymentData
+{
+ public function __construct($type)
+ {
+ $this->_setType($type);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/B2b/Sberbank/VatDataTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/B2b/Sberbank/VatDataTest.php
new file mode 100644
index 0000000..46cb8c2
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/B2b/Sberbank/VatDataTest.php
@@ -0,0 +1,287 @@
+getType());
+ self::assertEquals($value['rate'], $instance->getRate());
+ self::assertEquals($value['amount']->getValue(), $instance->getAmount()->getValue());
+
+ }
+
+ /**
+ * @dataProvider validTypeDataProvider
+ * @param string $value
+ */
+ public function testGetSetType($value)
+ {
+ $this->getAndSetTest($value, 'type');
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidType($value)
+ {
+ $this->getTestInstance()->setType($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validConstructDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'type' => VatDataType::CALCULATED,
+ 'rate' => VatDataRate::RATE_18,
+ 'amount' => new MonetaryAmount(Random::int(1, 1000))
+ ),
+ ),
+ );
+
+ return $result;
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validTypeDataProvider()
+ {
+ $result = array(
+ array(VatDataType::CALCULATED),
+ array(VatDataType::UNTAXED),
+ );
+
+ return $result;
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(20)),
+ );
+ }
+
+ /**
+ * @dataProvider validRateDataProvider
+ * @param string $value
+ */
+ public function testGetSetRate($value)
+ {
+ $this->getAndSetTest($value, 'rate');
+ }
+
+ /**
+ * @dataProvider invalidRateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidRate($value)
+ {
+ $this->getTestInstance()->setRate($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validRateDataProvider()
+ {
+ $result = array(
+ array(VatDataRate::RATE_7),
+ array(VatDataRate::RATE_10),
+ array(VatDataRate::RATE_18),
+ array(VatDataRate::RATE_20),
+ );
+
+ return $result;
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidRateDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(20)),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $value
+ */
+ public function testGetSetAmount($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+
+ $instance->setAmount($value);
+ if (is_array($value)) {
+ self::assertSame($value['value'], (int)$instance->getAmount()->getValue());
+ self::assertSame($value['currency'], $instance->amount->getCurrency());
+ } else {
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ $instance = $this->getTestInstance();
+
+ $instance->amount = $value;
+ if (is_array($value)) {
+ self::assertSame($value['value'], (int)$instance->getAmount()->getValue());
+ self::assertSame($value['currency'], $instance->amount->getCurrency());
+ } else {
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ self::setExpectedException('InvalidArgumentException');
+ $instance = $this->getTestInstance();
+ $instance->setAmount($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array(
+ array(null),
+ array(
+ array(
+ 'value' => Random::int(1, 1000),
+ 'currency' => CurrencyCode::EUR,
+ )
+ ),
+ array(new MonetaryAmount(Random::int(1, 10000), CurrencyCode::RUB))
+ );
+
+ return $result;
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidDataProvider()
+ {
+ return array(
+ array(''),
+ array(0),
+ array(1),
+ array(-1),
+ //array(array()),
+ array(new \stdClass()),
+ array(Random::str(20)),
+ );
+ }
+
+ /**
+ * @param $value
+ * @param string $property
+ * @param null $snakeCase
+ */
+ protected function getAndSetTest($value, $property, $snakeCase = null)
+ {
+ $getter = 'get'.ucfirst($property);
+ $setter = 'set'.ucfirst($property);
+
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertNull($instance->{$snakeCase});
+ }
+
+ $instance->{$setter}($value);
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ $instance = $this->getTestInstance();
+
+ $instance->{$property} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ if ($snakeCase !== null) {
+ $instance = $this->getTestInstance();
+
+ $instance->{$snakeCase} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataAlfabankTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataAlfabankTest.php
new file mode 100644
index 0000000..9ff685e
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataAlfabankTest.php
@@ -0,0 +1,90 @@
+getTestInstance();
+
+ self::assertNull($instance->getLogin());
+ self::assertNull($instance->login);
+
+ $instance->setLogin($value);
+ self::assertEquals($value, $instance->getLogin());
+ self::assertEquals($value, $instance->login);
+
+ $instance = $this->getTestInstance();
+ $instance->login = $value;
+ self::assertEquals($value, $instance->getLogin());
+ self::assertEquals($value, $instance->login);
+ }
+
+ /**
+ * @dataProvider invalidLoginDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidLogin($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setLogin($value);
+ }
+
+ /**
+ * @dataProvider invalidLoginDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidLogin($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->login = $value;
+ }
+
+ public function validLoginDataProvider()
+ {
+ return array(
+ array('123'),
+ array(Random::str(256)),
+ array(Random::str(1024)),
+ );
+ }
+
+ public function invalidLoginDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataApplePayTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataApplePayTest.php
new file mode 100644
index 0000000..46c31d0
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataApplePayTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+
+ self::assertNull($instance->getPaymentPurpose());
+ self::assertNull($instance->paymentPurpose);
+
+ $instance->setPaymentPurpose($value);
+
+ self::assertEquals($value, $instance->getPaymentPurpose());
+ self::assertEquals($value, $instance->paymentPurpose);
+ }
+
+ /**
+ * @dataProvider invalidPaymentPurposeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidPaymentPurpose($value)
+ {
+ $this->getTestInstance()->setPaymentPurpose($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validPaymentPurposeDataProvider()
+ {
+ return array(
+ array(Random::str(16)),
+ );
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidPaymentPurposeDataProvider()
+ {
+ return array(
+ array(''),
+ array(true),
+ array(new \stdClass()),
+ array(Random::str(211)),
+ );
+ }
+
+
+ /**
+ * @dataProvider validVatDataDataProvider
+ * @param mixed $value
+ */
+ public function testGetSetVatData($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getPaymentPurpose());
+ self::assertNull($instance->paymentPurpose);
+
+ $instance->setVatData($value);
+
+ if (is_array($value)) {
+ self::assertEquals($value['type'], $instance->getVatData()->getType());
+ self::assertEquals($value['type'], $instance->vatData->getType());
+ if (isset($value['rate'])) {
+ self::assertEquals($value['rate'], $instance->getVatData()->getRate());
+ self::assertEquals($value['rate'], $instance->vatData->getRate());
+ }
+ if (isset($value['amount'])) {
+ if (is_array($value['amount'])) {
+ self::assertEquals($value['amount']['value'],
+ (int)$instance->getVatData()->getAmount()->getValue());
+ self::assertEquals($value['amount']['currency'], $instance->vatData->getAmount()->getCurrency());
+ } else {
+ self::assertEquals($value['amount'], $instance->getVatData()->getAmount());
+ self::assertEquals($value['amount'], $instance->vatData->getAmount());
+ }
+ }
+ } else {
+ self::assertEquals($value, $instance->getVatData());
+ self::assertEquals($value, $instance->vatData);
+ }
+ }
+
+ /**
+ * @dataProvider invalidVatDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidVatData($value)
+ {
+ $this->getTestInstance()->setVatData($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validVatDataDataProvider()
+ {
+ return array(
+ array(null),
+ array(new VatData(VatDataType::UNTAXED)),
+ array(new VatData(VatDataType::CALCULATED, VatDataRate::RATE_7, new MonetaryAmount(Random::int(1, 10000)))),
+ array(
+ array(
+ 'type' => VatDataType::UNTAXED,
+ )
+ ),
+ array(
+ array(
+ 'type' => VatDataType::CALCULATED,
+ 'rate' => VatDataRate::RATE_10,
+ 'amount' => new MonetaryAmount(Random::int(1, 10000), CurrencyCode::EUR),
+ )
+ ),
+ array(
+ array(
+ 'type' => VatDataType::MIXED,
+ 'amount' => new MonetaryAmount(Random::int(1, 10000), CurrencyCode::EUR),
+ )
+ ),
+ array(
+ array(
+ 'type' => VatDataType::CALCULATED,
+ 'rate' => VatDataRate::RATE_20,
+ 'amount' => array(
+ 'value' => Random::int(1, 10000),
+ 'currency' => CurrencyCode::USD,
+ ),
+ )
+ ),
+ );
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidVatDataDataProvider()
+ {
+ return array(
+ array(0),
+ array(1),
+ array(-1),
+ array(''),
+ array(true),
+ array(new \stdClass()),
+ array(
+ array(
+ 'type' => VatDataType::CALCULATED,
+ 'rate' => VatDataRate::RATE_10,
+ 'amount' => Random::str(10),
+ )
+ ),
+
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataBankCardCardTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataBankCardCardTest.php
new file mode 100644
index 0000000..beb3f74
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataBankCardCardTest.php
@@ -0,0 +1,384 @@
+getAndSetTest($value, 'number');
+ }
+
+ /**
+ * @dataProvider invalidNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidNumber($value)
+ {
+ $this->getTestInstance()->setNumber($value);
+ }
+
+ /**
+ * @dataProvider invalidNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidNumber($value)
+ {
+ $this->getTestInstance()->number = $value;
+ }
+
+ /**
+ * @dataProvider validExpiryYearDataProvider
+ * @param $value
+ */
+ public function testGetSetExpiryYear($value)
+ {
+ $this->getAndSetTest($value, 'expiryYear', 'expiry_year');
+ }
+
+ /**
+ * @dataProvider invalidYearDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidYear($value)
+ {
+ $this->getTestInstance()->setExpiryYear($value);
+ }
+
+ /**
+ * @dataProvider invalidYearDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidYear($value)
+ {
+ $this->getTestInstance()->expiryYear = $value;
+ }
+
+ /**
+ * @dataProvider invalidYearDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalid_year($value)
+ {
+ $this->getTestInstance()->expiry_year = $value;
+ }
+
+ /**
+ * @dataProvider invalidMonthDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidMonth($value)
+ {
+ $this->getTestInstance()->expiryMonth = $value;
+ }
+
+ /**
+ * @dataProvider invalidMonthDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalid_month($value)
+ {
+ $this->getTestInstance()->expiry_month = $value;
+ }
+
+ /**
+ * @dataProvider validExpiryMonthDataProvider
+ * @param $value
+ */
+ public function testGetSetExpiryMonth($value)
+ {
+ $this->getAndSetTest($value, 'expiryMonth', 'expiry_month');
+ }
+
+ /**
+ * @dataProvider invalidMonthDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidMonth($value)
+ {
+ $this->getTestInstance()->setExpiryMonth($value);
+ }
+
+ /**
+ * @dataProvider validCscDataProvider
+ * @param $value
+ */
+ public function testGetSetCsc($value)
+ {
+ $this->getAndSetTest($value, 'csc');
+ }
+
+ /**
+ * @dataProvider invalidCscDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCsc($value)
+ {
+ $this->getTestInstance()->setCsc($value);
+ }
+
+ /**
+ * @dataProvider invalidCscDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCsc($value)
+ {
+ $this->getTestInstance()->csc = $value;
+ }
+
+ /**
+ * @dataProvider validCardholderDataProvider
+ * @param $value
+ */
+ public function testGetSetCardholder($value)
+ {
+ $this->getAndSetTest($value, 'cardholder');
+ }
+
+ /**
+ * @dataProvider invalidCardholderDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCardholder($value)
+ {
+ $this->getTestInstance()->setCardholder($value);
+ }
+
+ /**
+ * @dataProvider invalidCardholderDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCardholder($value)
+ {
+ $this->getTestInstance()->cardholder = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function validNumberDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 3; $i++) {
+ $result[] = array(Random::str(16, '0123456789'));
+ $result[] = array(Random::str(17, '0123456789'));
+ $result[] = array(Random::str(18, '0123456789'));
+ $result[] = array(Random::str(19, '0123456789'));
+ }
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function validExpiryYearDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::int(2000, 2200));
+ }
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function validExpiryMonthDataProvider()
+ {
+ return array(
+ array('01'),
+ array('02'),
+ array('03'),
+ array('04'),
+ array('05'),
+ array('06'),
+ array('07'),
+ array('08'),
+ array('09'),
+ array('10'),
+ array('11'),
+ array('12'),
+ );
+ }
+
+ public function validCscDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::str(3, 4, '0123456789'));
+ }
+ return $result;
+ }
+
+ public function validCardholderDataProvider()
+ {
+ $values = 'abcdefghijklmnopqrstuvwxyz';
+ $values .= strtoupper($values) . ' ';
+ $result = array(
+ array(Random::str(1, $values)),
+ array(Random::str(26, $values)),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::str(1, 26, $values));
+ }
+ return $result;
+ }
+
+ public function invalidNumberDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(15, '0123456789')),
+ array(Random::str(20, '0123456789')),
+ );
+ }
+
+ public function invalidYearDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, '0123456789')),
+ array(Random::str(2, '0123456789')),
+ array(Random::str(3, '0123456789')),
+ array(Random::str(5, '0123456789')),
+ );
+ }
+
+ public function invalidMonthDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, '0123456789')),
+ array(Random::str(3, '0123456789')),
+ array('13'),
+ array('16'),
+ );
+ }
+
+ public function invalidCscDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, '0123456789')),
+ array(Random::str(2, '0123456789')),
+ array(Random::str(5, '0123456789')),
+ array(Random::str(6, '0123456789')),
+ );
+ }
+
+ public function invalidCardholderDataProvider()
+ {
+ $values = 'abcdefghijklmnopqrstuvwxyz';
+ $values .= strtoupper($values) . ' ';
+ $result = array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, '0123456789')),
+ array(Random::str(2, '0123456789')),
+ array(Random::str(5, '0123456789')),
+ array(Random::str(6, '0123456789')),
+ array(Random::str(27, $values)),
+ );
+ return $result;
+ }
+
+ protected function getAndSetTest($value, $property, $snakeCase = null)
+ {
+ $getter = 'get' . ucfirst($property);
+ $setter = 'set' . ucfirst($property);
+
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertNull($instance->{$snakeCase});
+ }
+
+ $instance->{$setter}($value);
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ $instance = $this->getTestInstance();
+
+ $instance->{$property} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ if ($snakeCase !== null) {
+ $instance = $this->getTestInstance();
+
+ $instance->{$snakeCase} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataBankCardTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataBankCardTest.php
new file mode 100644
index 0000000..9666eca
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataBankCardTest.php
@@ -0,0 +1,119 @@
+getTestInstance();
+
+ self::assertNull($instance->getCard());
+ self::assertNull($instance->card);
+
+ $instance->setCard($value);
+ if ($value === null || $value === '' || $value === array()) {
+ self::assertNull($instance->getCard());
+ self::assertNull($instance->card);
+ } else {
+ if (is_array($value)) {
+ $expected = new PaymentDataBankCardCard();
+ foreach ($value as $property => $val) {
+ $expected->offsetSet($property, $val);
+ }
+ } else {
+ $expected = $value;
+ }
+ self::assertEquals($expected, $instance->getCard());
+ self::assertEquals($expected, $instance->card);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->card = $value;
+ if ($value === null || $value === '' || $value === array()) {
+ self::assertNull($instance->getCard());
+ self::assertNull($instance->card);
+ } else {
+ if (is_array($value)) {
+ $expected = new PaymentDataBankCardCard();
+ foreach ($value as $property => $val) {
+ $expected->offsetSet($property, $val);
+ }
+ } else {
+ $expected = $value;
+ }
+ self::assertEquals($expected, $instance->getCard());
+ self::assertEquals($expected, $instance->card);
+ }
+ }
+
+ /**
+ * @dataProvider invalidCardDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCard($value)
+ {
+ $this->getTestInstance()->setCard($value);
+ }
+
+ /**
+ * @dataProvider invalidCardDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCard($value)
+ {
+ $this->getTestInstance()->card = $value;
+ }
+
+ public function validCardDataProvider()
+ {
+ return array(
+ array(null),
+ array(new PaymentDataBankCardCard()),
+ array(array()),
+ array(''),
+ array(array(
+ 'number' => Random::str(16, '0123456789'),
+ )),
+ );
+ }
+
+ public function invalidCardDataProvider()
+ {
+ return array(
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(true),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataCashTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataCashTest.php
new file mode 100644
index 0000000..4cf25eb
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataCashTest.php
@@ -0,0 +1,56 @@
+getTestInstance();
+ $paymentData = $instance->factory($type);
+ self::assertNotNull($paymentData);
+ self::assertTrue($paymentData instanceof AbstractPaymentData);
+ self::assertEquals($type, $paymentData->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $type
+ */
+ public function testInvalidFactory($type)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factory($type);
+ }
+
+ /**
+ * @dataProvider validArrayDataProvider
+ * @param array $options
+ */
+ public function testFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $paymentData = $instance->factoryFromArray($options);
+ self::assertNotNull($paymentData);
+ self::assertTrue($paymentData instanceof AbstractPaymentData);
+
+ foreach ($options as $property => $value) {
+ self::assertEquals($paymentData->{$property}, $value);
+ }
+
+ $type = $options['type'];
+ unset($options['type']);
+ $paymentData = $instance->factoryFromArray($options, $type);
+ self::assertNotNull($paymentData);
+ self::assertTrue($paymentData instanceof AbstractPaymentData);
+
+ self::assertEquals($type, $paymentData->getType());
+ foreach ($options as $property => $value) {
+ self::assertEquals($paymentData->{$property}, $value);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataArrayDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $options
+ */
+ public function testInvalidFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factoryFromArray($options);
+ }
+
+ public function validTypeDataProvider()
+ {
+ $result = array();
+ foreach (PaymentMethodType::getEnabledValues() as $value) {
+ $result[] = array($value);
+ }
+ return $result;
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ );
+ }
+
+ public function validArrayDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'type' => PaymentMethodType::ALFABANK,
+ 'login' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::GOOGLE_PAY,
+ 'paymentMethodToken' => Random::str(10, 20),
+ 'googleTransactionId' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::APPLE_PAY,
+ 'paymentData' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::BANK_CARD,
+ 'card' => new PaymentDataBankCardCard(),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::CASH,
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::MOBILE_BALANCE,
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::SBERBANK,
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::YOO_MONEY,
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::INSTALLMENTS,
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::TINKOFF_BANK,
+ ),
+ ),
+ );
+ foreach (PaymentMethodType::getEnabledValues() as $value) {
+ $result[] = array(array('type' => $value));
+ }
+ return $result;
+ }
+
+ public function invalidDataArrayDataProvider()
+ {
+ return array(
+ array(array()),
+ array(array('type' => 'test')),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataGooglePayTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataGooglePayTest.php
new file mode 100644
index 0000000..20e357d
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentData/PaymentDataGooglePayTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+
+ self::assertNull($instance->getPhone());
+ self::assertNull($instance->phone);
+
+ $instance->setPhone($value);
+ self::assertEquals($value, $instance->getPhone());
+ self::assertEquals($value, $instance->phone);
+
+ $instance = $this->getTestInstance();
+ $instance->phone = $value;
+ self::assertEquals($value, $instance->getPhone());
+ self::assertEquals($value, $instance->phone);
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPhone($value)
+ {
+ /** @var PaymentMethodMobileBalance $instance */
+ $instance = $this->getTestInstance();
+ $instance->setPhone($value);
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPhone($value)
+ {
+ /** @var PaymentMethodMobileBalance $instance */
+ $instance = $this->getTestInstance();
+ $instance->phone = $value;
+ }
+
+ public function validPhoneDataProvider()
+ {
+ return array(
+ array('0123'),
+ array('45678'),
+ array('901234'),
+ array('5678901'),
+ array('23456789'),
+ array('012345678'),
+ array('9012345678'),
+ array('90123456789'),
+ array('012345678901'),
+ array('5678901234567'),
+ array('89012345678901'),
+ array('234567890123456'),
+ );
+ }
+
+ public function invalidPhoneDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array('2345678901234567'),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/AbstractPaymentMethodTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/AbstractPaymentMethodTest.php
new file mode 100644
index 0000000..1b21a74
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/AbstractPaymentMethodTest.php
@@ -0,0 +1,276 @@
+getTestInstance();
+ self::assertEquals($this->getExpectedType(), $instance->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testInvalidType($value)
+ {
+ new TestPaymentData($value);
+ }
+
+ /**
+ * @dataProvider validSavedDataProvider
+ * @param bool $value
+ */
+ public function testGetSetSaved($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertFalse($instance->getSaved());
+ self::assertFalse($instance->saved);
+
+ $instance->setSaved($value);
+ if ($value) {
+ self::assertTrue($instance->getSaved());
+ self::assertTrue($instance->saved);
+ } else {
+ self::assertFalse($instance->getSaved());
+ self::assertFalse($instance->saved);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->saved = $value;
+ if ($value) {
+ self::assertTrue($instance->getSaved());
+ self::assertTrue($instance->saved);
+ } else {
+ self::assertFalse($instance->getSaved());
+ self::assertFalse($instance->saved);
+ }
+ }
+
+ /**
+ * @dataProvider invalidSavedDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidSaved($value)
+ {
+ $this->getTestInstance()->setSaved($value);
+ }
+
+ /**
+ * @dataProvider invalidSavedDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidSaved($value)
+ {
+ $this->getTestInstance()->saved = $value;
+ }
+
+ /**
+ * @dataProvider validIdDataProvider
+ * @param bool $value
+ */
+ public function testGetSetId($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getId());
+ self::assertNull($instance->id);
+
+ $instance->setId($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getId());
+ self::assertNull($instance->id);
+ } else {
+ self::assertEquals($value, $instance->getId());
+ self::assertEquals($value, $instance->id);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->id = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getId());
+ self::assertNull($instance->id);
+ } else {
+ self::assertEquals($value, $instance->getId());
+ self::assertEquals($value, $instance->id);
+ }
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidId($value)
+ {
+ $this->getTestInstance()->setId($value);
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidId($value)
+ {
+ $this->getTestInstance()->id = $value;
+ }
+
+ /**
+ * @dataProvider validTitleDataProvider
+ * @param bool $value
+ */
+ public function testGetSetTitle($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getTitle());
+ self::assertNull($instance->title);
+
+ $instance->setTitle($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getTitle());
+ self::assertNull($instance->title);
+ } else {
+ self::assertEquals($value, $instance->getTitle());
+ self::assertEquals($value, $instance->title);
+ }
+
+ $instance = $this->getTestInstance();
+ $instance->title = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getTitle());
+ self::assertNull($instance->title);
+ } else {
+ self::assertEquals($value, $instance->getTitle());
+ self::assertEquals($value, $instance->title);
+ }
+ }
+
+ /**
+ * @dataProvider invalidTitleDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidTitle($value)
+ {
+ $this->getTestInstance()->setTitle($value);
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidTitle($value)
+ {
+ $this->getTestInstance()->title = $value;
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(40)),
+ array(0),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function validSavedDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(0),
+ array(1),
+ );
+ }
+
+ public function invalidSavedDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function validIdDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(1)),
+ array(Random::str(2)),
+ array(Random::str(10)),
+ array(Random::str(100)),
+ );
+ }
+
+ public function invalidIdDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array(true),
+ array(false),
+ );
+ }
+
+ public function validTitleDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(1)),
+ array(Random::str(2)),
+ array(Random::str(10)),
+ array(Random::str(100)),
+ );
+ }
+
+ public function invalidTitleDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array(true),
+ array(false),
+ );
+ }
+}
+
+class TestPaymentData extends AbstractPaymentMethod
+{
+ public function __construct($type)
+ {
+ $this->_setType($type);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsTest.php
new file mode 100644
index 0000000..f83fb3d
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/B2b/Sberbank/PayerBankDetailsTest.php
@@ -0,0 +1,157 @@
+getAndSetTest($value, 'fullName');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetShortName($value)
+ {
+ $this->getAndSetTest($value, 'shortName');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetAddress($value)
+ {
+ $this->getAndSetTest($value, 'address');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetInn($value)
+ {
+ $this->getAndSetTest($value, 'inn');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetKpp($value)
+ {
+ $this->getAndSetTest($value, 'kpp');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetBankName($value)
+ {
+ $this->getAndSetTest($value, 'bankName');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetBankBranch($value)
+ {
+ $this->getAndSetTest($value, 'bankBranch');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetBankBik($value)
+ {
+ $this->getAndSetTest($value, 'bankBik');
+ }
+
+ /**
+ * @dataProvider validStringDataProvider
+ * @param string $value
+ */
+ public function testGetSetAccount($value)
+ {
+ $this->getAndSetTest($value, 'account');
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validStringDataProvider()
+ {
+ $result = array(array(Random::str(10)));
+
+ return $result;
+ }
+
+ /**
+ * @param $value
+ * @param string $property
+ * @param null $snakeCase
+ */
+ protected function getAndSetTest($value, $property, $snakeCase = null)
+ {
+ $getter = 'get'.ucfirst($property);
+ $setter = 'set'.ucfirst($property);
+
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertNull($instance->{$snakeCase});
+ }
+
+ $instance->{$setter}($value);
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ $instance = $this->getTestInstance();
+
+ $instance->{$property} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ if ($snakeCase !== null) {
+ $instance = $this->getTestInstance();
+
+ $instance->{$snakeCase} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodAlfaBankTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodAlfaBankTest.php
new file mode 100644
index 0000000..e137f7b
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodAlfaBankTest.php
@@ -0,0 +1,90 @@
+getTestInstance();
+
+ self::assertNull($instance->getLogin());
+ self::assertNull($instance->login);
+
+ $instance->setLogin($value);
+ self::assertEquals($value, $instance->getLogin());
+ self::assertEquals($value, $instance->login);
+
+ $instance = $this->getTestInstance();
+ $instance->login = $value;
+ self::assertEquals($value, $instance->getLogin());
+ self::assertEquals($value, $instance->login);
+ }
+
+ /**
+ * @dataProvider invalidLoginDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidLogin($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setLogin($value);
+ }
+
+ /**
+ * @dataProvider invalidLoginDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidLogin($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->login = $value;
+ }
+
+ public function validLoginDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array('123'),
+ array(Random::str(256)),
+ array(Random::str(1024)),
+ );
+ }
+
+ public function invalidLoginDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodApplePayTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodApplePayTest.php
new file mode 100644
index 0000000..cf008e2
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodApplePayTest.php
@@ -0,0 +1,25 @@
+getAndSetTest($value, 'last4');
+ }
+
+ /**
+ * @dataProvider invalidLast4DataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidNumber($value)
+ {
+ $this->getTestInstance()->setLast4($value);
+ }
+
+ /**
+ * @dataProvider invalidLast4DataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidNumber($value)
+ {
+ $this->getTestInstance()->last4 = $value;
+ }
+
+ /**
+ * @dataProvider validFirst6DataProvider
+ * @param string $value
+ */
+ public function testGetSetFirst6($value)
+ {
+ $this->getAndSetTest($value, 'first6');
+ }
+
+ /**
+ * @dataProvider invalidFirst6DataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetFirst6InvalidNumber($value)
+ {
+ $this->getTestInstance()->setFirst6($value);
+ }
+
+ /**
+ * @dataProvider invalidFirst6DataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterFirst6InvalidNumber($value)
+ {
+ $this->getTestInstance()->first6 = $value;
+ }
+
+ /**
+ * @dataProvider validExpiryYearDataProvider
+ * @param $value
+ */
+ public function testGetSetExpiryYear($value)
+ {
+ $this->getAndSetTest($value, 'expiryYear', 'expiry_year');
+ }
+
+ /**
+ * @dataProvider invalidYearDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidYear($value)
+ {
+ $this->getTestInstance()->setExpiryYear($value);
+ }
+
+ /**
+ * @dataProvider invalidYearDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidYear($value)
+ {
+ $this->getTestInstance()->expiryYear = $value;
+ }
+
+ /**
+ * @dataProvider invalidYearDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalid_year($value)
+ {
+ $this->getTestInstance()->expiry_year = $value;
+ }
+
+ /**
+ * @dataProvider invalidMonthDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidMonth($value)
+ {
+ $this->getTestInstance()->expiryMonth = $value;
+ }
+
+ /**
+ * @dataProvider invalidMonthDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalid_month($value)
+ {
+ $this->getTestInstance()->expiry_month = $value;
+ }
+
+ /**
+ * @dataProvider validExpiryMonthDataProvider
+ * @param $value
+ */
+ public function testGetSetExpiryMonth($value)
+ {
+ $this->getAndSetTest($value, 'expiryMonth', 'expiry_month');
+ }
+
+ /**
+ * @dataProvider invalidMonthDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidMonth($value)
+ {
+ $this->getTestInstance()->setExpiryMonth($value);
+ }
+
+ /**
+ * @dataProvider validCardTypeDataProvider
+ * @param $value
+ */
+ public function testGetSetCardType($value)
+ {
+ $this->getAndSetTest($value, 'cardType', 'card_type');
+ }
+
+ /**
+ * @dataProvider validIssuerCountryDataProvider
+ * @param $value
+ */
+ public function testGetSetIssuerCountry($value)
+ {
+ $this->getAndSetTest($value, 'issuerCountry', 'issuer_country');
+ }
+
+ /**
+ * @dataProvider validIssuerNameDataProvider
+ * @param $value
+ */
+ public function testGetSetIssuerName($value)
+ {
+ $this->getAndSetTest($value, 'issuerName', 'issuer_name');
+ }
+
+ /**
+ * @dataProvider validSourceDataProvider
+ * @param $value
+ */
+ public function testGetSetSource($value)
+ {
+ $this->getAndSetTest($value, 'source', 'source');
+ }
+
+ /**
+ * @dataProvider invalidCardTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCardType($value)
+ {
+ $this->getTestInstance()->setCardType($value);
+ }
+
+ /**
+ * @dataProvider invalidCardTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCardType($value)
+ {
+ $this->getTestInstance()->cardType = $value;
+ }
+
+ /**
+ * @dataProvider invalidCardTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCard_type($value)
+ {
+ $this->getTestInstance()->card_type = $value;
+ }
+
+ /**
+ * @dataProvider invalidIssuerCountryDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidIssuerCountry($value)
+ {
+ $this->getTestInstance()->setIssuerCountry($value);
+ }
+
+ /**
+ * @dataProvider invalidIssuerCountryDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidIssuerCountry($value)
+ {
+ $this->getTestInstance()->issuerCountry = $value;
+ }
+
+ /**
+ * @dataProvider invalidIssuerCountryDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidIssuer_country($value)
+ {
+ $this->getTestInstance()->issuer_country = $value;
+ }
+
+ /**
+ * @dataProvider invalidIssuerNameDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidIssuerName($value)
+ {
+ $this->getTestInstance()->setIssuerName($value);
+ }
+
+ /**
+ * @dataProvider invalidIssuerNameDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidIssuerName($value)
+ {
+ $this->getTestInstance()->issuerName = $value;
+ }
+
+ /**
+ * @dataProvider invalidIssuerNameDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidIssuer_name($value)
+ {
+ $this->getTestInstance()->issuer_name = $value;
+ }
+
+ /**
+ * @dataProvider invalidSourceDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidSource($value)
+ {
+ $this->getTestInstance()->setSource($value);
+ }
+
+ /**
+ * @dataProvider invalidSourceDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidSource($value)
+ {
+ $this->getTestInstance()->source = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function validLast4DataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::str(4, '0123456789'));
+ }
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function validFirst6DataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::str(6, '0123456789'));
+ }
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function validExpiryYearDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::int(2000, 2200));
+ }
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function validExpiryMonthDataProvider()
+ {
+ return array(
+ array('01'),
+ array('02'),
+ array('03'),
+ array('04'),
+ array('05'),
+ array('06'),
+ array('07'),
+ array('08'),
+ array('09'),
+ array('10'),
+ array('11'),
+ array('12'),
+ );
+ }
+
+ public function validCardTypeDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::str(3, 35));
+ }
+
+ return $result;
+ }
+
+ public function validIssuerCountryDataProvider()
+ {
+ return array(
+ array('RU'),
+ array('EN'),
+ array('UK'),
+ array('AU'),
+ array(null),
+ array(''),
+ );
+ }
+
+ public function validIssuerNameDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(Random::str(3, 35));
+ }
+ $result[] = array("");
+ $result[] = array(null);
+
+ return $result;
+ }
+
+ public function validSourceDataProvider()
+ {
+ $result = array();
+ foreach (BankCardSource::getValidValues() as $value) {
+ $result[] = array($value);
+ }
+ $result[] = array("");
+ $result[] = array(null);
+
+ return $result;
+ }
+
+ public function invalidLast4DataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(3, '0123456789')),
+ array(Random::str(5, '0123456789')),
+ );
+ }
+
+ public function invalidFirst6DataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(3, '0123456789')),
+ array(Random::str(5, '0123456789')),
+ );
+ }
+
+ public function invalidYearDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, '0123456789')),
+ array(Random::str(2, '0123456789')),
+ array(Random::str(3, '0123456789')),
+ );
+ }
+
+ public function invalidMonthDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, '0123456789')),
+ array(Random::str(3, '0123456789')),
+ array('13'),
+ array('16'),
+ );
+ }
+
+ public function invalidCardTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidIssuerCountryDataProvider()
+ {
+ return array(
+ array(Random::str(3, 4)),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidIssuerNameDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidSourceDataProvider()
+ {
+ return array(
+ array(Random::str(3, 6)),
+ array(Random::int(1, 2)),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ protected function getAndSetTest($value, $property, $snakeCase = null)
+ {
+ $getter = 'get' . ucfirst($property);
+ $setter = 'set' . ucfirst($property);
+
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertNull($instance->{$snakeCase});
+ }
+
+ $instance->{$setter}($value);
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ $instance = $this->getTestInstance();
+
+ $instance->{$property} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ if ($snakeCase !== null) {
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+
+ if ($snakeCase !== null) {
+ $instance = $this->getTestInstance();
+
+ $instance->{$snakeCase} = $value;
+
+ self::assertEquals($value, $instance->{$getter}());
+ self::assertEquals($value, $instance->{$property});
+ self::assertEquals($value, $instance->{$snakeCase});
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodCashTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodCashTest.php
new file mode 100644
index 0000000..1cc819b
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodCashTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+ $paymentData = $instance->factory($type);
+ self::assertNotNull($paymentData);
+ self::assertTrue($paymentData instanceof AbstractPaymentMethod);
+ self::assertEquals($type, $paymentData->getType());
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $type
+ */
+ public function testInvalidFactory($type)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factory($type);
+ }
+
+ /**
+ * @dataProvider validArrayDataProvider
+ * @param array $options
+ */
+ public function testFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+
+ $optionsMap = array(
+ 'card_type' => 'cardType',
+ 'expiry_month' => 'expiryMonth',
+ 'expiry_year' => 'expiryYear',
+ 'account_number' => 'accountNumber',
+ );
+
+ $paymentData = $instance->factoryFromArray($options);
+ self::assertNotNull($paymentData);
+ self::assertTrue($paymentData instanceof AbstractPaymentMethod);
+
+ foreach ($options as $property => $value) {
+ if (array_key_exists($property, $optionsMap)) {
+ $property = $optionsMap[$property];
+ }
+ self::assertEquals($paymentData->{$property}, $value);
+ }
+
+ $type = $options['type'];
+ unset($options['type']);
+ $paymentData = $instance->factoryFromArray($options, $type);
+ self::assertNotNull($paymentData);
+ self::assertTrue($paymentData instanceof AbstractPaymentMethod);
+
+ self::assertEquals($type, $paymentData->getType());
+ foreach ($options as $property => $value) {
+ if (array_key_exists($property, $optionsMap)) {
+ $property = $optionsMap[$property];
+ }
+ self::assertEquals($paymentData->{$property}, $value);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataArrayDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $options
+ */
+ public function testInvalidFactoryFromArray($options)
+ {
+ $instance = $this->getTestInstance();
+ $instance->factoryFromArray($options);
+ }
+
+ public function validTypeDataProvider()
+ {
+ $result = array();
+ foreach (PaymentMethodType::getValidValues() as $value) {
+ $result[] = array($value);
+ }
+ return $result;
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(0),
+ array(1),
+ array(-1),
+ array('5'),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ );
+ }
+
+ public function validArrayDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'type' => PaymentMethodType::ALFABANK,
+ 'login' => Random::str(10, 20),
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::GOOGLE_PAY,
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::APPLE_PAY,
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::BANK_CARD,
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ 'last4' => Random::str(4, '0123456789'),
+ 'first6' => Random::str(6, '0123456789'),
+ 'expiryYear' => Random::int(2000, 2200),
+ 'expiryMonth' => Random::value(array('01','02','03','04','05','06','07','08','09','10','11','12')),
+ 'cardType' => Random::str(3, 10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::BANK_CARD,
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ 'last4' => Random::str(4, '0123456789'),
+ 'first6' => Random::str(6, '0123456789'),
+ 'expiry_year' => Random::int(2000, 2200),
+ 'expiry_month' => Random::value(array('01','02','03','04','05','06','07','08','09','10','11','12')),
+ 'card_type' => Random::str(3, 10),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::CASH,
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::MOBILE_BALANCE,
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::SBERBANK,
+ 'phone' => Random::str(4, 15, '0123456789'),
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::YOO_MONEY,
+ 'accountNumber' => Random::str(31, '0123456789'),
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::YOO_MONEY,
+ 'account_number' => Random::str(31, '0123456789'),
+ 'id' => Random::str(1, 64),
+ 'saved' => Random::int() % 2 ? true : false,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::INSTALLMENTS,
+ 'id' => Random::str(1, 64),
+ 'saved' => true,
+ 'title' => Random::str(10, 20),
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::B2B_SBERBANK,
+ 'id' => Random::str(1, 64),
+ 'saved' => false,
+ ),
+ ),
+ array(
+ array(
+ 'type' => PaymentMethodType::TINKOFF_BANK,
+ 'id' => Random::str(1, 64),
+ 'saved' => false,
+ ),
+ ),
+ );
+ foreach (PaymentMethodType::getValidValues() as $value) {
+ $result[] = array(array('type' => $value));
+ }
+ return $result;
+ }
+
+ public function invalidDataArrayDataProvider()
+ {
+ return array(
+ array(array()),
+ array(array('type' => 'test')),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodGooglePayTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodGooglePayTest.php
new file mode 100644
index 0000000..b41f79e
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentMethod/PaymentMethodGooglePayTest.php
@@ -0,0 +1,25 @@
+getTestInstance();
+
+ self::assertNull($instance->getAccountNumber());
+ self::assertNull($instance->accountNumber);
+ self::assertNull($instance->account_number);
+
+ $instance->setAccountNumber($value);
+ self::assertEquals($value, $instance->getAccountNumber());
+ self::assertEquals($value, $instance->accountNumber);
+ self::assertEquals($value, $instance->account_number);
+
+ $instance = $this->getTestInstance();
+ $instance->accountNumber = $value;
+ self::assertEquals($value, $instance->getAccountNumber());
+ self::assertEquals($value, $instance->accountNumber);
+ self::assertEquals($value, $instance->account_number);
+
+ $instance = $this->getTestInstance();
+ $instance->account_number = $value;
+ self::assertEquals($value, $instance->getAccountNumber());
+ self::assertEquals($value, $instance->accountNumber);
+ self::assertEquals($value, $instance->account_number);
+ }
+
+ /**
+ * @dataProvider invalidAccountNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidAccountNumber($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setAccountNumber($value);
+ }
+
+ /**
+ * @dataProvider invalidAccountNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidAccountNumber($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->accountNumber = $value;
+ }
+
+ /**
+ * @dataProvider invalidAccountNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidAccount_number($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->account_number = $value;
+ }
+
+ public function validAccountNumberDataProvider()
+ {
+ return array(
+ array(Random::str(11, '0123456789')),
+ array(Random::str(12, '0123456789')),
+ array(Random::str(13, '0123456789')),
+ array(Random::str(31, '0123456789')),
+ array(Random::str(32, '0123456789')),
+ array(Random::str(33, '0123456789')),
+ );
+ }
+
+ public function invalidAccountNumberDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10, '0123456789')),
+ array(Random::str(34, '0123456789')),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentTest.php
new file mode 100644
index 0000000..e8ae424
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/PaymentTest.php
@@ -0,0 +1,996 @@
+getId());
+ self::assertNull($instance->id);
+
+ $instance->setId($options['id']);
+ self::assertEquals($options['id'], $instance->getId());
+ self::assertEquals($options['id'], $instance->id);
+
+ $instance = new Payment();
+ $instance->id = $options['id'];
+ self::assertEquals($options['id'], $instance->getId());
+ self::assertEquals($options['id'], $instance->id);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidId($value)
+ {
+ $instance = new Payment();
+ $instance->setId($value['id']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidId($value)
+ {
+ $instance = new Payment();
+ $instance->id = $value['id'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetStatus($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->status);
+
+ $instance->setStatus($options['status']);
+ self::assertEquals($options['status'], $instance->getStatus());
+ self::assertEquals($options['status'], $instance->status);
+
+ $instance = new Payment();
+ $instance->status = $options['status'];
+ self::assertEquals($options['status'], $instance->getStatus());
+ self::assertEquals($options['status'], $instance->status);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidStatus($value)
+ {
+ $instance = new Payment();
+ $instance->setStatus($value['status']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidStatus($value)
+ {
+ $instance = new Payment();
+ $instance->status = $value['status'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetRecipient($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getRecipient());
+ self::assertNull($instance->recipient);
+
+ $instance->setRecipient($options['recipient']);
+ self::assertSame($options['recipient'], $instance->getRecipient());
+ self::assertSame($options['recipient'], $instance->recipient);
+
+ $instance = new Payment();
+ $instance->recipient = $options['recipient'];
+ self::assertSame($options['recipient'], $instance->getRecipient());
+ self::assertSame($options['recipient'], $instance->recipient);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetInvalidRecipient($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->setRecipient($value['recipient']);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidRecipient($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->recipient = $value['recipient'];
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetAmount($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+
+ $instance->setAmount($options['amount']);
+ self::assertSame($options['amount'], $instance->getAmount());
+ self::assertSame($options['amount'], $instance->amount);
+
+ $instance = new Payment();
+ $instance->amount = $options['amount'];
+ self::assertSame($options['amount'], $instance->getAmount());
+ self::assertSame($options['amount'], $instance->amount);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->setAmount($value['amount']);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidAmount($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->amount = $value['amount'];
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetPaymentMethod($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getPaymentMethod());
+ self::assertNull($instance->paymentMethod);
+ self::assertNull($instance->payment_method);
+
+ $instance->setPaymentMethod($options['payment_method']);
+ self::assertSame($options['payment_method'], $instance->getPaymentMethod());
+ self::assertSame($options['payment_method'], $instance->paymentMethod);
+ self::assertSame($options['payment_method'], $instance->payment_method);
+
+ $instance = new Payment();
+ $instance->paymentMethod = $options['payment_method'];
+ self::assertSame($options['payment_method'], $instance->getPaymentMethod());
+ self::assertSame($options['payment_method'], $instance->paymentMethod);
+ self::assertSame($options['payment_method'], $instance->payment_method);
+
+ $instance = new Payment();
+ $instance->payment_method = $options['payment_method'];
+ self::assertSame($options['payment_method'], $instance->getPaymentMethod());
+ self::assertSame($options['payment_method'], $instance->paymentMethod);
+ self::assertSame($options['payment_method'], $instance->payment_method);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetInvalidPaymentMethod($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->setPaymentMethod($value['payment_method']);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidPaymentMethod($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->paymentMethod = $value['payment_method'];
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidPayment_method($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->payment_method = $value['payment_method'];
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetCreatedAt($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getCreatedAt());
+ self::assertNull($instance->createdAt);
+ self::assertNull($instance->created_at);
+
+ $instance->setCreatedAt($options['created_at']);
+ self::assertSame($options['created_at'], $instance->getCreatedAt()->format(DATE_ATOM));
+ self::assertSame($options['created_at'], $instance->createdAt->format(DATE_ATOM));
+ self::assertSame($options['created_at'], $instance->created_at->format(DATE_ATOM));
+
+ $instance = new Payment();
+ $instance->createdAt = $options['created_at'];
+ self::assertSame($options['created_at'], $instance->getCreatedAt()->format(DATE_ATOM));
+ self::assertSame($options['created_at'], $instance->createdAt->format(DATE_ATOM));
+ self::assertSame($options['created_at'], $instance->created_at->format(DATE_ATOM));
+
+ $instance = new Payment();
+ $instance->created_at = $options['created_at'];
+ self::assertSame($options['created_at'], $instance->getCreatedAt()->format(DATE_ATOM));
+ self::assertSame($options['created_at'], $instance->createdAt->format(DATE_ATOM));
+ self::assertSame($options['created_at'], $instance->created_at->format(DATE_ATOM));
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCreatedAt($value)
+ {
+ $instance = new Payment();
+ $instance->setCreatedAt($value['created_at']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCreatedAt($value)
+ {
+ $instance = new Payment();
+ $instance->createdAt = $value['created_at'];
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCreated_at($value)
+ {
+ $instance = new Payment();
+ $instance->created_at = $value['created_at'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetCapturedAt($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getCapturedAt());
+ self::assertNull($instance->capturedAt);
+ self::assertNull($instance->captured_at);
+
+ $instance->setCapturedAt($options['captured_at']);
+ if ($options['captured_at'] === null || $options['captured_at'] === '') {
+ self::assertNull($instance->getCapturedAt());
+ self::assertNull($instance->capturedAt);
+ self::assertNull($instance->captured_at);
+ } else {
+ self::assertSame($options['captured_at'], $instance->getCapturedAt()->format(DATE_ATOM));
+ self::assertSame($options['captured_at'], $instance->capturedAt->format(DATE_ATOM));
+ self::assertSame($options['captured_at'], $instance->captured_at->format(DATE_ATOM));
+ }
+
+ $instance = new Payment();
+ $instance->capturedAt = $options['captured_at'];
+ if ($options['captured_at'] === null || $options['captured_at'] === '') {
+ self::assertNull($instance->getCapturedAt());
+ self::assertNull($instance->capturedAt);
+ self::assertNull($instance->captured_at);
+ } else {
+ self::assertSame($options['captured_at'], $instance->getCapturedAt()->format(DATE_ATOM));
+ self::assertSame($options['captured_at'], $instance->capturedAt->format(DATE_ATOM));
+ self::assertSame($options['captured_at'], $instance->captured_at->format(DATE_ATOM));
+ }
+
+ $instance = new Payment();
+ $instance->captured_at = $options['captured_at'];
+ if ($options['captured_at'] === null || $options['captured_at'] === '') {
+ self::assertNull($instance->getCapturedAt());
+ self::assertNull($instance->capturedAt);
+ self::assertNull($instance->captured_at);
+ } else {
+ self::assertSame($options['captured_at'], $instance->getCapturedAt()->format(DATE_ATOM));
+ self::assertSame($options['captured_at'], $instance->capturedAt->format(DATE_ATOM));
+ self::assertSame($options['captured_at'], $instance->captured_at->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCapturedAt($value)
+ {
+ $instance = new Payment();
+ $instance->setCapturedAt($value['captured_at']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCapturedAt($value)
+ {
+ $instance = new Payment();
+ $instance->capturedAt = $value['captured_at'];
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCaptured_at($value)
+ {
+ $instance = new Payment();
+ $instance->captured_at = $value['captured_at'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetConfirmation($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getConfirmation());
+ self::assertNull($instance->confirmation);
+
+ $instance->setConfirmation($options['confirmation']);
+ self::assertSame($options['confirmation'], $instance->getConfirmation());
+ self::assertSame($options['confirmation'], $instance->confirmation);
+
+ $instance = new Payment();
+ $instance->confirmation = $options['confirmation'];
+ self::assertSame($options['confirmation'], $instance->getConfirmation());
+ self::assertSame($options['confirmation'], $instance->confirmation);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetInvalidConfirmation($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->setConfirmation($value['confirmation']);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidConfirmation($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->confirmation = $value['confirmation'];
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetRefundedAmount($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getRefundedAmount());
+ self::assertNull($instance->refundedAmount);
+ self::assertNull($instance->refunded_amount);
+
+ $instance->setRefundedAmount($options['refunded_amount']);
+ self::assertSame($options['refunded_amount'], $instance->getRefundedAmount());
+ self::assertSame($options['refunded_amount'], $instance->refundedAmount);
+ self::assertSame($options['refunded_amount'], $instance->refunded_amount);
+
+ $instance = new Payment();
+ $instance->refundedAmount = $options['refunded_amount'];
+ self::assertSame($options['refunded_amount'], $instance->getRefundedAmount());
+ self::assertSame($options['refunded_amount'], $instance->refundedAmount);
+ self::assertSame($options['refunded_amount'], $instance->refunded_amount);
+
+ $instance = new Payment();
+ $instance->refunded_amount = $options['refunded_amount'];
+ self::assertSame($options['refunded_amount'], $instance->getRefundedAmount());
+ self::assertSame($options['refunded_amount'], $instance->refundedAmount);
+ self::assertSame($options['refunded_amount'], $instance->refunded_amount);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetInvalidRefundedAmount($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->setRefundedAmount($value['refunded_amount']);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidRefundedAmount($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->refundedAmount = $value['refunded_amount'];
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @param $value
+ */
+ public function testSetterInvalidRefunded_amount($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Payment();
+ $instance->refunded_amount = $value['refunded_amount'];
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetPaid($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getPaid());
+ self::assertNull($instance->paid);
+
+ $instance->setPaid($options['paid']);
+ self::assertSame($options['paid'], $instance->getPaid());
+ self::assertSame($options['paid'], $instance->paid);
+
+ $instance = new Payment();
+ $instance->paid = $options['paid'];
+ self::assertSame($options['paid'], $instance->getPaid());
+ self::assertSame($options['paid'], $instance->paid);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaid($value)
+ {
+ $instance = new Payment();
+ $instance->setPaid($value['paid']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPaid($value)
+ {
+ $instance = new Payment();
+ $instance->paid = $value['paid'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetRefundable($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getRefundable());
+ self::assertNull($instance->refundable);
+
+ $instance->setRefundable($options['refundable']);
+ self::assertSame($options['refundable'], $instance->getRefundable());
+ self::assertSame($options['refundable'], $instance->refundable);
+
+ $instance = new Payment();
+ $instance->refundable = $options['refundable'];
+ self::assertSame($options['refundable'], $instance->getRefundable());
+ self::assertSame($options['refundable'], $instance->refundable);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidRefundable($value)
+ {
+ $instance = new Payment();
+ $instance->setRefundable($value['refundable']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidRefundable($value)
+ {
+ $instance = new Payment();
+ $instance->refundable = $value['refundable'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetReceiptRegistration($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getReceiptRegistration());
+ self::assertNull($instance->receiptRegistration);
+ self::assertNull($instance->receipt_registration);
+
+ $instance->setReceiptRegistration($options['receipt_registration']);
+ if ($options['receipt_registration'] === null || $options['receipt_registration'] === '') {
+ self::assertNull($instance->getReceiptRegistration());
+ self::assertNull($instance->receiptRegistration);
+ self::assertNull($instance->receipt_registration);
+ } else {
+ self::assertSame($options['receipt_registration'], $instance->getReceiptRegistration());
+ self::assertSame($options['receipt_registration'], $instance->receiptRegistration);
+ self::assertSame($options['receipt_registration'], $instance->receipt_registration);
+ }
+
+
+ $instance = new Payment();
+ $instance->receiptRegistration = $options['receipt_registration'];
+ if ($options['receipt_registration'] === null || $options['receipt_registration'] === '') {
+ self::assertNull($instance->getReceiptRegistration());
+ self::assertNull($instance->receiptRegistration);
+ self::assertNull($instance->receipt_registration);
+ } else {
+ self::assertSame($options['receipt_registration'], $instance->getReceiptRegistration());
+ self::assertSame($options['receipt_registration'], $instance->receiptRegistration);
+ self::assertSame($options['receipt_registration'], $instance->receipt_registration);
+ }
+
+ $instance = new Payment();
+ $instance->receipt_registration = $options['receipt_registration'];
+ if ($options['receipt_registration'] === null || $options['receipt_registration'] === '') {
+ self::assertNull($instance->getReceiptRegistration());
+ self::assertNull($instance->receiptRegistration);
+ self::assertNull($instance->receipt_registration);
+ } else {
+ self::assertSame($options['receipt_registration'], $instance->getReceiptRegistration());
+ self::assertSame($options['receipt_registration'], $instance->receiptRegistration);
+ self::assertSame($options['receipt_registration'], $instance->receipt_registration);
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidReceiptRegistration($value)
+ {
+ $instance = new Payment();
+ $instance->setReceiptRegistration($value['receipt_registration']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReceiptRegistration($value)
+ {
+ $instance = new Payment();
+ $instance->receiptRegistration = $value['receipt_registration'];
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReceipt_registration($value)
+ {
+ $instance = new Payment();
+ $instance->receipt_registration = $value['receipt_registration'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetMetadata($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getMetadata());
+ self::assertNull($instance->metadata);
+
+ $instance->setMetadata($options['metadata']);
+ self::assertSame($options['metadata'], $instance->getMetadata());
+ self::assertSame($options['metadata'], $instance->metadata);
+
+ $instance = new Payment();
+ $instance->metadata = $options['metadata'];
+ self::assertSame($options['metadata'], $instance->getMetadata());
+ self::assertSame($options['metadata'], $instance->metadata);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetTransfers($options)
+ {
+ $instance = new Payment();
+
+ self::assertEmpty($instance->getTransfers());
+ self::assertEmpty($instance->transfers);
+
+ $instance->setTransfers($options['transfers']);
+ self::assertSame($options['transfers'], $instance->getTransfers());
+ self::assertSame($options['transfers'], $instance->transfers);
+
+ $instance = new Payment();
+ $instance->transfers = $options['transfers'];
+ self::assertSame($options['transfers'], $instance->getTransfers());
+ self::assertSame($options['transfers'], $instance->transfers);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array();
+ $cancellationDetailsParties = CancellationDetailsPartyCode::getValidValues();
+ $countCancellationDetailsParties = count($cancellationDetailsParties);
+ $cancellationDetailsReasons = CancellationDetailsReasonCode::getValidValues();
+ $countCancellationDetailsReasons = count($cancellationDetailsReasons);
+ for ($i = 0; $i < 20; $i++) {
+ $payment = array(
+ 'id' => Random::str(36),
+ 'status' => Random::value(PaymentStatus::getValidValues()),
+ 'recipient' => new Recipient(),
+ 'amount' => new MonetaryAmount(Random::int(1, 10000), 'RUB'),
+ 'description' => ($i == 0 ? null : ($i == 1 ? '' : ($i == 2 ? Random::str(Payment::MAX_LENGTH_DESCRIPTION)
+ : Random::str(1, Payment::MAX_LENGTH_DESCRIPTION)))),
+ 'payment_method' => new PaymentMethodQiwi(),
+ 'reference_id' => ($i == 0 ? null : ($i == 1 ? '' : Random::str(10, 20, 'abcdef0123456789'))),
+ 'created_at' => date(DATE_ATOM, mt_rand(1, time())),
+ 'captured_at' => ($i == 0 ? null : ($i == 1 ? '' : date(DATE_ATOM, mt_rand(1, time())))),
+ 'expires_at' => ($i == 0 ? null : ($i == 1 ? '' : date(DATE_ATOM, mt_rand(1, time())))),
+ 'confirmation' => new ConfirmationRedirect(),
+ 'charge' => new MonetaryAmount(),
+ 'income' => new MonetaryAmount(),
+ 'refunded_amount' => new MonetaryAmount(),
+ 'paid' => $i % 2 ? true : false,
+ 'refundable' => $i % 2 ? true : false,
+ 'receipt_registration' => $i == 0 ? null : ($i == 1 ? '' : Random::value(ReceiptRegistrationStatus::getValidValues())),
+ 'metadata' => new Metadata(),
+ 'cancellation_details' => new CancellationDetails(
+ $cancellationDetailsParties[$i % $countCancellationDetailsParties],
+ $cancellationDetailsReasons[$i % $countCancellationDetailsReasons]
+ ),
+ 'transfers' => array(
+ new Transfer(array(
+ 'account_id' => Random::str(36),
+ 'amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'platform_fee_amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ )),
+ )
+ );
+ $result[] = array($payment);
+ }
+ return $result;
+ }
+
+ public function invalidDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'id' => null,
+ 'status' => null,
+ 'recipient' => null,
+ 'amount' => null,
+ 'payment_method' => null,
+ 'reference_id' => Random::str(65),
+ 'confirmation' => null,
+ 'charge' => null,
+ 'income' => null,
+ 'refunded_amount' => null,
+ 'paid' => null,
+ 'refundable' => null,
+ 'created_at' => null,
+ 'captured_at' => array(),
+ 'receipt_registration' => array(),
+ )
+ ),
+ array(
+ array(
+ 'id' => '',
+ 'status' => '',
+ 'recipient' => '',
+ 'amount' => '',
+ 'payment_method' => '',
+ 'reference_id' => array(),
+ 'confirmation' => '',
+ 'charge' => '',
+ 'income' => '',
+ 'refunded_amount' => '',
+ 'paid' => '',
+ 'refundable' => '',
+ 'created_at' => array(),
+ 'captured_at' => '23423-234-234',
+ 'receipt_registration' => new \stdClass(),
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $payment = array(
+ 'id' => Random::str($i < 5 ? mt_rand(1, 35) : mt_rand(37, 64)),
+ 'status' => Random::str(1, 35),
+ 'recipient' => 'test',
+ 'amount' => 'test',
+ 'payment_method' => 'test',
+ 'reference_id' => Random::str(66, 128),
+ 'confirmation' => 'test',
+ 'charge' => 'test',
+ 'income' => 'test',
+ 'refunded_amount' => 'test',
+ 'paid' => $i == 0 ? array() : new \stdClass(),
+ 'refundable' => $i == 0 ? array() : new \stdClass(),
+ 'created_at' => $i == 0 ? '23423-234-32' : -Random::int(),
+ 'captured_at' => -Random::int(),
+ 'receipt_registration' => $i == 0 ? true : Random::str(5),
+ );
+ $result[] = array($payment);
+ }
+ return $result;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetExpiresAt($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getExpiresAt());
+ self::assertNull($instance->expiresAt);
+ self::assertNull($instance->expires_at);
+
+ $instance->setExpiresAt($options['expires_at']);
+ if ($options['expires_at'] === null || $options['expires_at'] === '') {
+ self::assertNull($instance->getExpiresAt());
+ self::assertNull($instance->expiresAt);
+ self::assertNull($instance->expires_at);
+ } else {
+ self::assertSame($options['expires_at'], $instance->getExpiresAt()->format(DATE_ATOM));
+ self::assertSame($options['expires_at'], $instance->expiresAt->format(DATE_ATOM));
+ self::assertSame($options['expires_at'], $instance->expires_at->format(DATE_ATOM));
+ }
+
+ $instance = new Payment();
+ $instance->expiresAt = $options['expires_at'];
+ if ($options['expires_at'] === null || $options['expires_at'] === '') {
+ self::assertNull($instance->getExpiresAt());
+ self::assertNull($instance->expiresAt);
+ self::assertNull($instance->expires_at);
+ } else {
+ self::assertSame($options['expires_at'], $instance->getExpiresAt()->format(DATE_ATOM));
+ self::assertSame($options['expires_at'], $instance->expiresAt->format(DATE_ATOM));
+ self::assertSame($options['expires_at'], $instance->expires_at->format(DATE_ATOM));
+ }
+
+ $instance = new Payment();
+ $instance->expires_at = $options['expires_at'];
+ if ($options['expires_at'] === null || $options['expires_at'] === '') {
+ self::assertNull($instance->getExpiresAt());
+ self::assertNull($instance->expiresAt);
+ self::assertNull($instance->expires_at);
+ } else {
+ self::assertSame($options['expires_at'], $instance->getExpiresAt()->format(DATE_ATOM));
+ self::assertSame($options['expires_at'], $instance->expiresAt->format(DATE_ATOM));
+ self::assertSame($options['expires_at'], $instance->expires_at->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidExpiresAt($value)
+ {
+ $instance = new Payment();
+ $instance->setExpiresAt($value['captured_at']);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidExpiresAt($value)
+ {
+ $instance = new Payment();
+ $instance->expiresAt = $value['captured_at'];
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidExpires_at($value)
+ {
+ $instance = new Payment();
+ $instance->expires_at = $value['captured_at'];
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetDescription($options)
+ {
+ $instance = new Payment();
+ $instance->setDescription($options['description']);
+
+ if (empty($options['description']) && ($options['description'] !== '0')) {
+ self::assertNull($instance->getDescription());
+ } else {
+ self::assertEquals($options['description'], $instance->getDescription());
+ }
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSetInvalidTypeDescription()
+ {
+ $instance = new Payment();
+ $instance->setDescription(true);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ */
+ public function testSetInvalidLengthDescription()
+ {
+ $instance = new Payment();
+ $description = Random::str(Payment::MAX_LENGTH_DESCRIPTION + 1);
+ $instance->setDescription($description);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSetCancellationDetails($options)
+ {
+ $instance = new Payment();
+
+ self::assertNull($instance->getCancellationDetails());
+ self::assertNull($instance->cancellationDetails);
+ self::assertNull($instance->cancellation_details);
+
+ $instance->setCancellationDetails($options['cancellation_details']);
+ self::assertSame($options['cancellation_details'], $instance->getCancellationDetails());
+ self::assertSame($options['cancellation_details'], $instance->cancellationDetails);
+ self::assertSame($options['cancellation_details'], $instance->cancellation_details);
+
+ $instance = new Payment();
+ $instance->cancellationDetails = $options['cancellation_details'];
+ self::assertSame($options['cancellation_details'], $instance->getCancellationDetails());
+ self::assertSame($options['cancellation_details'], $instance->cancellationDetails);
+ self::assertSame($options['cancellation_details'], $instance->cancellation_details);
+
+ $instance = new Payment();
+ $instance->cancellation_details = $options['cancellation_details'];
+ self::assertSame($options['cancellation_details'], $instance->getCancellationDetails());
+ self::assertSame($options['cancellation_details'], $instance->cancellationDetails);
+ self::assertSame($options['cancellation_details'], $instance->cancellation_details);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptCustomerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptCustomerTest.php
new file mode 100644
index 0000000..829bf83
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptCustomerTest.php
@@ -0,0 +1,509 @@
+getPhone());
+ self::assertNull($instance->phone);
+
+ $value = !empty($options['customer']['phone'])
+ ? $options['customer']['phone']
+ : (!empty($options['phone']) ? $options['phone'] : null);
+
+ $instance->setPhone($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPhone());
+ self::assertNull($instance->phone);
+ } else {
+ self::assertEquals($value, $instance->getPhone());
+ self::assertEquals($value, $instance->phone);
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetterPhone($options)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getPhone());
+ self::assertNull($instance->phone);
+
+ $value = !empty($options['customer']['phone'])
+ ? $options['customer']['phone']
+ : (!empty($options['phone']) ? $options['phone'] : null);
+
+ $instance->phone = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPhone());
+ self::assertNull($instance->phone);
+ } else {
+ self::assertEquals($value, $instance->getPhone());
+ self::assertEquals($value, $instance->phone);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPhoneProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPhone($value)
+ {
+ $instance = new ReceiptCustomer();
+ $instance->setPhone($value);
+ }
+
+ public function invalidPhoneProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testGetSetEmail($options)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getEmail());
+ self::assertNull($instance->email);
+
+ $value = !empty($options['customer']['email'])
+ ? $options['customer']['email']
+ : (!empty($options['email']) ? $options['email'] : null);
+
+ $instance->setEmail($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getEmail());
+ self::assertNull($instance->email);
+ } else {
+ self::assertEquals($value, $instance->getEmail());
+ self::assertEquals($value, $instance->email);
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetterEmail($options)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getEmail());
+ self::assertNull($instance->email);
+
+ $value = !empty($options['customer']['email'])
+ ? $options['customer']['email']
+ : (!empty($options['email']) ? $options['email'] : null);
+
+ $instance->email = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getEmail());
+ self::assertNull($instance->email);
+ } else {
+ self::assertEquals($value, $instance->getEmail());
+ self::assertEquals($value, $instance->email);
+ }
+ }
+
+ /**
+ * @dataProvider validFullNameProvider
+ * @param $value
+ */
+ public function testGetSetFullName($value)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getFullName());
+ self::assertNull($instance->fullName);
+ self::assertNull($instance->full_name);
+
+ $instance->setFullName($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getFullName());
+ self::assertNull($instance->fullName);
+ self::assertNull($instance->full_name);
+ } else {
+ self::assertEquals($value, $instance->getFullName());
+ self::assertEquals($value, $instance->fullName);
+ self::assertEquals($value, $instance->full_name);
+ }
+ }
+
+ /**
+ * @dataProvider validFullNameProvider
+ * @param $value
+ */
+ public function testSetterFullName($value)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getFullName());
+ self::assertNull($instance->fullName);
+ self::assertNull($instance->full_name);
+
+ $instance->fullName = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getFullName());
+ self::assertNull($instance->fullName);
+ self::assertNull($instance->full_name);
+ } else {
+ self::assertEquals($value, $instance->getFullName());
+ self::assertEquals($value, $instance->fullName);
+ self::assertEquals($value, $instance->full_name);
+ }
+ }
+
+ /**
+ * @dataProvider validFullNameProvider
+ * @param $value
+ */
+ public function testSetterFull_name($value)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getFullName());
+ self::assertNull($instance->fullName);
+ self::assertNull($instance->full_name);
+
+ $instance->full_name = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getFullName());
+ self::assertNull($instance->fullName);
+ self::assertNull($instance->full_name);
+ } else {
+ self::assertEquals($value, $instance->getFullName());
+ self::assertEquals($value, $instance->fullName);
+ self::assertEquals($value, $instance->full_name);
+ }
+ }
+
+ public function validFullNameProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(1)),
+ array(Random::str(null, 256)),
+ array(Random::str(256)),
+ );
+ }
+
+ /**
+ * @dataProvider invalidFullNameProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidFullName($value)
+ {
+ $instance = new ReceiptCustomer();
+ $instance->setFullName($value);
+ }
+
+ public function invalidFullNameProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ array(Random::str(257)),
+ );
+ }
+
+ /**
+ * @dataProvider validInnProvider
+ * @param $value
+ */
+ public function testGetSetInn($value)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getInn());
+ self::assertNull($instance->inn);
+
+ $instance->setInn($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getInn());
+ self::assertNull($instance->inn);
+ } else {
+ self::assertEquals($value, $instance->getInn());
+ self::assertEquals($value, $instance->inn);
+ }
+ }
+
+ /**
+ * @dataProvider validInnProvider
+ * @param $options
+ */
+ public function testSetterInn($options)
+ {
+ $instance = new ReceiptCustomer();
+
+ self::assertNull($instance->getInn());
+ self::assertNull($instance->inn);
+
+ $instance->inn = $options;
+ if ($options === null || $options === '') {
+ self::assertNull($instance->getInn());
+ self::assertNull($instance->inn);
+ } else {
+ self::assertEquals($options, $instance->getInn());
+ self::assertEquals($options, $instance->inn);
+ }
+ }
+
+ public function validInnProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array('1234567890'),
+ array('123456789012'),
+ array(Random::str(10, 10, '1234567890')),
+ array(Random::str(12, 12, '1234567890')),
+ );
+ }
+
+ /**
+ * @dataProvider invalidInnProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidInn($value)
+ {
+ $instance = new ReceiptCustomer();
+ $instance->setInn($value);
+ }
+
+
+ public function invalidInnProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ array('123456789'),
+ array('12345678901'),
+ array('1234567890123'),
+ array(Random::str(1)),
+ array(Random::str(10, 10, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')),
+ array(Random::str(12, 12, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')),
+ array(Random::str(13, 13, '1234567890')),
+ );
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'customer' => array(),
+ ),
+ ),
+ array(
+ array(
+ 'customer' => array(),
+ 'phone' => Random::str(10, 10, '1234567890'),
+ 'email' => uniqid() . '@' . uniqid(),
+ ),
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'phone' => Random::str(10, 10, '1234567890'),
+ 'email' => uniqid() . '@' . uniqid(),
+ ),
+ ),
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => Random::str(1, 256),
+ 'inn' => Random::str(12, 12, '1234567890'),
+ ),
+ 'phone' => Random::str(10, 10, '1234567890'),
+ 'email' => uniqid() . '@' . uniqid(),
+ ),
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => Random::str(1, 256),
+ 'phone' => Random::str(10, 10, '1234567890'),
+ 'email' => uniqid() . '@' . uniqid(),
+ 'inn' => Random::str(10, 10, '1234567890'),
+ ),
+ ),
+ ),
+ );
+
+ return $result;
+ }
+
+
+ /**
+ * @dataProvider fromArrayDataProvider
+ * @param array $source
+ * @param ReceiptCustomer $expected
+ */
+ public function testCustomerFromArray($source, $expected)
+ {
+ $receipt = new Receipt();
+ $receipt->fromArray($source);
+
+ if (!empty($expected)) {
+ foreach ($expected->jsonSerialize() as $property => $value) {
+ self::assertEquals($value, $expected->offsetGet($property));
+ }
+ } else {
+ self::assertEquals(true, $receipt->getCustomer()->isEmpty());
+ }
+ }
+
+ public function fromArrayDataProvider()
+ {
+ $customer = new ReceiptCustomer();
+ $customer->setFullName('John Doe');
+ $customer->setEmail('johndoe@yoomoney.ru');
+ $customer->setPhone('79000000000');
+ $customer->setInn('6321341814');
+
+ return array(
+
+ array(
+ array(),
+ null,
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'fullName' => 'John Doe',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ 'inn' => '6321341814',
+ ),
+ ),
+
+ $customer
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ ),
+ ),
+
+ $customer
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'fullName' => 'John Doe',
+ 'inn' => '6321341814',
+ ),
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ ),
+
+ $customer
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ ),
+ 'phone' => '79000000000',
+ ),
+
+ $customer
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'fullName' => 'John Doe',
+ 'inn' => '6321341814',
+ 'phone' => '79000000000',
+ ),
+ 'email' => 'johndoe@yoomoney.ru',
+ ),
+
+ $customer
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'phone' => '79000000000',
+ 'email' => 'johndoe@yoomoney.ru',
+ ),
+ 'email' => 'johndoeOld@yoomoney.ru',
+ ),
+
+ $customer
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'fullName' => 'John Doe',
+ 'inn' => '6321341814',
+ 'phone' => '79000000000',
+ 'email' => 'johndoe@yoomoney.ru',
+ ),
+ 'phone' => '79111111111',
+ ),
+
+ $customer
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'phone' => '79000000000',
+ 'email' => 'johndoe@yoomoney.ru',
+ ),
+ 'phone' => '79111111111',
+ 'email' => 'johndoeOld@yoomoney.ru',
+ ),
+
+ $customer
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptItemTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptItemTest.php
new file mode 100644
index 0000000..753cc28
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptItemTest.php
@@ -0,0 +1,1206 @@
+getTestInstance();
+ self::assertNull($instance->getDescription());
+ self::assertNull($instance->description);
+ $instance->setDescription($value);
+ self::assertEquals((string)$value, $instance->getDescription());
+ self::assertEquals((string)$value, $instance->description);
+ }
+
+ /**
+ * @dataProvider validDescriptionDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterDescription($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->description = $value;
+ self::assertEquals((string)$value, $instance->getDescription());
+ self::assertEquals((string)$value, $instance->description);
+ }
+
+ public function validDescriptionDataProvider()
+ {
+ return array(
+ array(Random::str(1)),
+ array(Random::str(2, 31)),
+ array(Random::str(32)),
+ array(new StringObject(Random::str(64))),
+ array(123),
+ array(45.3),
+ );
+ }
+
+ /**
+ * @dataProvider invalidDescriptionDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidDescription($value)
+ {
+ $this->getTestInstance()->setDescription($value);
+ }
+
+ /**
+ * @dataProvider invalidDescriptionDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidDescription($value)
+ {
+ $this->getTestInstance()->description = $value;
+ }
+
+ public function invalidDescriptionDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(new StringObject('')),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(array()),
+ );
+ }
+
+ /**
+ * @dataProvider validQuantityDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetQuantity($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getQuantity());
+ self::assertNull($instance->quantity);
+ $instance->setQuantity($value);
+ self::assertEquals((float)$value, $instance->getQuantity());
+ self::assertEquals((float)$value, $instance->quantity);
+ }
+
+ /**
+ * @dataProvider validQuantityDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterQuantity($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->quantity = $value;
+ self::assertEquals((float)$value, $instance->getQuantity());
+ self::assertEquals((float)$value, $instance->quantity);
+ }
+
+ public function validQuantityDataProvider()
+ {
+ return array(
+ array(1),
+ array(1.3),
+ array(0.001),
+ array(10000.001),
+ array('3.1415'),
+ array(Random::float(0.001, 9999.999)),
+ array(Random::int(1, 9999)),
+ );
+ }
+
+ /**
+ * @dataProvider invalidQuantityDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidQuantity($value)
+ {
+ $this->getTestInstance()->setQuantity($value);
+ }
+
+ /**
+ * @dataProvider invalidQuantityDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidQuantity($value)
+ {
+ $this->getTestInstance()->quantity = $value;
+ }
+
+ public function invalidQuantityDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(0.0),
+ array(Random::float(-100, -0.001)),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validVatCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetVatCode($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getVatCode());
+ self::assertNull($instance->vatCode);
+ self::assertNull($instance->vat_code);
+ $instance->setVatCode($value);
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getVatCode());
+ self::assertNull($instance->vatCode);
+ self::assertNull($instance->vat_code);
+ } else {
+ self::assertEquals((int)$value, $instance->getVatCode());
+ self::assertEquals((int)$value, $instance->vatCode);
+ self::assertEquals((int)$value, $instance->vat_code);
+ }
+ }
+
+ /**
+ * @dataProvider validVatCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterVatCode($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->vatCode = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getVatCode());
+ self::assertNull($instance->vatCode);
+ self::assertNull($instance->vat_code);
+ } else {
+ self::assertEquals((int)$value, $instance->getVatCode());
+ self::assertEquals((int)$value, $instance->vatCode);
+ self::assertEquals((int)$value, $instance->vat_code);
+ }
+ }
+
+ /**
+ * @dataProvider validDataAgent
+ * @param $value
+ */
+ public function testSetAgentType($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->getAgentType());
+ $instance->setAgentType($value);
+ self::assertSame($value, $instance->getAgentType());
+ }
+
+ public function validDataAgent()
+ {
+ $values = array();
+ for ($i = 0; $i < 5; $i++) {
+ $values[] = array(Random::value(AgentType::getValidValues()));
+ }
+ return $values;
+ }
+
+ /**
+ * @dataProvider validDataSupplier
+ * @param $value
+ */
+ public function testSetSupplier($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->getSupplier());
+ $instance->setSupplier($value);
+ if (is_array($value)) {
+ $value = new Supplier($value);
+ }
+ self::assertEquals($value, $instance->getSupplier());
+ }
+
+ /**
+ * @return array[]
+ * @throws \Exception
+ */
+ public function validDataSupplier()
+ {
+ $validData = array(
+ array(
+ array(
+ 'name' => Random::str(1, 100),
+ 'phone' => '79000000000',
+ 'inn' => '1000000000',
+ ),
+ ),
+ );
+ for ($i = 0; $i < 3; $i++) {
+ $supplier = array(
+ new Supplier(
+ array(
+ 'name' => Random::str(1, 100),
+ 'phone' => '79000000000',
+ 'inn' => '1000000000',
+ )
+ )
+ );
+ $validData[] = $supplier;
+ }
+ return $validData;
+ }
+ /**
+ * @dataProvider validVatCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterVat_code($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->vat_code = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getVatCode());
+ self::assertNull($instance->vatCode);
+ self::assertNull($instance->vat_code);
+ } else {
+ self::assertEquals((int)$value, $instance->getVatCode());
+ self::assertEquals((int)$value, $instance->vatCode);
+ self::assertEquals((int)$value, $instance->vat_code);
+ }
+ }
+
+ /**
+ * @dataProvider validPaymentSubjectDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterPayment_subject($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->payment_subject = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentSubject());
+ self::assertNull($instance->payment_subject);
+ self::assertNull($instance->paymentSubject);
+ } else {
+ self::assertContains($instance->getPaymentSubject(), PaymentSubject::getValidValues());
+ self::assertContains($instance->payment_subject, PaymentSubject::getValidValues());
+ self::assertContains($instance->paymentSubject, PaymentSubject::getValidValues());
+ }
+ }
+
+ /**
+ * @dataProvider validPaymentSubjectDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterPaymentSubject($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->paymentSubject = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentSubject());
+ self::assertNull($instance->payment_subject);
+ self::assertNull($instance->paymentSubject);
+ } else {
+ self::assertContains($instance->getPaymentSubject(), PaymentSubject::getValidValues());
+ self::assertContains($instance->payment_subject, PaymentSubject::getValidValues());
+ self::assertContains($instance->paymentSubject, PaymentSubject::getValidValues());
+ }
+ }
+
+ /**
+ * @dataProvider validPaymentModeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterPayment_mode($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->payment_mode = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentMode());
+ self::assertNull($instance->payment_mode);
+ self::assertNull($instance->paymentMode);
+ } else {
+ self::assertContains($instance->getPaymentMode(), PaymentMode::getValidValues());
+ self::assertContains($instance->payment_mode, PaymentMode::getValidValues());
+ self::assertContains($instance->paymentMode, PaymentMode::getValidValues());
+ }
+ }
+
+ /**
+ * @dataProvider validPaymentModeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterPaymentMode($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->paymentMode = $value;
+ if ($value === null || $value === '') {
+ self::assertNull($instance->getPaymentMode());
+ self::assertNull($instance->payment_mode);
+ self::assertNull($instance->paymentMode);
+ } else {
+ self::assertContains($instance->getPaymentMode(), PaymentMode::getValidValues());
+ self::assertContains($instance->payment_mode, PaymentMode::getValidValues());
+ self::assertContains($instance->paymentMode, PaymentMode::getValidValues());
+ }
+ }
+
+ public function validVatCodeDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(1),
+ array(2),
+ array(3),
+ array(4),
+ array(5),
+ array(6),
+ );
+ }
+
+ public function validPaymentSubjectDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(PaymentSubject::ANOTHER),
+ array(PaymentSubject::AGENT_COMMISSION),
+ array(PaymentSubject::PAYMENT),
+ array(PaymentSubject::GAMBLING_PRIZE),
+ array(PaymentSubject::GAMBLING_BET),
+ array(PaymentSubject::COMPOSITE),
+ array(PaymentSubject::INTELLECTUAL_ACTIVITY),
+ array(PaymentSubject::LOTTERY_PRIZE),
+ array(PaymentSubject::LOTTERY),
+ array(PaymentSubject::SERVICE),
+ array(PaymentSubject::JOB),
+ array(PaymentSubject::EXCISE),
+ array(PaymentSubject::COMMODITY),
+ );
+ }
+
+ public function validPaymentModeDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(PaymentMode::ADVANCE),
+ array(PaymentMode::CREDIT),
+ array(PaymentMode::CREDIT_PAYMENT),
+ array(PaymentMode::FULL_PAYMENT),
+ array(PaymentMode::FULL_PREPAYMENT),
+ array(PaymentMode::PARTIAL_PAYMENT),
+ array(PaymentMode::PARTIAL_PREPAYMENT),
+ );
+ }
+
+ /**
+ * @dataProvider invalidVatCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidVatCode($value)
+ {
+ $this->getTestInstance()->setVatCode($value);
+ }
+
+ /**
+ * @dataProvider invalidVatCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidVatCode($value)
+ {
+ $this->getTestInstance()->vatCode = $value;
+ }
+
+ /**
+ * @dataProvider invalidVatCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidVat_code($value)
+ {
+ $this->getTestInstance()->vat_code = $value;
+ }
+
+ public function invalidVatCodeDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(0),
+ array(7),
+ array(Random::int(-100, -1)),
+ array(Random::int(8, 100)),
+ );
+ }
+
+ /**
+ * @dataProvider validPriceDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testGetSetPrice($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getPrice());
+ self::assertNull($instance->price);
+ $instance->setPrice($value);
+ self::assertSame($value, $instance->getPrice());
+ self::assertSame($value, $instance->price);
+ }
+
+ /**
+ * @dataProvider validPriceDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterPrice($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->price = $value;
+ self::assertSame($value, $instance->getPrice());
+ self::assertSame($value, $instance->price);
+ }
+
+ public function validPriceDataProvider()
+ {
+ return array(
+ array(
+ new ReceiptItemAmount(
+ Random::int(1, 100),
+ Random::value(CurrencyCode::getValidValues())
+ ),
+ ),
+ array(
+ new ReceiptItemAmount(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider invalidPriceDataProvider
+ *
+ * @param $value
+ */
+ public function testSetInvalidPrice($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $this->getTestInstance()->setPrice($value);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPriceDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterInvalidPrice($value)
+ {
+ if (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $this->getTestInstance()->price = $value;
+ }
+ }
+
+ public function invalidPriceDataProvider()
+ {
+ $result = array(
+ array(null),
+ array(''),
+ array(1.0),
+ array(1),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+
+ return $result;
+ }
+
+ /**
+ * @dataProvider validIsShippingDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetIsShipping($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertFalse($instance->isShipping());
+ $instance->setIsShipping($value);
+ if ($value) {
+ self::assertTrue($instance->isShipping());
+ } else {
+ self::assertFalse($instance->isShipping());
+ }
+ }
+
+ /**
+ * @dataProvider validIsShippingDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterIsShipping($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->isShipping = $value;
+ if ($value) {
+ self::assertTrue($instance->isShipping());
+ } else {
+ self::assertFalse($instance->isShipping());
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function validIsShippingDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(0),
+ array(1),
+ array(2),
+ array(null),
+ array(''),
+ );
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @dataProvider invalidIsShippingDataProvider
+ *
+ * @param mixed $value
+ */
+ public function testInvalidSetIsShipping($value)
+ {
+ $this->getTestInstance()->setIsShipping($value);
+ }
+
+ /**
+ * @expectedException \InvalidArgumentException
+ * @dataProvider invalidIsShippingDataProvider
+ *
+ * @param mixed $value
+ */
+ public function testInvalidSetterIsShipping($value)
+ {
+ $this->getTestInstance()->isShipping = $value;
+ }
+
+ public function invalidIsShippingDataProvider()
+ {
+ return array(
+ array(array()),
+ array('true'),
+ array('false'),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validApplyDiscountCoefficientDataProvider
+ *
+ * @param $baseValue
+ * @param $coefficient
+ * @param $expected
+ */
+ public function testApplyDiscountCoefficient($baseValue, $coefficient, $expected)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->setPrice(new ReceiptItemAmount($baseValue));
+ $instance->applyDiscountCoefficient($coefficient);
+ self::assertEquals($expected, $instance->getPrice()->getIntegerValue());
+ }
+
+ public function validApplyDiscountCoefficientDataProvider()
+ {
+ return array(
+ array(1, 1, 100),
+ array(1.01, 1, 101),
+ array(1.01, 0.5, 51),
+ array(1.01, 0.4, 40),
+ array(1.00, 0.5, 50),
+ array(1.00, 0.333333333, 33),
+ array(2.00, 0.333333333, 67),
+ );
+ }
+
+ /**
+ * @dataProvider invalidApplyDiscountCoefficientDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param mixed $coefficient
+ */
+ public function testInvalidApplyDiscountCoefficient($coefficient)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->setPrice(new ReceiptItemAmount(Random::int(100)));
+ $instance->applyDiscountCoefficient($coefficient);
+ }
+
+ public function invalidApplyDiscountCoefficientDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array('test'),
+ array(array()),
+ array(new \stdClass()),
+ array(-1.4),
+ array(-0.01),
+ array(-0.0001),
+ array(0.0),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param $price
+ * @param $quantity
+ */
+ public function testGetAmount($price, $quantity)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setPrice(new ReceiptItemAmount($price));
+ $instance->setQuantity($quantity);
+ $expected = (int)round($price * 100.0 * $quantity);
+ self::assertEquals($expected, $instance->getAmount());
+ }
+
+ public function validAmountDataProvider()
+ {
+ return array(
+ array(1, 1),
+ array(1.01, 1.01),
+ );
+ }
+
+ /**
+ * @dataProvider validIncreasePriceDataProvider
+ *
+ * @param float $price
+ * @param float $value
+ * @param int $expected
+ */
+ public function testIncreasePrice($price, $value, $expected)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setPrice(new ReceiptItemAmount($price));
+ $instance->increasePrice($value);
+ self::assertEquals($expected, $instance->getPrice()->getIntegerValue());
+ }
+
+ public function validIncreasePriceDataProvider()
+ {
+ return array(
+ array(1, 1, 200),
+ array(1.01, 3.03, 404),
+ array(1.01, -0.01, 100),
+ );
+ }
+
+ /**
+ * @dataProvider invalidIncreasePriceDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param float $price
+ * @param float $value
+ */
+ public function testInvalidIncreasePrice($price, $value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setPrice(new ReceiptItemAmount($price));
+ $instance->increasePrice($value);
+ }
+
+ public function invalidIncreasePriceDataProvider()
+ {
+ return array(
+ array(1, -1),
+ array(1.01, -1.01),
+ array(1.01, -1.02),
+ array(1.01, null),
+ array(1.01, false),
+ array(1.01, true),
+ array(1.01, ''),
+ array(1.01, 'test'),
+ array(1.01, array()),
+ array(1.01, new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validFetchItemDataProvider
+ *
+ * @param $price
+ * @param $quantity
+ * @param $fetch
+ */
+ public function testFetchItem($price, $quantity, $fetch)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setPrice(new ReceiptItemAmount($price));
+ $instance->setQuantity($quantity);
+
+ $fetched = $instance->fetchItem($fetch);
+ self::assertTrue($fetched instanceof ReceiptItem);
+ self::assertNotSame($fetched->getPrice(), $instance->getPrice());
+ self::assertEquals($fetch, $fetched->getQuantity());
+ self::assertEquals($quantity - $fetch, $instance->getQuantity());
+ self::assertEquals($price, $instance->getPrice()->getValue());
+ self::assertEquals($price, $fetched->getPrice()->getValue());
+ }
+
+ public function validFetchItemDataProvider()
+ {
+ return array(
+ array(1, 2, 1),
+ array(1.01, 2, 1.5),
+ array(1.01, 2, 1.99),
+ array(1.01, 2, 1.9999),
+ );
+ }
+
+ /**
+ * @dataProvider invalidFetchItemDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $quantity
+ * @param $fetch
+ */
+ public function testInvalidFetchItem($quantity, $fetch)
+ {
+ $instance = $this->getTestInstance();
+ $instance->setPrice(new ReceiptItemAmount(Random::int(1, 100)));
+ $instance->setQuantity($quantity);
+ $instance->fetchItem($fetch);
+
+ }
+
+ public function invalidFetchItemDataProvider()
+ {
+ return array(
+ array(1, 1),
+ array(1.01, 1.01),
+ array(1.01, 1.02),
+ array(1, null),
+ array(1, ''),
+ array(1, 0.0),
+ array(1, -12.3),
+ array(1, array()),
+ array(1, new \stdClass()),
+ array(1, 'test'),
+ );
+ }
+
+ ////////////////////////////////////////////////////////////////
+
+ /**
+ * @dataProvider validProductCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetProductCode($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->getProductCode());
+ self::assertNull($instance->productCode);
+ self::assertNull($instance->product_code);
+ $instance->setProductCode($value);
+ self::assertEquals((string)$value, $instance->getProductCode());
+ self::assertEquals((string)$value, $instance->productCode);
+ self::assertEquals((string)$value, $instance->product_code);
+ }
+
+ /**
+ * @dataProvider validProductCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetProduct_code($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->product_code = $value;
+ self::assertEquals((string)$value, $instance->getProductCode());
+ self::assertEquals((string)$value, $instance->productCode);
+ self::assertEquals((string)$value, $instance->product_code);
+ }
+
+ /**
+ * @dataProvider validProductCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterProductCode($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->productCode = $value;
+ self::assertEquals((string)$value, $instance->getProductCode());
+ self::assertEquals((string)$value, $instance->productCode);
+ self::assertEquals((string)$value, $instance->product_code);
+ }
+
+ public function validProductCodeDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(2, 96, '0123456789ABCDEF ')),
+ );
+ }
+
+ /**
+ * @dataProvider invalidProductCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidProductCode($value)
+ {
+ $this->getTestInstance()->setProductCode($value);
+ }
+
+ /**
+ * @dataProvider invalidProductCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidProductCode($value)
+ {
+ $this->getTestInstance()->productCode = $value;
+ }
+
+ public function invalidProductCodeDataProvider()
+ {
+ return array(
+ array(new StringObject('')),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(array()),
+ array(Random::str(2, 96, 'GHIJKLMNOPQRSTUVWXYZ!@#$%^&*()_+-=`~?><:"\'')),
+ );
+ }
+
+ ////////////////////////////////////////////////////////////////
+
+ /**
+ * @dataProvider validCountryOfOriginCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetCountryOfOriginCode($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->getCountryOfOriginCode());
+ self::assertNull($instance->countryOfOriginCode);
+ self::assertNull($instance->country_of_origin_code);
+ $instance->setCountryOfOriginCode($value);
+ self::assertEquals((string)$value, $instance->getCountryOfOriginCode());
+ self::assertEquals((string)$value, $instance->countryOfOriginCode);
+ self::assertEquals((string)$value, $instance->country_of_origin_code);
+ }
+
+ /**
+ * @dataProvider validCountryOfOriginCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterCountryOfOrigin_code($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->country_of_origin_code = $value;
+ self::assertEquals((string)$value, $instance->getCountryOfOriginCode());
+ self::assertEquals((string)$value, $instance->countryOfOriginCode);
+ self::assertEquals((string)$value, $instance->country_of_origin_code);
+ }
+
+ /**
+ * @dataProvider validCountryOfOriginCodeDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterCountryOfOriginCode($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->countryOfOriginCode = $value;
+ self::assertEquals((string)$value, $instance->getCountryOfOriginCode());
+ self::assertEquals((string)$value, $instance->countryOfOriginCode);
+ self::assertEquals((string)$value, $instance->country_of_origin_code);
+ }
+
+ public function validCountryOfOriginCodeDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(2, 2, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')),
+ );
+ }
+
+ /**
+ * @dataProvider invalidCountryOfOriginCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidCountryOfOriginCode($value)
+ {
+ $this->getTestInstance()->setCountryOfOriginCode($value);
+ }
+
+ /**
+ * @dataProvider invalidCountryOfOriginCodeDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidCountryOfOriginCode($value)
+ {
+ $this->getTestInstance()->countryOfOriginCode = $value;
+ }
+
+ public function invalidCountryOfOriginCodeDataProvider()
+ {
+ return array(
+ array(new StringObject('')),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(array()),
+ array(Random::int()),
+ array(Random::str(1, 1)),
+ array(Random::str(3, null, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')),
+ array(Random::str(2, 2, '0123456789!@#$%^&*()_+-=`~?><:"\' ')),
+ );
+ }
+
+ /**
+ * @dataProvider validCustomsDeclarationNumberDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetCustomsDeclarationNumber($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->getCustomsDeclarationNumber());
+ self::assertNull($instance->customsDeclarationNumber);
+ self::assertNull($instance->customs_declaration_number);
+ $instance->setCustomsDeclarationNumber($value);
+ self::assertEquals((string)$value, $instance->getCustomsDeclarationNumber());
+ self::assertEquals((string)$value, $instance->customsDeclarationNumber);
+ self::assertEquals((string)$value, $instance->customs_declaration_number);
+ }
+
+ /**
+ * @dataProvider validCustomsDeclarationNumberDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterCustomsDeclaration_number($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->customsDeclarationNumber = $value;
+ self::assertEquals((string)$value, $instance->getCustomsDeclarationNumber());
+ self::assertEquals((string)$value, $instance->customsDeclarationNumber);
+ self::assertEquals((string)$value, $instance->customs_declaration_number);
+ }
+
+ /**
+ * @dataProvider validCustomsDeclarationNumberDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterCustomsDeclarationNumber($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->customsDeclarationNumber = $value;
+ self::assertEquals((string)$value, $instance->getCustomsDeclarationNumber());
+ self::assertEquals((string)$value, $instance->customsDeclarationNumber);
+ self::assertEquals((string)$value, $instance->customs_declaration_number);
+ }
+
+ public function validCustomsDeclarationNumberDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(1)),
+ array(Random::str(2, 31)),
+ array(Random::str(32)),
+ );
+ }
+
+ /**
+ * @dataProvider invalidCustomsDeclarationNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidCustomsDeclarationNumber($value)
+ {
+ $this->getTestInstance()->setCustomsDeclarationNumber($value);
+ }
+
+ /**
+ * @dataProvider invalidCustomsDeclarationNumberDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidCustomsDeclarationNumber($value)
+ {
+ $this->getTestInstance()->customsDeclarationNumber = $value;
+ }
+
+ public function invalidCustomsDeclarationNumberDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(array()),
+ array(Random::str(33, 64)),
+ );
+ }
+
+ /**
+ * @dataProvider validExciseDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetExcise($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getExcise());
+ self::assertNull($instance->excise);
+ $instance->setExcise($value);
+ self::assertEquals((float)$value, $instance->getExcise());
+ self::assertEquals((float)$value, $instance->excise);
+ }
+
+ /**
+ * @dataProvider validExciseDataProvider
+ *
+ * @param $value
+ */
+ public function testSetterExcise($value)
+ {
+ $instance = $this->getTestInstance();
+
+ $instance->excise = $value;
+ self::assertEquals((float)$value, $instance->getExcise());
+ self::assertEquals((float)$value, $instance->excise);
+ }
+
+ public function validExciseDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(1),
+ array(1.3),
+ array(0.001),
+ array(10000.001),
+ array('3.1415'),
+ array(Random::float(0.001, 9999.999)),
+ array(Random::int(1, 9999)),
+ );
+ }
+
+ /**
+ * @dataProvider invalidExciseDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidExcise($value)
+ {
+ $this->getTestInstance()->setExcise($value);
+ }
+
+ /**
+ * @dataProvider invalidExciseDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidExcise($value)
+ {
+ $this->getTestInstance()->excise = $value;
+ }
+
+ public function invalidExciseDataProvider()
+ {
+ return array(
+ array(0.0),
+ array(Random::float(-100, -0.001)),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptTest.php
new file mode 100644
index 0000000..bd0aaf9
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/ReceiptTest.php
@@ -0,0 +1,734 @@
+getItems());
+ self::assertTrue(is_array($instance->getItems()));
+ self::assertEmpty($instance->getItems());
+
+ self::assertNotNull($instance->items);
+ self::assertTrue(is_array($instance->items));
+ self::assertEmpty($instance->items);
+
+ $item = new ReceiptItem();
+ $instance->addItem($item);
+ $items = $instance->getItems();
+ self::assertTrue(count($items) === 1);
+ foreach ($items as $tmp) {
+ self::assertSame($item, $tmp);
+ }
+
+ $instance->setItems(array());
+ self::assertNotNull($instance->getItems());
+ self::assertTrue(is_array($instance->getItems()));
+ self::assertEmpty($instance->getItems());
+
+ $instance->setItems($items);
+ self::assertTrue(count($items) === 1);
+ foreach ($items as $tmp) {
+ self::assertSame($item, $tmp);
+ }
+ }
+
+ /**
+ * @dataProvider invalidItemsProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidItems($value)
+ {
+ $instance = new Receipt();
+ $instance->setItems($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testGetSetTaxSystemCode($options)
+ {
+ $instance = new Receipt();
+
+ self::assertNull($instance->getTaxSystemCode());
+ self::assertNull($instance->taxSystemCode);
+ self::assertNull($instance->tax_system_code);
+
+ $instance->setTaxSystemCode($options['tax_system_code']);
+ self::assertEquals($options['tax_system_code'], $instance->getTaxSystemCode());
+ self::assertEquals($options['tax_system_code'], $instance->taxSystemCode);
+ self::assertEquals($options['tax_system_code'], $instance->tax_system_code);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetterTaxSystemCode($options)
+ {
+ $instance = new Receipt();
+
+ self::assertNull($instance->getTaxSystemCode());
+ self::assertNull($instance->taxSystemCode);
+ self::assertNull($instance->tax_system_code);
+
+ $instance->taxSystemCode = $options['tax_system_code'];
+ self::assertEquals($options['tax_system_code'], $instance->getTaxSystemCode());
+ self::assertEquals($options['tax_system_code'], $instance->taxSystemCode);
+ self::assertEquals($options['tax_system_code'], $instance->tax_system_code);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetterTax_system_code($options)
+ {
+ $instance = new Receipt();
+
+ self::assertNull($instance->getTaxSystemCode());
+ self::assertNull($instance->taxSystemCode);
+ self::assertNull($instance->tax_system_code);
+
+ $instance->tax_system_code = $options['tax_system_code'];
+ self::assertEquals($options['tax_system_code'], $instance->getTaxSystemCode());
+ self::assertEquals($options['tax_system_code'], $instance->taxSystemCode);
+ self::assertEquals($options['tax_system_code'], $instance->tax_system_code);
+ }
+
+ /**
+ * @dataProvider invalidTaxSystemIdProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidTaxSystemCode($value)
+ {
+ $instance = new Receipt();
+ $instance->setTaxSystemCode($value);
+ }
+
+ /**
+ *
+ */
+ public function testNotEmpty()
+ {
+ $instance = new Receipt();
+
+ self::assertFalse($instance->notEmpty());
+ $instance->addItem(new ReceiptItem());
+ self::assertTrue($instance->notEmpty());
+ $instance->setItems(array());
+ self::assertFalse($instance->notEmpty());
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'items' => array(),
+ 'tax_system_code' => null,
+ 'customer' => array(
+ 'phone' => '',
+ 'email' => '',
+ ),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(),
+ 'tax_system_code' => '',
+ 'customer' => array(
+ 'phone' => '',
+ 'email' => '',
+ ),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(),
+ 'customer' => array(
+ 'phone' => '',
+ 'email' => '',
+ ),
+ 'tax_system_code' => '',
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(),
+ 'customer' => array(
+ 'phone' => '',
+ 'email' => '',
+ ),
+ 'tax_system_code' => '',
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(),
+ 'customer' => array(
+ 'phone' => '',
+ 'email' => '',
+ ),
+ 'tax_system_code' => '',
+ ),
+ ),
+ );
+ for ($i = 1; $i < 6; $i++) {
+ $receipt = array(
+ 'items' => array(),
+ 'tax_system_code' => $i,
+ 'phone' => Random::str(10, 10, '1234567890'),
+ 'email' => uniqid() . '@' . uniqid(),
+ );
+ $result[] = array($receipt);
+ }
+ return $result;
+ }
+
+ public function invalidItemsProvider()
+ {
+ return array(
+ array(null),
+ array(new \stdClass()),
+ array('invalid_value'),
+ array(''),
+ array(0),
+ array(1),
+ array(true),
+ array(false),
+ array(1.43),
+ array(
+ array(
+ array(
+ 'description' => 'text',
+ 'quantity' => 1,
+ 'amount' => array(
+ 'value' => 1,
+ 'currency' => 'RUB',
+ ),
+ 'vat_code' => 1,
+ ),
+ ),
+ ),
+ array(
+ array(new \stdClass()),
+ ),
+ );
+ }
+
+ public function invalidTaxSystemIdProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array('invalid_value'),
+ array(0),
+ array(3234),
+ array(true),
+ array(false),
+ array(0.43),
+ );
+ }
+
+ public function invalidPhoneProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ );
+ }
+
+ public function testGetAmountValue()
+ {
+ $receipt = new Receipt();
+ self::assertEquals(0, $receipt->getAmountValue());
+
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(Random::float(0.01, 99.99)));
+ $item->setQuantity(Random::float(0.0001, 99.99));
+ $receipt->addItem($item);
+
+ $expected = (int)round($item->getPrice()->getIntegerValue() * $item->getQuantity());
+ self::assertEquals($expected, $receipt->getAmountValue());
+ self::assertEquals($expected, $receipt->getAmountValue(false));
+ self::assertEquals(0, $receipt->getShippingAmountValue());
+
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(Random::float(0.01, 99.99)));
+ $item->setQuantity(Random::float(0.0001, 99.99));
+ $receipt->addItem($item);
+
+ $expected += (int)round($item->getPrice()->getIntegerValue() * $item->getQuantity());
+ self::assertEquals($expected, $receipt->getAmountValue());
+ self::assertEquals($expected, $receipt->getAmountValue(false));
+ self::assertEquals(0, $receipt->getShippingAmountValue());
+
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(Random::float(0.01, 99.99)));
+ $item->setQuantity(Random::float(0.0001, 99.99));
+ $item->setIsShipping(true);
+ $receipt->addItem($item);
+
+ $shipping = $expected;
+ $expected += (int)round($item->getPrice()->getIntegerValue() * $item->getQuantity());
+
+ self::assertEquals($expected, $receipt->getAmountValue());
+ self::assertEquals($shipping, $receipt->getAmountValue(false));
+ self::assertEquals($expected - $shipping, $receipt->getShippingAmountValue());
+
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(Random::float(0.01, 99.99)));
+ $item->setQuantity(Random::float(0.0001, 99.99));
+ $item->setIsShipping(true);
+ $receipt->addItem($item);
+
+ $expected += (int)round($item->getPrice()->getIntegerValue() * $item->getQuantity());
+
+ self::assertEquals($expected, $receipt->getAmountValue());
+ self::assertEquals($shipping, $receipt->getAmountValue(false));
+ self::assertEquals($expected - $shipping, $receipt->getShippingAmountValue());
+
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(Random::float(0.01, 99.99)));
+ $item->setQuantity(Random::float(0.0001, 99.99));
+ $receipt->addItem($item);
+
+ $shipping += (int)round($item->getPrice()->getIntegerValue() * $item->getQuantity());
+ $expected += (int)round($item->getPrice()->getIntegerValue() * $item->getQuantity());
+ self::assertEquals($expected, $receipt->getAmountValue());
+ self::assertEquals($shipping, $receipt->getAmountValue(false));
+ self::assertEquals($expected - $shipping, $receipt->getShippingAmountValue());
+ }
+
+ /**
+ * @dataProvider validNormalizationDataProvider
+ * @param $items
+ * @param $amount
+ * @param $expected
+ */
+ public function testNormalize($items, $amount, $expected, $withShipping = false)
+ {
+ $receipt = new Receipt();
+ foreach ($items as $itemInfo) {
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount($itemInfo['price']));
+ if (!empty($itemInfo['quantity'])) {
+ $item->setQuantity($itemInfo['quantity']);
+ } else {
+ $item->setQuantity(1);
+ }
+ if (!empty($itemInfo['shipping'])) {
+ $item->setIsShipping(true);
+ }
+ $receipt->addItem($item);
+ }
+ $receipt->normalize(new MonetaryAmount($amount), $withShipping);
+
+ self::assertEquals(count($expected), count($receipt->getItems()));
+ $expectedAmount = 0;
+ foreach ($receipt->getItems() as $index => $item) {
+ self::assertEquals($expected[$index]['price'], $item->getPrice()->getIntegerValue());
+ self::assertEquals($expected[$index]['quantity'], $item->getQuantity());
+
+ $expectedAmount += $item->getAmount();
+ }
+ self::assertEquals($expectedAmount, $amount * 100);
+ }
+
+ public function validNormalizationDataProvider()
+ {
+ return array(
+ array(
+ array(
+ array('price' => 10.0),
+ ),
+ 9.0,
+ array(
+ array('price' => 900, 'quantity' => 1.0),
+ )
+ ),
+ array(
+ array(
+ array('price' => 10.0),
+ array('price' => 20.0),
+ ),
+ 29.0,
+ array(
+ array('price' => 967, 'quantity' => 1.0),
+ array('price' => 1933, 'quantity' => 1.0),
+ )
+ ),
+ array(
+ array(
+ array('price' => 10.0, 'quantity' => 1),
+ array('price' => 20.0, 'quantity' => 3),
+ ),
+ 29.0,
+ array(
+ array('price' => 413, 'quantity' => 1.0),
+ array('price' => 829, 'quantity' => 3.0),
+ )
+ ),
+ array(
+ array(
+ array('price' => 50.0, 'quantity' => 3),
+ array('price' => 20.0, 'quantity' => 3),
+ ),
+ 100.0,
+ array(
+ array('price' => 2381, 'quantity' => 2.0),
+ array('price' => 2382, 'quantity' => 1.0),
+ array('price' => 952, 'quantity' => 3.0),
+ )
+ ),
+ array(
+ array(
+ array('price' => 10.0, 'shipping' => true),
+ array('price' => 50.0, 'quantity' => 3),
+ array('price' => 10.0, 'shipping' => true),
+ array('price' => 20.0, 'quantity' => 3),
+ ),
+ 120.0,
+ array(
+ array('price' => 1000, 'quantity' => 1.0),
+ array('price' => 2381, 'quantity' => 2.0),
+ array('price' => 2382, 'quantity' => 1.0),
+ array('price' => 1000, 'quantity' => 1.0),
+ array('price' => 952, 'quantity' => 3.0),
+ )
+ ),
+ array(
+ array(
+ array('price' => 50.0, 'quantity' => 1, 'shipping' => 1),
+ array('price' => 50.0, 'quantity' => 2),
+ array('price' => 20.0, 'quantity' => 3),
+ ),
+ 100.0,
+ array(
+ array('price' => 2381, 'quantity' => 1.0),
+ array('price' => 2381, 'quantity' => 1.0),
+ array('price' => 2382, 'quantity' => 1.0),
+ array('price' => 952, 'quantity' => 3.0),
+ ),
+ true
+ ),
+ array(
+ array(
+ array('price' => 50.0, 'quantity' => 1, 'shipping' => 1),
+ ),
+ 49.0,
+ array(
+ array('price' => 4900, 'quantity' => 1.0),
+ ),
+ true
+ ),
+ array(
+ array(
+ array('price' => 100.0, 'quantity' => 0.5),
+ array('price' => 100.0, 'quantity' => 0.4),
+ ),
+ 98.0,
+ array(
+ array('price' => 10889, 'quantity' => 0.25),
+ array('price' => 10888, 'quantity' => 0.25),
+ array('price' => 10889, 'quantity' => 0.4),
+ ),
+ true
+ ),
+ array(
+ array(
+ array('price' => 10, 'quantity' => 1),
+ array('price' => 300, 'quantity' => 1, 'shipping' => 1),
+ ),
+ 10.0,
+ array(
+ array('price' => 32, 'quantity' => 1),
+ array('price' => 968, 'quantity' => 1, 'shipping' => 1),
+ ),
+ true
+ ),
+ array(
+ array(
+ array('price' => 10, 'quantity' => 1),
+ array('price' => 300, 'quantity' => 1, 'shipping' => 1),
+ ),
+ 10.0,
+ array(
+ array('price' => 32, 'quantity' => 1),
+ array('price' => 968, 'quantity' => 1, 'shipping' => 1),
+ ),
+ false
+ ),
+ array(
+ array(
+ array('price' => 0.01, 'quantity' => 1),
+ array('price' => 0.02, 'quantity' => 1),
+ array('price' => 0.03, 'quantity' => 1),
+ array('price' => 300, 'quantity' => 1, 'shipping' => 1),
+ ),
+ 0.06,
+ array(
+ array('price' => 1, 'quantity' => 1),
+ array('price' => 1, 'quantity' => 1),
+ array('price' => 1, 'quantity' => 1),
+ array('price' => 3, 'quantity' => 1, 'shipping' => 1),
+ ),
+ false
+ ),
+ array(
+ array(
+ array('price' => 0.01, 'quantity' => 7),
+ array('price' => 0.02, 'quantity' => 11),
+ array('price' => 0.03, 'quantity' => 13),
+ array('price' => 300, 'quantity' => 1, 'shipping' => 1),
+ ),
+ 0.60,
+ array(
+ array('price' => 1, 'quantity' => 7),
+ array('price' => 1, 'quantity' => 11),
+ array('price' => 1, 'quantity' => 13),
+ array('price' => 29, 'quantity' => 1, 'shipping' => 1),
+ ),
+ false
+ ),
+ array(
+ array(
+ array('price' => 0.01, 'quantity' => 7),
+ array('price' => 0.02, 'quantity' => 11),
+ array('price' => 10, 'quantity' => 1),
+ array('price' => 300, 'quantity' => 1, 'shipping' => 1),
+ ),
+ 10.29,
+ array(
+ array('price' => 1, 'quantity' => 7),
+ array('price' => 1, 'quantity' => 11),
+ array('price' => 33, 'quantity' => 1),
+ array('price' => 978, 'quantity' => 1, 'shipping' => 1),
+ ),
+ false
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider fromArrayDataProvider
+ * @param array $source
+ * @param array $expected
+ */
+ public function testFromArray($source, $expected)
+ {
+ $receipt = new Receipt();
+ $receipt->fromArray($source);
+
+ if (!empty($expected)) {
+ foreach ($expected as $property => $value) {
+ self::assertEquals($value, $receipt->offsetGet($property));
+ }
+ } else {
+ self::assertEquals(array(), $receipt->getItems());
+ }
+ }
+
+ public function fromArrayDataProvider()
+ {
+ $receiptItem = new ReceiptItem();
+ $receiptItem->setDescription('test');
+ $receiptItem->setQuantity(322);
+ $receiptItem->setVatCode(4);
+ $receiptItem->setPrice(new ReceiptItemAmount(5, 'USD'));
+
+ return array(
+ array(
+ array(),
+ array(),
+ ),
+
+ array(
+ array(
+ 'taxSystemCode' => 2,
+ 'customer' => array(
+ 'phone' => '1234567890',
+ 'email' => 'test@tset',
+ ),
+ 'items' => array(
+ new ReceiptItem(),
+ ),
+ ),
+ array(
+ 'tax_system_code' => 2,
+ 'customer' => new ReceiptCustomer(array(
+ 'phone' => '1234567890',
+ 'email' => 'test@tset',
+ )),
+ 'items' => array(
+ new ReceiptItem(),
+ ),
+ ),
+ ),
+
+ array(
+ array(
+ 'tax_system_code' => 3,
+ 'customer' => array(
+ 'phone' => '1234567890',
+ 'email' => 'test@tset',
+ ),
+ 'items' => array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 322,
+ 'amount' => array(
+ 'value' => 5,
+ 'currency' => 'USD',
+ ),
+ 'vat_code' => 4,
+ ),
+ new ReceiptItem(),
+ array(
+ 'description' => 'test',
+ 'quantity' => 322,
+ 'amount' => array(
+ 'value' => 5,
+ 'currency' => 'USD',
+ ),
+ 'vat_code' => 4,
+ ),
+ ),
+ ),
+ array(
+ 'taxSystemCode' => 3,
+ 'customer' => new ReceiptCustomer(array(
+ 'phone' => '1234567890',
+ 'email' => 'test@tset',
+ )),
+ 'items' => array(
+ $receiptItem,
+ new ReceiptItem(),
+ $receiptItem,
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider fromArrayCustomerDataProvider
+ * @param array $source
+ * @param array $expected
+ */
+ public function testCustomerFromArray($source, $expected)
+ {
+ $receipt = new Receipt();
+ $receipt->fromArray($source);
+
+ if (!empty($expected)) {
+ foreach ($expected as $property => $value) {
+ self::assertEquals($value, $receipt->offsetGet($property));
+ }
+ } else {
+ self::assertEquals(true, $receipt->getCustomer()->isEmpty());
+ }
+ }
+
+ public function fromArrayCustomerDataProvider()
+ {
+ $customer = new ReceiptCustomer();
+ $customer->setFullName('John Doe');
+ $customer->setEmail('johndoe@yoomoney.ru');
+ $customer->setPhone('79000000000');
+ $customer->setInn('6321341814');
+
+ return array(
+
+ array(
+ array(),
+ array(),
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'fullName' => 'John Doe',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ 'inn' => '6321341814',
+ ),
+ ),
+ array(
+ 'customer' => $customer
+ ),
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ ),
+ ),
+ array(
+ 'customer' => $customer
+ ),
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ ),
+ ),
+ array(
+ 'customer' => $customer
+ ),
+ ),
+
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ ),
+ ),
+ array(
+ 'customer' => $customer
+ ),
+ ),
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => 'John Doe',
+ 'inn' => '6321341814',
+ 'email' => 'johndoe@yoomoney.ru',
+ 'phone' => '79000000000',
+ ),
+ ),
+ array(
+ 'customer' => $customer
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/RecipientTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/RecipientTest.php
new file mode 100644
index 0000000..9848765
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/RecipientTest.php
@@ -0,0 +1,161 @@
+getAccountId());
+ self::assertEquals(null, $instance->accountId);
+ self::assertEquals(null, $instance->account_id);
+ $instance->setAccountId($value);
+ self::assertEquals((string)$value, $instance->getAccountId());
+ self::assertEquals((string)$value, $instance->accountId);
+ self::assertEquals((string)$value, $instance->account_id);
+
+ $instance = new Recipient();
+ $instance->accountId = $value;
+ self::assertEquals((string)$value, $instance->getAccountId());
+ self::assertEquals((string)$value, $instance->accountId);
+ self::assertEquals((string)$value, $instance->account_id);
+
+ $instance = new Recipient();
+ $instance->account_id = $value;
+ self::assertEquals((string)$value, $instance->getAccountId());
+ self::assertEquals((string)$value, $instance->accountId);
+ self::assertEquals((string)$value, $instance->account_id);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidAccountId($value)
+ {
+ $instance = new Recipient();
+ $instance->setAccountId($value);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidAccountId($value)
+ {
+ $instance = new Recipient();
+ $instance->accountId = $value;
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidAccount_id($value)
+ {
+ $instance = new Recipient();
+ $instance->account_id = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetGatewayId($value)
+ {
+ $instance = new Recipient();
+
+ self::assertEquals(null, $instance->getGatewayId());
+ self::assertEquals(null, $instance->gatewayId);
+ self::assertEquals(null, $instance->gateway_id);
+ $instance->setGatewayId($value);
+ self::assertEquals((string)$value, $instance->getGatewayId());
+ self::assertEquals((string)$value, $instance->gatewayId);
+ self::assertEquals((string)$value, $instance->gateway_id);
+
+ $instance = new Recipient();
+ $instance->gatewayId = $value;
+ self::assertEquals((string)$value, $instance->getGatewayId());
+ self::assertEquals((string)$value, $instance->gatewayId);
+ self::assertEquals((string)$value, $instance->gateway_id);
+
+ $instance = new Recipient();
+ $instance->gateway_id = $value;
+ self::assertEquals((string)$value, $instance->getGatewayId());
+ self::assertEquals((string)$value, $instance->gatewayId);
+ self::assertEquals((string)$value, $instance->gateway_id);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidGatewayId($value)
+ {
+ $instance = new Recipient();
+ $instance->setGatewayId($value);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidGatewayId($value)
+ {
+ $instance = new Recipient();
+ $instance->gatewayId = $value;
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidGateway_id($value)
+ {
+ $instance = new Recipient();
+ $instance->gateway_id = $value;
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(Random::str(1)),
+ array(Random::str(2, 64)),
+ array(new StringObject(Random::str(1, 32))),
+ array(0),
+ array(123),
+ );
+ return $result;
+ }
+
+ public function invalidDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/RefundTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/RefundTest.php
new file mode 100644
index 0000000..2d6a615
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/RefundTest.php
@@ -0,0 +1,598 @@
+getId());
+ self::assertNull($instance->id);
+
+ $instance->setId($value);
+ self::assertEquals((string)$value, $instance->getId());
+ self::assertEquals((string)$value, $instance->id);
+
+ $instance = new Refund();
+ $instance->id = $value;
+ self::assertEquals((string)$value, $instance->getId());
+ self::assertEquals((string)$value, $instance->id);
+ }
+
+ public function validIdDataProvider()
+ {
+ $values = 'abcdefghijklmnopqrstuvwxyz';
+ $values .= strtoupper($values) . '0123456789._-+';
+
+ return array(
+ array(Random::str(36, $values)),
+ array(Random::str(36, $values)),
+ array(new StringObject(Random::str(36, $values))),
+ array(new StringObject(Random::str(36, $values))),
+ );
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidId($value)
+ {
+ $instance = new Refund();
+ $instance->setId($value);
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidId($value)
+ {
+ $instance = new Refund();
+ $instance->id = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidIdDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(array()),
+ array(Random::str(1,35)),
+ array(Random::str(1)),
+ array(Random::str(35)),
+ array(Random::str(37,48)),
+ array(Random::str(37)),
+ array(new \stdClass()),
+ array(1),
+ array(0),
+ array(-1),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @dataProvider validSources
+ * @param $value
+ */
+ public function testSetSources($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->setSources($value);
+ if (is_array($value)) {
+ $value = array(new Source($value[0]));
+ }
+ self::assertEquals($value, $instance->getSources());
+ }
+
+ /**
+ * @return array[]
+ * @throws \Exception
+ */
+ public function validSources()
+ {
+ $sources = array();
+ for($i = 0; $i < 10; $i++) {
+ $sources[$i][] = array(
+ 'account_id' => (string)Random::int(11111111, 99999999),
+ 'amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'platform_fee_amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ );
+ }
+ $sources[$i][] = array(new Source($sources[0]));
+
+ return array($sources);
+ }
+
+ /**
+ * @dataProvider validIdDataProvider
+ * @param string $value
+ */
+ public function testGetSetPaymentId($value)
+ {
+ $instance = new Refund();
+
+ self::assertNull($instance->getPaymentId());
+ self::assertNull($instance->paymentId);
+ self::assertNull($instance->payment_id);
+
+ $instance->setPaymentId($value);
+ self::assertEquals((string)$value, $instance->getPaymentId());
+ self::assertEquals((string)$value, $instance->paymentId);
+ self::assertEquals((string)$value, $instance->payment_id);
+
+ $instance = new Refund();
+ $instance->paymentId = $value;
+ self::assertEquals((string)$value, $instance->getPaymentId());
+ self::assertEquals((string)$value, $instance->paymentId);
+ self::assertEquals((string)$value, $instance->payment_id);
+
+ $instance = new Refund();
+ $instance->payment_id = $value;
+ self::assertEquals((string)$value, $instance->getPaymentId());
+ self::assertEquals((string)$value, $instance->paymentId);
+ self::assertEquals((string)$value, $instance->payment_id);
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentId($value)
+ {
+ $instance = new Refund();
+ $instance->setPaymentId($value);
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPaymentId($value)
+ {
+ $instance = new Refund();
+ $instance->paymentId = $value;
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPayment_id($value)
+ {
+ $instance = new Refund();
+ $instance->payment_id = $value;
+ }
+
+ /**
+ * @dataProvider validStatusDataProvider
+ * @param string $value
+ */
+ public function testGetSetStatus($value)
+ {
+ $instance = new Refund();
+
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->status);
+
+ $instance->setStatus($value);
+ self::assertEquals((string)$value, $instance->getStatus());
+ self::assertEquals((string)$value, $instance->status);
+
+ $instance = new Refund();
+ $instance->status = $value;
+ self::assertEquals((string)$value, $instance->getStatus());
+ self::assertEquals((string)$value, $instance->status);
+ }
+
+ /**
+ * @return array
+ */
+ public function validStatusDataProvider()
+ {
+ $result = array();
+ foreach (RefundStatus::getValidValues() as $value) {
+ $result[] = array($value);
+ $result[] = array(new StringObject($value));
+ }
+ return $result;
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidStatus($value)
+ {
+ $instance = new Refund();
+ $instance->setStatus($value);
+ }
+
+ /**
+ * @dataProvider invalidIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidStatus($value)
+ {
+ $instance = new Refund();
+ $instance->status = $value;
+ }
+
+ /**
+ * @dataProvider validCreatedAtDataProvider
+ * @param mixed $value
+ */
+ public function testGetSetCreatedAt($value)
+ {
+ $instance = new Refund();
+
+ if (is_numeric($value)) {
+ $expected = $value;
+ } elseif ($value instanceof \DateTime) {
+ $expected = $value->getTimestamp();
+ } else {
+ $expected = strtotime((string)$value);
+ }
+
+ self::assertNull($instance->getCreatedAt());
+ self::assertNull($instance->createdAt);
+ self::assertNull($instance->created_at);
+
+ $instance->setCreatedAt($value);
+ self::assertSame($expected, $instance->getCreatedAt()->getTimestamp());
+ self::assertSame($expected, $instance->createdAt->getTimestamp());
+ self::assertSame($expected, $instance->created_at->getTimestamp());
+
+ $instance = new Refund();
+ $instance->createdAt = $value;
+ self::assertSame($expected, $instance->getCreatedAt()->getTimestamp());
+ self::assertSame($expected, $instance->createdAt->getTimestamp());
+ self::assertSame($expected, $instance->created_at->getTimestamp());
+
+ $instance = new Refund();
+ $instance->created_at = $value;
+ self::assertSame($expected, $instance->getCreatedAt()->getTimestamp());
+ self::assertSame($expected, $instance->createdAt->getTimestamp());
+ self::assertSame($expected, $instance->created_at->getTimestamp());
+ }
+
+ /**
+ * @return array
+ */
+ public function validCreatedAtDataProvider()
+ {
+ return array(
+ array(new \DateTime()),
+ array(new \DateTime(date(DATE_ATOM, Random::int(1, time())))),
+ array(time()),
+ array(Random::int(1, time())),
+ array(date(DATE_ATOM)),
+ array(date(DATE_ATOM, Random::int(1, time()))),
+ array(new StringObject(date(DATE_ATOM))),
+ array(new StringObject(date(DATE_ATOM, Random::int(1, time())))),
+ );
+ }
+
+ /**
+ * @dataProvider invalidCreatedAtDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCreatedAt($value)
+ {
+ $instance = new Refund();
+ $instance->setCreatedAt($value);
+ }
+
+ /**
+ * @dataProvider invalidCreatedAtDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCreatedAt($value)
+ {
+ $instance = new Refund();
+ $instance->createdAt = $value;
+ }
+
+ /**
+ * @dataProvider invalidCreatedAtDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCreated_at($value)
+ {
+ $instance = new Refund();
+ $instance->created_at = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidCreatedAtDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(array()),
+ array(new \stdClass()),
+ array('test'),
+ );
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ * @param AmountInterface $value
+ */
+ public function testGetSetAmount($value)
+ {
+ $instance = new Refund();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+
+ $instance->setAmount($value);
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+
+ $instance = new Refund();
+ $instance->amount = $value;
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ /**
+ * @return array
+ */
+ public function validAmountDataProvider()
+ {
+ return array(
+ array(new MonetaryAmount(1)),
+ array(new MonetaryAmount(Random::float(0.01, 9999999.99))),
+ );
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ * @param mixed $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ if ($value instanceof AmountInterface) {
+ self::setExpectedException('InvalidArgumentException');
+ $instance = new Refund();
+ $instance->setAmount($value);
+ } elseif (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Refund();
+ $instance->setAmount($value);
+ }
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ * @param mixed $value
+ */
+ public function testSetterInvalidAmount($value)
+ {
+ if ($value instanceof AmountInterface) {
+ self::setExpectedException('InvalidArgumentException');
+ $instance = new Refund();
+ $instance->amount = $value;
+ } elseif (class_exists('TypeError')) {
+ self::setExpectedException('TypeError');
+ $instance = new Refund();
+ $instance->amount = $value;
+ }
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidAmountDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(true),
+ array(false),
+ array(new MonetaryAmount()),
+ array(array()),
+ array(1),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validReceiptRegisteredDataProvider
+ * @param string $value
+ */
+ public function testGetSetReceiptRegistered($value)
+ {
+ $instance = new Refund();
+
+ self::assertNull($instance->getReceiptRegistration());
+ self::assertNull($instance->receiptRegistration);
+ self::assertNull($instance->receipt_registration);
+
+ $instance->setReceiptRegistration($value);
+ self::assertEquals((string)$value, $instance->getReceiptRegistration());
+ self::assertEquals((string)$value, $instance->receiptRegistration);
+ self::assertEquals((string)$value, $instance->receipt_registration);
+
+ $instance = new Refund();
+ $instance->receiptRegistration = $value;
+ self::assertEquals((string)$value, $instance->getReceiptRegistration());
+ self::assertEquals((string)$value, $instance->receiptRegistration);
+ self::assertEquals((string)$value, $instance->receipt_registration);
+
+ $instance = new Refund();
+ $instance->receipt_registration = $value;
+ self::assertEquals((string)$value, $instance->getReceiptRegistration());
+ self::assertEquals((string)$value, $instance->receiptRegistration);
+ self::assertEquals((string)$value, $instance->receipt_registration);
+ }
+
+ /**
+ * @return array
+ */
+ public function validReceiptRegisteredDataProvider()
+ {
+ $result = array();
+ foreach (ReceiptRegistrationStatus::getValidValues() as $value) {
+ $result[] = array($value);
+ $result[] = array(new StringObject($value));
+ }
+ return $result;
+ }
+
+ /**
+ * @dataProvider invalidReceiptRegisteredDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidReceiptRegistered($value)
+ {
+ $instance = new Refund();
+ $instance->setReceiptRegistration($value);
+ }
+
+ /**
+ * @dataProvider invalidReceiptRegisteredDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReceiptRegistration($value)
+ {
+ $instance = new Refund();
+ $instance->receiptRegistration = $value;
+ }
+
+ /**
+ * @dataProvider invalidReceiptRegisteredDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReceipt_registration($value)
+ {
+ $instance = new Refund();
+ $instance->receipt_registration = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidReceiptRegisteredDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1,10)),
+ array(new StringObject(Random::str(1,10))),
+ );
+ }
+
+ /**
+ * @dataProvider validCommentDataProvider
+ * @param string $value
+ */
+ public function testGetSetDescription($value)
+ {
+ $instance = new Refund();
+
+ self::assertNull($instance->getDescription());
+ self::assertNull($instance->description);
+
+ $instance->setDescription($value);
+ self::assertEquals((string)$value, $instance->getDescription());
+ self::assertEquals((string)$value, $instance->description);
+
+ $instance = new Refund();
+ $instance->description = $value;
+ self::assertEquals((string)$value, $instance->getDescription());
+ self::assertEquals((string)$value, $instance->description);
+ }
+
+ public function validCommentDataProvider()
+ {
+ return array(
+ array(Random::str(1, 249)),
+ array(new StringObject(Random::str(1, 249))),
+ array(Random::str(250)),
+ array(new StringObject(Random::str(250))),
+ );
+ }
+
+ /**
+ * @dataProvider invalidCommentDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidComment($value)
+ {
+ $instance = new Refund();
+ $instance->setDescription($value);
+ }
+
+ /**
+ * @dataProvider invalidCommentDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidComment($value)
+ {
+ $instance = new Refund();
+ $instance->description = $value;
+ }
+
+ public function invalidCommentDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/SettlementTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/SettlementTest.php
new file mode 100644
index 0000000..e7ad531
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/SettlementTest.php
@@ -0,0 +1,195 @@
+getTestInstance();
+
+ self::assertNull($instance->getType());
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->type);
+ self::assertNull($instance->amount);
+
+ $instance->fromArray($value);
+
+ self::assertSame($value['type'], $instance->getType());
+ self::assertSame($value['type'], $instance->type);
+ self::assertSame($value['amount'], $instance->getAmount()->jsonSerialize());
+ self::assertSame($value['amount'], $instance->amount->jsonSerialize());
+
+ self::assertSame($value, $instance->jsonSerialize());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param array $value
+ */
+ public function testGetSetType($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getType());
+ self::assertNull($instance->type);
+ $instance->setType($value['type']);
+ self::assertSame($value['type'], $instance->getType());
+ self::assertSame($value['type'], $instance->type);
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ * @expectedException EmptyPropertyValueException
+ *
+ * @param $value
+ */
+ public function testSetInvalidType($value)
+ {
+ $this->getTestInstance()->setType($value);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ );
+ }
+ return array($result);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testGetSetAmount($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+ $instance->setAmount($value);
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterAmount($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->amount = $value;
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ public function validAmountDataProvider()
+ {
+ return array(
+ array(
+ new MonetaryAmount(
+ Random::int(1, 100),
+ Random::value(CurrencyCode::getValidValues())
+ ),
+ ),
+ array(
+ new MonetaryAmount(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ * @expectedException EmptyPropertyValueException
+ *
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ $this->getTestInstance()->setAmount($value);
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ * @expectedException EmptyPropertyValueException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidAmount($value)
+ {
+ $this->getTestInstance()->amount = $value;
+ }
+
+ public function invalidAmountDataProvider()
+ {
+ $result = array(
+ array(null),
+ array(''),
+ array(1.0),
+ array(1),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+
+ return $result;
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ $result = array(
+ array(null),
+ array(''),
+ array(1.0),
+ array(1),
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, 10)),
+ );
+
+ return $result;
+ }
+
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/SourceTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/SourceTest.php
new file mode 100644
index 0000000..8c3ee61
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/SourceTest.php
@@ -0,0 +1,279 @@
+getTestInstance();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->getPlatformFeeAmount());
+ self::assertNull($instance->getAccountId());
+ self::assertNull($instance->amount);
+ self::assertNull($instance->platform_fee_amount);
+ self::assertNull($instance->accountId);
+
+ $instance->fromArray($value);
+
+ self::assertSame($value['account_id'], $instance->getAccountId());
+ self::assertSame($value['account_id'], $instance->accountId);
+ self::assertSame($value['amount'], $instance->getAmount()->jsonSerialize());
+ self::assertSame($value['amount'], $instance->amount->jsonSerialize());
+ self::assertSame($value['platform_fee_amount'], $instance->getPlatformFeeAmount()->jsonSerialize());
+ self::assertSame($value['platform_fee_amount'], $instance->platform_fee_amount->jsonSerialize());
+
+ self::assertSame($value, $instance->jsonSerialize());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param array $value
+ */
+ public function testGetSetAccountId($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getAccountId());
+ self::assertNull($instance->accountId);
+ $instance->setAccountId($value['account_id']);
+ self::assertSame($value['account_id'], $instance->getAccountId());
+ self::assertSame($value['account_id'], $instance->accountId);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterAccountId($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->accountId = $value['account_id'];
+ self::assertSame($value['account_id'], $instance->getAccountId());
+ self::assertSame($value['account_id'], $instance->accountId);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(
+ 'account_id' => (string)Random::int(11111111, 99999999),
+ 'amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'platform_fee_amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ );
+ }
+ return array($result);
+ }
+
+ /**
+ * @dataProvider invalidAccountIdProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testGetSetInvalidAccountId($value)
+ {
+ $this->getTestInstance()->setAccountId($value);
+ }
+
+ /**
+ * @dataProvider invalidAccountIdProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidAccountId($value)
+ {
+ $this->getTestInstance()->accountId = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidAccountIdProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetAmount($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+ $instance->setAmount($value);
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterAmount($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->amount = $value;
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetPlatformFeeAmount($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getPlatformFeeAmount());
+ self::assertNull($instance->platform_fee_amount);
+ $instance->setPlatformFeeAmount($value);
+ self::assertSame($value, $instance->getPlatformFeeAmount());
+ self::assertSame($value, $instance->platform_fee_amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterPlatformFeeAmount($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->platform_fee_amount = $value;
+ self::assertSame($value, $instance->getPlatformFeeAmount());
+ self::assertSame($value, $instance->platform_fee_amount);
+ }
+
+ /**
+ * @return \YooKassa\Model\MonetaryAmount[][]
+ * @throws \Exception
+ */
+ public function validAmountDataProvider()
+ {
+ return array(
+ array(
+ new MonetaryAmount(
+ Random::int(1, 100),
+ Random::value(CurrencyCode::getValidValues())
+ ),
+ ),
+ array(
+ new MonetaryAmount(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ $this->getTestInstance()->setAmount($value);
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidAmount($value)
+ {
+ $this->getTestInstance()->amount = $value;
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidPlatformFeeAmount($value)
+ {
+ $this->getTestInstance()->setPlatformFeeAmount($value);
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidPlatformFeeAmount($value)
+ {
+ $this->getTestInstance()->platform_fee_amount = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidAmountDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(1.0),
+ array(1),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/TransferTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/TransferTest.php
new file mode 100644
index 0000000..04c0d85
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/TransferTest.php
@@ -0,0 +1,363 @@
+getTestInstance();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->getPlatformFeeAmount());
+ self::assertNull($instance->getAccountId());
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->amount);
+ self::assertNull($instance->platform_fee_amount);
+ self::assertNull($instance->accountId);
+ self::assertNull($instance->status);
+
+ $instance->fromArray($value);
+
+ self::assertSame($value['account_id'], $instance->getAccountId());
+ self::assertSame($value['account_id'], $instance->accountId);
+ self::assertSame($value['amount'], $instance->getAmount()->jsonSerialize());
+ self::assertSame($value['amount'], $instance->amount->jsonSerialize());
+ self::assertSame($value['platform_fee_amount'], $instance->getPlatformFeeAmount()->jsonSerialize());
+ self::assertSame($value['platform_fee_amount'], $instance->platform_fee_amount->jsonSerialize());
+ self::assertSame($value['status'], $instance->getStatus());
+ self::assertSame($value['status'], $instance->status);
+
+ self::assertSame($value, $instance->jsonSerialize());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param array $value
+ */
+ public function testGetSetAccountId($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getAccountId());
+ self::assertNull($instance->accountId);
+ $instance->setAccountId($value['account_id']);
+ self::assertSame($value['account_id'], $instance->getAccountId());
+ self::assertSame($value['account_id'], $instance->accountId);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterAccountId($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->accountId = $value['account_id'];
+ self::assertSame($value['account_id'], $instance->getAccountId());
+ self::assertSame($value['account_id'], $instance->accountId);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $result[] = array(
+ 'account_id' => (string)Random::int(11111111, 99999999),
+ 'amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'platform_fee_amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'status' => Random::value(TransferStatus::getValidValues())
+ );
+ }
+ return array($result);
+ }
+
+ /**
+ * @dataProvider invalidAccountIdProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testGetSetInvalidAccountId($value)
+ {
+ $this->getTestInstance()->setAccountId($value);
+ }
+
+ /**
+ * @dataProvider invalidAccountIdProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidAccountId($value)
+ {
+ $this->getTestInstance()->accountId = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidAccountIdProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetAmount($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+ $instance->setAmount($value);
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterAmount($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->amount = $value;
+ self::assertSame($value, $instance->getAmount());
+ self::assertSame($value, $instance->amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param $value
+ */
+ public function testGetSetPlatformFeeAmount($value)
+ {
+ $instance = $this->getTestInstance();
+
+ self::assertNull($instance->getPlatformFeeAmount());
+ self::assertNull($instance->platform_fee_amount);
+ $instance->setPlatformFeeAmount($value);
+ self::assertSame($value, $instance->getPlatformFeeAmount());
+ self::assertSame($value, $instance->platform_fee_amount);
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $value
+ */
+ public function testSetterPlatformFeeAmount($value)
+ {
+ $instance = $this->getTestInstance();
+ $instance->platform_fee_amount = $value;
+ self::assertSame($value, $instance->getPlatformFeeAmount());
+ self::assertSame($value, $instance->platform_fee_amount);
+ }
+
+ /**
+ * @return \YooKassa\Model\MonetaryAmount[][]
+ * @throws \Exception
+ */
+ public function validAmountDataProvider()
+ {
+ return array(
+ array(
+ new MonetaryAmount(
+ Random::int(1, 100),
+ Random::value(CurrencyCode::getValidValues())
+ ),
+ ),
+ array(
+ new MonetaryAmount(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ $this->getTestInstance()->setAmount($value);
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidAmount($value)
+ {
+ $this->getTestInstance()->amount = $value;
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidPlatformFeeAmount($value)
+ {
+ $this->getTestInstance()->setPlatformFeeAmount($value);
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidPlatformFeeAmount($value)
+ {
+ $this->getTestInstance()->platform_fee_amount = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidAmountDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(1.0),
+ array(1),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validStatusProvider
+ *
+ * @param $value
+ */
+ public function testSetStatus($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->getStatus());
+ $instance->setStatus($value);
+ self::assertEquals($value, $instance->getStatus());
+ }
+
+ /**
+ * @dataProvider validStatusProvider
+ *
+ * @param $value
+ */
+ public function testSetterStatus($value)
+ {
+ $instance = $this->getTestInstance();
+ self::assertNull($instance->status);
+ $instance->status = $value;
+ self::assertEquals($value, $instance->status);
+ self::assertEquals($value, $instance->getStatus());
+ }
+
+ /**
+ * @return array[]
+ */
+ public function validStatusProvider()
+ {
+ return array(
+ array(TransferStatus::SUCCEEDED),
+ array(TransferStatus::CANCELED),
+ array(TransferStatus::WAITING_FOR_CAPTURE),
+ array(TransferStatus::PENDING),
+ );
+ }
+
+ /**
+ * @dataProvider invalidStatusProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testGetSetInvalidStatus($value)
+ {
+ $this->getTestInstance()->setStatus($value);
+ }
+
+ /**
+ * @dataProvider invalidStatusProvider
+ *
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetterInvalidStatus($value)
+ {
+ $this->getTestInstance()->status = $value;
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidStatusProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::str(15, 100)),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Webhook/WebhookTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Webhook/WebhookTest.php
new file mode 100644
index 0000000..6718855
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Model/Webhook/WebhookTest.php
@@ -0,0 +1,71 @@
+setId($data['id']);
+ $webhook->setUrl($data['url']);
+ $webhook->setEvent($data['event']);
+
+ self::assertEquals($webhook->getId(), $data['id']);
+ self::assertEquals($webhook->getUrl(), $data['url']);
+ self::assertEquals($webhook->getEvent(), $data['event']);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $data
+ */
+ public function testWebhookConstructorInstantiate($data)
+ {
+ $webhook = new Webhook($data);
+
+ self::assertEquals($webhook->getId(), $data['id']);
+ self::assertEquals($webhook->getUrl(), $data['url']);
+ self::assertEquals($webhook->getEvent(), $data['event']);
+ }
+
+ /**
+ * @return array
+ */
+ public function validDataProvider()
+ {
+ return array(
+ array(
+ array(
+ "id" => Random::str(20),
+ "event" => NotificationEventType::REFUND_SUCCEEDED,
+ "url" => Random::str(20),
+ ),
+ ),
+ array(
+ array(
+ "id" => Random::str(20),
+ "event" => NotificationEventType::PAYMENT_SUCCEEDED,
+ "url" => Random::str(20),
+ ),
+ ),
+ array(
+ array(
+ "id" => Random::str(20),
+ "event" => NotificationEventType::PAYMENT_WAITING_FOR_CAPTURE,
+ "url" => Random::str(20),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/AbstractPaymentResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/AbstractPaymentResponseTest.php
new file mode 100644
index 0000000..aff36e3
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/AbstractPaymentResponseTest.php
@@ -0,0 +1,409 @@
+getTestInstance($options);
+ self::assertEquals($options['id'], $instance->getId());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetStatus($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertEquals($options['status'], $instance->getStatus());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetRecipient($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['recipient'])) {
+ self::assertNull($instance->getRecipient());
+ } else {
+ if (!empty($options['recipient']['account_id'])) {
+ self::assertEquals($options['recipient']['account_id'], $instance->getRecipient()->getAccountId());
+ }
+ if (!empty($options['recipient']['gateway_id'])) {
+ self::assertEquals($options['recipient']['gateway_id'], $instance->getRecipient()->getGatewayId());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetAmount($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertEquals(number_format($options['amount']['value'], 2, '.', ''), $instance->getAmount()->getValue());
+ self::assertEquals($options['amount']['currency'], $instance->getAmount()->getCurrency());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetPaymentMethod($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['payment_method'])) {
+ self::assertNull($instance->getPaymentMethod());
+ } else {
+ self::assertEquals($options['payment_method']['type'], $instance->getPaymentMethod()->getType());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetCreatedAt($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['created_at'])) {
+ self::assertNull($instance->getCreatedAt());
+ } else {
+ self::assertEquals($options['created_at'], $instance->getCreatedAt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetCapturedAt($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['captured_at'])) {
+ self::assertNull($instance->getCapturedAt());
+ } else {
+ self::assertEquals($options['captured_at'], $instance->getCapturedAt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetConfirmation($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['confirmation'])) {
+ self::assertNull($instance->getConfirmation());
+ } else {
+ self::assertEquals($options['confirmation']['type'], $instance->getConfirmation()->getType());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetRefundedAmount($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['refunded_amount'])) {
+ self::assertNull($instance->getRefundedAmount());
+ } else {
+ self::assertEquals(number_format($options['refunded_amount']['value'], 2, '.', ''), $instance->getRefundedAmount()->getValue());
+ self::assertEquals((string)$options['refunded_amount']['currency'], $instance->getRefundedAmount()->getCurrency());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetPaid($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['paid'])) {
+ self::assertFalse($instance->getPaid());
+ } else {
+ self::assertEquals($options['paid'], $instance->getPaid());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetRefundable($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['refundable'])) {
+ self::assertFalse($instance->getRefundable());
+ } else {
+ self::assertEquals($options['refundable'], $instance->getRefundable());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetTest($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['test'])) {
+ self::assertNull($instance->getTest());
+ } else {
+ self::assertEquals($options['test'], $instance->getTest());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetReceiptRegistration($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['receipt_registration'])) {
+ self::assertNull($instance->getReceiptRegistration());
+ } else {
+ self::assertEquals($options['receipt_registration'], $instance->getReceiptRegistration());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetMetadata($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['metadata'])) {
+ self::assertNull($instance->getMetadata());
+ } else {
+ self::assertEquals($options['metadata'], $instance->getMetadata()->toArray());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetTransfers($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['transfers'])) {
+ self::assertEmpty($instance->getMetadata());
+ } else {
+ foreach ($instance->getTransfers() as $transfer) {
+ self::assertInstanceOf('\YooKassa\Model\Transfer', $transfer);
+ }
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $result = array();
+ $statuses = PaymentStatus::getValidValues();
+ $receiptRegistrations = ReceiptRegistrationStatus::getValidValues();
+
+ $confirmations = array(
+ array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ 'return_url' => Random::str(10),
+ 'enforce' => false,
+ ),
+ array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ );
+
+ for ($i = 0; $i < 10; $i++) {
+ $payment = array(
+ 'id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'description' => Random::str(128),
+ 'recipient' => array(
+ 'account_id' => Random::str(1, 64, '0123456789'),
+ 'gateway_id' => Random::str(1, 256),
+ ),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getEnabledValues()),
+ ),
+ 'payment_method' => array(
+ 'type' => Random::value(PaymentMethodType::getEnabledValues()),
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'captured_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'expires_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'confirmation' => Random::value($confirmations),
+ 'refunded_amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'paid' => $i % 2 ? true : false,
+ 'refundable' => $i % 2 ? true : false,
+ 'test' => $i % 2 ? true : false,
+ 'receipt_registration' => Random::value($receiptRegistrations),
+ 'metadata' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::str(1, 256),
+ ),
+ 'requestor' => array(
+ 'type' => 'RequestorMarchant',
+ 'account_id' => Random::int(100000, 999999),
+ ),
+ 'authorization_details' => array(
+ 'rrn' => Random::str(10),
+ 'auth_code' => Random::str(10),
+ ),
+ 'transfers' => array(
+ new Transfer(array(
+ 'account_id' => Random::str(36),
+ 'amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'platform_fee_amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'status' => Random::value(TransferStatus::getValidValues()),
+ )),
+ )
+ );
+ $result[] = array($payment);
+ }
+
+ $trueFalse = Random::bool();
+ $result[] = array(
+ array(
+ 'id' => Random::str(36),
+ 'status' => Random::value($statuses),
+ 'description' => Random::str(128),
+ 'recipient' => array(
+ 'account_id' => Random::str(1, 64, '0123456789'),
+ 'gateway_id' => Random::str(1, 256),
+ ),
+ 'amount' => array(
+ 'value' => Random::float(0.01, 1000000.0),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::WECHAT,
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'captured_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'expires_at' => date(DATE_ATOM, Random::int(1, time())),
+ 'requestor' => array(
+ 'type' => 'RequestorThirdPartyService',
+ 'client_id' => Random::int(100000, 999999),
+ 'client_name' => Random::str(1, 50),
+ ),
+ 'confirmation' => array(
+ 'type' => 'qr',
+ 'confirmation_data' => 'weixin://wxpay/bizpayurl?pr=SqTE9cX'
+ ),
+ 'paid' => $trueFalse,
+ 'refundable' => $trueFalse,
+ 'test' => $trueFalse,
+ 'metadata' => array(),
+ 'transfers' => array(
+ new Transfer(array(
+ 'account_id' => Random::str(36),
+ 'amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'platform_fee_amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'status' => Random::value(TransferStatus::getValidValues()),
+ )),
+ )
+ )
+ );
+
+ return $result;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetCancellationDetails($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['cancellation_details'])) {
+ self::assertNull($instance->getCancellationDetails());
+ } else {
+ self::assertEquals(
+ $options['cancellation_details']['party'],
+ $instance->getCancellationDetails()->getParty()
+ );
+ self::assertEquals(
+ $options['cancellation_details']['reason'],
+ $instance->getCancellationDetails()->getReason()
+ );
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetAuthorizationDetails($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['authorization_details'])) {
+ self::assertNull($instance->getAuthorizationDetails());
+ } else {
+ self::assertEquals(
+ $options['authorization_details']['rrn'],
+ $instance->getAuthorizationDetails()->getRrn()
+ );
+ self::assertEquals(
+ $options['authorization_details']['auth_code'],
+ $instance->getAuthorizationDetails()->getAuthCode()
+ );
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testGetRequestor($options)
+ {
+ $instance = $this->getTestInstance($options);
+
+ if ($options['requestor']['type'] === 'RequestorThirdPartyService') {
+ self::assertEquals($options['requestor']['type'], $instance->getRequestor()->getType());
+ self::assertEquals($options['requestor']['client_id'], $instance->getRequestor()->getClientId());
+ self::assertEquals($options['requestor']['client_name'], $instance->getRequestor()->getClientName());
+ } else {
+ self::assertEquals($options['requestor']['type'], $instance->getRequestor()->getType());
+ self::assertEquals($options['requestor']['account_id'], $instance->getRequestor()->getAccountId());
+ }
+ }
+
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestBuilderTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestBuilderTest.php
new file mode 100644
index 0000000..0db5cd6
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestBuilderTest.php
@@ -0,0 +1,1028 @@
+build($this->getRequiredData());
+ self::assertNull($instance->getRecipient());
+
+ $builder->setAccountId($options['accountId']);
+ $instance = $builder->build($this->getRequiredData('accountId'));
+
+ if ($options['accountId'] === null || $options['accountId'] === '') {
+ self::assertNull($instance->getRecipient());
+ } else {
+ self::assertNotNull($instance->getRecipient());
+ self::assertEquals($options['accountId'], $instance->getRecipient()->getAccountId());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetProductGroupId($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getRecipient());
+
+ $builder->setGatewayId($options['gatewayId']);
+ $instance = $builder->build($this->getRequiredData('gatewayId'));
+
+ if (empty($options['gatewayId'])) {
+ self::assertNull($instance->getRecipient());
+ } else {
+ self::assertNotNull($instance->getRecipient());
+ self::assertEquals($options['gatewayId'], $instance->getRecipient()->getGatewayId());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetAmount($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNotNull($instance->getAmount());
+
+ $builder->setAmount($options['amount']);
+ $instance = $builder->build($this->getRequiredData('amount'));
+
+ if ($options['amount'] instanceof AmountInterface) {
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ } else {
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+
+ $builder->setAmount(10000)->setAmount($options['amount']);
+ $instance = $builder->build($this->getRequiredData('amount'));
+
+ if ($options['amount'] instanceof AmountInterface) {
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ } else {
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+
+ if (!($options['amount'] instanceof AmountInterface)) {
+ $builder->setAmount(array(
+ 'value' => $options['amount'],
+ 'currency' => 'EUR',
+ ));
+ $instance = $builder->build($this->getRequiredData('amount'));
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ * @dataProvider invalidAmountDataProvider
+ *
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setAmount($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetCurrency($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNotNull($instance->getAmount());
+ self::assertEquals(CurrencyCode::RUB, $instance->getAmount()->getCurrency());
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setCurrency($options['currency']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($options['currency'], $instance->getAmount()->getCurrency());
+ if (!empty($options['receiptItems'])) {
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertEquals($options['currency'], $item->getPrice()->getCurrency());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetReceiptItems($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testAddReceiptItems($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ foreach ($options['receiptItems'] as $item) {
+ if ($item instanceof ReceiptItem) {
+ $builder->addReceiptItem(
+ $item->getDescription(), $item->getPrice()->getValue(), $item->getQuantity(), $item->getVatCode(),
+ $item->getPaymentMode(), $item->getPaymentSubject()
+ );
+ } else {
+ $builder->addReceiptItem($item['title'], $item['price'], $item['quantity'], $item['vatCode'],
+ $item['paymentMode'], $item['paymentSubject']);
+ }
+ }
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertFalse($item->isShipping());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testAddReceiptShipping($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ foreach ($options['receiptItems'] as $item) {
+ if ($item instanceof ReceiptItem) {
+ $builder->addReceiptShipping(
+ $item->getDescription(), $item->getPrice()->getValue(), $item->getVatCode()
+ );
+ } else {
+ $builder->addReceiptShipping($item['title'], $item['price'], $item['vatCode']);
+ }
+ }
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertTrue($item->isShipping());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider invalidItemsDataProvider
+ * @expectedException InvalidArgumentException
+ *
+ * @param $items
+ */
+ public function testSetInvalidReceiptItems($items)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setReceiptItems($items);
+ }
+
+ public function invalidItemsDataProvider()
+ {
+ return array(
+ array(
+ array(
+ array(
+ 'price' => 1,
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'price' => 123,
+ 'quantity' => 1.4,
+ 'vatCode' => 7,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'description' => 'test',
+ 'price' => 123,
+ 'quantity' => -1.4,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'price' => 1,
+ 'vatCode' => 7,
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetReceiptEmail($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['receiptEmail'], $instance->getReceipt()->getCustomer()->getEmail());
+ }
+ }
+
+ /**
+ * @dataProvider invalidEmailDataProvider
+ * @expectedException InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidEmail($value)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setReceiptEmail($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetReceiptPhone($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $builder->setReceiptPhone($options['receiptPhone']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['receiptPhone'], $instance->getReceipt()->getCustomer()->getPhone());
+ }
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidPhone($value)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setReceiptPhone($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetReceiptTaxSystemCode($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $builder->setTaxSystemCode($options['taxSystemCode']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['taxSystemCode'], $instance->getReceipt()->getTaxSystemCode());
+ }
+ }
+
+ /**
+ * @dataProvider invalidVatIdDataProvider
+ * @expectedException InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidTaxSystemId($value)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setTaxSystemCode($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetPaymentToken($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData(null, 'paymentMethodId'));
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+ self::assertNull($instance->payment_token);
+
+ if (empty($options['paymentToken'])) {
+ $buildData = $this->getRequiredData(null, 'paymentMethodId');
+ } else {
+ $buildData = $this->getRequiredData('paymentToken');
+ }
+
+ $builder->setPaymentToken($options['paymentToken']);
+ $instance = $builder->build($buildData);
+
+ if (empty($options['paymentToken'])) {
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+ self::assertNull($instance->payment_token);
+ } else {
+ self::assertEquals($options['paymentToken'], $instance->getPaymentToken());
+ self::assertEquals($options['paymentToken'], $instance->paymentToken);
+ self::assertEquals($options['paymentToken'], $instance->payment_token);
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetPaymentMethodId($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getPaymentMethodId());
+
+ $builder->setPaymentMethodId($options['paymentMethodId']);
+ $instance = $builder->build($this->getRequiredData(empty($options['paymentMethodId']) ? null : 'paymentToken'));
+
+ if (empty($options['paymentMethodId'])) {
+ self::assertNull($instance->getPaymentMethodId());
+ } else {
+ self::assertEquals($options['paymentMethodId'], $instance->getPaymentMethodId());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetPaymentData($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getPaymentMethodData());
+
+ $builder->setPaymentMethodData($options['paymentMethodData']);
+ $instance = $builder->build($this->getRequiredData(empty($options['paymentMethodId']) ? null : 'paymentToken'));
+
+ if (empty($options['paymentMethodData'])) {
+ self::assertNull($instance->getPaymentMethodData());
+ } else {
+ if (is_object($options['paymentMethodData'])) {
+ self::assertSame($options['paymentMethodData'], $instance->getPaymentMethodData());
+ } elseif (is_string($options['paymentMethodData'])) {
+ self::assertEquals($options['paymentMethodData'], $instance->getPaymentMethodData()->getType());
+ } else {
+ self::assertEquals($options['paymentMethodData']['type'], $instance->getPaymentMethodData()->getType());
+ }
+ }
+
+ if (is_array($options['paymentMethodData'])) {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->build($this->getRequiredData());
+ $builder->setPaymentMethodData($options['paymentMethodData']['type'], $options['paymentMethodData']);
+ $instance = $builder->build($this->getRequiredData(empty($options['paymentMethodId']) ? null : 'paymentToken'));
+ self::assertEquals($options['paymentMethodData']['type'], $instance->getPaymentMethodData()->getType());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetConfirmationAttributes($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getConfirmation());
+
+ $builder->setConfirmation($options['confirmation']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['confirmation'])) {
+ self::assertNull($instance->getConfirmation());
+ } else {
+ if (is_object($options['confirmation'])) {
+ self::assertSame($options['confirmation'], $instance->getConfirmation());
+ } elseif (is_string($options['confirmation'])) {
+ self::assertEquals($options['confirmation'], $instance->getConfirmation()->getType());
+ } else {
+ self::assertEquals($options['confirmation']['type'], $instance->getConfirmation()->getType());
+ self::assertEquals($options['confirmation']['locale'], $instance->getConfirmation()->getLocale());
+ }
+ }
+
+ if (is_array($options['confirmation'])) {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->build($this->getRequiredData());
+ $builder->setConfirmation($options['confirmation']['type'], $options['confirmation']);
+ $instance = $builder->build($this->getRequiredData());
+ self::assertEquals($options['confirmation']['type'], $instance->getConfirmation()->getType());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetCreateRecurring($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getSavePaymentMethod());
+
+ $builder->setSavePaymentMethod($options['savePaymentMethod']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if ($options['savePaymentMethod'] === null || $options['savePaymentMethod'] === '') {
+ self::assertNull($instance->getSavePaymentMethod());
+ } else {
+ self::assertEquals($options['savePaymentMethod'], $instance->getSavePaymentMethod());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetCapture($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getCapture());
+
+ $builder->setCapture($options['capture']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if ($options['capture'] === null || $options['capture'] === '') {
+ self::assertNull($instance->getCapture());
+ } else {
+ self::assertEquals($options['capture'], $instance->getCapture());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetClientIp($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getClientIp());
+
+ $builder->setClientIp($options['clientIp']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['clientIp'])) {
+ self::assertNull($instance->getClientIp());
+ } else {
+ self::assertEquals($options['clientIp'], $instance->getClientIp());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetMetadata($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $instance = $builder->build($this->getRequiredData());
+ self::assertNull($instance->getMetadata());
+
+ $builder->setMetadata($options['metadata']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['metadata'])) {
+ self::assertNull($instance->getMetadata());
+ } else {
+ self::assertEquals($options['metadata'], $instance->getMetadata()->toArray());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetRecipient($options)
+ {
+ $recipient = new Recipient();
+ $recipient->setAccountId($options['accountId']);
+ $recipient->setGatewayId($options['gatewayId']);
+
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setRecipient($recipient);
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($recipient, $instance->getRecipient());
+
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setRecipient(array(
+ 'account_id' => $options['accountId'],
+ 'gateway_id' => $options['gatewayId'],
+ ));
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($recipient, $instance->getRecipient());
+ }
+
+ /**
+ * @dataProvider invalidRecipientDataProvider
+ * @expectedException InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testSetInvalidRecipient($value)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setRecipient($value);
+ }
+
+ public function invalidRecipientDataProvider()
+ {
+ return array(
+ array(null),
+ array(true),
+ array(false),
+ array(1),
+ array(1.1),
+ array('test'),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @throws Exception
+ */
+ public function testSetReceipt()
+ {
+ $receipt = array(
+ 'tax_system_code' => Random::int(1, 6),
+ 'customer' => array(
+ 'email' => Random::str(10),
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ 'items' => array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 123,
+ 'amount' => array(
+ 'value' => 321,
+ 'currency' => 'USD',
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => PaymentSubject::COMMODITY,
+ 'payment_mode' => PaymentMode::PARTIAL_PREPAYMENT,
+ ),
+ ),
+ );
+
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setReceipt($receipt);
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($receipt['tax_system_code'], $instance->getReceipt()->getTaxSystemCode());
+ self::assertEquals($receipt['customer']['email'], $instance->getReceipt()->getCustomer()->getEmail());
+ self::assertEquals($receipt['customer']['phone'], $instance->getReceipt()->getCustomer()->getPhone());
+ self::assertEquals(1, count($instance->getReceipt()->getItems()));
+
+ $receipt = $instance->getReceipt();
+
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setReceipt($instance->getReceipt());
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($receipt['tax_system_code'], $instance->getReceipt()->getTaxSystemCode());
+ self::assertEquals($receipt['customer']['email'], $instance->getReceipt()->getCustomer()->getEmail());
+ self::assertEquals($receipt['customer']['phone'], $instance->getReceipt()->getCustomer()->getPhone());
+ self::assertEquals(1, count($instance->getReceipt()->getItems()));
+ }
+
+ /**
+ * @dataProvider invalidReceiptDataProvider
+ * @expectedException InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testSetInvalidReceipt($value)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setReceipt($value);
+ }
+
+ public function invalidReceiptDataProvider()
+ {
+ return array(
+ array(null),
+ array(true),
+ array(false),
+ array(1),
+ array(1.1),
+ array('test'),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @return array
+ * @throws Exception
+ */
+ public function validDataProvider()
+ {
+ $receiptItem = new ReceiptItem();
+ $receiptItem->setPrice(new MonetaryAmount(1));
+ $receiptItem->setQuantity(1);
+ $receiptItem->setDescription('test');
+ $receiptItem->setVatCode(3);
+ $result = array(
+ array(
+ array(
+ 'accountId' => Random::str(1, 32),
+ 'gatewayId' => Random::str(1, 32),
+ 'recipient' => null,
+ 'description' => null,
+ 'amount' => new MonetaryAmount(Random::int(1, 1000)),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'receiptItems' => array(),
+ 'paymentToken' => null,
+ 'paymentMethodId' => null,
+ 'paymentMethodData' => null,
+ 'confirmation' => null,
+ 'savePaymentMethod' => null,
+ 'capture' => null,
+ 'clientIp' => null,
+ 'metadata' => null,
+ 'receiptEmail' => null,
+ 'receiptPhone' => null,
+ 'taxSystemCode' => null,
+ ),
+ ),
+ array(
+ array(
+ 'accountId' => Random::str(1, 32),
+ 'gatewayId' => Random::str(1, 32),
+ 'recipient' => null,
+ 'description' => '',
+ 'amount' => new MonetaryAmount(Random::int(1, 1000)),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'receiptItems' => array(
+ array(
+ 'title' => 'test',
+ 'quantity' => mt_rand(1, 100),
+ 'price' => mt_rand(1, 100),
+ 'vatCode' => mt_rand(1, 6),
+ 'paymentMode' => PaymentMode::CREDIT_PAYMENT,
+ 'paymentSubject' => PaymentSubject::ANOTHER,
+ ),
+ $receiptItem,
+ ),
+ 'referenceId' => '',
+ 'paymentToken' => '',
+ 'paymentMethodId' => '',
+ 'paymentMethodData' => '',
+ 'confirmation' => '',
+ 'savePaymentMethod' => '',
+ 'capture' => '',
+ 'clientIp' => '',
+ 'metadata' => array(),
+ 'receiptEmail' => Random::str(10, 32),
+ 'receiptPhone' => '',
+ 'taxSystemCode' => '',
+ ),
+ ),
+ );
+ $paymentMethodData = array(
+ new PaymentDataQiwi(),
+ PaymentMethodType::BANK_CARD,
+ array(
+ 'type' => PaymentMethodType::BANK_CARD,
+ ),
+ );
+ $confirmationStatuses = array(
+ new ConfirmationAttributesExternal(),
+ ConfirmationType::EXTERNAL,
+ array(
+ 'type' => ConfirmationType::EXTERNAL,
+ 'locale' => 'en_US',
+ ),
+ array(
+ 'type' => ConfirmationType::QR,
+ 'locale' => 'ru_RU',
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'accountId' => uniqid(),
+ 'gatewayId' => uniqid(),
+ 'recipient' => new Recipient(),
+ 'description' => uniqid(),
+ 'amount' => mt_rand(1, 100000),
+ 'currency' => CurrencyCode::RUB,
+ 'receiptItems' => array(),
+ 'referenceId' => uniqid(),
+ 'paymentToken' => uniqid(),
+ 'paymentMethodId' => uniqid(),
+ 'paymentMethodData' => isset($paymentMethodData[$i]) ? $paymentMethodData[$i] : null,
+ 'confirmation' => isset($confirmationStatuses[$i]) ? $confirmationStatuses[$i] : null,
+ 'savePaymentMethod' => mt_rand(0, 1) ? true : false,
+ 'capture' => mt_rand(0, 1) ? true : false,
+ 'clientIp' => long2ip(mt_rand(0, pow(2, 32))),
+ 'metadata' => array('test' => 'test'),
+ 'receiptEmail' => Random::str(10),
+ 'receiptPhone' => Random::str(10, '0123456789'),
+ 'taxSystemCode' => Random::int(1, 6),
+ );
+ $result[] = array($request);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidAmountDataProvider()
+ {
+ return array(
+ array(-1),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(0),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidEmailDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @return array
+ * @throws Exception
+ */
+ public function invalidPhoneDataProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @return array
+ * @throws Exception
+ */
+ public function invalidVatIdDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(0),
+ array(7),
+ array(Random::int(-100, -1)),
+ array(Random::int(7, 100)),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws Exception
+ */
+ public function testSetDescription($options)
+ {
+ $builder = new CreatePaymentRequestBuilder();
+
+ $builder->setDescription($options['description']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['description'])) {
+ self::assertNull($instance->getDescription());
+ } else {
+ self::assertEquals($options['description'], $instance->getDescription());
+ }
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testSetInvalidTypeDescription()
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setDescription(true);
+ }
+
+ /**
+ * @expectedException InvalidArgumentException
+ */
+ public function testSetInvalidLengthDescription()
+ {
+ $builder = new CreatePaymentRequestBuilder();
+ $description = Random::str(Payment::MAX_LENGTH_DESCRIPTION + 1);
+ $builder->setDescription($description);
+ }
+
+ /**
+ * @dataProvider invalidVatIdDataProvider
+ * @expectedException InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidAirline($value)
+ {
+ if (is_array($value)) {
+ throw new \InvalidArgumentException();
+ }
+ $builder = new CreatePaymentRequestBuilder();
+ $builder->setAirline($value);
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestSerializerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestSerializerTest.php
new file mode 100644
index 0000000..24e0e09
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestSerializerTest.php
@@ -0,0 +1,357 @@
+ 'paymentToken',
+ 'payment_method_id' => 'paymentMethodId',
+ 'client_ip' => 'clientIp',
+ );
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSerialize($options)
+ {
+ $serializer = new CreatePaymentRequestSerializer();
+ $instance = CreatePaymentRequest::builder()->build($options);
+ $data = $serializer->serialize($instance);
+
+ $expected = array(
+ 'amount' => array(
+ 'value' => $options['amount'],
+ 'currency' => isset($options['currency']) ? $options['currency'] : CurrencyCode::RUB,
+ ),
+ );
+ foreach ($this->fieldMap as $mapped => $field) {
+ if (isset($options[$field])) {
+ $value = $options[$field];
+ if (!empty($value)) {
+ $expected[$mapped] = $value instanceof \DateTime ? $value->format(DATE_ATOM) : $value;
+ }
+ }
+ }
+ if (!empty($options['accountId']) && !empty($options['gatewayId'])) {
+ $expected['recipient'] = array(
+ 'account_id' => $options['accountId'],
+ 'gateway_id' => $options['gatewayId'],
+ );
+ }
+ if (!empty($options['confirmation'])) {
+ $expected['confirmation'] = array(
+ 'type' => $options['confirmation']->getType(),
+ );
+ if ($locale = $options['confirmation']->getLocale()) {
+ $expected['confirmation']['locale'] = $locale;
+ }
+ if ($options['confirmation']->getType() === ConfirmationType::REDIRECT) {
+ $expected['confirmation']['enforce'] = $options['confirmation']->enforce;
+ $expected['confirmation']['return_url'] = $options['confirmation']->returnUrl;
+ }
+ }
+ if (!empty($options['paymentMethodData'])) {
+ $expected['payment_method_data'] = array(
+ 'type' => $options['paymentMethodData']->getType(),
+ );
+ switch ($options['paymentMethodData']['type']) {
+ case PaymentMethodType::ALFABANK:
+ $expected['payment_method_data']['login'] = $options['paymentMethodData']->getLogin();
+ break;
+ case PaymentMethodType::APPLE_PAY:
+ $expected['payment_method_data']['payment_data'] = $options['paymentMethodData']->getPaymentData();
+ break;
+ case PaymentMethodType::GOOGLE_PAY:
+ $expected['payment_method_data']['payment_method_token'] = $options['paymentMethodData']->getPaymentMethodToken();
+ $expected['payment_method_data']['google_transaction_id'] = $options['paymentMethodData']->getGoogleTransactionId();
+ break;
+ case PaymentMethodType::BANK_CARD:
+ $expected['payment_method_data']['card'] = array(
+ 'number' => $options['paymentMethodData']->getCard()->getNumber(),
+ 'expiry_year' => $options['paymentMethodData']->getCard()->getExpiryYear(),
+ 'expiry_month' => $options['paymentMethodData']->getCard()->getExpiryMonth(),
+ 'csc' => $options['paymentMethodData']->getCard()->getCsc(),
+ 'cardholder' => $options['paymentMethodData']->getCard()->getCardholder(),
+ );
+ break;
+ case PaymentMethodType::MOBILE_BALANCE:
+ case PaymentMethodType::CASH:
+ $expected['payment_method_data']['phone'] = $options['paymentMethodData']->getPhone();
+ break;
+ case PaymentMethodType::SBERBANK:
+ $expected['payment_method_data']['phone'] = $options['paymentMethodData']->getPhone();
+ break;
+ case PaymentMethodType::B2B_SBERBANK:
+ /** @var PaymentDataB2bSberbank $paymentMethodData */
+ $paymentMethodData = $options['paymentMethodData'];
+ $expected['payment_method_data']['payment_purpose'] = $paymentMethodData->getPaymentPurpose();
+ $expected['payment_method_data']['vat_data'] = array(
+ 'type' => $paymentMethodData->getVatData()->getType(),
+ 'rate' => $paymentMethodData->getVatData()->getRate(),
+ 'amount' => array(
+ 'value' => $paymentMethodData->getVatData()->getAmount()->getValue(),
+ 'currency' => $paymentMethodData->getVatData()->getAmount()->getCurrency(),
+ ),
+ );
+ break;
+ }
+ }
+ if (!empty($options['metadata'])) {
+ $expected['metadata'] = array();
+ foreach ($options['metadata'] as $key => $value) {
+ $expected['metadata'][$key] = $value;
+ }
+ }
+ if (!empty($options['receipt']['items'])) {
+ foreach ($options['receipt']['items'] as $item) {
+ $itemArray = $item;
+
+ if (!empty($item['payment_subject'])) {
+ $itemArray['payment_subject'] = $item['payment_subject'];
+ }
+ if (!empty($item['payment_mode'])) {
+ $itemArray['payment_mode'] = $item['payment_mode'];
+ }
+ $expected['receipt']['items'][] = $itemArray;
+ }
+ if (!empty($options['receipt']['customer'])) {
+ $expected['receipt']['customer'] = $options['receipt']['customer'];
+ }
+ if (!empty($options['receipt']['tax_system_code'])) {
+ $expected['receipt']['tax_system_code'] = $options['receipt']['tax_system_code'];
+ }
+ }
+
+ if (array_key_exists('capture', $options)) {
+ $expected['capture'] = (bool)$options['capture'];
+ }
+ if (array_key_exists('savePaymentMethod', $options)) {
+ $expected['save_payment_method'] = (bool)$options['savePaymentMethod'];
+ }
+ if (!empty($options['description'])) {
+ $expected['description'] = $options['description'];
+ }
+
+ if (!empty($options['airline'])) {
+ $expected['airline'] = array(
+ 'booking_reference' => $options['airline']['booking_reference'],
+ 'ticket_number' => $options['airline']['ticket_number'],
+ 'passengers' => array_map(function ($passenger) {
+ return array(
+ 'first_name' => $passenger['first_name'],
+ 'last_name' => $passenger['last_name'],
+ );
+ }, $options['airline']['passengers']),
+ 'legs' => array_map(function ($leg) {
+ return array(
+ 'departure_airport' => $leg['departure_airport'],
+ 'destination_airport' => $leg['destination_airport'],
+ 'departure_date' => $leg['departure_date'],
+ );
+ }, $options['airline']['legs']),
+ );
+ }
+
+ self::assertEquals($expected, $data);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $airline = new Airline();
+ $airline->setBookingReference(Random::str(10));
+ $airline->setTicketNumber(Random::int(10));
+ $leg = new Leg();
+ $leg->setDepartureAirport(Random::str(3, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'));
+ $leg->setDestinationAirport(Random::str(3, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'));
+ $leg->setDepartureDate("2018-12-31");
+ $airline->setLegs(array($leg));
+ $passenger = new Passenger();
+ $passenger->setFirstName(Random::str(10));
+ $passenger->setLastName(Random::str(10));
+ $airline->setPassengers(array($passenger));
+
+ $result = array(
+ array(
+ array(
+ 'amount' => mt_rand(10, 100000),
+ 'paymentToken' => Random::str(36),
+ 'receipt' => array(
+ 'items' => array(
+ array(
+ 'description' => Random::str(10),
+ 'quantity' => (float)Random::int(1, 10),
+ 'amount' => array(
+ 'value' => (float)Random::int(100, 100),
+ 'currency' => CurrencyCode::RUB,
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => PaymentSubject::COMMODITY,
+ 'payment_mode' => PaymentMode::PARTIAL_PREPAYMENT,
+ )
+ ),
+ 'customer' => array(
+ 'email' => Random::str(10),
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ ),
+ 'description' => Random::str(10),
+ 'airline' => array(
+ 'booking_reference' => Random::str(10),
+ 'ticket_number' => Random::int(10),
+ 'passengers' => array(
+ array(
+ 'first_name' => Random::str(10, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ 'last_name' => Random::str(10, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ ),
+ ),
+ 'legs' => array(
+ array(
+ 'departure_airport' => Random::str(3, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ 'destination_airport' => Random::str(3, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),
+ 'departure_date' => "2020-01-01",
+ ),
+ ),
+ ),
+ ),
+ ),
+ );
+ $confirmations = array(
+ new ConfirmationAttributesExternal(),
+ new ConfirmationAttributesRedirect(),
+ );
+ $paymentData = array(
+ new PaymentDataAlfabank(),
+ new PaymentDataApplePay(),
+ new PaymentDataGooglePay(),
+ new PaymentDataBankCard(),
+ new PaymentDataMobileBalance(),
+ new PaymentDataQiwi(),
+ new PaymentDataSberbank(),
+ new PaymentDataWebmoney(),
+ new PaymentDataYooMoney(),
+ new PaymentDataInstallments(),
+ new PaymentDataB2bSberbank(),
+ );
+ $paymentData[0]->setLogin(Random::str(10));
+
+ $paymentData[1]->setPaymentData(Random::str(10));
+ $paymentData[2]->setPaymentMethodToken(Random::str(10));
+ $paymentData[2]->setGoogleTransactionId(Random::str(10));
+
+ $card = new PaymentDataBankCardCard();
+ $card->setNumber(Random::str(16, '0123456789'));
+ $card->setExpiryYear(Random::int(2000, 2200));
+ $card->setExpiryMonth(Random::value(array('01', '02', '03', '04', '05', '06', '07', '08', '09', '11', '12')));
+ $card->setCsc(Random::str(4, '0123456789'));
+ $card->setCardholder(Random::str(26, 'abcdefghijklmnopqrstuvwxyz'));
+ $paymentData[3]->setCard($card);
+ $paymentData[4]->setPhone(Random::str(14, '0123456789'));
+
+ $paymentData[6]->setPhone(Random::str(14, '0123456789'));
+
+ /** @var PaymentDataB2bSberbank $paymentData [10] */
+ $paymentDataB2bSberbank = new PaymentDataB2bSberbank();
+ $paymentDataB2bSberbank->setPaymentPurpose(Random::str(10));
+ $paymentDataB2bSberbank->setVatData(array(
+ 'type' => VatDataType::CALCULATED,
+ 'rate' => VatDataRate::RATE_10,
+ 'amount' => array(
+ 'value' => Random::int(1, 10000),
+ 'currency' => CurrencyCode::USD,
+ ),
+ ));
+ $paymentData[10] = $paymentDataB2bSberbank;
+
+ $confirmations[0]->setLocale('en_US');
+ $confirmations[1]->setEnforce(true);
+ $confirmations[1]->setReturnUrl(Random::str(10));
+ foreach ($paymentData as $i => $paymentMethodData) {
+ $request = array(
+ 'accountId' => uniqid(),
+ 'gatewayId' => uniqid(),
+ 'amount' => mt_rand(0, 100000),
+ 'currency' => CurrencyCode::RUB,
+ 'referenceId' => uniqid(),
+ 'paymentMethodData' => $paymentData[$i],
+ 'confirmation' => Random::value($confirmations),
+ 'savePaymentMethod' => Random::bool(),
+ 'capture' => mt_rand(0, 1) ? true : false,
+ 'clientIp' => long2ip(mt_rand(0, pow(2, 32))),
+ 'metadata' => array('test' => uniqid()),
+ 'receipt' => array(
+ 'items' => $this->getReceiptItem($i + 1),
+ 'customer' => array(
+ 'email' => Random::str(10),
+ 'phone' => Random::str(12, '0123456789'),
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ ),
+ 'airline' => $airline,
+ );
+ $result[] = array($request);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param $count
+ * @return array
+ * @throws \Exception
+ */
+ private function getReceiptItem($count)
+ {
+ $result = array();
+ for ($i = 0; $i < $count; $i++) {
+ $result[] = array(
+ 'description' => Random::str(10),
+ 'quantity' => (float)Random::float(1, 100),
+ 'amount' => array(
+ 'value' => (float)Random::int(1, 100),
+ 'currency' => CurrencyCode::RUB,
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => PaymentSubject::COMMODITY,
+ 'payment_mode' => PaymentMode::PARTIAL_PREPAYMENT,
+ );
+ }
+
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestTest.php
new file mode 100644
index 0000000..03bfd04
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentRequestTest.php
@@ -0,0 +1,837 @@
+hasRecipient());
+ self::assertNull($instance->getRecipient());
+ self::assertNull($instance->recipient);
+
+ $instance->setRecipient($options['recipient']);
+ if (empty($options['recipient'])) {
+ self::assertFalse($instance->hasRecipient());
+ self::assertNull($instance->getRecipient());
+ self::assertNull($instance->recipient);
+ } else {
+ self::assertTrue($instance->hasRecipient());
+ self::assertSame($options['recipient'], $instance->getRecipient());
+ self::assertSame($options['recipient'], $instance->recipient);
+ }
+
+ $instance->setRecipient(null);
+ self::assertFalse($instance->hasRecipient());
+ self::assertNull($instance->getRecipient());
+ self::assertNull($instance->recipient);
+
+ $instance->recipient = $options['recipient'];
+ if (empty($options['recipient'])) {
+ self::assertFalse($instance->hasRecipient());
+ self::assertNull($instance->getRecipient());
+ self::assertNull($instance->recipient);
+ } else {
+ self::assertTrue($instance->hasRecipient());
+ self::assertSame($options['recipient'], $instance->getRecipient());
+ self::assertSame($options['recipient'], $instance->recipient);
+ }
+ }
+
+ /**
+ * @dataProvider invalidRecipientDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidRecipient($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setRecipient($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testAmount($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+
+ $instance->setAmount($options['amount']);
+
+ self::assertSame($options['amount'], $instance->getAmount());
+ self::assertSame($options['amount'], $instance->amount);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testPaymentToken($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasPaymentToken());
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+
+ $instance->setPaymentToken($options['paymentToken']);
+ if (empty($options['paymentToken'])) {
+ self::assertFalse($instance->hasPaymentToken());
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+ self::assertNull($instance->payment_token);
+ } else {
+ self::assertTrue($instance->hasPaymentToken());
+ self::assertSame($options['paymentToken'], $instance->getPaymentToken());
+ self::assertSame($options['paymentToken'], $instance->paymentToken);
+ self::assertSame($options['paymentToken'], $instance->payment_token);
+ }
+
+ $instance->setPaymentToken(null);
+ self::assertFalse($instance->hasPaymentToken());
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+
+ $instance->paymentToken = $options['paymentToken'];
+ if (empty($options['paymentToken'])) {
+ self::assertFalse($instance->hasPaymentToken());
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+ self::assertNull($instance->payment_token);
+ } else {
+ self::assertTrue($instance->hasPaymentToken());
+ self::assertSame($options['paymentToken'], $instance->getPaymentToken());
+ self::assertSame($options['paymentToken'], $instance->paymentToken);
+ self::assertSame($options['paymentToken'], $instance->payment_token);
+ }
+
+ $instance->paymentToken = null;
+ self::assertFalse($instance->hasPaymentToken());
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+
+ $instance->payment_token = $options['paymentToken'];
+ if (empty($options['paymentToken'])) {
+ self::assertFalse($instance->hasPaymentToken());
+ self::assertNull($instance->getPaymentToken());
+ self::assertNull($instance->paymentToken);
+ self::assertNull($instance->payment_token);
+ } else {
+ self::assertTrue($instance->hasPaymentToken());
+ self::assertSame($options['paymentToken'], $instance->getPaymentToken());
+ self::assertSame($options['paymentToken'], $instance->paymentToken);
+ self::assertSame($options['paymentToken'], $instance->payment_token);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPaymentTokenDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentToken($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setPaymentToken($value);
+ }
+
+ /**
+ * @dataProvider invalidPaymentTokenDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPaymentToken($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->paymentToken = $value;
+ }
+
+ /**
+ * @dataProvider invalidPaymentTokenDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPayment_token($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->payment_token = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testPaymentMethodId($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasPaymentMethodId());
+ self::assertNull($instance->getPaymentMethodId());
+ self::assertNull($instance->paymentMethodId);
+ self::assertNull($instance->payment_method_id);
+
+ $instance->setPaymentMethodId($options['paymentMethodId']);
+ if (empty($options['paymentMethodId'])) {
+ self::assertFalse($instance->hasPaymentMethodId());
+ self::assertNull($instance->getPaymentMethodId());
+ self::assertNull($instance->paymentMethodId);
+ self::assertNull($instance->payment_method_id);
+ } else {
+ self::assertTrue($instance->hasPaymentMethodId());
+ self::assertSame($options['paymentMethodId'], $instance->getPaymentMethodId());
+ self::assertSame($options['paymentMethodId'], $instance->paymentMethodId);
+ self::assertSame($options['paymentMethodId'], $instance->payment_method_id);
+ }
+
+ $instance->setPaymentMethodId(null);
+ self::assertFalse($instance->hasPaymentMethodId());
+ self::assertNull($instance->getPaymentMethodId());
+ self::assertNull($instance->paymentMethodId);
+
+ $instance->paymentMethodId = $options['paymentMethodId'];
+ if (empty($options['paymentMethodId'])) {
+ self::assertFalse($instance->hasPaymentMethodId());
+ self::assertNull($instance->getPaymentMethodId());
+ self::assertNull($instance->paymentMethodId);
+ self::assertNull($instance->payment_method_id);
+ } else {
+ self::assertTrue($instance->hasPaymentMethodId());
+ self::assertSame($options['paymentMethodId'], $instance->getPaymentMethodId());
+ self::assertSame($options['paymentMethodId'], $instance->paymentMethodId);
+ self::assertSame($options['paymentMethodId'], $instance->payment_method_id);
+ }
+
+ $instance->setPaymentMethodId(null);
+ self::assertFalse($instance->hasPaymentMethodId());
+ self::assertNull($instance->getPaymentMethodId());
+ self::assertNull($instance->paymentMethodId);
+
+ $instance->payment_method_id = $options['paymentMethodId'];
+ if (empty($options['paymentMethodId'])) {
+ self::assertFalse($instance->hasPaymentMethodId());
+ self::assertNull($instance->getPaymentMethodId());
+ self::assertNull($instance->paymentMethodId);
+ self::assertNull($instance->payment_method_id);
+ } else {
+ self::assertTrue($instance->hasPaymentMethodId());
+ self::assertSame($options['paymentMethodId'], $instance->getPaymentMethodId());
+ self::assertSame($options['paymentMethodId'], $instance->paymentMethodId);
+ self::assertSame($options['paymentMethodId'], $instance->payment_method_id);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPaymentMethodIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentMethodId($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setPaymentMethodId($value);
+ }
+
+ /**
+ * @dataProvider invalidPaymentMethodIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPaymentMethodId($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->paymentMethodId = $value;
+ }
+
+ /**
+ * @dataProvider invalidPaymentMethodIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPayment_method_id($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->payment_method_id = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testPaymentData($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasPaymentMethodData());
+ self::assertNull($instance->getPaymentMethodData());
+ self::assertNull($instance->paymentMethodData);
+
+ $instance->setPaymentMethodData($options['paymentMethodData']);
+ if (empty($options['paymentMethodData'])) {
+ self::assertFalse($instance->hasPaymentMethodData());
+ self::assertNull($instance->getPaymentMethodData());
+ self::assertNull($instance->paymentMethodData);
+ } else {
+ self::assertTrue($instance->hasPaymentMethodData());
+ self::assertSame($options['paymentMethodData'], $instance->getPaymentMethodData());
+ self::assertSame($options['paymentMethodData'], $instance->paymentMethodData);
+ }
+
+ $instance->setPaymentMethodData(null);
+ self::assertFalse($instance->hasPaymentMethodData());
+ self::assertNull($instance->getPaymentMethodData());
+ self::assertNull($instance->paymentMethodData);
+
+ $instance->paymentMethodData = $options['paymentMethodData'];
+ if (empty($options['paymentMethodData'])) {
+ self::assertFalse($instance->hasPaymentMethodData());
+ self::assertNull($instance->getPaymentMethodData());
+ self::assertNull($instance->paymentMethodData);
+ } else {
+ self::assertTrue($instance->hasPaymentMethodData());
+ self::assertSame($options['paymentMethodData'], $instance->getPaymentMethodData());
+ self::assertSame($options['paymentMethodData'], $instance->paymentMethodData);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPaymentDataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentData($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setPaymentMethodData($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testConfirmationAttributes($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasConfirmation());
+ self::assertNull($instance->getConfirmation());
+ self::assertNull($instance->confirmation);
+
+ $instance->setConfirmation($options['confirmation']);
+ if (empty($options['confirmation'])) {
+ self::assertFalse($instance->hasConfirmation());
+ self::assertNull($instance->getConfirmation());
+ self::assertNull($instance->confirmation);
+ } else {
+ self::assertTrue($instance->hasConfirmation());
+ self::assertSame($options['confirmation'], $instance->getConfirmation());
+ self::assertSame($options['confirmation'], $instance->confirmation);
+ }
+
+ $instance->setConfirmation(null);
+ self::assertFalse($instance->hasConfirmation());
+ self::assertNull($instance->getConfirmation());
+ self::assertNull($instance->confirmation);
+
+ $instance->confirmation = $options['confirmation'];
+ if (empty($options['confirmation'])) {
+ self::assertFalse($instance->hasConfirmation());
+ self::assertNull($instance->getConfirmation());
+ self::assertNull($instance->confirmation);
+ } else {
+ self::assertTrue($instance->hasConfirmation());
+ self::assertSame($options['confirmation'], $instance->getConfirmation());
+ self::assertSame($options['confirmation'], $instance->confirmation);
+ }
+ }
+
+ /**
+ * @dataProvider invalidConfirmationAttributesDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidConfirmationAttributes($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setConfirmation($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCreateRecurring($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasSavePaymentMethod());
+ self::assertNull($instance->getSavePaymentMethod());
+ self::assertNull($instance->savePaymentMethod);
+
+ $instance->setSavePaymentMethod($options['savePaymentMethod']);
+ if ($options['savePaymentMethod'] === null || $options['savePaymentMethod'] === '') {
+ self::assertFalse($instance->hasSavePaymentMethod());
+ self::assertNull($instance->getSavePaymentMethod());
+ self::assertNull($instance->savePaymentMethod);
+ } else {
+ self::assertTrue($instance->hasSavePaymentMethod());
+ self::assertSame($options['savePaymentMethod'], $instance->getSavePaymentMethod());
+ self::assertSame($options['savePaymentMethod'], $instance->savePaymentMethod);
+ }
+
+ $instance->setSavePaymentMethod(null);
+ self::assertFalse($instance->hasSavePaymentMethod());
+ self::assertNull($instance->getSavePaymentMethod());
+ self::assertNull($instance->savePaymentMethod);
+
+ $instance->savePaymentMethod = $options['savePaymentMethod'];
+ if ($options['savePaymentMethod'] === null || $options['savePaymentMethod'] === '') {
+ self::assertFalse($instance->hasSavePaymentMethod());
+ self::assertNull($instance->getSavePaymentMethod());
+ self::assertNull($instance->savePaymentMethod);
+ } else {
+ self::assertTrue($instance->hasSavePaymentMethod());
+ self::assertSame($options['savePaymentMethod'], $instance->getSavePaymentMethod());
+ self::assertSame($options['savePaymentMethod'], $instance->savePaymentMethod);
+ }
+ }
+
+ /**
+ * @dataProvider invalidBooleanDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCreateRecurring($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setSavePaymentMethod($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCapture($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasCapture());
+ self::assertNull($instance->getCapture());
+ self::assertNull($instance->capture);
+
+ $instance->setCapture($options['capture']);
+ if ($options['capture'] === null || $options['capture'] === '') {
+ self::assertFalse($instance->hasCapture());
+ self::assertNull($instance->getCapture());
+ self::assertNull($instance->capture);
+ } else {
+ self::assertTrue($instance->hasCapture());
+ self::assertSame($options['capture'], $instance->getCapture());
+ self::assertSame($options['capture'], $instance->capture);
+ }
+
+ $instance->setCapture(null);
+ self::assertFalse($instance->hasCapture());
+ self::assertNull($instance->getCapture());
+ self::assertNull($instance->capture);
+
+ $instance->capture = $options['capture'];
+ if ($options['capture'] === null || $options['capture'] === '') {
+ self::assertFalse($instance->hasCapture());
+ self::assertNull($instance->getCapture());
+ self::assertNull($instance->capture);
+ } else {
+ self::assertTrue($instance->hasCapture());
+ self::assertSame($options['capture'], $instance->getCapture());
+ self::assertSame($options['capture'], $instance->capture);
+ }
+ }
+
+ /**
+ * @dataProvider invalidBooleanDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCapture($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setCapture($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testClientIp($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasClientIp());
+ self::assertNull($instance->getClientIp());
+ self::assertNull($instance->clientIp);
+
+ $instance->setClientIp($options['clientIp']);
+ if (empty($options['clientIp'])) {
+ self::assertFalse($instance->hasClientIp());
+ self::assertNull($instance->getClientIp());
+ self::assertNull($instance->clientIp);
+ } else {
+ self::assertTrue($instance->hasClientIp());
+ self::assertSame($options['clientIp'], $instance->getClientIp());
+ self::assertSame($options['clientIp'], $instance->clientIp);
+ }
+
+ $instance->setClientIp(null);
+ self::assertFalse($instance->hasClientIp());
+ self::assertNull($instance->getClientIp());
+ self::assertNull($instance->clientIp);
+
+ $instance->clientIp = $options['clientIp'];
+ if (empty($options['clientIp'])) {
+ self::assertFalse($instance->hasClientIp());
+ self::assertNull($instance->getClientIp());
+ self::assertNull($instance->clientIp);
+ } else {
+ self::assertTrue($instance->hasClientIp());
+ self::assertSame($options['clientIp'], $instance->getClientIp());
+ self::assertSame($options['clientIp'], $instance->clientIp);
+ }
+ }
+
+ /**
+ * @dataProvider invalidClientIpDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidClientIp($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setClientIp($value);
+ }
+
+ public function invalidClientIpDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @dataProvider validTransfers
+ * @param $value
+ */
+ public function testSetTransfer($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setTransfers($value);
+ if (is_array($value)) {
+ $value = array(new Transfer($value[0]));
+ }
+ self::assertEquals($value, $instance->getTransfers());
+ }
+
+ /**
+ * @return array[]
+ * @throws \Exception
+ */
+ public function validTransfers()
+ {
+ $transfers = array();
+ for($i = 0; $i < 10; $i++) {
+ $transfers[$i][] = array(
+ 'account_id' => (string)Random::int(11111111, 99999999),
+ 'amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'platform_fee_amount' => array(
+ 'value' => sprintf('%.2f', round(Random::float(0.1, 99.99), 2)),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ );
+ }
+ $transfers[$i][] = array(new Transfer($transfers[0]));
+
+ return array($transfers);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testMetadata($options)
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->hasMetadata());
+ self::assertNull($instance->getMetadata());
+ self::assertNull($instance->metadata);
+
+ $expected = $options['metadata'];
+ if ($expected instanceof Metadata) {
+ $expected = $expected->toArray();
+ }
+
+ $instance->setMetadata($options['metadata']);
+ if (empty($options['metadata'])) {
+ self::assertFalse($instance->hasMetadata());
+ self::assertNull($instance->getMetadata());
+ self::assertNull($instance->metadata);
+ } else {
+ self::assertTrue($instance->hasMetadata());
+ self::assertSame($expected, $instance->getMetadata()->toArray());
+ self::assertSame($expected, $instance->metadata->toArray());
+ }
+
+ $instance->setMetadata(null);
+ self::assertFalse($instance->hasMetadata());
+ self::assertNull($instance->getMetadata());
+ self::assertNull($instance->metadata);
+
+ $instance->metadata = $options['metadata'];
+ if (empty($options['metadata'])) {
+ self::assertFalse($instance->hasMetadata());
+ self::assertNull($instance->getMetadata());
+ self::assertNull($instance->metadata);
+ } else {
+ self::assertTrue($instance->hasMetadata());
+ self::assertSame($expected, $instance->getMetadata()->toArray());
+ self::assertSame($expected, $instance->metadata->toArray());
+ }
+ }
+
+ public function testValidate()
+ {
+ $instance = new CreatePaymentRequest();
+
+ self::assertFalse($instance->validate());
+
+ $amount = new MonetaryAmount();
+ $instance->setAmount($amount);
+ self::assertFalse($instance->validate());
+
+ $instance->setAmount(new MonetaryAmount(10));
+ self::assertTrue($instance->validate());
+
+ $instance->setPaymentToken(Random::str(10));
+ self::assertTrue($instance->validate());
+ $instance->setPaymentMethodId(Random::str(10));
+ self::assertFalse($instance->validate());
+ $instance->setPaymentMethodId(null);
+ self::assertTrue($instance->validate());
+ $instance->setPaymentMethodData(new PaymentDataQiwi());
+ self::assertFalse($instance->validate());
+ $instance->setPaymentToken(null);
+ self::assertTrue($instance->validate());
+ $instance->setPaymentMethodId(Random::str(10));
+ self::assertFalse($instance->validate());
+ $instance->setPaymentMethodId(null);
+ self::assertTrue($instance->validate());
+
+ $receipt = new Receipt();
+ $instance->setReceipt($receipt);
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(10));
+ $item->setDescription('test');
+ $receipt->addItem($item);
+ self::assertFalse($instance->validate());
+ $receipt->getCustomer()->setPhone('123123');
+ self::assertTrue($instance->validate());
+ $item->setVatCode(3);
+ self::assertTrue($instance->validate());
+ $receipt->setTaxSystemCode(4);
+ self::assertTrue($instance->validate());
+
+ self::assertNotNull($instance->getReceipt());
+ $instance->removeReceipt();
+ self::assertTrue($instance->validate());
+ self::assertNull($instance->getReceipt());
+
+ $instance->setAmount(new MonetaryAmount());
+ self::assertFalse($instance->validate());
+ }
+
+ public function testBuilder()
+ {
+ $builder = CreatePaymentRequest::builder();
+ self::assertTrue($builder instanceof CreatePaymentRequestBuilder);
+ }
+
+ /**
+ * @dataProvider invalidMetadataDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidMetadata($value)
+ {
+ $instance = new CreatePaymentRequest();
+ $instance->setMetadata($value);
+ }
+
+ public function validDataProvider()
+ {
+ $metadata = new Metadata();
+ $metadata->test = 'test';
+ $result = array(
+ array(
+ array(
+ 'recipient' => null,
+ 'amount' => new MonetaryAmount(Random::int(1, 1000000)),
+ 'referenceId' => null,
+ 'paymentToken' => null,
+ 'paymentMethodId' => null,
+ 'paymentMethodData' => null,
+ 'confirmation' => null,
+ 'savePaymentMethod' => null,
+ 'capture' => null,
+ 'clientIp' => null,
+ 'metadata' => null,
+ ),
+ ),
+ array(
+ array(
+ 'recipient' => null,
+ 'amount' => new MonetaryAmount(Random::int(1, 1000000)),
+ 'referenceId' => '',
+ 'paymentToken' => '',
+ 'paymentMethodId' => '',
+ 'paymentMethodData' => '',
+ 'confirmation' => '',
+ 'savePaymentMethod' => '',
+ 'capture' => '',
+ 'clientIp' => '',
+ 'metadata' => array(),
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'recipient' => new Recipient(),
+ 'amount' => new MonetaryAmount(Random::int(1, 1000000)),
+ 'referenceId' => uniqid(),
+ 'paymentToken' => uniqid(),
+ 'paymentMethodId' => uniqid(),
+ 'paymentMethodData' => new PaymentDataQiwi(),
+ 'confirmation' => new ConfirmationAttributesExternal(),
+ 'savePaymentMethod' => mt_rand(0, 1) ? true : false,
+ 'capture' => mt_rand(0, 1) ? true : false,
+ 'clientIp' => long2ip(mt_rand(0, pow(2, 32))),
+ 'metadata' => $i == 0 ? $metadata : array('test' => 'test'),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ public function invalidRecipientDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(1),
+ array(Random::str(10)),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidReferenceIdDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(new \stdClass()),
+ array(array()),
+ array(Random::str(32)),
+ );
+ }
+
+ public function invalidPaymentTokenDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(new \stdClass()),
+ array(array()),
+ array(Random::str(CreatePaymentRequest::MAX_LENGTH_PAYMENT_TOKEN + 1)),
+ );
+ }
+
+ public function invalidPaymentMethodIdDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(new \stdClass()),
+ array(array()),
+ );
+ }
+
+ public function invalidPaymentDataDataProvider()
+ {
+ return array(
+ array(array()),
+ array(false),
+ array(true),
+ array(1),
+ array(Random::str(10)),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidConfirmationAttributesDataProvider()
+ {
+ return array(
+ array(array()),
+ array(false),
+ array(true),
+ array(1),
+ array(Random::str(10)),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidMetadataDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(1),
+ array(Random::str(10)),
+ );
+ }
+
+ public function invalidBooleanDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array('test'),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentResponseTest.php
new file mode 100644
index 0000000..957d067
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/CreatePaymentResponseTest.php
@@ -0,0 +1,13 @@
+setAmount($options['amount']);
+ $instance = $builder->build();
+
+ if (empty($options['amount'])) {
+ self::assertNull($instance->getAmount());
+ } else {
+ self::assertNotNull($instance->getAmount());
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+ }
+
+ /**
+ * @dataProvider validAmountDataProvider
+ *
+ * @param AmountInterface $amount
+ */
+ public function testSetAmount($amount)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ $builder->setAmount($amount);
+ $instance = $builder->build();
+
+ self::assertNotNull($instance->getAmount());
+ self::assertEquals($amount->getValue(), $instance->getAmount()->getValue());
+ self::assertEquals($amount->getCurrency(), $instance->getAmount()->getCurrency());
+
+ $builder->setAmount(array(
+ 'value' => $amount->getValue(),
+ 'currency' => $amount->getCurrency(),
+ ));
+ $instance = $builder->build();
+
+ self::assertNotNull($instance->getAmount());
+ self::assertEquals($amount->getValue(), $instance->getAmount()->getValue());
+ self::assertEquals($amount->getCurrency(), $instance->getAmount()->getCurrency());
+ }
+
+ /**
+ * @dataProvider invalidAmountDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidAmount($value)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setAmount($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetAmountCurrency($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ $builder->setCurrency($options['currency']);
+ $instance = $builder->build(array('amount' => mt_rand(1, 100)));
+
+ self::assertNotNull($instance->getAmount());
+ self::assertEquals($options['currency'], $instance->getAmount()->getCurrency());
+ }
+
+ /**
+ * @dataProvider invalidCurrencyDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidCurrency($value)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setCurrency($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetReceiptItems($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build();
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testAddReceiptItems($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ foreach ($options['receiptItems'] as $item) {
+ if ($item instanceof ReceiptItem) {
+ $builder->addReceiptItem(
+ $item->getDescription(), $item->getPrice()->getValue(), $item->getQuantity(), $item->getVatCode()
+ );
+ } else {
+ $builder->addReceiptItem($item['title'], $item['price'], $item['quantity'], $item['vatCode']);
+ }
+ }
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build();
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertFalse($item->isShipping());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testAddReceiptShipping($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ foreach ($options['receiptItems'] as $item) {
+ if ($item instanceof ReceiptItem) {
+ $builder->addReceiptShipping(
+ $item->getDescription(), $item->getPrice()->getValue(), $item->getVatCode()
+ );
+ } else {
+ $builder->addReceiptShipping($item['title'], $item['price'], $item['vatCode']);
+ }
+ }
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build();
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertTrue($item->isShipping());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider invalidItemsDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $items
+ */
+ public function testSetInvalidReceiptItems($items)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setReceiptItems($items);
+ }
+
+ public function invalidItemsDataProvider()
+ {
+ return array(
+ array(
+ array(
+ array(
+ 'price' => 1,
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'price' => 123,
+ 'quantity' => 1.4,
+ 'vatCode' => 7,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'description' => 'test',
+ 'price' => 123,
+ 'quantity' => -1.4,
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetReceiptEmail($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build();
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['receiptEmail'], $instance->getReceipt()->getCustomer()->getEmail());
+ }
+ }
+
+ /**
+ * @dataProvider invalidEmailDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidEmail($value)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setReceiptEmail($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetReceiptPhone($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $builder->setReceiptPhone($options['receiptPhone']);
+ $instance = $builder->build();
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['receiptPhone'], $instance->getReceipt()->getCustomer()->getPhone());
+ }
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidPhone($value)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setReceiptPhone($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetReceiptTaxSystemCode($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $builder->setTaxSystemCode($options['taxSystemCode']);
+ $instance = $builder->build();
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['taxSystemCode'], $instance->getReceipt()->getTaxSystemCode());
+ }
+ }
+
+ /**
+ * @dataProvider invalidVatIdDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidTaxSystemId($value)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setTaxSystemCode($value);
+ }
+
+ public function testSetReceipt()
+ {
+ $receipt = array(
+ 'tax_system_code' => Random::int(1, 6),
+ 'customer' => array(
+ 'email' => Random::str(10),
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ 'items' => array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 123,
+ 'amount' => array(
+ 'value' => 321,
+ 'currency' => 'USD',
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => PaymentSubject::COMMODITY,
+ 'payment_mode' => PaymentMode::PARTIAL_PREPAYMENT,
+ ),
+ ),
+ );
+
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setReceipt($receipt);
+ $instance = $builder->build();
+
+ self::assertEquals($receipt['tax_system_code'], $instance->getReceipt()->getTaxSystemCode());
+ self::assertEquals($receipt['customer']['email'], $instance->getReceipt()->getCustomer()->getEmail());
+ self::assertEquals($receipt['customer']['phone'], $instance->getReceipt()->getCustomer()->getPhone());
+ self::assertEquals(1, count($instance->getReceipt()->getItems()));
+
+ $receipt = $instance->getReceipt();
+
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setReceipt($instance->getReceipt());
+ $instance = $builder->build();
+
+ self::assertEquals($receipt['tax_system_code'], $instance->getReceipt()->getTaxSystemCode());
+ self::assertEquals($receipt['customer']['email'], $instance->getReceipt()->getCustomer()->getEmail());
+ self::assertEquals($receipt['customer']['phone'], $instance->getReceipt()->getCustomer()->getPhone());
+ self::assertEquals(1, count($instance->getReceipt()->getItems()));
+ }
+
+ /**
+ * @dataProvider invalidReceiptDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testSetInvalidReceipt($value)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $builder->setReceipt($value);
+ }
+
+ public function invalidReceiptDataProvider()
+ {
+ return array(
+ array(null),
+ array(true),
+ array(false),
+ array(1),
+ array(1.1),
+ array('test'),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testBuild($options)
+ {
+ $builder = new CreateCaptureRequestBuilder();
+ $instance = $builder->build($options);
+ if (!empty($options['amount'])) {
+ self::assertNotNull($instance->getAmount());
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ self::assertEquals($options['currency'], $instance->getAmount()->getCurrency());
+ } else {
+ self::assertNull($instance->getAmount());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $receiptItem = new ReceiptItem();
+ $receiptItem->setPrice(new MonetaryAmount(1));
+ $receiptItem->setQuantity(1);
+ $receiptItem->setDescription('test');
+ $receiptItem->setVatCode(3);
+
+ $result = array(
+ array(
+ array(
+ 'amount' => null,
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'receiptItems' => array(
+ array(
+ 'title' => 'test',
+ 'quantity' => mt_rand(1, 100),
+ 'price' => mt_rand(1, 100),
+ 'vatCode' => mt_rand(1, 6),
+ ),
+ $receiptItem,
+ ),
+ 'receiptEmail' => Random::str(32),
+ 'receiptPhone' => null,
+ 'taxSystemCode' => null,
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'receiptItems' => array(),
+ 'amount' => Random::int(1, 1000000),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'receiptEmail' => null,
+ 'receiptPhone' => Random::str(10, '0123456789'),
+ 'taxSystemCode' => Random::int(1, 6),
+ );
+ $result[] = array($request);
+ }
+
+ return $result;
+ }
+
+ public function validAmountDataProvider()
+ {
+ return array(
+ array(new MonetaryAmount(Random::int(1, 1000000))),
+ array(new MonetaryAmount(Random::int(1, 1000000)), Random::value(CurrencyCode::getValidValues())),
+ );
+ }
+
+ public function invalidAmountDataProvider()
+ {
+ return array(
+ array(-1),
+ array(Random::str(10)),
+ array(new \stdClass()),
+ array(true),
+ array(false),
+ );
+ }
+
+ public function invalidCurrencyDataProvider()
+ {
+ return array(
+ array(array()),
+ array(null),
+ array(''),
+ array(-1),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ array(true),
+ array(false),
+ );
+ }
+
+ public function invalidEmailDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidPhoneDataProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ );
+ }
+
+ public function invalidVatIdDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(0),
+ array(7),
+ array(Random::int(-100, -1)),
+ array(Random::int(7, 100)),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php
new file mode 100644
index 0000000..86d21d8
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestSerializerTest.php
@@ -0,0 +1,138 @@
+serialize(CreateCaptureRequest::builder()->build($options));
+
+ $expected = array();
+ if (isset($options['amount'])) {
+ $expected = array(
+ 'amount' => $options['amount'],
+ );
+ }
+ if (!empty($options['receiptItems'])) {
+ foreach ($options['receiptItems'] as $item) {
+ $itemArray = array(
+ 'description' => $item['title'],
+ 'quantity' => $item['quantity'],
+ 'amount' => array(
+ 'value' => $item['price'],
+ 'currency' => isset($options['currency']) ? $options['currency'] : CurrencyCode::RUB,
+ ),
+ 'vat_code' => $item['vatCode'],
+ );
+
+ if (!empty($item['payment_subject'])) {
+ $itemArray['payment_subject'] = $options['payment_subject'];
+ }
+ if (!empty($item['payment_mode'])) {
+ $itemArray['payment_mode'] = $options['payment_mode'];
+ }
+ $expected['receipt']['items'][] = $itemArray;
+ }
+ if (!empty($options['receiptEmail'])) {
+ $expected['receipt']['customer']['email'] = $options['receiptEmail'];
+ }
+ if (!empty($options['receiptEmail'])) {
+ $expected['receipt']['customer']['email'] = $options['receiptEmail'];
+ }
+ if (!empty($options['taxSystemCode'])) {
+ $expected['receipt']['tax_system_code'] = $options['taxSystemCode'];
+ }
+ } elseif (!empty($options['receipt'])) {
+ $expected['receipt'] = $options['receipt'];
+ if (!empty($expected['receipt']['phone'])) {
+ $expected['receipt']['customer']['phone'] = $expected['receipt']['phone'];
+ unset($expected['receipt']['phone']);
+ }
+ if (!empty($expected['receipt']['email'])) {
+ $expected['receipt']['customer']['email'] = $expected['receipt']['email'];
+ unset($expected['receipt']['email']);
+ }
+ }
+ self::assertEquals($expected, $data);
+ }
+
+ public function validDataProvider()
+ {
+ $currencies = CurrencyCode::getValidValues();
+
+ $result = array(
+ array(
+ array()
+ ),
+ array(
+ array(
+ 'receiptItems' => array(
+ array(
+ 'title' => Random::str(10),
+ 'quantity' => round(Random::float(0.01, 10.00), 2),
+ 'price' => round(Random::float(10.00, 100.00), 2),
+ 'vatCode' => Random::int(1, 6),
+ ),
+ ),
+ 'receiptEmail' => Random::str(10),
+ 'taxSystemCode' => Random::int(1, 6),
+ )
+ ),
+ array(
+ array(
+ 'receipt' => array(
+ 'items' => array(
+ array(
+ 'description' => Random::str(10),
+ 'quantity' => round(Random::float(0.01, 10.00), 2),
+ 'amount' => array(
+ 'value' => round(Random::float(10.00, 100.00), 2),
+ 'currency' => $currencies[mt_rand(0, count($currencies) - 1)],
+ ),
+ 'vat_code' => Random::int(1, 6),
+ ),
+ array(
+ 'description' => Random::str(10),
+ 'amount' => array(
+ 'value' => round(Random::float(10.00, 100.00), 2),
+ 'currency' => $currencies[mt_rand(0, count($currencies) - 1)],
+ ),
+ 'quantity' => round(Random::float(0.01, 10.00), 2),
+ 'vat_code' => Random::int(1, 6),
+ ),
+ ),
+ 'customer' => array(
+ 'phone' => Random::str(12, '0123456789'),
+ 'email' => Random::str(10 ),
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ ),
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'amount' => array(
+ 'value' => (float)mt_rand(1, 1000000),
+ 'currency' => $currencies[mt_rand(0, count($currencies) - 1)],
+ ),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestTest.php
new file mode 100644
index 0000000..2f58ec7
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureRequestTest.php
@@ -0,0 +1,94 @@
+hasAmount());
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+
+ $instance->setAmount($options['amount']);
+ self::assertTrue($instance->hasAmount());
+ self::assertSame($options['amount'], $instance->getAmount());
+ self::assertSame($options['amount'], $instance->amount);
+
+ $instance = new CreateCaptureRequest();
+ self::assertFalse($instance->hasAmount());
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount);
+
+ $instance->amount = $options['amount'];
+ self::assertTrue($instance->hasAmount());
+ self::assertSame($options['amount'], $instance->getAmount());
+ self::assertSame($options['amount'], $instance->amount);
+ }
+
+ public function testValidate()
+ {
+ $instance = new CreateCaptureRequest();
+
+ self::assertTrue($instance->validate());
+ $amount = new MonetaryAmount();
+ $instance->setAmount($amount);
+ self::assertFalse($instance->validate());
+ $amount->setValue(1);
+ self::assertTrue($instance->validate());
+
+ $receipt = new Receipt();
+ $instance->setReceipt($receipt);
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(10));
+ $item->setDescription('test');
+ $receipt->addItem($item);
+ self::assertFalse($instance->validate());
+ $receipt->getCustomer()->setPhone('123123');
+ self::assertTrue($instance->validate());
+ $item->setVatCode(3);
+ self::assertTrue($instance->validate());
+ $receipt->setTaxSystemCode(4);
+ self::assertTrue($instance->validate());
+
+ self::assertNotNull($instance->getReceipt());
+ $instance->removeReceipt();
+ self::assertTrue($instance->validate());
+ self::assertNull($instance->getReceipt());
+
+ $instance->setAmount(new MonetaryAmount());
+ self::assertFalse($instance->validate());
+ }
+
+ public function testBuilder()
+ {
+ $builder = CreateCaptureRequest::builder();
+ self::assertTrue($builder instanceof CreateCaptureRequestBuilder);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array();
+ $currencies = CurrencyCode::getValidValues();
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'amount' => new MonetaryAmount(mt_rand(1, 1000000), $currencies[mt_rand(0, count($currencies) - 1)])
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureResponseTest.php
new file mode 100644
index 0000000..020e91c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/Payment/CreateCaptureResponseTest.php
@@ -0,0 +1,14 @@
+build();
+ self::assertNull($instance->getCursor());
+
+ $builder->setCursor($options['cursor']);
+ $instance = $builder->build();
+ if (empty($options['cursor'])) {
+ self::assertNull($instance->getCursor());
+ } else {
+ self::assertEquals($options['cursor'], $instance->getCursor());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCreatedAtGte($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtGte());
+
+ $builder->setCreatedAtGte($options['createdAtGte']);
+ $instance = $builder->build();
+ if (empty($options['createdAtGte'])) {
+ self::assertNull($instance->getCreatedAtGte());
+ } else {
+ self::assertEquals($options['createdAtGte'], $instance->getCreatedAtGte()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetCreatedGt($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtGt());
+
+ $builder->setCreatedAtGt($options['createdAtGt']);
+ $instance = $builder->build();
+ if (empty($options['createdAtGt'])) {
+ self::assertNull($instance->getCreatedAtGt());
+ } else {
+ self::assertEquals($options['createdAtGt'], $instance->getCreatedAtGt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetCreatedLte($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtLte());
+
+ $builder->setCreatedAtLte($options['createdAtLte']);
+ $instance = $builder->build();
+ if (empty($options['createdAtLte'])) {
+ self::assertNull($instance->getCreatedAtLte());
+ } else {
+ self::assertEquals($options['createdAtLte'], $instance->getCreatedAtLte()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCreatedLt($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtLt());
+
+ $builder->setCreatedAtLt($options['createdAtLt']);
+ $instance = $builder->build();
+ if (empty($options['createdAtLt'])) {
+ self::assertNull($instance->getCreatedAtLt());
+ } else {
+ self::assertEquals($options['createdAtLt'], $instance->getCreatedAtLt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCapturedAtGte($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCapturedAtGte());
+
+ $builder->setCapturedAtGte($options['capturedAtGte']);
+ $instance = $builder->build();
+ if (empty($options['capturedAtGte'])) {
+ self::assertNull($instance->getCapturedAtGte());
+ } else {
+ self::assertEquals($options['capturedAtGte'], $instance->getCapturedAtGte()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetCapturedGt($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCapturedAtGt());
+
+ $builder->setCapturedAtGt($options['capturedAtGt']);
+ $instance = $builder->build();
+ if (empty($options['capturedAtGt'])) {
+ self::assertNull($instance->getCapturedAtGt());
+ } else {
+ self::assertEquals($options['capturedAtGt'], $instance->getCapturedAtGt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetCapturedLte($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCapturedAtLte());
+
+ $builder->setCapturedAtLte($options['capturedAtLte']);
+ $instance = $builder->build();
+ if (empty($options['capturedAtLte'])) {
+ self::assertNull($instance->getCapturedAtLte());
+ } else {
+ self::assertEquals($options['capturedAtLte'], $instance->getCapturedAtLte()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCapturedLt($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCapturedAtLt());
+
+ $builder->setCapturedAtLt($options['capturedAtLt']);
+ $instance = $builder->build();
+ if (empty($options['capturedAtLt'])) {
+ self::assertNull($instance->getCapturedAtLt());
+ } else {
+ self::assertEquals($options['capturedAtLt'], $instance->getCapturedAtLt()->format(DATE_ATOM));
+ }
+ }
+
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetPaymentMethod($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getPaymentMethod());
+
+ $builder->setPaymentMethod($options['paymentMethod']);
+ $instance = $builder->build();
+ if (empty($options['paymentMethod'])) {
+ self::assertNull($instance->getPaymentMethod());
+ } else {
+ self::assertEquals($options['paymentMethod'], $instance->getPaymentMethod());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetLimit($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getLimit());
+
+ $builder->setLimit($options['limit']);
+ $instance = $builder->build();
+ if (is_null($options['limit'])) {
+ self::assertNull($instance->getLimit());
+ } else {
+ self::assertEquals($options['limit'], $instance->getLimit());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetStatus($options)
+ {
+ $builder = new PaymentsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getStatus());
+
+ $builder->setStatus($options['status']);
+ $instance = $builder->build();
+ if (empty($options['status'])) {
+ self::assertNull($instance->getStatus());
+ } else {
+ self::assertEquals($options['status'], $instance->getStatus());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'createdAtGte' => null,
+ 'createdAtGt' => null,
+ 'createdAtLte' => null,
+ 'createdAtLt' => null,
+ 'capturedAtGte' => null,
+ 'capturedAtGt' => null,
+ 'capturedAtLte' => null,
+ 'capturedAtLt' => null,
+ 'paymentMethod' => null,
+ 'status' => null,
+ 'limit' => null,
+ 'cursor' => null,
+ ),
+ ),
+ array(
+ array(
+ 'createdAtGte' => '',
+ 'createdAtGt' => '',
+ 'createdAtLte' => '',
+ 'createdAtLt' => '',
+ 'capturedAtGte' => '',
+ 'capturedAtGt' => '',
+ 'capturedAtLte' => '',
+ 'capturedAtLt' => '',
+ 'paymentMethod' => '',
+ 'status' => '',
+ 'limit' => 0,
+ 'cursor' => '',
+ ),
+ ),
+ );
+ $statuses = PaymentStatus::getValidValues();
+ $methods = PaymentMethodType::getValidValues();
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'createdAtGte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createdAtGt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createdAtLte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createdAtLt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtGte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtGt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtLte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtLt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'paymentMethod' => $methods[mt_rand(0, count($methods) - 1)],
+ 'status' => $statuses[mt_rand(0, count($statuses) - 1)],
+ 'limit' => mt_rand(1, 100),
+ 'cursor' => $this->randomString(mt_rand(1, 30)),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ private function randomString($length, $any = true)
+ {
+ static $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+_.';
+
+ $result = '';
+ for ($i = 0; $i < $length; $i++) {
+ if ($any) {
+ $char = chr(mt_rand(32, 126));
+ } else {
+ $rnd = mt_rand(0, strlen($chars) - 1);
+ $char = substr($chars, $rnd, 1);
+ }
+ $result .= $char;
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsRequestSerializerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsRequestSerializerTest.php
new file mode 100644
index 0000000..8d44eaa
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsRequestSerializerTest.php
@@ -0,0 +1,110 @@
+ 'created_at.gte',
+ 'createdAtGt' => 'created_at.gt',
+ 'createdAtLte' => 'created_at.lte',
+ 'createdAtLt' => 'created_at.lt',
+ 'capturedAtGte' => 'captured_at.gte',
+ 'capturedAtGt' => 'captured_at.gt',
+ 'capturedAtLte' => 'captured_at.lte',
+ 'capturedAtLt' => 'captured_at.lt',
+ 'status' => 'status',
+ 'paymentMethod' => 'payment_method',
+ 'limit' => 'limit',
+ 'cursor' => 'cursor',
+ );
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSerialize($options)
+ {
+ $serializer = new PaymentsRequestSerializer();
+ $data = $serializer->serialize(PaymentsRequest::builder()->build($options));
+
+ $expected = array();
+ foreach ($this->fieldMap as $field => $mapped) {
+ if (isset($options[$field])) {
+ $value = $options[$field];
+ if (!empty($value)) {
+ $expected[$mapped] = $value instanceof \DateTime ? $value->format(DATE_ATOM) : $value;
+ }
+ }
+ }
+ self::assertEquals($expected, $data);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(),
+ ),
+ array(
+ array(
+ 'createdAtGte' => '',
+ 'createdAtGt' => '',
+ 'createdAtLte' => '',
+ 'createdAtLt' => '',
+ 'capturedAtGte' => '',
+ 'capturedAtGt' => '',
+ 'capturedAtLte' => '',
+ 'capturedAtLt' => '',
+ 'paymentMethod' => '',
+ 'status' => '',
+ 'limit' => 0,
+ 'cursor' => '',
+ ),
+ ),
+ );
+ $statuses = PaymentStatus::getValidValues();
+ $methods = PaymentMethodType::getValidValues();
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'createdAtGte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createdAtGt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createdAtLte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createdAtLt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtGte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtGt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtLte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'capturedAtLt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'paymentMethod' => $methods[mt_rand(0, count($methods) - 1)],
+ 'status' => $statuses[mt_rand(0, count($statuses) - 1)],
+ 'limit' => mt_rand(1, 100),
+ 'cursor' => $this->randomString(mt_rand(1, 30)),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ private function randomString($length, $any = true)
+ {
+ static $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+_.';
+
+ $result = '';
+ for ($i = 0; $i < $length; $i++) {
+ if ($any) {
+ $char = chr(mt_rand(32, 126));
+ } else {
+ $rnd = mt_rand(0, strlen($chars) - 1);
+ $char = substr($chars, $rnd, 1);
+ }
+ $result .= $char;
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsRequestTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsRequestTest.php
new file mode 100644
index 0000000..65a81fe
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsRequestTest.php
@@ -0,0 +1,410 @@
+getterAndSetterTest($value, 'cursor', $value === null ? '' : (string)$value);
+ }
+
+ /**
+ * @dataProvider invalidPageDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCursor($value)
+ {
+ $this->getTestInstance()->setCursor($value);
+ }
+
+ /**
+ * @dataProvider validPaymentMethodDataProvider
+ * @param $value
+ */
+ public function testPaymentMethod($value)
+ {
+ $this->getterAndSetterTest($value, 'paymentMethod', $value);
+ }
+
+ /**
+ * @dataProvider invalidPaymentMethodDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentMethod($value)
+ {
+ $this->getTestInstance()->setPaymentMethod($value);
+ }
+
+ /**
+ * @dataProvider validDateDataProvider
+ * @param $value
+ */
+ public function testDateMethods($value)
+ {
+ $properties = array(
+ 'createdAtGte',
+ 'createdAtGt',
+ 'createdAtLte',
+ 'createdAtLt',
+ 'capturedAtGte',
+ 'capturedAtGt',
+ 'capturedAtLte',
+ 'capturedAtLt',
+ );
+ $expected = null;
+ if ($value instanceof \DateTime) {
+ $expected = $value->format(DATE_ATOM);
+ } elseif (is_numeric($value)) {
+ $expected = date(DATE_ATOM, $value);
+ } else {
+ $expected = $value;
+ }
+ foreach ($properties as $property) {
+ $this->getterAndSetterTest($value, $property, empty($expected) ? null : new \DateTime($expected));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedAtGte($value)
+ {
+ $this->getTestInstance()->setCreatedAtGte($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedAtGt($value)
+ {
+ $this->getTestInstance()->setCreatedAtGt($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedAtLte($value)
+ {
+ $this->getTestInstance()->setCreatedAtLte($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedAtLt($value)
+ {
+ $this->getTestInstance()->setCreatedAtLt($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCapturedAtGte($value)
+ {
+ $this->getTestInstance()->setCapturedAtGte($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCapturedAtGt($value)
+ {
+ $this->getTestInstance()->setCapturedAtGt($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCapturedAtLte($value)
+ {
+ $this->getTestInstance()->setCapturedAtLte($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCapturedAtLt($value)
+ {
+ $this->getTestInstance()->setCapturedAtLt($value);
+ }
+
+
+ /**
+ * @dataProvider validLimitDataProvider
+ * @param $value
+ */
+ public function testLimit($value)
+ {
+ $this->getterAndSetterTest($value, 'limit', $value);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidLimit($value)
+ {
+ $this->getTestInstance()->setLimit($value);
+ }
+
+ /**
+ * @dataProvider validStatusDataProvider
+ * @param $value
+ */
+ public function testStatus($value)
+ {
+ $this->getterAndSetterTest($value, 'status', $value === null ? '' : (string)$value);
+ }
+
+ /**
+ * @dataProvider invalidDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidStatus($value)
+ {
+ $this->getTestInstance()->setStatus($value);
+ }
+
+ public function testValidate()
+ {
+ $instance = new PaymentsRequest();
+ self::assertTrue($instance->validate());
+ }
+
+ public function testBuilder()
+ {
+ $builder = PaymentsRequest::builder();
+ self::assertTrue($builder instanceof PaymentsRequestBuilder);
+ }
+
+ public function validNetPageDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(Random::str(1)),
+ array(Random::str(2, 64)),
+ array(new StringObject(Random::str(1))),
+ array(new StringObject(Random::str(2, 64))),
+ );
+ }
+
+ public function validPaymentMethodDataProvider()
+ {
+ $result = array(
+ array(null),
+ array(''),
+ );
+ foreach (PaymentMethodType::getValidValues() as $value) {
+ $result[] = array($value);
+ $result[] = array(new StringObject($value));
+ }
+ return $result;
+ }
+
+ public function validIdDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array('123'),
+ array(Random::str(1, 64)),
+ array(new StringObject(Random::str(1, 64))),
+ );
+ }
+
+ public function validDateDataProvider()
+ {
+ return array(
+ array(null),
+ array(''),
+ array(Random::int(0, time())),
+ array(date(DATE_ATOM, Random::int(0, time()))),
+ array(new \DateTime()),
+ );
+ }
+
+ public function validStatusDataProvider()
+ {
+ $result = array(
+ array(null),
+ array(''),
+ );
+ foreach (PaymentStatus::getValidValues() as $value) {
+ $result[] = array($value);
+ $result[] = array(new StringObject($value));
+ }
+ return $result;
+ }
+
+ public function validLimitDataProvider()
+ {
+ return array(
+ array(null),
+ array(Random::int(1, PaymentsRequest::MAX_LIMIT_VALUE)),
+ );
+ }
+
+ public function invalidIdDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array(true),
+ array(false),
+ );
+ }
+
+ public function invalidDataProvider()
+ {
+ $result = array(
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ array(Random::bytes(10)),
+ array(-1),
+ array(PaymentsRequest::MAX_LIMIT_VALUE + 1),
+ );
+ return $result;
+ }
+
+ public function invalidPaymentMethodDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(35)),
+ array(Random::str(37)),
+ array(new StringObject(Random::str(10))),
+ );
+ }
+
+ public function invalidDateDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(35)),
+ array(Random::str(37)),
+ array(new StringObject(Random::str(10))),
+ array(-123),
+ );
+ }
+
+ public function invalidPageDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array(true),
+ array(false),
+ );
+ }
+
+ private function getterAndSetterTest($value, $property, $expected, $testHas = true)
+ {
+ $getter = 'get'.ucfirst($property);
+ $setter = 'set'.ucfirst($property);
+ $has = 'has'.ucfirst($property);
+
+ $instance = $this->getTestInstance();
+
+ if ($testHas) {
+ self::assertFalse($instance->{$has}());
+ }
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+
+ $instance->{$setter}($value);
+ if ($value === null || $value === '') {
+ if ($testHas) {
+ self::assertFalse($instance->{$has}());
+ }
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+ } else {
+ if ($testHas) {
+ self::assertTrue($instance->{$has}());
+ }
+ if ($expected instanceof \DateTime) {
+ self::assertEquals($expected->getTimestamp(), $instance->{$getter}()->getTimestamp());
+ self::assertEquals($expected->getTimestamp(), $instance->{$property}->getTimestamp());
+ } else {
+ self::assertEquals($expected, $instance->{$getter}());
+ self::assertEquals($expected, $instance->{$property});
+ }
+ }
+
+ $instance->{$setter}(null);
+ if ($testHas) {
+ self::assertFalse($instance->{$has}());
+ }
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+
+ $instance->{$property} = $value;
+ if ($value === null || $value === '') {
+ if ($testHas) {
+ self::assertFalse($instance->{$has}());
+ }
+ self::assertNull($instance->{$getter}());
+ self::assertNull($instance->{$property});
+ } else {
+ if ($testHas) {
+ self::assertTrue($instance->{$has}());
+ }
+ if ($expected instanceof \DateTime) {
+ self::assertEquals($expected->getTimestamp(), $instance->{$getter}()->getTimestamp());
+ self::assertEquals($expected->getTimestamp(), $instance->{$property}->getTimestamp());
+ } else {
+ self::assertEquals($expected, $instance->{$getter}());
+ self::assertEquals($expected, $instance->{$property});
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsResponseTest.php
new file mode 100644
index 0000000..432d8a4
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Payments/PaymentsResponseTest.php
@@ -0,0 +1,204 @@
+getItems()));
+ foreach ($instance->getItems() as $index => $item) {
+ self::assertTrue($item instanceof PaymentInterface);
+ self::assertArrayHasKey($index, $options['items']);
+ self::assertEquals($options['items'][$index]['id'], $item->getId());
+ self::assertEquals($options['items'][$index]['status'], $item->getStatus());
+ self::assertEquals($options['items'][$index]['amount']['value'], $item->getAmount()->getValue());
+ self::assertEquals($options['items'][$index]['amount']['currency'], $item->getAmount()->getCurrency());
+ self::assertEquals($options['items'][$index]['created_at'], $item->getCreatedAt()->format(DATE_ATOM));
+ self::assertEquals($options['items'][$index]['payment_method']['type'], $item->getPaymentMethod()->getType());
+ self::assertEquals($options['items'][$index]['paid'], $item->getPaid());
+ self::assertEquals($options['items'][$index]['refundable'], $item->getRefundable());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetNextCursor($options)
+ {
+ $instance = new PaymentsResponse($options);
+ if (empty($options['next_cursor'])) {
+ self::assertNull($instance->getNextCursor());
+ } else {
+ self::assertEquals($options['next_cursor'], $instance->getNextCursor());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testHasNext($options)
+ {
+ $instance = new PaymentsResponse($options);
+ if (empty($options['next_cursor'])) {
+ self::assertFalse($instance->hasNextCursor());
+ } else {
+ self::assertTrue($instance->hasNextCursor());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ return array(
+ array(
+ array(
+ 'items' => array(),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(
+ array(
+ 'id' => Random::str(36),
+ 'status' => PaymentStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100000),
+ 'currency' => CurrencyCode::EUR,
+ ),
+ 'description' => Random::str(20),
+ 'created_at' => date(DATE_ATOM),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'paid' => false,
+ 'refundable' => false,
+ )
+ ),
+ 'next_cursor' => uniqid(),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(
+ array(
+ 'id' => Random::str(36),
+ 'status' => PaymentStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100000),
+ 'currency' => CurrencyCode::EUR,
+ ),
+ 'created_at' => date(DATE_ATOM),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'paid' => true,
+ 'refundable' => true,
+ 'confirmation' => array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ ),
+ array(
+ 'id' => Random::str(36),
+ 'status' => PaymentStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100000),
+ 'currency' => CurrencyCode::EUR,
+ ),
+ 'description' => Random::str(20),
+ 'created_at' => date(DATE_ATOM),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'paid' => false,
+ 'refundable' => false,
+ 'recipient' => array(
+ 'account_id' => uniqid(),
+ 'gateway_id' => uniqid(),
+ ),
+ 'reference_id' => uniqid(),
+ 'captured_at' => date(DATE_ATOM),
+ 'charge' => array('value' => Random::int(1, 100000), 'currency' => CurrencyCode::RUB),
+ 'income' => array('value' => Random::int(1, 100000), 'currency' => CurrencyCode::USD),
+ 'refunded' => array('value' => Random::int(1, 100000), 'currency' => CurrencyCode::EUR),
+ 'metadata' => array('test_key' => 'test_value'),
+ 'cancellation_details' => array('party' => CancellationDetailsPartyCode::PAYMENT_NETWORK, 'reason' => CancellationDetailsReasonCode::INVALID_CSC),
+ 'authorization_details' => array('rrn' => Random::str(20), 'auth_code' => Random::str(20)),
+ 'refunded_amount' => array('value' => Random::int(1, 100000), 'currency' => CurrencyCode::RUB),
+ 'confirmation' => array(
+ 'type' => ConfirmationType::EXTERNAL,
+ ),
+ 'receipt_registration' => ReceiptRegistrationStatus::PENDING,
+ ),
+ ),
+ 'next_cursor' => uniqid(),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(
+ array(
+ 'id' => Random::str(36),
+ 'status' => PaymentStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100000),
+ 'currency' => CurrencyCode::EUR,
+ ),
+ 'description' => Random::str(20),
+ 'created_at' => date(DATE_ATOM),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'paid' => true,
+ 'refundable' => true,
+ 'confirmation' => array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ 'return_url' => Random::str(10),
+ 'enforce' => false,
+ ),
+ ),
+ array(
+ 'id' => Random::str(36),
+ 'status' => PaymentStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100000),
+ 'currency' => CurrencyCode::EUR,
+ ),
+ 'description' => Random::str(20),
+ 'created_at' => date(DATE_ATOM),
+ 'payment_method' => array(
+ 'type' => PaymentMethodType::QIWI,
+ ),
+ 'paid' => true,
+ 'refundable' => true,
+ 'confirmation' => array(
+ 'type' => ConfirmationType::REDIRECT,
+ 'confirmation_url' => Random::str(10),
+ ),
+ ),
+ ),
+ 'next_cursor' => uniqid(),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/AbstractReceiptResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/AbstractReceiptResponseTest.php
new file mode 100644
index 0000000..14783d5
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/AbstractReceiptResponseTest.php
@@ -0,0 +1,183 @@
+getTestInstance($options);
+ self::assertEquals($options['id'], $instance->getId());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetType($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertEquals($options['type'], $instance->getType());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetStatus($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['status'])) {
+ self::assertFalse($instance->getStatus());
+ } else {
+ self::assertEquals($options['status'], $instance->getStatus());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetTaxSystemCode($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['tax_system_code'])) {
+ self::assertFalse($instance->getTaxSystemCode());
+ } else {
+ self::assertEquals($options['tax_system_code'], $instance->getTaxSystemCode());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetItems($options)
+ {
+ $instance = $this->getTestInstance($options);
+
+ self::assertEquals(count($options['items']), count($instance->getItems()));
+
+ foreach ($instance->getItems() as $index => $item) {
+ self::assertTrue($item instanceof ReceiptResponseItemInterface);
+ self::assertArrayHasKey($index, $options['items']);
+ self::assertEquals($options['items'][$index]['description'], $item->getDescription());
+ self::assertEquals($options['items'][$index]['amount']['value'], $item->getPrice()->getValue());
+ self::assertEquals($options['items'][$index]['amount']['currency'], $item->getPrice()->getCurrency());
+ self::assertEquals($options['items'][$index]['quantity'], $item->getQuantity());
+ self::assertEquals($options['items'][$index]['vat_code'], $item->getVatCode());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ return array($this->generateReceipts($this->type));
+ }
+
+ private function generateReceipts($type)
+ {
+ $return = array();
+ $count = Random::int(1, 10);
+
+ for ($i=0; $i < $count; $i++) {
+ $return[] = $this->generateReceipt($type);
+ }
+
+ return $return;
+ }
+
+ private function generateReceipt($type)
+ {
+ $receipt = array(
+ 'id' => Random::str(39),
+ 'type' => $type,
+ 'status' => Random::value(array('pending', 'succeeded', 'canceled')),
+ 'items' => $this->generateItems(),
+ 'settlements' => $this->generateSettlements(),
+ 'tax_system_code' => Random::int(1 ,6),
+ );
+
+ $receipt = $this->addSpecificProperties($receipt);
+
+ return $receipt;
+ }
+
+ private function generateItems()
+ {
+ $return = array();
+ $count = Random::int(1, 10);
+
+ for ($i=0; $i < $count; $i++) {
+ $return[] = $this->generateItem();
+ }
+
+ return $return;
+ }
+
+ private function generateItem()
+ {
+ return array(
+ 'description' => Random::str(1, 128),
+ 'amount' => array(
+ 'value' => round(Random::float(1.00, 100.00), 2),
+ 'currency' => 'RUB',
+ ),
+ 'quantity' => round(Random::float(0.001, 99.999), 3),
+ 'vat_code' => Random::int(1 ,6),
+ );
+ }
+
+ private function generateSettlements()
+ {
+ $return = array();
+ $count = Random::int(1, 10);
+
+ for ($i=0; $i < $count; $i++) {
+ $return[] = $this->generateSettlement();
+ }
+
+ return $return;
+ }
+
+ private function generateSettlement()
+ {
+ return array(
+ 'description' => Random::str(1, 128),
+ 'amount' => array(
+ 'value' => round(Random::float(1.00, 100.00), 2),
+ 'currency' => 'RUB',
+ ),
+ 'quantity' => round(Random::float(0.001, 99.999), 3),
+ 'vat_code' => Random::int(1 ,6),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestBuilderTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestBuilderTest.php
new file mode 100644
index 0000000..b6a1a9a
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestBuilderTest.php
@@ -0,0 +1,329 @@
+build($options);
+
+ if (empty($options['items'])) {
+ self::assertNull($instance->getItems());
+ } else {
+ self::assertNotNull($instance->getItems());
+ self::assertEquals(count($options['items']), count($instance->getItems()));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetSettlements($options)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $instance = $builder->build($options);
+
+ if (empty($options['settlements'])) {
+ self::assertNull($instance->getSettlements());
+ } else {
+ self::assertNotNull($instance->getSettlements());
+ self::assertEquals(count($options['settlements']), count($instance->getSettlements()));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetCustomer($options)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $instance = $builder->build($options);
+
+ if (empty($options['customer'])) {
+ self::assertNull($instance->getCustomer());
+ } else {
+ self::assertNotNull($instance->getCustomer());
+ self::assertEquals($options['customer'], $instance->getCustomer()->jsonSerialize());
+ }
+ }
+
+ /**
+ * @dataProvider invalidCustomerDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidCustomer($value)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $builder->setCustomer($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetType($options)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+
+ $instance = $builder->build($options);
+
+ if (empty($options['type'])) {
+ self::assertNull($instance->getType());
+ } else {
+ self::assertNotNull($instance->getType());
+ self::assertEquals($options['type'], $instance->getType());
+ }
+ }
+
+ /**
+ * @dataProvider invalidVatIdDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidType($value)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $builder->setType($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetSend($options)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+
+ $instance = $builder->build($options);
+
+ if (empty($options['send'])) {
+ self::assertNull($instance->getSend());
+ } else {
+ self::assertNotNull($instance->getSend());
+ self::assertEquals($options['send'], $instance->getSend());
+ }
+ }
+
+ /**
+ * @dataProvider invalidBooleanDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidSend($value)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $builder->setType($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testSetTaxSystemCode($options)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+
+ $instance = $builder->build($options);
+
+ if (empty($options['tax_system_code'])) {
+ self::assertNull($instance->getTaxSystemCode());
+ } else {
+ self::assertNotNull($instance->getTaxSystemCode());
+ self::assertEquals($options['tax_system_code'], $instance->getTaxSystemCode());
+ }
+ }
+
+ /**
+ * @dataProvider invalidVatIdDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidTaxSystemId($value)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $builder->setTaxSystemCode($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $value
+ */
+ public function testSetOnBehalfOf($options)
+ {
+ $builder = new CreatePostReceiptRequestBuilder();
+ $instance = $builder->build($options);
+
+ if (empty($options['on_behalf_of'])) {
+ self::assertNull($instance->getOnBehalfOf());
+ } else {
+ self::assertNotNull($instance->getOnBehalfOf());
+ self::assertEquals($options['on_behalf_of'], $instance->getOnBehalfOf());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $type = Random::value(ReceiptType::getValidValues());
+ $result = array(
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => Random::str(128),
+ 'email' => Random::str(128),
+ 'phone' => Random::str(4, 12, '1234567890'),
+ 'inn' => '1234567890',
+ ),
+ 'items' => array(
+ array(
+ 'description' => Random::str(128),
+ 'quantity' => Random::int(1, 10),
+ 'amount' => array(
+ 'value' => round(Random::float(0.1, 99.99), 2),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => Random::value(PaymentSubject::getValidValues()),
+ 'payment_mode' => Random::value(PaymentMode::getValidValues()),
+ 'product_code' => Random::str(2, 96, '1234567890ABCDEF '),
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => Random::str(32),
+ 'excise' => Random::float(0.0, 99.99),
+ )
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ 'type' => $type,
+ 'send' => true,
+ 'settlements' => array(
+ array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => round(Random::float(0.1, 99.99), 2),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ )
+ ),
+ $type . '_id' => uniqid()
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $type = Random::value(ReceiptType::getValidValues());
+ $request = array(
+ 'customer' => array(
+ 'full_name' => Random::str(128),
+ 'email' => Random::str(128),
+ 'phone' => Random::str(4, 12, '1234567890'),
+ 'inn' => '1234567890',
+ ),
+ 'items' => array(
+ array(
+ 'description' => Random::str(128),
+ 'quantity' => Random::int(1, 10),
+ 'amount' => array(
+ 'value' => round(Random::float(0.1, 99.99), 2),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => Random::value(PaymentSubject::getValidValues()),
+ 'payment_mode' => Random::value(PaymentMode::getValidValues()),
+ 'product_code' => Random::str(2, 96, '0123456789ABCDEF '),
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => Random::str(32),
+ 'excise' => round(Random::float(0.0, 99.99), 2),
+ )
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ 'type' => $type,
+ 'send' => true,
+ 'on_behalf_of' => Random::int(99999, 999999),
+ 'settlements' => array(
+ array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => round(Random::float(0.1, 99.99), 2),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ )
+ ),
+ $type . '_id' => uniqid()
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ public function invalidAmountDataProvider()
+ {
+ return array(
+ array(-1),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(0),
+ );
+ }
+
+ public function invalidCustomerDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(Random::str(1, 100)),
+ );
+ }
+
+ public function invalidVatIdDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(0),
+ array(7),
+ array(Random::int(-100, -1)),
+ array(Random::int(7, 100)),
+ );
+ }
+
+
+ public function invalidBooleanDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array('test'),
+ );
+ }
+
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestSerializerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestSerializerTest.php
new file mode 100644
index 0000000..096e0c5
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestSerializerTest.php
@@ -0,0 +1,183 @@
+build($options);
+ $data = $serializer->serialize($instance);
+
+ $expected = array(
+ 'type' => $options['type'],
+ 'send' => $options['send'],
+ );
+
+ if (!empty($options['customer'])) {
+ $expected['customer'] = $options['customer'];
+ }
+ if (!empty($options['tax_system_code'])) {
+ $expected['tax_system_code'] = $options['tax_system_code'];
+ }
+ if (!empty($options['items'])) {
+ foreach ($options['items'] as $item) {
+ $itemArray = $item;
+
+ if (!empty($item['payment_subject'])) {
+ $itemArray['payment_subject'] = $item['payment_subject'];
+ }
+ if (!empty($item['payment_mode'])) {
+ $itemArray['payment_mode'] = $item['payment_mode'];
+ }
+ if (!empty($item['vat_code'])) {
+ $itemArray['vat_code'] = $item['vat_code'];
+ }
+ if (!empty($item['product_code'])) {
+ $itemArray['product_code'] = $item['product_code'];
+ }
+ $expected['items'][] = $itemArray;
+ }
+ }
+
+ if (!empty($options['settlements'])) {
+ foreach ($options['settlements'] as $item) {
+ $itemArray = $item;
+ $expected['settlements'][] = $itemArray;
+ }
+ }
+
+ if (!empty($options['payment_id'])) {
+ $expected['payment_id'] = $options['payment_id'];
+ }
+ if (!empty($options['refund_id'])) {
+ $expected['refund_id'] = $options['refund_id'];
+ }
+
+ self::assertEquals($expected, $data);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'type' => 'payment',
+ 'send' => true,
+ 'customer' => array(
+ 'email' => Random::str(10),
+ ),
+ 'items' => array(
+ array(
+ 'description' => Random::str(10),
+ 'quantity' => (float)Random::int(1, 10),
+ 'amount' => array(
+ 'value' => round(Random::float(1, 100), 2),
+ 'currency' => CurrencyCode::RUB,
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => PaymentSubject::COMMODITY,
+ 'payment_mode' => PaymentMode::PARTIAL_PREPAYMENT,
+ )
+ ),
+ 'settlements' => array(
+ array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => round(Random::float(0.1, 99.99), 2),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ )
+ ),
+ 'payment_id' => uniqid(),
+ 'tax_system_code' => Random::int(1, 6),
+ ),
+ ),
+ );
+
+ for ($i = 0; $i < 10; $i++) {
+ $type = Random::value(array(ReceiptType::PAYMENT, ReceiptType::REFUND));
+ $request = array(
+ 'items' => $this->getReceiptItems($i + 1),
+ 'customer' => array(
+ 'email' => Random::str(10),
+ 'phone' => Random::str(12, '0123456789'),
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ 'type' => $type,
+ 'send' => true,
+ 'settlements' => $this->getSettlements($i + 1),
+ $type . '_id' => uniqid()
+ );
+ $result[] = array($request);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param int $count
+ * @return array
+ * @throws \Exception
+ */
+ private function getReceiptItems($count)
+ {
+ $result = array();
+ for ($i = 0; $i < $count; $i++) {
+ $result[] = array(
+ 'description' => Random::str(10),
+ 'quantity' => (float)Random::float(1, 100),
+ 'amount' => array(
+ 'value' => (float)Random::int(1, 100),
+ 'currency' => CurrencyCode::RUB,
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => Random::value(PaymentSubject::getValidValues()),
+ 'payment_mode' => Random::value(PaymentMode::getValidValues()),
+ 'product_code' => Random::str(96, 96, '0123456789ABCDEF '),
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => Random::str(32),
+ 'excise' => Random::float(0.0, 99.99),
+ );
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param int $count
+ * @return array
+ * @throws \Exception
+ */
+ private function getSettlements($count)
+ {
+ $result = array();
+ for ($i = 0; $i < $count; $i++) {
+ $result[] = array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => round(Random::float(0.1, 99.99), 2),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ );
+ }
+
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestTest.php
new file mode 100644
index 0000000..fb03eb2
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/CreatePostReceiptRequestTest.php
@@ -0,0 +1,314 @@
+hasCustomer());
+ self::assertNull($instance->getCustomer());
+ self::assertNull($instance->customer);
+
+ $instance->setCustomer($options['customer']);
+ if (empty($options['customer'])) {
+ self::assertFalse($instance->hasCustomer());
+ self::assertNull($instance->getCustomer());
+ self::assertNull($instance->customer);
+ } else {
+ self::assertTrue($instance->hasCustomer());
+ self::assertSame($options['customer'], $instance->getCustomer()->jsonSerialize());
+ self::assertSame($options['customer'], $instance->customer->jsonSerialize());
+ }
+
+ $instance->customer = $options['customer'];
+ if (empty($options['customer'])) {
+ self::assertFalse($instance->hasCustomer());
+ self::assertNull($instance->getCustomer());
+ self::assertNull($instance->customer);
+ } else {
+ self::assertTrue($instance->hasCustomer());
+ self::assertSame($options['customer'], $instance->getCustomer()->jsonSerialize());
+ self::assertSame($options['customer'], $instance->customer->jsonSerialize());
+ }
+ }
+
+ /**
+ * @dataProvider invalidCustomerDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCustomer($value)
+ {
+ $instance = new CreatePostReceiptRequest();
+ $instance->setCustomer($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testType($options)
+ {
+ $instance = new CreatePostReceiptRequest();
+
+ self::assertNull($instance->getType());
+ self::assertNull($instance->type);
+
+ $instance->setType($options['type']);
+
+ self::assertSame($options['type'], $instance->getType());
+ self::assertSame($options['type'], $instance->type);
+ }
+
+ /**
+ * @dataProvider invalidTypeDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidType($value)
+ {
+ $instance = new CreatePostReceiptRequest();
+ $instance->setType($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSend($options)
+ {
+ $instance = new CreatePostReceiptRequest();
+
+ self::assertTrue($instance->getSend());
+ self::assertTrue($instance->send);
+
+ $instance->setSend($options['send']);
+
+ self::assertSame($options['send'], $instance->getSend());
+ self::assertSame($options['send'], $instance->send);
+ }
+
+ /**
+ * @dataProvider invalidBooleanDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidSend($value)
+ {
+ $instance = new CreatePostReceiptRequest();
+ $instance->setType($value);
+ }
+
+ public function testValidate()
+ {
+ $instance = new CreatePostReceiptRequest();
+
+ self::assertFalse($instance->validate());
+
+ $instance->setCustomer(new ReceiptCustomer());
+ self::assertFalse($instance->validate());
+
+ $instance->setCustomer(new ReceiptCustomer(array('email' => 'johndoe@email.com')));
+ self::assertFalse($instance->validate());
+
+ $instance->setType(ReceiptType::REFUND);
+ self::assertFalse($instance->validate());
+
+ $instance->setType(ReceiptType::PAYMENT);
+ self::assertFalse($instance->validate());
+
+ $instance->setSend(false);
+ self::assertFalse($instance->validate());
+
+ $instance->setSend(true);
+ self::assertFalse($instance->validate());
+
+ $instance->setObjectId(uniqid());
+ self::assertFalse($instance->validate());
+
+ $instance->setItems(array());
+ self::assertFalse($instance->validate());
+
+ $instance->setSettlements(array());
+ self::assertFalse($instance->validate());
+
+ $instance->setItems(array(
+ new ReceiptItem(array(
+ 'description' => 'description',
+ 'amount' => array(
+ 'value' => 10,
+ 'currency' => 'RUB',
+ ),
+ 'quantity' => 1,
+ 'vat_code' => 1
+ ))
+ ));
+ self::assertFalse($instance->validate());
+
+ $instance->setSettlements(array(
+ new Settlement(array(
+ 'type' => SettlementType::PREPAYMENT,
+ 'amount' => new ReceiptItemAmount(10, 'RUB')))
+ )
+ );
+ self::assertTrue($instance->validate());
+ }
+
+ public function testBuilder()
+ {
+ $builder = CreatePaymentRequest::builder();
+ self::assertTrue($builder instanceof CreatePaymentRequestBuilder);
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $type = Random::value(ReceiptType::getValidValues());
+ $result = array(
+
+ array(
+ array(
+ 'customer' => array(
+ 'full_name' => Random::str(128),
+ 'email' => Random::str(128),
+ 'phone' => Random::str(4, 12, '1234567890'),
+ 'inn' => '1234567890',
+ ),
+ 'items' => array(
+ array(
+ 'description' => Random::str(128),
+ 'quantity' => Random::int(1, 10),
+ 'amount' => array(
+ 'value' => Random::float(0.1, 99.99),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => Random::value(PaymentSubject::getValidValues()),
+ 'payment_mode' => Random::value(PaymentMode::getValidValues()),
+ 'product_code' => Random::str(128),
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => Random::str(128),
+ 'excise' => Random::float(0.0, 99.99),
+ )
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ 'type' => $type,
+ 'send' => true,
+ 'settlements' => array(
+ array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => Random::float(0.1, 99.99),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ )
+ ),
+ $type . '_id' => uniqid()
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $type = Random::value(ReceiptType::getValidValues());
+ $request = array(
+ 'customer' => array(
+ 'full_name' => Random::str(128),
+ 'email' => Random::str(128),
+ 'phone' => Random::str(4, 12, '1234567890'),
+ 'inn' => '1234567890',
+ ),
+ 'items' => array(
+ array(
+ 'description' => Random::str(128),
+ 'quantity' => Random::int(1, 10),
+ 'amount' => array(
+ 'value' => Random::float(0.1, 99.99),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => Random::value(PaymentSubject::getValidValues()),
+ 'payment_mode' => Random::value(PaymentMode::getValidValues()),
+ 'product_code' => Random::str(128),
+ 'country_of_origin_code' => 'RU',
+ 'customs_declaration_number' => Random::str(128),
+ 'excise' => Random::float(0.0, 99.99),
+ )
+ ),
+ 'tax_system_code' => Random::int(1, 6),
+ 'type' => $type,
+ 'send' => true,
+ 'settlements' => array(
+ array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => Random::float(0.1, 99.99),
+ 'currency' => Random::value(CurrencyCode::getValidValues())
+ )
+ )
+ ),
+ $type . '_id' => uniqid()
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ public function invalidCustomerDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(1),
+ array(Random::str(10)),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidTypeDataProvider()
+ {
+ return array(
+ array(false),
+ array(true),
+ array(1),
+ array(Random::str(10)),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidBooleanDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array('test'),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/PaymentReceiptResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/PaymentReceiptResponseTest.php
new file mode 100644
index 0000000..ca0612c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/PaymentReceiptResponseTest.php
@@ -0,0 +1,33 @@
+getTestInstance($options);
+ self::assertEquals($options['payment_id'], $instance->getPaymentId());
+ }
+
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/ReceiptsResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/ReceiptsResponseTest.php
new file mode 100644
index 0000000..6e0c6a1
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/ReceiptsResponseTest.php
@@ -0,0 +1,133 @@
+getType());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ * @throws \Exception
+ */
+ public function testGetItems($options)
+ {
+ $instance = new ReceiptsResponse($options);
+
+ self::assertEquals(count($options['items']), count($instance->getItems()));
+
+ foreach ($instance->getItems() as $index => $item) {
+ self::assertTrue($item instanceof ReceiptResponseInterface);
+ self::assertArrayHasKey($index, $options['items']);
+ self::assertEquals($options['items'][$index]['id'], $item->getId());
+ self::assertEquals($options['items'][$index]['type'], $item->getType());
+ self::assertEquals($options['items'][$index]['tax_system_code'], $item->getTaxSystemCode());
+ self::assertEquals($options['items'][$index]['status'], $item->getStatus());
+
+ self::assertEquals(count($options['items'][$index]['items']), count($item->getItems()));
+ }
+ }
+
+ public function validDataProvider()
+ {
+ return array(
+ array(
+ array(
+ 'type' => 'list',
+ 'items' => $this->generateReceipts(),
+ ),
+ ),
+ );
+ }
+
+ private function generateReceipts()
+ {
+ $return = array();
+ $count = Random::int(1, 10);
+
+ for ($i=0; $i < $count; $i++) {
+ $return[] = $this->generateReceipt();
+ }
+
+ return $return;
+ }
+
+ private function generateReceipt()
+ { $type = Random::value(ReceiptType::getEnabledValues());
+ return array(
+ 'id' => Random::str(39),
+ 'type' => $type,
+ 'status' => Random::value(array('pending', 'succeeded', 'canceled')),
+ 'items' => $this->generateItems(),
+ 'settlements' => $this->generateItems(),
+ 'tax_system_code' => Random::int(1 ,6),
+ $type . '_id' => UUID::v4(),
+ );
+ }
+
+ private function generateItems()
+ {
+ $return = array();
+ $count = Random::int(1, 10);
+
+ for ($i=0; $i < $count; $i++) {
+ $return[] = $this->generateItem();
+ }
+
+ return $return;
+ }
+
+ private function generateItem()
+ {
+ return array(
+ 'description' => Random::str(1, 128),
+ 'amount' => array(
+ 'value' => round(Random::float(1.00, 100.00), 2),
+ 'currency' => 'RUB',
+ ),
+ 'quantity' => round(Random::float(0.001, 99.999), 3),
+ 'vat_code' => Random::int(1 ,6),
+ );
+ }
+
+ private function generateSettlements()
+ {
+ $return = array();
+ $count = Random::int(1, 10);
+
+ for ($i=0; $i < $count; $i++) {
+ $return[] = $this->generateSettlement();
+ }
+
+ return $return;
+ }
+
+ private function generateSettlement()
+ {
+ return array(
+ 'type' => Random::value(SettlementType::getValidValues()),
+ 'amount' => array(
+ 'value' => round(Random::float(1.00, 100.00), 2),
+ 'currency' => 'RUB',
+ ),
+ );
+ }
+}
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/RefundReceiptResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/RefundReceiptResponseTest.php
new file mode 100644
index 0000000..42c3ff1
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Receipts/RefundReceiptResponseTest.php
@@ -0,0 +1,32 @@
+getTestInstance($options);
+ self::assertEquals($options['refund_id'], $instance->getRefundId());
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/AbstractRefundResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/AbstractRefundResponseTest.php
new file mode 100644
index 0000000..7c13c1c
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/AbstractRefundResponseTest.php
@@ -0,0 +1,148 @@
+getTestInstance($options);
+ self::assertEquals($options['id'], $instance->getId());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetPaymentId($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertEquals($options['payment_id'], $instance->getPaymentId());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetStatus($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertEquals($options['status'], $instance->getStatus());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetCreatedAt($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertTrue($instance->getCreatedAt() instanceof \DateTime);
+ self::assertEquals($options['created_at'], $instance->getCreatedAt()->format(DATE_ATOM));
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetAmount($options)
+ {
+ $instance = $this->getTestInstance($options);
+ self::assertTrue($instance->getAmount() instanceof AmountInterface);
+ self::assertEquals($options['amount']['value'], $instance->getAmount()->getValue());
+ self::assertEquals($options['amount']['currency'], $instance->getAmount()->getCurrency());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetReceiptRegistered($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['receipt_registration'])) {
+ self::assertNull($instance->getReceiptRegistration());
+ } else {
+ self::assertEquals($options['receipt_registration'], $instance->getReceiptRegistration());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetComment($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['description'])) {
+ self::assertNull($instance->getDescription());
+ } else {
+ self::assertEquals($options['description'], $instance->getDescription());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetSources($options)
+ {
+ $instance = $this->getTestInstance($options);
+ if (empty($options['sources'])) {
+ self::assertEmpty($instance->getSources());
+ } else {
+ foreach ($instance->getSources() as $sources) {
+ self::assertInstanceOf('\YooKassa\Model\Source', $sources);
+ }
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $result = array();
+ for ($i = 0; $i < 10; $i++) {
+ $payment = array(
+ 'id' => Random::str(36),
+ 'payment_id' => Random::str(36),
+ 'status' => Random::value(RefundStatus::getValidValues()),
+ 'created_at' => date(DATE_ATOM, mt_rand(1, time())),
+ 'authorized_at' => date(DATE_ATOM, mt_rand(1, time())),
+ 'amount' => array(
+ 'value' => mt_rand(100, 100000),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'receipt_registration' => Random::value(ReceiptRegistrationStatus::getValidValues()),
+ 'description' => uniqid(),
+ 'sources' => array(
+ new Source(array(
+ 'account_id' => Random::str(36),
+ 'amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ 'platform_fee_amount' => new MonetaryAmount(Random::int(1, 1000), 'RUB'),
+ )),
+ )
+ );
+ $result[] = array($payment);
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestBuilderTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestBuilderTest.php
new file mode 100644
index 0000000..64d881a
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestBuilderTest.php
@@ -0,0 +1,612 @@
+build(array('amountValue' => mt_rand(1, 100)));
+ } catch (\RuntimeException $e) {
+ $builder->setPaymentId($options['paymentId']);
+ $instance = $builder->build(array('amount' => mt_rand(1, 100)));
+ self::assertEquals($options['paymentId'], $instance->getPaymentId());
+
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetAmountValue($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ try {
+ $builder->build(array('paymentId' => Random::str(36)));
+ } catch (\RuntimeException $e) {
+ $builder->setAmount($options['amount']);
+ $instance = $builder->build(array('paymentId' => Random::str(36)));
+ if ($options['amount'] instanceof AmountInterface) {
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ } else {
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+
+
+ if ($options['amount'] instanceof AmountInterface) {
+ $builder->setAmount(array(
+ 'value' => $options['amount']->getValue(),
+ 'currency' => 'USD',
+ ));
+ $instance = $builder->build(array('paymentId' => Random::str(36)));
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ } else {
+ $builder->setAmount(array(
+ 'value' => $options['amount'],
+ 'currency' => 'USD',
+ ));
+ $instance = $builder->build(array('paymentId' => Random::str(36)));
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+
+ return;
+ }
+ self::fail('Exception not thrown');
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetAmountCurrency($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ $builder->setCurrency($options['currency']);
+ $instance = $builder->build(array(
+ 'paymentId' => Random::str(36),
+ 'amount' => mt_rand(1, 100),
+ ));
+ self::assertEquals($options['currency'], $instance->getAmount()->getCurrency());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetComment($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $instance = $builder->build(array(
+ 'paymentId' => Random::str(36),
+ 'amount' => mt_rand(1, 100),
+ ));
+ self::assertNull($instance->getDescription());
+
+ $builder->setDescription($options['description']);
+ $instance = $builder->build(array(
+ 'paymentId' => Random::str(36),
+ 'amount' => mt_rand(1, 100),
+ ));
+ if (empty($options['description'])) {
+ self::assertNull($instance->getDescription());
+ } else {
+ self::assertEquals($options['description'], $instance->getDescription());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ */
+ public function testBuild($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $instance = $builder->build($options);
+
+ self::assertEquals($options['paymentId'], $instance->getPaymentId());
+ if ($options['amount'] instanceof AmountInterface) {
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ } else {
+ self::assertEquals($options['amount'], $instance->getAmount()->getValue());
+ }
+ self::assertEquals($options['currency'], $instance->getAmount()->getCurrency());
+ if (empty($options['description'])) {
+ self::assertNull($instance->getDescription());
+ } else {
+ self::assertEquals($options['description'], $instance->getDescription());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetReceiptItems($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testAddReceiptItems($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ foreach ($options['receiptItems'] as $item) {
+ if ($item instanceof ReceiptItem) {
+ $builder->addReceiptItem(
+ $item->getDescription(), $item->getPrice()->getValue(), $item->getQuantity(), $item->getVatCode()
+ );
+ } else {
+ $builder->addReceiptItem($item['title'], $item['price'], $item['quantity'], $item['vatCode']);
+ }
+ }
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertFalse($item->isShipping());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testAddReceiptShipping($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ foreach ($options['receiptItems'] as $item) {
+ if ($item instanceof ReceiptItem) {
+ $builder->addReceiptShipping(
+ $item->getDescription(), $item->getPrice()->getValue(), $item->getVatCode()
+ );
+ } else {
+ $builder->addReceiptShipping($item['title'], $item['price'], $item['vatCode']);
+ }
+ }
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals(count($options['receiptItems']), count($instance->getReceipt()->getItems()));
+ foreach ($instance->getReceipt()->getItems() as $item) {
+ self::assertTrue($item->isShipping());
+ }
+ }
+ }
+
+ /**
+ * @dataProvider invalidItemsDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $items
+ */
+ public function testSetInvalidReceiptItems($items)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setReceiptItems($items);
+ }
+
+ /**
+ * @throws \Exception
+ */
+ public function testSetReceipt()
+ {
+ $receipt = array(
+ 'tax_system_code' => Random::int(1, 6),
+ 'customer' => array(
+ 'email' => Random::str(10),
+ 'phone' => Random::str(4, 15, '0123456789'),
+ ),
+ 'items' => array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 123,
+ 'amount' => array(
+ 'value' => 321,
+ 'currency' => 'USD',
+ ),
+ 'vat_code' => Random::int(1, 6),
+ 'payment_subject' => PaymentSubject::COMMODITY,
+ 'payment_mode' => PaymentMode::PARTIAL_PREPAYMENT,
+ ),
+ ),
+ );
+
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setReceipt($receipt);
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($receipt['tax_system_code'], $instance->getReceipt()->getTaxSystemCode());
+ self::assertEquals($receipt['customer']['email'], $instance->getReceipt()->getCustomer()->getEmail());
+ self::assertEquals($receipt['customer']['phone'], $instance->getReceipt()->getCustomer()->getPhone());
+ self::assertEquals(1, count($instance->getReceipt()->getItems()));
+
+ $receipt = $instance->getReceipt();
+
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setReceipt($instance->getReceipt());
+ $instance = $builder->build($this->getRequiredData());
+
+ self::assertEquals($receipt['tax_system_code'], $instance->getReceipt()->getTaxSystemCode());
+ self::assertEquals($receipt['customer']['email'], $instance->getReceipt()->getCustomer()->getEmail());
+ self::assertEquals($receipt['customer']['phone'], $instance->getReceipt()->getCustomer()->getPhone());
+ self::assertEquals(1, count($instance->getReceipt()->getItems()));
+ }
+
+ /**
+ * @dataProvider invalidReceiptDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param mixed $value
+ */
+ public function testSetInvalidReceipt($value)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setReceipt($value);
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidReceiptDataProvider()
+ {
+ return array(
+ array(null),
+ array(true),
+ array(false),
+ array(1),
+ array(1.1),
+ array('test'),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidItemsDataProvider()
+ {
+ return array(
+ array(
+ array(
+ array(
+ 'price' => 1,
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'description' => 'test',
+ 'quantity' => 1.4,
+ 'vatCode' => 3,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'price' => 123,
+ 'quantity' => 1.4,
+ 'vatCode' => 7,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'description' => 'test',
+ 'price' => 123,
+ 'quantity' => -1.4,
+ ),
+ ),
+ ),
+ array(
+ array(
+ array(
+ 'title' => 'test',
+ 'price' => 1,
+ 'vatCode' => 7,
+ ),
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetReceiptEmail($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['receiptEmail'], $instance->getReceipt()->getCustomer()->getEmail());
+ }
+ }
+
+ /**
+ * @dataProvider invalidEmailDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidEmail($value)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setReceiptEmail($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetReceiptPhone($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $builder->setReceiptPhone($options['receiptPhone']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['receiptPhone'], $instance->getReceipt()->getCustomer()->getPhone());
+ }
+ }
+
+ /**
+ * @dataProvider invalidPhoneDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidPhone($value)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setReceiptPhone($value);
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ *
+ * @param $options
+ * @throws \Exception
+ */
+ public function testSetReceiptTaxSystemCode($options)
+ {
+ $builder = new CreateRefundRequestBuilder();
+
+ $builder->setReceiptItems($options['receiptItems']);
+ $builder->setReceiptEmail($options['receiptEmail']);
+ $builder->setTaxSystemCode($options['taxSystemCode']);
+ $instance = $builder->build($this->getRequiredData());
+
+ if (empty($options['receiptItems'])) {
+ self::assertNull($instance->getReceipt());
+ } else {
+ self::assertNotNull($instance->getReceipt());
+ self::assertEquals($options['taxSystemCode'], $instance->getReceipt()->getTaxSystemCode());
+ }
+ }
+
+ /**
+ * @dataProvider invalidVatIdDataProvider
+ * @expectedException \InvalidArgumentException
+ *
+ * @param $value
+ */
+ public function testSetInvalidTaxSystemId($value)
+ {
+ $builder = new CreateRefundRequestBuilder();
+ $builder->setTaxSystemCode($value);
+ }
+
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'paymentId' => Random::str(36),
+ 'amount' => mt_rand(1, 999999),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'description' => null,
+ 'receiptItems' => array(),
+ 'receiptEmail' => null,
+ 'receiptPhone' => null,
+ 'taxSystemCode' => Random::int(1, 6),
+ ),
+ ),
+ array(
+ array(
+ 'paymentId' => Random::str(36),
+ 'amount' => new MonetaryAmount(
+ Random::int(1, 999999),
+ Random::value(CurrencyCode::getValidValues())
+ ),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'description' => '',
+ 'receiptItems' => array(),
+ 'receiptEmail' => '',
+ 'receiptPhone' => '',
+ 'taxSystemCode' => Random::int(1, 6),
+ ),
+ ),
+ );
+ $items = array(
+ new ReceiptItem(),
+ array(
+ 'title' => 'test',
+ 'price' => Random::int(1, 999999),
+ 'quantity' => Random::int(1, 9999),
+ 'vatCode' => Random::int(1, 6),
+ ),
+ );
+ $items[0]->setDescription('test1');
+ $items[0]->setQuantity(Random::int(1, 9999));
+ $items[0]->setPrice(new MonetaryAmount(Random::int(1, 999999)));
+ $items[0]->setVatCode(Random::int(1, 6));
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'paymentId' => Random::str(36),
+ 'amount' => mt_rand(1, 999999),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ 'description' => uniqid(),
+ 'receiptItems' => $items,
+ 'receiptEmail' => uniqid(),
+ 'receiptPhone' => Random::str(4, 15, '0123456789'),
+ 'taxSystemCode' => Random::int(1, 6),
+ );
+ $result[] = array($request);
+ }
+
+ return $result;
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ private function getRequiredData()
+ {
+ return array(
+ 'paymentId' => Random::str(36),
+ 'amount' => mt_rand(1, 100),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidEmailDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @return array
+ */
+ public function invalidPhoneDataProvider()
+ {
+ return array(
+ array(new \stdClass()),
+ array(array()),
+ array(true),
+ array(false),
+ );
+ }
+
+ /**
+ * @return array
+ * @throws \Exception
+ */
+ public function invalidVatIdDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ array(0),
+ array(7),
+ array(Random::int(-100, -1)),
+ array(Random::int(7, 100)),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestSerializerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestSerializerTest.php
new file mode 100644
index 0000000..4792163
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestSerializerTest.php
@@ -0,0 +1,137 @@
+serialize(CreateRefundRequest::builder()->build($options));
+
+ $expected = array(
+ 'payment_id' => $options['paymentId'],
+ 'amount' => array(
+ 'value' => $options['amount'],
+ 'currency' => $options['currency'],
+ ),
+ );
+ if (!empty($options['description'])) {
+ $expected['description'] = $options['description'];
+ }
+
+ if (!empty($options['receiptItems'])) {
+ foreach ($options['receiptItems'] as $item) {
+ $expected['receipt']['items'][] = array(
+ 'description' => $item['title'],
+ 'quantity' => empty($item['quantity']) ? 1 : $item['quantity'],
+ 'amount' => array(
+ 'value' => $item['price'],
+ 'currency' => isset($options['currency']) ? $options['currency'] : CurrencyCode::RUB,
+ ),
+ 'vat_code' => $item['vatCode'],
+ );
+ }
+ }
+ if (!empty($options['receiptEmail'])) {
+ $expected['receipt']['customer']['email'] = $options['receiptEmail'];
+ }
+ if (!empty($options['receiptPhone'])) {
+ $expected['receipt']['customer']['phone'] = $options['receiptPhone'];
+ }
+ if (!empty($options['taxSystemCode'])) {
+ $expected['receipt']['tax_system_code'] = $options['taxSystemCode'];
+ }
+
+ self::assertEquals($expected, $data);
+ }
+
+ public function validDataProvider()
+ {
+ $currencies = CurrencyCode::getValidValues();
+ $result = array(
+ array(
+ array(
+ 'paymentId' => $this->randomString(36),
+ 'amount' => mt_rand(1, 999999),
+ 'currency' => $currencies[mt_rand(0, count($currencies) - 1)],
+ 'description' => null,
+ 'receiptItems' => array(),
+ ),
+ ),
+ array(
+ array(
+ 'paymentId' => $this->randomString(36),
+ 'amount' => mt_rand(1, 999999),
+ 'currency' => $currencies[mt_rand(0, count($currencies) - 1)],
+ 'description' => '',
+ 'receiptItems' => array(
+ array(
+ 'title' => Random::str(10),
+ 'quantity' => Random::int(1, 10),
+ 'price' => Random::int(100, 100),
+ 'vatCode' => Random::int(1, 6),
+ ),
+ ),
+ 'receiptEmail' => Random::str(10),
+ 'taxSystemCode' => Random::int(1, 6),
+ ),
+ ),
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'paymentId' => $this->randomString(36),
+ 'amount' => mt_rand(1, 999999),
+ 'currency' => $currencies[mt_rand(0, count($currencies) - 1)],
+ 'description' => uniqid(),
+ 'receiptItems' => $this->getReceipt($i + 1),
+ 'receiptEmail' => Random::str(10),
+ 'receiptPhone' => Random::str(12, '0123456789'),
+ 'taxSystemCode' => Random::int(1, 6),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ private function randomString($length, $any = true)
+ {
+ static $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+_.';
+
+ $result = '';
+ for ($i = 0; $i < $length; $i++) {
+ if ($any) {
+ $char = chr(mt_rand(32, 126));
+ } else {
+ $rnd = mt_rand(0, strlen($chars) - 1);
+ $char = substr($chars, $rnd, 1);
+ }
+ $result .= $char;
+ }
+ return $result;
+ }
+
+ private function getReceipt($count)
+ {
+ $result = array();
+ for ($i = 0; $i < $count; $i++) {
+ $result[] = array(
+ 'title' => Random::str(10),
+ 'quantity' => Random::float(1, 100),
+ 'price' => Random::int(1, 100),
+ 'vatCode' => Random::int(1, 6),
+ );
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestTest.php
new file mode 100644
index 0000000..903b9bb
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundRequestTest.php
@@ -0,0 +1,270 @@
+getPaymentId());
+ self::assertNull($instance->paymentId);
+
+ $instance->setPaymentId($options['paymentId']);
+
+ self::assertEquals($options['paymentId'], $instance->getPaymentId());
+ self::assertEquals($options['paymentId'], $instance->paymentId);
+
+ $instance = new CreateRefundRequest();
+
+ self::assertNull($instance->getPaymentId());
+ self::assertNull($instance->paymentId);
+
+ $instance->paymentId = $options['paymentId'];
+
+ self::assertEquals($options['paymentId'], $instance->getPaymentId());
+ self::assertEquals($options['paymentId'], $instance->paymentId);
+ }
+
+ /**
+ * @dataProvider invalidPaymentIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidPaymentId($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->setPaymentId($value);
+ }
+
+ /**
+ * @dataProvider invalidPaymentIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidPaymentId($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->paymentId = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testAmount($options)
+ {
+ $instance = new CreateRefundRequest();
+
+ self::assertNull($instance->getAmount());
+ self::assertNull($instance->amount, $instance->getAmount());
+
+ $instance->setAmount($options['amount']);
+
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ self::assertEquals($options['amount']->getValue(), $instance->amount->getValue());
+ self::assertEquals($options['amount']->getCurrency(), $instance->getAmount()->getCurrency());
+ self::assertEquals($options['amount']->getCurrency(), $instance->amount->getCurrency());
+
+ $instance = new CreateRefundRequest();
+
+ $instance->amount = $options['amount'];
+
+ self::assertEquals($options['amount']->getValue(), $instance->getAmount()->getValue());
+ self::assertEquals($options['amount']->getValue(), $instance->amount->getValue());
+ self::assertEquals($options['amount']->getCurrency(), $instance->getAmount()->getCurrency());
+ self::assertEquals($options['amount']->getCurrency(), $instance->amount->getCurrency());
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testComment($options)
+ {
+ $instance = new CreateRefundRequest();
+
+ self::assertFalse($instance->hasDescription());
+ self::assertNull($instance->getDescription());
+ self::assertNull($instance->description);
+
+ $instance->setDescription($options['description']);
+ if (empty($options['description'])) {
+ self::assertFalse($instance->hasDescription());
+ self::assertNull($instance->getDescription());
+ self::assertNull($instance->description);
+ } else {
+ self::assertTrue($instance->hasDescription());
+ self::assertEquals($options['description'], $instance->getDescription());
+ self::assertEquals($options['description'], $instance->description);
+ }
+
+ $instance->setDescription('');
+ self::assertFalse($instance->hasDescription());
+ self::assertNull($instance->getDescription());
+ self::assertNull($instance->description);
+
+ $instance->description = $options['description'];
+ if (empty($options['description'])) {
+ self::assertFalse($instance->hasDescription());
+ self::assertNull($instance->getDescription());
+ self::assertNull($instance->description);
+ } else {
+ self::assertTrue($instance->hasDescription());
+ self::assertEquals($options['description'], $instance->getDescription());
+ self::assertEquals($options['description'], $instance->description);
+ }
+ }
+
+ /**
+ * @dataProvider invalidCommentDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidComment($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->setDescription($value);
+ }
+
+ /**
+ * @dataProvider invalidCommentDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidComment($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->description = $value;
+ }
+
+ public function testValidate()
+ {
+ $instance = new CreateRefundRequest();
+
+ self::assertFalse($instance->validate());
+ $instance->setAmount(new MonetaryAmount());
+ self::assertFalse($instance->validate());
+ $instance->setAmount(new MonetaryAmount(Random::int(1, 100000)));
+ self::assertFalse($instance->validate());
+ $instance->setPaymentId(Random::str(36));
+ self::assertTrue($instance->validate());
+
+ $receipt = new Receipt();
+ $instance->setReceipt($receipt);
+ $item = new ReceiptItem();
+ $item->setPrice(new MonetaryAmount(10));
+ $item->setDescription('test');
+ $receipt->addItem($item);
+ self::assertFalse($instance->validate());
+ $receipt->getCustomer()->setPhone('123123');
+ self::assertTrue($instance->validate());
+ $item->setVatCode(3);
+ self::assertTrue($instance->validate());
+ $receipt->setTaxSystemCode(4);
+ self::assertTrue($instance->validate());
+ }
+
+ /**
+ * @dataProvider invalidReceiptDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidReceipt($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->setReceipt($value);
+ }
+
+ /**
+ * @dataProvider invalidReceiptDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidReceipt($value)
+ {
+ $instance = new CreateRefundRequest();
+ $instance->receipt = $value;
+ }
+
+ public function invalidReceiptDataProvider()
+ {
+ return array(
+ array(''),
+ array(1),
+ array('test'),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+
+ public function testBuilder()
+ {
+ $builder = CreateRefundRequest::builder();
+ self::assertTrue($builder instanceof CreateRefundRequestBuilder);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'paymentId' => Random::str(36),
+ 'amount' => new MonetaryAmount(mt_rand(1, 100)),
+ 'description' => null,
+ )
+ ),
+ array(
+ array(
+ 'paymentId' => Random::str(36),
+ 'amount' => new MonetaryAmount(mt_rand(1, 100)),
+ 'description' => '',
+ )
+ )
+ );
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'paymentId' => Random::str(36),
+ 'amount' => new MonetaryAmount(mt_rand(1, 100)),
+ 'description' => uniqid(),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ public function invalidPaymentIdDataProvider()
+ {
+ return array(
+ array(''),
+ array(null),
+ array(array()),
+ array(1),
+ array(new \stdClass()),
+ array(Random::str(35)),
+ array(Random::str(37)),
+ );
+ }
+
+ public function invalidCommentDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundResponseTest.php
new file mode 100644
index 0000000..6dbdf67
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/CreateRefundResponseTest.php
@@ -0,0 +1,17 @@
+build();
+ self::assertNull($instance->getPaymentId());
+
+ $builder->setPaymentId($options['paymentId']);
+ $instance = $builder->build();
+ if (empty($options['paymentId'])) {
+ self::assertNull($instance->getPaymentId());
+ } else {
+ self::assertEquals($options['paymentId'], $instance->getPaymentId());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCreateAtGte($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtGte());
+
+ $builder->setCreatedAtGte($options['createAtGte']);
+ $instance = $builder->build();
+ if (empty($options['createAtGte'])) {
+ self::assertNull($instance->getCreatedAtGte());
+ } else {
+ self::assertEquals($options['createAtGte'], $instance->getCreatedAtGte()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCreateAtGt($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtGt());
+
+ $builder->setCreatedAtGt($options['createAtGt']);
+ $instance = $builder->build();
+ if (empty($options['createAtGt'])) {
+ self::assertNull($instance->getCreatedAtGt());
+ } else {
+ self::assertEquals($options['createAtGt'], $instance->getCreatedAtGt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCreateAtLte($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtLte());
+
+ $builder->setCreatedAtLte($options['createAtLte']);
+ $instance = $builder->build();
+ if (empty($options['createAtLte'])) {
+ self::assertNull($instance->getCreatedAtLte());
+ } else {
+ self::assertEquals($options['createAtLte'], $instance->getCreatedAtLte()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCreateAtLt($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCreatedAtLt());
+
+ $builder->setCreatedAtLt($options['createAtLt']);
+ $instance = $builder->build();
+ if (empty($options['createAtLt'])) {
+ self::assertNull($instance->getCreatedAtLt());
+ } else {
+ self::assertEquals($options['createAtLt'], $instance->getCreatedAtLt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetStatus($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getStatus());
+
+ $builder->setStatus($options['status']);
+ $instance = $builder->build();
+ if (empty($options['status'])) {
+ self::assertNull($instance->getStatus());
+ } else {
+ self::assertEquals($options['status'], $instance->getStatus());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetCursor($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getCursor());
+
+ $builder->setCursor($options['cursor']);
+ $instance = $builder->build();
+ if (empty($options['cursor'])) {
+ self::assertNull($instance->getCursor());
+ } else {
+ self::assertEquals($options['cursor'], $instance->getCursor());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSetLimit($options)
+ {
+ $builder = new RefundsRequestBuilder();
+
+ $instance = $builder->build();
+ self::assertNull($instance->getLimit());
+
+ $builder->setLimit($options['limit']);
+ $instance = $builder->build();
+ if (empty($options['limit'])) {
+ self::assertNull($instance->getLimit());
+ } else {
+ self::assertEquals($options['limit'], $instance->getLimit());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'paymentId' => null,
+ 'createAtGte' => null,
+ 'createAtGt' => null,
+ 'createAtLte' => null,
+ 'createAtLt' => null,
+ 'status' => null,
+ 'cursor' => null,
+ 'limit' => 1,
+ ),
+ ),
+ array(
+ array(
+ 'paymentId' => '',
+ 'createAtGte' => '',
+ 'createAtGt' => '',
+ 'createAtLte' => '',
+ 'createAtLt' => '',
+ 'status' => '',
+ 'cursor' => '',
+ 'limit' => null,
+ ),
+ ),
+ );
+ $statuses = RefundStatus::getValidValues();
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'paymentId' => $this->randomString(36),
+ 'createAtGte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createAtGt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createAtLte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createAtLt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'status' => $statuses[mt_rand(0, count($statuses) - 1)],
+ 'cursor' => uniqid(),
+ 'limit' => mt_rand(1, RefundsRequest::MAX_LIMIT_VALUE),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ private function randomString($length, $any = true)
+ {
+ static $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+_.';
+
+ $result = '';
+ for ($i = 0; $i < $length; $i++) {
+ if ($any) {
+ $char = chr(mt_rand(32, 126));
+ } else {
+ $rnd = mt_rand(0, strlen($chars) - 1);
+ $char = substr($chars, $rnd, 1);
+ }
+ $result .= $char;
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsRequestSerializerTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsRequestSerializerTest.php
new file mode 100644
index 0000000..d19fd01
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsRequestSerializerTest.php
@@ -0,0 +1,98 @@
+ 'payment_id',
+ 'createdAtGte' => 'created_at.gte',
+ 'createdAtGt' => 'created_at.gt',
+ 'createdAtLte' => 'created_at.lte',
+ 'createdAtLt' => 'created_at.lt',
+ 'status' => 'status',
+ 'cursor' => 'cursor',
+ 'limit' => 'limit',
+ );
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testSerialize($options)
+ {
+ $serializer = new RefundsRequestSerializer();
+ $data = $serializer->serialize(RefundsRequest::builder()->build($options));
+
+ $expected = array();
+ foreach ($this->fieldMap as $field => $mapped) {
+ if (isset($options[$field])) {
+ $value = $options[$field];
+ if (!empty($value)) {
+ $expected[$mapped] = $value instanceof \DateTime ? $value->format(DATE_ATOM) : $value;
+ }
+ }
+ }
+ self::assertEquals($expected, $data);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'accountId' => uniqid(),
+ ),
+ ),
+ array(
+ array(
+ 'paymentId' => '',
+ 'createAtGte' => '',
+ 'createAtGt' => '',
+ 'createAtLte' => '',
+ 'createAtLt' => '',
+ 'status' => '',
+ 'cursor' => '',
+ 'limit' => '',
+ ),
+ ),
+ );
+ $statuses = RefundStatus::getValidValues();
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'paymentId' => $this->randomString(36),
+ 'createAtGte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createAtGt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createAtLte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'createAtLt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'status' => $statuses[mt_rand(0, count($statuses) - 1)],
+ 'cursor' => uniqid(),
+ 'limit' => mt_rand(1, RefundsRequest::MAX_LIMIT_VALUE),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ private function randomString($length, $any = true)
+ {
+ static $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+_.';
+
+ $result = '';
+ for ($i = 0; $i < $length; $i++) {
+ if ($any) {
+ $char = chr(mt_rand(32, 126));
+ } else {
+ $rnd = mt_rand(0, strlen($chars) - 1);
+ $char = substr($chars, $rnd, 1);
+ }
+ $result .= $char;
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsRequestTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsRequestTest.php
new file mode 100644
index 0000000..15db4c0
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsRequestTest.php
@@ -0,0 +1,639 @@
+hasPaymentId());
+ self::assertNull($instance->getPaymentId());
+ self::assertNull($instance->paymentId);
+
+ $instance->setPaymentId($options['payment_id']);
+ if (empty($options['payment_id'])) {
+ self::assertFalse($instance->hasPaymentId());
+ self::assertNull($instance->getPaymentId());
+ self::assertNull($instance->paymentId);
+ } else {
+ self::assertTrue($instance->hasPaymentId());
+ self::assertEquals($options['payment_id'], $instance->getPaymentId());
+ self::assertEquals($options['payment_id'], $instance->paymentId);
+ }
+
+ $instance->setPaymentId('');
+ self::assertFalse($instance->hasPaymentId());
+ self::assertNull($instance->getPaymentId());
+ self::assertNull($instance->paymentId);
+
+ $instance->paymentId = $options['payment_id'];
+ if (empty($options['payment_id'])) {
+ self::assertFalse($instance->hasPaymentId());
+ self::assertNull($instance->getPaymentId());
+ self::assertNull($instance->paymentId);
+ } else {
+ self::assertTrue($instance->hasPaymentId());
+ self::assertEquals($options['payment_id'], $instance->getPaymentId());
+ self::assertEquals($options['payment_id'], $instance->paymentId);
+ }
+ }
+
+ /**
+ * @dataProvider invalidPaymentIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidPaymentId($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setPaymentId($value);
+ }
+
+ /**
+ * @dataProvider invalidPaymentIdDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidPaymentId($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->paymentId = $value;
+ }
+
+ /**
+ * @return array
+ */
+ public function validStringDataProvider()
+ {
+ return array(
+ array(array()),
+ array(true),
+ array(false),
+ array(new \stdClass()),
+ );
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCreateGte($options)
+ {
+ $instance = new RefundsRequest();
+
+ self::assertFalse($instance->hasCreatedAtGte());
+ self::assertNull($instance->getCreatedAtGte());
+ self::assertNull($instance->createdAtGte);
+
+ $instance->setCreatedAtGte($options['created_at_gte']);
+ if (empty($options['created_at_gte'])) {
+ self::assertFalse($instance->hasCreatedAtGte());
+ self::assertNull($instance->getCreatedAtGte());
+ self::assertNull($instance->createdAtGte);
+ } else {
+ self::assertTrue($instance->hasCreatedAtGte());
+ self::assertEquals($options['created_at_gte'], $instance->getCreatedAtGte()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_gte'], $instance->createdAtGte->format(DATE_ATOM));
+ }
+
+ $instance->setCreatedAtGte('');
+ self::assertFalse($instance->hasCreatedAtGte());
+ self::assertNull($instance->getCreatedAtGte());
+ self::assertNull($instance->createdAtGte);
+
+ $instance->createdAtGte = $options['created_at_gte'];
+ if (empty($options['created_at_gte'])) {
+ self::assertFalse($instance->hasCreatedAtGte());
+ self::assertNull($instance->getCreatedAtGte());
+ self::assertNull($instance->createdAtGte);
+ } else {
+ self::assertTrue($instance->hasCreatedAtGte());
+ self::assertEquals($options['created_at_gte'], $instance->getCreatedAtGte()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_gte'], $instance->createdAtGte->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedGte($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setCreatedAtGte($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCreatedGte($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->createdAtGte = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCreateGt($options)
+ {
+ $instance = new RefundsRequest();
+
+ self::assertFalse($instance->hasCreatedAtGt());
+ self::assertNull($instance->getCreatedAtGt());
+ self::assertNull($instance->createdAtGt);
+
+ $instance->setCreatedAtGt($options['created_at_gt']);
+ if (empty($options['created_at_gt'])) {
+ self::assertFalse($instance->hasCreatedAtGte());
+ self::assertNull($instance->getCreatedAtGte());
+ self::assertNull($instance->createdAtGte);
+ } else {
+ self::assertTrue($instance->hasCreatedAtGt());
+ self::assertEquals($options['created_at_gt'], $instance->getCreatedAtGt()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_gt'], $instance->createdAtGt->format(DATE_ATOM));
+ }
+
+ $instance->setCreatedAtGt('');
+ self::assertFalse($instance->hasCreatedAtGt());
+ self::assertNull($instance->getCreatedAtGt());
+ self::assertNull($instance->createdAtGt);
+
+ $instance->createdAtGt = $options['created_at_gt'];
+ if (empty($options['created_at_gt'])) {
+ self::assertFalse($instance->hasCreatedAtGt());
+ self::assertNull($instance->getCreatedAtGt());
+ self::assertNull($instance->createdAtGt);
+ } else {
+ self::assertTrue($instance->hasCreatedAtGt());
+ self::assertEquals($options['created_at_gt'], $instance->getCreatedAtGt()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_gt'], $instance->createdAtGt->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedGt($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setCreatedAtGt($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCreatedGt($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->createdAtGt = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCreateLte($options)
+ {
+ $instance = new RefundsRequest();
+
+ self::assertFalse($instance->hasCreatedAtLte());
+ self::assertNull($instance->getCreatedAtLte());
+ self::assertNull($instance->createdAtLte);
+
+ $instance->setCreatedAtLte($options['created_at_lte']);
+ if (empty($options['created_at_lte'])) {
+ self::assertFalse($instance->hasCreatedAtLte());
+ self::assertNull($instance->getCreatedAtLte());
+ self::assertNull($instance->createdAtLte);
+ } else {
+ self::assertTrue($instance->hasCreatedAtLte());
+ self::assertEquals($options['created_at_lte'], $instance->getCreatedAtLte()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_lte'], $instance->createdAtLte->format(DATE_ATOM));
+ }
+
+ $instance->setCreatedAtLte('');
+ self::assertFalse($instance->hasCreatedAtLte());
+ self::assertNull($instance->getCreatedAtLte());
+ self::assertNull($instance->createdAtLte);
+
+ $instance->createdAtLte = $options['created_at_lte'];
+ if (empty($options['created_at_lte'])) {
+ self::assertFalse($instance->hasCreatedAtLte());
+ self::assertNull($instance->getCreatedAtLte());
+ self::assertNull($instance->createdAtLte);
+ } else {
+ self::assertTrue($instance->hasCreatedAtLte());
+ self::assertEquals($options['created_at_lte'], $instance->getCreatedAtLte()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_lte'], $instance->createdAtLte->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedLte($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setCreatedAtLte($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCreatedLte($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->createdAtLte = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCreateLt($options)
+ {
+ $instance = new RefundsRequest();
+
+ self::assertFalse($instance->hasCreatedAtLt());
+ self::assertNull($instance->getCreatedAtLt());
+ self::assertNull($instance->createdAtLt);
+
+ $instance->setCreatedAtLt($options['created_at_lt']);
+ if (empty($options['created_at_lt'])) {
+ self::assertFalse($instance->hasCreatedAtLt());
+ self::assertNull($instance->getCreatedAtLt());
+ self::assertNull($instance->createdAtLt);
+ } else {
+ self::assertTrue($instance->hasCreatedAtLt());
+ self::assertEquals($options['created_at_lt'], $instance->getCreatedAtLt()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_lt'], $instance->createdAtLt->format(DATE_ATOM));
+ }
+
+ $instance->setCreatedAtLt('');
+ self::assertFalse($instance->hasCreatedAtLt());
+ self::assertNull($instance->getCreatedAtLt());
+ self::assertNull($instance->createdAtLt);
+
+ $instance->createdAtLt = $options['created_at_lt'];
+ if (empty($options['created_at_lt'])) {
+ self::assertFalse($instance->hasCreatedAtLt());
+ self::assertNull($instance->getCreatedAtLt());
+ self::assertNull($instance->createdAtLt);
+ } else {
+ self::assertTrue($instance->hasCreatedAtLt());
+ self::assertEquals($options['created_at_lt'], $instance->getCreatedAtLt()->format(DATE_ATOM));
+ self::assertEquals($options['created_at_lt'], $instance->createdAtLt->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetInvalidCreatedLt($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setCreatedAtLt($value);
+ }
+
+ /**
+ * @dataProvider invalidDateDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param mixed $value
+ */
+ public function testSetterInvalidCreatedLt($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->createdAtLt = $value;
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testStatus($options)
+ {
+ $instance = new RefundsRequest();
+
+ self::assertFalse($instance->hasStatus());
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->status);
+
+ $instance->setStatus($options['status']);
+ if (empty($options['status'])) {
+ self::assertFalse($instance->hasStatus());
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->status);
+ } else {
+ self::assertTrue($instance->hasStatus());
+ self::assertEquals($options['status'], $instance->getStatus());
+ self::assertEquals($options['status'], $instance->status);
+ }
+
+ $instance->setStatus('');
+ self::assertFalse($instance->hasStatus());
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->status);
+
+ $instance->status = $options['status'];
+ if (empty($options['status'])) {
+ self::assertFalse($instance->hasStatus());
+ self::assertNull($instance->getStatus());
+ self::assertNull($instance->status);
+ } else {
+ self::assertTrue($instance->hasStatus());
+ self::assertEquals($options['status'], $instance->getStatus());
+ self::assertEquals($options['status'], $instance->status);
+ }
+ }
+
+ /**
+ * @dataProvider invalidStatusDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidStatus($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setStatus($value);
+ }
+
+ /**
+ * @dataProvider invalidStatusDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidStatus($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->status = $value;
+ self::assertEquals($value, $instance->status);
+ }
+
+ /**
+ * @dataProvider validLimitDataProvider
+ * @param $value
+ */
+ public function testLimit($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->limit = $value;
+ self::assertEquals($value, $instance->limit);
+ }
+
+ /**
+ * @dataProvider invalidLimitDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidLimit($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setLimit($value);
+ }
+
+
+ /**
+ * @dataProvider validDataProvider
+ * @param $options
+ */
+ public function testCursor($options)
+ {
+ $instance = new RefundsRequest();
+
+ self::assertFalse($instance->hasCursor());
+ self::assertNull($instance->getCursor());
+ self::assertNull($instance->cursor);
+
+ $instance->setCursor($options['cursor']);
+ if (empty($options['cursor'])) {
+ self::assertFalse($instance->hasCursor());
+ self::assertNull($instance->getCursor());
+ self::assertNull($instance->cursor);
+ } else {
+ self::assertTrue($instance->hasCursor());
+ self::assertEquals($options['cursor'], $instance->getCursor());
+ self::assertEquals($options['cursor'], $instance->cursor);
+ }
+
+ $instance->setCursor('');
+ self::assertFalse($instance->hasCursor());
+ self::assertNull($instance->getCursor());
+ self::assertNull($instance->cursor);
+
+ $instance->cursor = $options['cursor'];
+ if (empty($options['cursor'])) {
+ self::assertFalse($instance->hasCursor());
+ self::assertNull($instance->getCursor());
+ self::assertNull($instance->cursor);
+ } else {
+ self::assertTrue($instance->hasCursor());
+ self::assertEquals($options['cursor'], $instance->getCursor());
+ self::assertEquals($options['cursor'], $instance->cursor);
+ }
+ }
+
+ /**
+ * @dataProvider invalidNextCursorDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetInvalidCursor($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->setCursor($value);
+ }
+
+ /**
+ * @dataProvider invalidNextCursorDataProvider
+ * @expectedException \InvalidArgumentException
+ * @param $value
+ */
+ public function testSetterInvalidCursor($value)
+ {
+ $instance = new RefundsRequest();
+ $instance->cursor = $value;
+ }
+
+ public function testValidate()
+ {
+ $instance = new RefundsRequest();
+
+ self::assertTrue($instance->validate());
+ }
+
+ public function testBuilder()
+ {
+ $builder = RefundsRequest::builder();
+ self::assertTrue($builder instanceof RefundsRequestBuilder);
+ }
+
+ public function validDataProvider()
+ {
+ $result = array(
+ array(
+ array(
+ 'created_at_gte' => null,
+ 'created_at_gt' => null,
+ 'created_at_lte' => null,
+ 'created_at_lt' => null,
+ 'status' => null,
+ 'payment_id' => null,
+ 'limit' => null,
+ 'cursor' => null,
+ ),
+ ),
+ array(
+ array(
+ 'created_at_gte' => '',
+ 'created_at_gt' => '',
+ 'created_at_lte' => '',
+ 'created_at_lt' => '',
+ 'status' => '',
+ 'payment_id' => '',
+ 'limit' => '',
+ 'cursor' => '',
+ ),
+ ),
+ );
+ $statuses = RefundStatus::getValidValues();
+ for ($i = 0; $i < 10; $i++) {
+ $request = array(
+ 'created_at_gte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'created_at_gt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'created_at_lte' => date(DATE_ATOM, mt_rand(1, time())),
+ 'created_at_lt' => date(DATE_ATOM, mt_rand(1, time())),
+ 'status' => $statuses[mt_rand(0, count($statuses) - 1)],
+ 'payment_id' => $this->randomString(36),
+ 'limit' => mt_rand(0, RefundsRequest::MAX_LIMIT_VALUE),
+ 'cursor' => uniqid(),
+ );
+ $result[] = array($request);
+ }
+ return $result;
+ }
+
+ public function invalidStatusDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(1, 10)),
+ array(new StringObject(Random::str(1, 10))),
+ );
+ }
+
+ public function validLimitDataProvider()
+ {
+ return array(
+ array(null),
+ array(Random::int(1, RefundsRequest::MAX_LIMIT_VALUE)),
+ );
+ }
+
+ public function invalidLimitDataProvider()
+ {
+ return array(
+ array(array()),
+ array(new \stdClass()),
+ array(-1),
+ array(RefundsRequest::MAX_LIMIT_VALUE + 1),
+ );
+ }
+
+ public function invalidDataProvider()
+ {
+ $result = array(
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(10)),
+ array(Random::bytes(10)),
+ array(-1),
+ array(RefundsRequest::MAX_LIMIT_VALUE + 1),
+ );
+ return $result;
+ }
+
+ public function invalidNextCursorDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ );
+ }
+
+ public function invalidPaymentIdDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(35)),
+ array(Random::str(37)),
+ array(new StringObject(Random::str(10))),
+ );
+ }
+
+ public function invalidDateDataProvider()
+ {
+ return array(
+ array(true),
+ array(false),
+ array(array()),
+ array(new \stdClass()),
+ array(Random::str(35)),
+ array(Random::str(37)),
+ array(new StringObject(Random::str(10))),
+ array(-123),
+ );
+ }
+
+ private function randomString($length, $any = true)
+ {
+ static $chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-+_.';
+
+ $result = '';
+ for ($i = 0; $i < $length; $i++) {
+ if ($any) {
+ $char = chr(mt_rand(32, 126));
+ } else {
+ $rnd = mt_rand(0, strlen($chars) - 1);
+ $char = substr($chars, $rnd, 1);
+ }
+ $result .= $char;
+ }
+ return $result;
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsResponseTest.php b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsResponseTest.php
new file mode 100644
index 0000000..5bc8318
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney/lib/vendor/yoomoney/yookassa-sdk-php/tests/Request/Refunds/RefundsResponseTest.php
@@ -0,0 +1,120 @@
+getItems()));
+ foreach ($instance->getItems() as $index => $item) {
+ self::assertTrue($item instanceof RefundInterface);
+ self::assertArrayHasKey($index, $options['items']);
+ self::assertEquals($options['items'][$index]['id'], $item->getId());
+ self::assertEquals($options['items'][$index]['payment_id'], $item->getPaymentId());
+ self::assertEquals($options['items'][$index]['status'], $item->getStatus());
+ self::assertEquals($options['items'][$index]['amount']['value'], $item->getAmount()->getValue());
+ self::assertEquals($options['items'][$index]['amount']['currency'], $item->getAmount()->getCurrency());
+ self::assertEquals($options['items'][$index]['created_at'], $item->getCreatedAt()->format(DATE_ATOM));
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testGetNextCursor($options)
+ {
+ $instance = new RefundsResponse($options);
+ if (empty($options['next_cursor'])) {
+ self::assertNull($instance->getNextCursor());
+ } else {
+ self::assertEquals($options['next_cursor'], $instance->getNextCursor());
+ }
+ }
+
+ /**
+ * @dataProvider validDataProvider
+ * @param array $options
+ */
+ public function testHasNextCursor($options)
+ {
+ $instance = new RefundsResponse($options);
+ if (empty($options['next_cursor'])) {
+ self::assertFalse($instance->hasNextCursor());
+ } else {
+ self::assertTrue($instance->hasNextCursor());
+ }
+ }
+
+ public function validDataProvider()
+ {
+ return array(
+ array(
+ array(
+ 'items' => array(),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(
+ array(
+ 'id' => Random::str(36),
+ 'payment_id' => Random::str(36),
+ 'status' => RefundStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(0, time())),
+ )
+ ),
+ 'next_cursor' => Random::str(1, 64),
+ ),
+ ),
+ array(
+ array(
+ 'items' => array(
+ array(
+ 'id' => Random::str(36),
+ 'payment_id' => Random::str(36),
+ 'status' => RefundStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'created_at' => date(DATE_ATOM),
+ ),
+ array(
+ 'id' => Random::str(36),
+ 'payment_id' => Random::str(36),
+ 'status' => RefundStatus::SUCCEEDED,
+ 'amount' => array(
+ 'value' => Random::int(1, 100),
+ 'currency' => Random::value(CurrencyCode::getValidValues()),
+ ),
+ 'created_at' => date(DATE_ATOM, Random::int(0, time())),
+ 'authorized_at' => date(DATE_ATOM, Random::int(0, time())),
+ 'receipt_registered' => Random::value(ReceiptRegistrationStatus::getValidValues()),
+ 'description' => Random::str(64, 250),
+ ),
+ ),
+ 'next_cursor' => Random::str(1, 64),
+ ),
+ ),
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money/payment_form_kassa.php b/src/components/com_jshopping/payments/pm_yoomoney/payment_form_yookassa.php
similarity index 53%
rename from src/components/com_jshopping/payments/pm_yandex_money/payment_form_kassa.php
rename to src/components/com_jshopping/payments/pm_yoomoney/payment_form_yookassa.php
index df52bd1..1419876 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money/payment_form_kassa.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney/payment_form_yookassa.php
@@ -3,11 +3,11 @@
/**
* @package JoomShopping for Joomla!
* @subpackage payment
- * @author YandexMoney
- * @copyright Copyright (C) 2012-2017 YandexMoney. All rights reserved.
+ * @author YooMoney
+ * @copyright Copyright (C) 2020 YooMoney. All rights reserved.
*/
-use YandexCheckout\Model\PaymentMethodType;
+use YooKassa\Model\PaymentMethodType;
defined('_JEXEC') or die('Restricted access');
@@ -23,7 +23,7 @@
'PC',
+ PaymentMethodType::YOO_MONEY => 'PC',
PaymentMethodType::BANK_CARD => 'AC',
PaymentMethodType::CASH => 'GP',
PaymentMethodType::MOBILE_BALANCE => 'MC',
@@ -47,34 +47,34 @@
$num += 1; ?>
@@ -78,11 +78,11 @@
+
-
-=constant("_JSHOP_YM_BTN_BACK")?>
+
+=constant("_JSHOP_YOO_BTN_BACK")?>
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/SbbolException.php b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/SbbolException.php
similarity index 54%
rename from src/components/com_jshopping/payments/pm_yandex_money_sbbol/SbbolException.php
rename to src/components/com_jshopping/payments/pm_yoomoney_sbbol/SbbolException.php
index fd6ce92..e1f717c 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/SbbolException.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/SbbolException.php
@@ -1,4 +1,7 @@
YooMoney for business.");
+define('_JSHOP_YOO_VERSION_DESCRIPTION','Module version ');
+
+define('_JSHOP_YOO_TAB_MONEY', 'YooMoney');
+define('_JSHOP_YOO_TAB_KASSA', 'YooMoney for business');
+
+define('_JSHOP_YOO_KASSA_ON', 'Enable payment acceptance via YooMoney for business');
+define('_JSHOP_YOO_KASSA_HELP_CHECKURL', 'Only required if YooMoney for business\'s specialists ask for it');
+
+define('_JSHOP_YOO_KASSA_HEAD_LK', 'Parameters from YooMoney for business\'s Merchant Profile');
+define('_JSHOP_YOO_KASSA_SHOP_ID_LABEL', 'shopId');
+define('_JSHOP_YOO_KASSA_SHOP_ID_DESCRIPTION', 'Copy your shopId from your YooMoney for business\'s Merchant Profile');
+define('_JSHOP_YOO_KASSA_PASSWORD_LABEL', 'Secret key');
+define('_JSHOP_YOO_KASSA_PASSWORD_DESCRIPTION', 'Issue and activate a secret key under your YooMoney for business\'s Merchant Profile. Then copy it here.');
+
+define('_JSHOP_YOO_KASSA_PAYMODE_HEAD', 'Check the preferable scenario of selecting the payment method');
+define('_JSHOP_YOO_KASSA_PAYMODE_LABEL', 'Select payment method');
+define('_JSHOP_YOO_KASSA_SEND_RECEIPT_LABEL', 'Transmit details for receipts to YooMoney for business (Federal Law 54-FZ)');
+define('_JSHOP_YOO_KASSA_PAYMODE_KASSA', 'On YooMoney for business\'s site');
+define('_JSHOP_YOO_KASSA_PAYMODE_SHOP', 'On the store\'s site');
+define('_JSHOP_YOO_KASSA_PAYMODE_LINK', 'More about payment scenarios');
+define('_JSHOP_YOO_KASSA_SELECT_TEXT', 'Check payment methods from the contract');
+define('_JSHOP_YOO_KASSA_CREDENTIALS_ERROR', 'Such secret key does not exist. If you are sure you copied the key correctly, this means it does not work for some reason. Issue and activate the key again under your Merchant Profile');
+define('_JSHOP_YOO_KASSA_TEST_WARNING', 'You have enabled the test mode. Check the payment making process. Learn more');
+define('_JSHOP_YOO_DESCRIPTION_TITLE', 'Transaction data');
+define('_JSHOP_YOO_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Payment for order No. %order_id%');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE', 'Enable payment holding');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE_HELP', 'If the option is enabled, payments are processed in two steps: first, the required amount is blocked on the customer’s card, and then you need to manually capture it via the administrator’s dashboard. Learn more at.');
+define('_JSHOP_YOO_HOLD_MODE_STATUSES', 'What status should be assigned to an order if it is:');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS', 'waiting for capture');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS_HELP', 'the order status will be changed to this one after the funds are credited, until the store\'s operator either captures or cancels the payment');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS', 'canceled');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS_HELP', 'the order status will be changed to this one after the payment is canceled');
+define('_JSHOP_YOO_HOLD_MODE_COMMENT_ON_HOLD', 'New payment received. Capture until %1$s, after that date it will be automatically canceled');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'You\'ve captured a payment in YooMoney for business. ');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Payment wasn\'t captured. Please try again.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'You\'ve canceled a payment in YooMoney for business. Money will be returned to the user.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Payment wasn\'t canceled. Please try again.');
+define('_JSHOP_YOO_DESCRIPTION_HELP', 'Full description of the transaction that the user will see during the checkout process. You can find it in your YooMoney for business Merchant Profile. For example, "Payment for order No. 72 by user@yoomoney.ru". Limitations: no more than 128 symbols.');
+define('_JSHOP_YOO_METHOD_YOO_MONEY_DESCRIPTION', 'YooMoney');
+define('_JSHOP_YOO_METHOD_CARDS_DESCRIPTION', 'Bank cards');
+define('_JSHOP_YOO_METHOD_BANK_CARD_DESCRIPTION', 'Bank cards');
+define('_JSHOP_YOO_METHOD_CASH_DESCRIPTION', 'Cash via payment kiosks');
+define('_JSHOP_YOO_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Direct carrier billing');
+define('_JSHOP_YOO_METHOD_WEBMONEY_DESCRIPTION', 'Webmoney');
+define('_JSHOP_YOO_METHOD_ALFABANK_DESCRIPTION', 'Alfa-Click');
+define('_JSHOP_YOO_METHOD_SBERBANK_DESCRIPTION', 'Sberbank Online');
+define('_JSHOP_YOO_METHOD_MA_DESCRIPTION', 'MasterPass');
+define('_JSHOP_YOO_METHOD_PB_DESCRIPTION', 'Promsvyazbank');
+define('_JSHOP_YOO_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
+define('_JSHOP_YOO_METHOD_MP_DESCRIPTION', 'Mobile payment kiosk');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_DESCRIPTION', 'Installments');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ per month)');
+
+define('_JSHOP_YOO_KASSA_MPOS_LABEL', 'Success page for the Payment by Card on Delivery method');
+define('_JSHOP_YOO_KASSA_MPOS_HELP', 'This page contains delivery information. Specify the terms of the delivery and the payment here');
+
+
+define('_JSHOP_YOO_MONEY_HEAD', 'To start operating the module, connect your store to YooMoney.');
+define('_JSHOP_YOO_MONEY_ON', 'Enable payment acceptance to the YooMoney Wallet');
+define('_JSHOP_YOO_MONEY_REDIRECT_HELP', "Copy this link to the Redirect URL field at the notifications settings page.");
+
+define('_JSHOP_YOO_MONEY_SET_HEAD', 'Payment acceptance settings');
+define('_JSHOP_YOO_MONEY_WALLET', 'Wallet number');
+define('_JSHOP_YOO_MONEY_PSW', 'Codeword');
+
+define('_JSHOP_YOO_MONEY_SELECT_HEAD', 'Check the preferable scenario of selecting the payment method');
+define('_JSHOP_YOO_MONEY_SELECT_LABEL', 'Select payment method');
+define('_JSHOP_YOO_METHOD_YM2_DESCRIPTION', 'YooMoney');
+define('_JSHOP_YOO_METHOD_CARDS2_DESCRIPTION', 'Bank cards');
+
+define('_JSHOP_YOO_COMMON_HEAD', 'Additional settings for administrator');
+define('_JSHOP_YOO_COMMON_STATUS', 'Order status after the payment');
+
+define('_JSHOP_YOO_PAYMENTS_STATUS_LABEL', 'Order status');
+define('_JSHOP_YOO_PAYMENTS_STATUS_INFO', 'The status should indicate that the result of the payment is unknown: you can only find out if the customer paid or not by checking the notification sent to your email or by contacting your bank.');
+define('_JSHOP_YOO_PAYMENTS_FIO_LABEL', 'Payer\'s full name');
+define('_JSHOP_YOO_PAYMENTS_CONFIRM_LABEL', 'Next');
+define('_JSHOP_YOO_PAYMENTS_EMPTY_NAME_ERROR', 'Payer\'s full name is empty');
+define('_JSHOP_YOO_PAYMENTS_INVALID_NAME_ERROR', 'The payer\'s name should consist of the first, middle, and last name, separated by spaces');
+
+// версия 2.х
+define('_JSHOP_YOO_LICENSE','License agreement:');
+define('_JSHOP_YOO_LICENSE_TEXT2',"
By using this program in any way, you fully and unconditionally accept the terms of the license agreement as posted at https://yoomoney.ru/doc.xml?id=527132 (hereinafter referred to \"license agreement\"). If you do not accept any part of the terms of the license agreement, you are forbidden to use the program for any purpose.
");
+define('_JSHOP_YOO_TESTMODE_DESCRIPTION', 'Enable test mode');
+define('_JSHOP_YOO_MODE_DESCRIPTION', 'Payment acceptance settings');
+define('_JSHOP_YOO_MODE1_DESCRIPTION', 'YooMoney');
+define('_JSHOP_YOO_MODE2_DESCRIPTION', 'YooMoney for business (On the store\'s site)');
+define('_JSHOP_YOO_MODE3_DESCRIPTION', 'YooMoney for business (On YooMoney for business\'s site)');
+define('_JSHOP_YOO_REG_IND', 'If you don\'t have a YooMoney account, register here - https://yoomoney.ru/ IMPORTANT! Copy this link to the Redirect URL field at the notifications settings page.');
+
+define('_JSHOP_YOO_REG_ORG', "To start operating the module, connect your store to YooMoney for business. Shop ID, scid, ShopPassword can be found in the Merchant Profile after the onboarding process.");
+define('_JSHOP_YOO_METHODS_DESCRIPTION', 'Select payment method');
+define('_JSHOP_YOO_PASSWORD', 'Specify shopPassword:');
+define('_JSHOP_YOO_SHOPID', 'Specify shopId:');
+define('_JSHOP_YOO_SCID', 'Specify scid:');
+define('_JSHOP_YOO_PARAM', 'Parameter name');
+define('_JSHOP_YOO_VALUE', 'Value');
+define('_JSHOP_YOO_RETURNURL', 'Dynamic');
+define('_JSHOP_YOO_ACCOUNT_DESCRIPTION', 'Wallet number:');
+
+define('_JSHOP_YOO_PAY', 'Pay!');
+define('_JSHOP_YOO_TRANSACTION_END', 'Order status after the payment');
+define('_JSHOP_YOO_TEXT_MPOS', 'Success page for the Payment by Card on Delivery method');
+
+//updater
+define('_JSHOP_YOO_UPDATER_ERROR_RESTORE', 'Unable to restore the data from the backup. ');
+define('_JSHOP_YOO_UPDATER_SUCCESS_MESSAGE', 'Module successfully installed ');
+define('_JSHOP_YOO_UPDATER_ERROR_REMOVE', 'Unable to delete backup %s.');
+define('_JSHOP_YOO_ERROR_BACKUP_NOT_FOUND', 'Unable to delete backup %s.');
+define('_JSHOP_YOO_ERROR_REMOVE_BACKUP', 'Unable to delete backup %s.');
+define('_JSHOP_YOO_SUCCESS_REMOVE_BECKUP', 'Backup %s successfully deleted');
+define('_JSHOP_YOO_SUCCESS_UPDATE_VERSION', 'Module version %s successfully downloaded and installed');
+define('_JSHOP_YOO_ERROR_UNPACK_NEW_VERSION', 'Unable to extract archive %s. More about the error in module\'s logs');
+define('_JSHOP_YOO_ERROR_CREATE_BACKUP', 'Unable to create a backup copy of the installed module version. More about the error in module\'s logs');
+define('_JSHOP_YOO_ERROR_DOWNLOAD_NEW_VERSION', 'Unable to load the archive, please try again. More about the error in module\'s logs');
+define('_JSHOP_YOO_FAILED_CREATE_DIRECTORY', 'Unable to create directory ');
+define('_JSHOP_YOO_FAILED_DOWNLOAD_UPDATE', 'Unable to load the archive with the update');
+define('_JSHOP_YOO_UPDATER_HEADER_TEXT', ' New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
+define('_JSHOP_YOO_UPDATER_ABOUT', 'About the module:');
+define('_JSHOP_YOO_UPDATER_CURRENT_VERSION', 'Current module version —');
+define('_JSHOP_YOO_UPDATER_LAST_VERSION', 'Latest available module version —');
+define('_JSHOP_YOO_UPDATER_LAST_CHECK', 'Date of the last check for updates —');
+define('_JSHOP_YOO_UPDATER_CHECK', 'Check for updates');
+define('_JSHOP_YOO_HISTORY_LABEL', 'Changelog:');
+define('_JSHOP_YOO_UPDATE_LABEL', 'Update module');
+define('_JSHOP_YOO_INSTALL_MESSAGE', 'You have the latest module version installed.');
+define('_JSHOP_YOO_BACKUPS_LABEL', 'Backups');
+define('_JSHOP_YOO_MODULE_VERSION_LABEL', 'Module version');
+define('_JSHOP_YOO_BACKUP_DATE_CREATE', 'Creation date');
+define('_JSHOP_YOO_BACKUP_FILE_NAME', 'File name');
+define('_JSHOP_YOO_BACKUP_FILE_SIZE', 'File size');
+define('_JSHOP_YOO_UPDATER_RESTORE', 'Restore');
+define('_JSHOP_YOO_UPDATER_DELETE', 'Remove');
+define('_JSHOP_YOO_UPDATER_APPROVE_ACTION_MESSAGE', 'Do you really want to update module?');
+define('_JSHOP_YOO_UPDATER_APPROVE_DELETE_MESSAGE', 'Do you really want to delete the backup copy of this module version ');
+define('_JSHOP_YOO_UPDATER_APPROVE_RESTORE_MESSAGE', 'Do you really want to restore the module from the backup copy of this version');
+define('_JSHOP_YOO_UPDATER_TEXT_HEADER', 'Module updates');
+define('_JSHOP_YOO_UPDATER_ABOUT_TEXT', 'New module versions with added features and fixed errors will appear here. Click the Update button to install the latest module version.');
+define('_JSHOP_YOO_UPDATER_DISABLED_TEXT', 'Unfortunately, the module update option is unavailable');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP_CURL', 'because the "zip" and "curl" extensions are not installed.');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP', 'because the "zip" extension is not installed.');
+define('_JSHOP_YOO_UPDATER_CAUSE_CURL', 'because the "curl" extension is not installed.');
+
+
+
+define('_JSHOP_YOO_WAITING_FOR_CAPTURE', 'Waiting for capture');
+define('_JSHOP_YOO_CAPTURE_FAILED', 'Capture failed');
+define('_JSHOP_YOO_PAYMENT_CAPTURED', 'Payment captured');
+define('_JSHOP_YOO_PAYMENT_CAPTURED_TEXT', 'Payment %s captured');
+define('_JSHOP_YOO_ERROR_MESSAGE_CREATE_PAYMENT', 'Unable to create the payment, choose another payment method.');
+define('_JSHOP_YOO_ALFA_CLICK_TEXT', 'Specify the login, and we\'ll send the bill in Alfa-Click. All you have do after that is confirm the payment online at the bank\'s website.');
+define('_JSHOP_YOO_QIWI_PHONE_TEXT', 'Phone number linked to QIWI Wallet');
+define('_JSHOP_YOO_FILL_PHONE_MESSAGE', 'Specify phone number');
+define('_JSHOP_YOO_FILL_ALFA_CLICK_LOGIN', 'Specify the login for Alfa-Click');
+define('_JSHOP_YOO_ENABLE', 'Enable');
+define('_JSHOP_YOO_DISABLE', 'Disable');
+define('_JSHOP_YOO_DEFAULT_TAX_LABEL', 'Default rate');
+define('_JSHOP_YOO_DEFAULT_TAX_DESCRIPTION', 'The default rate applies if another rate is not set on the product\'s page.');
+define('_JSHOP_YOO_TAX_RATES_LABEL', 'Compare rates');
+define('_JSHOP_YOO_TAX_IN_MODULE', 'Rate at your store');
+define('_JSHOP_YOO_TAX_FOR_CHECKOUT', 'Rate for the receipt to the tax service');
+define('_JSHOP_YOO_WITHOUT_VAT', 'Without VAT');
+define('_JSHOP_YOO_VAT_10_100', 'Applicable rate 10/110');
+define('_JSHOP_YOO_VAT_18_118', 'Applicable rate 18/118');
+define('_JSHOP_YOO_NOTIFICATION_URL_LABEL', 'Address for notifications');
+define('_JSHOP_YOO_NOTIFICATION_URL_HELP_TEXT', 'Only required if YooMoney for business\'s specialists ask for it');
+define('_JSHOP_YOO_LOG_VIEW_LABEL', 'View logs');
+define('_JSHOP_YOO_CLEAR_LOGS', 'Clear logs');
+define('_JSHOP_YOO_CLOSE', 'Close');
+define('_JSHOP_YOO_LOGS_LABEL', 'Logs');
+
+define('_JSHOP_YOO_TAB_UPDATE', 'Module update');
+define('_JSHOP_YOO_SBBOL_HELP_TEXT', 'There is a restriction for payments via Sberbank Business Online: one receipt can only contain products with the same VAT rate. If the client wants to pay for products with different VAT rates at the same time, we will show him the message explaining that it\'s not possible.');
+
diff --git a/src/components/com_jshopping/payments/pm_yoomoney_sbbol/lang/ru-RU.php b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/lang/ru-RU.php
new file mode 100644
index 0000000..3e647e2
--- /dev/null
+++ b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/lang/ru-RU.php
@@ -0,0 +1,198 @@
+ЮKassa.");
+define('_JSHOP_YOO_VERSION_DESCRIPTION','Версия модуля ');
+
+define('_JSHOP_YOO_TAB_MONEY', 'ЮMoney');
+define('_JSHOP_YOO_TAB_KASSA', 'ЮKassa');
+
+define('_JSHOP_YOO_KASSA_ON', 'Включить приём платежей через ЮKassa');
+define('_JSHOP_YOO_KASSA_TEST', 'Тестовый режим');
+define('_JSHOP_YOO_KASSA_WORK', 'Реальный режим');
+define('_JSHOP_YOO_KASSA_HELP_CHECKURL', 'Этот адрес понадобится, только если его попросят специалисты ЮKassa');
+define('_JSHOP_YOO_KASSA_HELP_SUCCESSURL', 'Включите «Использовать страницы успеха и ошибки с динамическими адресами» в настройках личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_HELP_DYNAMICURL', 'Страницы с динамическими адресами');
+
+define('_JSHOP_YOO_KASSA_HEAD_LK', 'Параметры из личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_SHOP_ID_LABEL', 'shopId');
+define('_JSHOP_YOO_KASSA_SHOP_ID_DESCRIPTION', 'Скопируйте shopId из личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_PASSWORD_LABEL', 'Секретный ключ');
+define('_JSHOP_YOO_KASSA_PASSWORD_DESCRIPTION', 'Выпустите и активируйте секретный ключ в личном кабинете ЮKassa. Потом скопируйте его сюда.');
+define('_JSHOP_YOO_KASSA_PARAMS', 'Shop ID, scid, ShopPassword можно посмотреть в личном кабинете после подключения ЮKassa.');
+
+define('_JSHOP_YOO_KASSA_PAYMODE_HEAD', 'Настройка сценария оплаты');
+define('_JSHOP_YOO_KASSA_PAYMODE_LABEL', 'Выбор способа оплаты');
+define('_JSHOP_YOO_KASSA_SEND_RECEIPT_LABEL', 'Отправлять в ЮKassa данные для чеков (54-ФЗ)');
+define('_JSHOP_YOO_DESCRIPTION_TITLE', 'Описание платежа');
+define('_JSHOP_YOO_DESCRIPTION_DEFAULT_PLACEHOLDER', 'Оплата заказа №%order_id%');
+define('_JSHOP_YOO_DESCRIPTION_HELP', 'Это описание транзакции, которое пользователь увидит при оплате, а вы — в личном кабинете ЮKassa. Например, «Оплата заказа №72».
+Чтобы в описание подставлялся номер заказа (как в примере), поставьте на его месте %order_id% (Оплата заказа №%order_id%).
+Ограничение для описания — 128 символов.');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE', 'Включить отложенную оплату');
+define('_JSHOP_YOO_ENABLE_HOLD_MODE_HELP', 'Если опция включена, платежи с карт проходят в 2 этапа: у клиента сумма замораживается, и вам вручную нужно подтвердить её списание – через панель администратора. Подробное описание Холдирования.');
+define('_JSHOP_YOO_HOLD_MODE_STATUSES', 'Какой статус присваивать заказу, если он:');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS', 'ожидает подтверждения');
+define('_JSHOP_YOO_HOLD_MODE_ON_HOLD_STATUS_HELP', 'заказ переходит в этот статус при поступлении и остается в нем пока оператор магазина не подтвердит или не отменит платеж');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS', 'отменён');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_STATUS_HELP', 'заказ переходит в этот статус после отмены платежа');
+define('_JSHOP_YOO_HOLD_MODE_COMMENT_ON_HOLD', 'Поступил новый платёж. Он ожидает подтверждения до %1$s, после чего автоматически отменится');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_SUCCESS', 'Вы подтвердили платёж в ЮKassa.');
+define('_JSHOP_YOO_HOLD_MODE_CAPTURE_PAYMENT_FAIL', 'Платёж не подтвердился. Попробуйте ещё раз.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_SUCCESS', 'Вы отменили платёж в ЮKassa. Деньги вернутся клиенту.');
+define('_JSHOP_YOO_HOLD_MODE_CANCEL_PAYMENT_FAIL', 'Платёж не отменился. Попробуйте ещё раз.');
+define('_JSHOP_YOO_KASSA_PAYMODE_KASSA', 'На стороне ЮKassa');
+define('_JSHOP_YOO_KASSA_PAYMODE_SHOP', 'На стороне магазина');
+define('_JSHOP_YOO_KASSA_PAYMODE_LINK', 'Подробнее о сценариях оплаты');
+define('_JSHOP_YOO_KASSA_SELECT_TEXT', 'Отметьте способы оплаты, которые указаны в вашем договоре с ЮMoney');
+define('_JSHOP_YOO_KASSA_CREDENTIALS_ERROR', 'Проверьте shopId и Секретный ключ — где-то есть ошибка. А лучше скопируйте их прямо из личного кабинета ЮKassa');
+define('_JSHOP_YOO_KASSA_TEST_WARNING', 'Вы включили тестовый режим приема платежей. Проверьте, как проходит оплата, и напишите менеджеру ЮKassa. Он выдаст рабочие shopId и Секретный ключ. Инструкция');
+define('_JSHOP_YOO_METHOD_YOO_MONEY_DESCRIPTION', 'ЮMoney');
+define('_JSHOP_YOO_METHOD_CARDS_DESCRIPTION', 'Банковские карты');
+define('_JSHOP_YOO_METHOD_BANK_CARD_DESCRIPTION', 'Банковские карты');
+define('_JSHOP_YOO_METHOD_CASH_DESCRIPTION', 'Наличные через терминалы');
+define('_JSHOP_YOO_METHOD_MOBILE_BALANCE_DESCRIPTION', 'Баланс мобильного');
+define('_JSHOP_YOO_METHOD_WEBMONEY_DESCRIPTION', 'Кошелек WebMoney');
+define('_JSHOP_YOO_METHOD_ALFABANK_DESCRIPTION', 'Альфа-Клик');
+define('_JSHOP_YOO_METHOD_SBERBANK_DESCRIPTION', 'Сбербанк Онлайн');
+define('_JSHOP_YOO_METHOD_MA_DESCRIPTION', 'MasterPass');
+define('_JSHOP_YOO_METHOD_PB_DESCRIPTION', 'Интернет-банк Промсвязьбанка');
+define('_JSHOP_YOO_METHOD_QIWI_DESCRIPTION', 'QIWI Wallet');
+define('_JSHOP_YOO_METHOD_QP_DESCRIPTION', 'Доверительный платеж (Куппи.ру)');
+define('_JSHOP_YOO_METHOD_MP_DESCRIPTION', 'Мобильный терминал');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_DESCRIPTION', 'Заплатить по частям');
+define('_JSHOP_YOO_METHOD_INSTALLMENTS_AMOUNT', ' (%s ₽ в месяц)');
+define('_JSHOP_YOO_KASSA_MPOS_LABEL', 'Страница успеха для способа «Оплата картой при доставке»');
+define('_JSHOP_YOO_KASSA_MPOS_HELP', 'Это страница с информацией о доставке. Укажите на ней, когда привезут товар и как его можно будет оплатить');
+
+define('_JSHOP_YOO_MONEY_HEAD', 'Для работы с модулем нужно открыть кошелек на ЮMoney и
+ зарегистрировать приложение на сайте ЮMoney');
+define('_JSHOP_YOO_MONEY_ON', 'Включить прием платежей в кошелек на ЮMoney');
+define('_JSHOP_YOO_MONEY_REDIRECT_HELP', 'Скопируйте эту ссылку в поле Redirect URL на странице регистрации приложения.');
+
+define('_JSHOP_YOO_MONEY_SET_HEAD', 'Настройки приема платежей');
+define('_JSHOP_YOO_MONEY_WALLET', 'Номер кошелька');
+define('_JSHOP_YOO_MONEY_PSW', 'Секретное слово');
+
+define('_JSHOP_YOO_MONEY_SELECT_HEAD', 'Настройка сценария оплаты');
+define('_JSHOP_YOO_MONEY_SELECT_LABEL', 'Способы оплаты');
+define('_JSHOP_YOO_METHOD_YM2_DESCRIPTION', 'Кошелек ЮMoney');
+define('_JSHOP_YOO_METHOD_CARDS2_DESCRIPTION', 'Банковская карта');
+
+define('_JSHOP_YOO_COMMON_HEAD', 'Дополнительные настройки для администратора');
+define('_JSHOP_YOO_COMMON_STATUS', 'Статус заказа после оплаты');
+
+define('_JSHOP_YOO_PAYMENTS_STATUS_LABEL', 'Статус заказа');
+define('_JSHOP_YOO_PAYMENTS_STATUS_INFO', 'Статус должен показать, что результат платежа неизвестен: о том, что клиент
+заплатил, можно узнать только из письма от Платежки или в своем банке.');
+define('_JSHOP_YOO_PAYMENTS_FIO_LABEL', 'ФИО плательщика');
+define('_JSHOP_YOO_PAYMENTS_CONFIRM_LABEL', 'Далее');
+define('_JSHOP_YOO_PAYMENTS_EMPTY_NAME_ERROR', 'Укажите ФИО плательщика');
+define('_JSHOP_YOO_PAYMENTS_INVALID_NAME_ERROR', 'ФИО плательщика должно состоять из фамилии, имени и отчества, разделённых пробелами');
+
+// версия 2.х
+define('_JSHOP_YOO_LICENSE','Лицензионный договор:');
+define('_JSHOP_YOO_LICENSE_TEXT2',"
Любое использование Вами программы означает полное и безоговорочное принятие Вами условий лицензионного договора, размещенного по адресу https://yoomoney.ru/doc.xml?id=527132 (далее – «Лицензионный договор»). Если Вы не принимаете условия Лицензионного договора в полном объёме, Вы не имеете права использовать программу в каких-либо целях.
");
+define('_JSHOP_YOO_TESTMODE_DESCRIPTION', 'Использовать в тестовом режиме?');
+define('_JSHOP_YOO_MODE_DESCRIPTION', 'Способ приема платежей:');
+define('_JSHOP_YOO_MODE1_DESCRIPTION', 'ЮMoney');
+define('_JSHOP_YOO_MODE2_DESCRIPTION', 'ЮKassa (выбор оплаты на стороне сайта)');
+define('_JSHOP_YOO_MODE3_DESCRIPTION', 'ЮKassa (выбор оплаты на стороне ЮKassa)');
+define('_JSHOP_YOO_REG_IND', 'Если у вас нет аккаунта в ЮMoney, то следует зарегистрироваться тут - https://yoomoney.ru/ ВАЖНО! Вам нужно будет указать ссылку для приема HTTP уведомлений здесь - https://yoomoney.ru/transfer/myservices/http-notification');
+
+define('_JSHOP_YOO_REG_ORG', 'Для работы с модулем необходимо подключить магазин к ЮKassa. После подключения вы получите параметры для приема платежей (идентификатор магазина — shopId и номер витрины — scid).');
+define('_JSHOP_YOO_METHODS_DESCRIPTION', 'Укажите необходимые способы оплаты');
+define('_JSHOP_YOO_PASSWORD', 'Секретное слово (shopPassword) для обмена сообщениями:');
+define('_JSHOP_YOO_SHOPID', 'Идентификатор вашего магазина в ЮMoney (ShopID):');
+define('_JSHOP_YOO_SCID', 'Идентификатор витрины вашего магазина в ЮMoney (scid):');
+define('_JSHOP_YOO_PARAM', 'Название параметра');
+define('_JSHOP_YOO_VALUE', 'Значение');
+define('_JSHOP_YOO_RETURNURL', 'Динамический');
+define('_JSHOP_YOO_ACCOUNT_DESCRIPTION', 'Номер кошелька ЮMoney:');
+
+define('_JSHOP_YOO_PAY', 'Оплатить!');
+define('_JSHOP_YOO_TRANSACTION_END', 'Статус заказа для успешных транзакций');
+define('_JSHOP_YOO_TEXT_MPOS', 'Страница с инструкцией для платеждей через мобильный терминал!');
+
+//updater
+define('_JSHOP_YOO_UPDATER_ERROR_RESTORE', 'Не удалось восстановить модуль из резервной копии: ');
+define('_JSHOP_YOO_UPDATER_SUCCESS_MESSAGE', 'Модуль был успешно восстановлен из резервной копии: ');
+define('_JSHOP_YOO_UPDATER_ERROR_REMOVE', 'Не был передан удаляемый файл резервной копии');
+define('_JSHOP_YOO_ERROR_BACKUP_NOT_FOUND', 'Файл резервной копии %s не найден');
+define('_JSHOP_YOO_ERROR_REMOVE_BACKUP', 'Не удалось удалить файл резервной копии ');
+define('_JSHOP_YOO_SUCCESS_REMOVE_BECKUP', 'Файл резервной копии %s был успешно удалён');
+define('_JSHOP_YOO_SUCCESS_UPDATE_VERSION', 'Версия модуля %s (%s) была успешно загружена и установлена');
+define('_JSHOP_YOO_ERROR_UNPACK_NEW_VERSION', 'Не удалось распаковать загруженный архив %s, подробную информацию о произошедшей ошибке можно найти в логах модуля');
+define('_JSHOP_YOO_ERROR_CREATE_BACKUP', 'Не удалось создать резервную копию установленной версии модуля, подробную информацию о произошедшей ошибке можно найти в логах модуля');
+define('_JSHOP_YOO_ERROR_DOWNLOAD_NEW_VERSION', 'Не удалось загрузить архив с новой версией, подробную информацию о произошедшей ошибке можно найти в логах модуля');
+define('_JSHOP_YOO_FAILED_CREATE_DIRECTORY', 'Не удалось создать директорию ');
+define('_JSHOP_YOO_FAILED_DOWNLOAD_UPDATE', 'Не удалось загрузить архив с обновлением');
+define('_JSHOP_YOO_UPDATER_HEADER_TEXT', ' Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками. Чтобы установить новую версию модуля, нажмите кнопку «Обновить».');
+define('_JSHOP_YOO_UPDATER_ABOUT', 'О модуле:');
+define('_JSHOP_YOO_UPDATER_CURRENT_VERSION', 'Установленная версия модуля —');
+define('_JSHOP_YOO_UPDATER_LAST_VERSION', 'Последняя версия модуля —');
+define('_JSHOP_YOO_UPDATER_LAST_CHECK', 'Последняя проверка наличия новых версий —');
+define('_JSHOP_YOO_UPDATER_CHECK', 'Проверить наличие обновлений');
+define('_JSHOP_YOO_HISTORY_LABEL', 'История изменений:');
+define('_JSHOP_YOO_UPDATE_LABEL', 'Обновить');
+define('_JSHOP_YOO_INSTALL_MESSAGE', 'Установлена последняя версия модуля.');
+define('_JSHOP_YOO_BACKUPS_LABEL', 'Резервные копии');
+define('_JSHOP_YOO_MODULE_VERSION_LABEL', 'Версия модуля');
+define('_JSHOP_YOO_BACKUP_DATE_CREATE', 'Дата создания');
+define('_JSHOP_YOO_BACKUP_FILE_NAME', 'Имя файла');
+define('_JSHOP_YOO_BACKUP_FILE_SIZE', 'Размер файла');
+define('_JSHOP_YOO_UPDATER_RESTORE', 'Восстановить');
+define('_JSHOP_YOO_UPDATER_DELETE', 'Удалить');
+define('_JSHOP_YOO_UPDATER_APPROVE_ACTION_MESSAGE', 'Вы действительно хотите обновить модуль до последней версии?');
+define('_JSHOP_YOO_UPDATER_APPROVE_DELETE_MESSAGE', 'Вы действительно хотите удалить резервную копию');
+define('_JSHOP_YOO_UPDATER_APPROVE_RESTORE_MESSAGE', 'Вы действительно хотите восстановить резервную копию');
+define('_JSHOP_YOO_UPDATER_TEXT_HEADER', 'Обновление модуля');
+define('_JSHOP_YOO_UPDATER_ABOUT_TEXT', 'Здесь будут появляться новые версии модуля — с новыми возможностями или с исправленными ошибками.');
+define('_JSHOP_YOO_UPDATER_DISABLED_TEXT', ' К сожалению функция обновления модуля недоступна');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP_CURL', 'так как для не установлены расширения "zip" и "curl".');
+define('_JSHOP_YOO_UPDATER_CAUSE_ZIP', 'так как для не установлено расширение "zip".');
+define('_JSHOP_YOO_UPDATER_CAUSE_CURL', 'так как для не установлено расширение "curl".');
+
+
+
+define('_JSHOP_YOO_WAITING_FOR_CAPTURE', 'Ожидается проведение оплаты');
+define('_JSHOP_YOO_CAPTURE_FAILED', 'Платёж не был проведён');
+define('_JSHOP_YOO_PAYMENT_CAPTURED', 'Оплата была проведена');
+define('_JSHOP_YOO_PAYMENT_CAPTURED_TEXT', 'Платёж %s проведён');
+define('_JSHOP_YOO_ERROR_MESSAGE_CREATE_PAYMENT', 'Не удалось создать платёж, попробуйте выбрать другой способ оплаты.');
+define('_JSHOP_YOO_ALFA_CLICK_TEXT', 'Укажите логин, и мы выставим счет в Альфа-Клике. После этого останется подтвердить платеж на сайте интернет-банка.');
+define('_JSHOP_YOO_QIWI_PHONE_TEXT', 'Телефон, который привязан к Qiwi Wallet');
+define('_JSHOP_YOO_FILL_PHONE_MESSAGE', 'Укажите телефон');
+define('_JSHOP_YOO_FILL_ALFA_CLICK_LOGIN', 'Укажите логин в Альфа-клике');
+define('_JSHOP_YOO_ENABLE', 'Включить');
+define('_JSHOP_YOO_DISABLE', 'Выключить');
+define('_JSHOP_YOO_DEFAULT_TAX_LABEL', 'Ставка по умолчанию');
+define('_JSHOP_YOO_DEFAULT_TAX_DESCRIPTION', 'Ставка по умолчанию будет в чеке, если в карточке товара не указана другая ставка.');
+define('_JSHOP_YOO_TAX_RATES_LABEL', 'Сопоставьте ставки');
+define('_JSHOP_YOO_TAX_IN_MODULE', 'Ставка в вашем магазине');
+define('_JSHOP_YOO_TAX_FOR_CHECKOUT', 'Ставка для чека в налоговую');
+define('_JSHOP_YOO_WITHOUT_VAT', 'Без НДС');
+define('_JSHOP_YOO_VAT_10_100', 'Расчётная ставка 10/110');
+define('_JSHOP_YOO_VAT_18_118', 'Расчётная ставка 18/118');
+define('_JSHOP_YOO_NOTIFICATION_URL_LABEL', 'Адрес для уведомлений');
+define('_JSHOP_YOO_NOTIFICATION_URL_HELP_TEXT', 'Этот адрес понадобится, только если его попросят специалисты ЮKassa');
+define('_JSHOP_YOO_LOG_VIEW_LABEL', 'Просмотр логов модуля');
+define('_JSHOP_YOO_CLEAR_LOGS', 'Очистить журнал');
+define('_JSHOP_YOO_CLOSE', 'Закрыть');
+define('_JSHOP_YOO_LOGS_LABEL', 'Журнал сообщений модуля');
+
+define('_JSHOP_YOO_TAB_UPDATE', 'Обновления');
+
+define('_JSHOP_YOO_KASSA_ENABLE_SBBOL', 'Включить платежи через Сбербанк Бизнес Онлайн');
+define('_JSHOP_YOO_SBBOL_HELP_TEXT', 'При оплате через Сбербанк Бизнес Онлайн есть ограничение: в одном заказе могут быть только товары с одинаковой ставкой НДС. Если клиент захочет оплатить за один раз товары с разными ставками — мы покажем ему сообщение, что так сделать не получится.');
+define('_JSHOP_YOO_SBBOL_HEAD', 'Чтобы платежи через Сбербанк Бизнес Онлайн работали, магазин должен быть подключен к ЮKassa.');
+define('_JSHOP_YOO_SBBOL_TAX_RATES_HEAD', 'Сопоставьте ставки НДС в вашем магазине со ставками для Сбербанка Бизнес Онлайн');
\ No newline at end of file
diff --git a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/paymentform.php b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/paymentform.php
similarity index 50%
rename from src/components/com_jshopping/payments/pm_yandex_money_sbbol/paymentform.php
rename to src/components/com_jshopping/payments/pm_yoomoney_sbbol/paymentform.php
index 74030c8..482f7cd 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/paymentform.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/paymentform.php
@@ -3,8 +3,8 @@
/**
* @package JoomShopping for Joomla!
* @subpackage payment
- * @author YandexMoney
- * @copyright Copyright (C) 2012-2017 YandexMoney. All rights reserved.
+ * @author YooMoney
+ * @copyright Copyright (C) 2020 YooMoney. All rights reserved.
*/
defined('_JEXEC') or die('Restricted access');
@@ -15,5 +15,5 @@
$cart_data->load();
?>
-
+
diff --git a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/pm_yandex_money_sbbol.php b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/pm_yoomoney_sbbol.php
similarity index 90%
rename from src/components/com_jshopping/payments/pm_yandex_money_sbbol/pm_yandex_money_sbbol.php
rename to src/components/com_jshopping/payments/pm_yoomoney_sbbol/pm_yoomoney_sbbol.php
index d0601c6..32bd4c2 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/pm_yandex_money_sbbol.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/pm_yoomoney_sbbol.php
@@ -3,26 +3,27 @@
/**
* @package JoomShopping for Joomla!
* @subpackage payment
- * @author YandexMoney
- * @copyright Copyright (C) 2012-2017 YandexMoney. All rights reserved.
+ * @author YooMoney
+ * @copyright Copyright (C) 2020 YooMoney. All rights reserved.
*/
-use YandexCheckout\Model\Notification\NotificationSucceeded;
-use YandexCheckout\Model\Notification\NotificationWaitingForCapture;
-use YandexCheckout\Model\NotificationEventType;
-use YandexCheckout\Model\PaymentMethodType;
-use YandexCheckout\Model\PaymentStatus;
-use YandexMoney\Model\KassaPaymentMethod;
+use YooKassa\Model\Notification\NotificationSucceeded;
+use YooKassa\Model\Notification\NotificationWaitingForCapture;
+use YooKassa\Model\NotificationEventType;
+use YooKassa\Model\PaymentMethodType;
+use YooKassa\Model\PaymentStatus;
+use YooMoney\Model\KassaPaymentMethod;
+use YooMoney\Model\SbbolException;
defined('_JEXEC') or die('Restricted access');
define('JSH_DIR', realpath(dirname(__FILE__).'/../..'));
define('DIR_DOWNLOAD', JSH_DIR.'/log');
-require_once dirname(__FILE__).'/../pm_yandex_money/lib/autoload.php';
+require_once dirname(__FILE__) . '/../pm_yoomoney/lib/autoload.php';
require_once dirname(__FILE__).'/SbbolException.php';
-class pm_yandex_money_sbbol extends PaymentRoot
+class pm_yoomoney_sbbol extends PaymentRoot
{
private $orderModel;
private $kassa;
@@ -110,10 +111,10 @@ public function showAdminFormParams($params)
'scid',
'account',
'transaction_end_status',
- 'ym_pay_id',
- 'ym_pay_desc',
- 'ya_payments_fio',
- 'ya_sbbol_default_tax',
+ 'yoopay_id',
+ 'yoopay_desc',
+ 'yoo_payments_fio',
+ 'yoo_sbbol_default_tax',
'sbbol_purpose',
);
@@ -128,7 +129,7 @@ public function showAdminFormParams($params)
$taxes = $taxes = JSFactory::getAllTaxes();
foreach ($taxes as $k => $tax) {
- $array_params[] = 'ya_sbbol_tax_'.$k;
+ $array_params[] = 'yoo_sbbol_tax_'.$k;
}
foreach ($array_params as $key) {
@@ -170,10 +171,10 @@ private function loadLanguageFile()
{
$lang = JFactory::getLanguage();
$langtag = $lang->getTag();
- if (file_exists(JPATH_ROOT.'/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/'.$langtag.'.php')) {
- require_once(JPATH_ROOT.'/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/'.$langtag.'.php');
+ if (file_exists(JPATH_ROOT.'/components/com_jshopping/payments/pm_yoomoney_sbbol/lang/'.$langtag.'.php')) {
+ require_once(JPATH_ROOT.'/components/com_jshopping/payments/pm_yoomoney_sbbol/lang/'.$langtag.'.php');
} else {
- require_once(JPATH_ROOT.'/components/com_jshopping/payments/pm_yandex_money_sbbol/lang/ru-RU.php');
+ require_once(JPATH_ROOT.'/components/com_jshopping/payments/pm_yoomoney_sbbol/lang/ru-RU.php');
}
}
@@ -204,19 +205,19 @@ function showEndForm($pmconfigs, $order)
$redirectUrl = $uri->toString(array('scheme', 'host', 'port'))
- .SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_yandex_money&no_lang=1&order_id=".$order->order_id);
+ .SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_yoomoney&no_lang=1&order_id=".$order->order_id);
$redirectUrl = htmlspecialchars_decode($redirectUrl);
try {
$payment = $this->getKassaPaymentMethod($pmconfigs)->createSbbolPayment($order, $cart, $redirectUrl);
- } catch (\SbbolException $e) {
+ } catch (SbbolException $e) {
$redirectUrl = JRoute::_(JURI::root().'index.php?option=com_jshopping&controller=checkout&task=step3');
$app->enqueueMessage('У вас в корзине товары, для которых действуют разные ставки НДС — их нельзя оплатить одновременно. Можно разбить покупку на несколько этапов: сначала оплатить товары с одной ставкой НДС, потом — с другой.',
'error');
$app->redirect($redirectUrl);
} catch (\Exception $e) {
$redirectUrl = JRoute::_(JURI::root().'index.php?option=com_jshopping&controller=checkout&task=step3');
- $app->enqueueMessage(_JSHOP_YM_ERROR_MESSAGE_CREATE_PAYMENT, 'error');
+ $app->enqueueMessage(_JSHOP_YOO_ERROR_MESSAGE_CREATE_PAYMENT, 'error');
$app->redirect($redirectUrl);
}
@@ -225,14 +226,14 @@ function showEndForm($pmconfigs, $order)
if ($payment !== null) {
$confirmation = $payment->getConfirmation();
- if ($confirmation instanceof \YandexCheckout\Model\Confirmation\ConfirmationRedirect) {
+ if ($confirmation instanceof \YooKassa\Model\Confirmation\ConfirmationRedirect) {
$redirect = $confirmation->getConfirmationUrl();
}
$this->getOrderModel()->savePayment($order->order_id, $payment);
} else {
$redirect = JRoute::_(JURI::root().'index.php?option=com_jshopping&controller=checkout&task=step3');
- $this->setErrorMessage(_JSHOP_YM_ERROR_MESSAGE_CREATE_PAYMENT);
+ $this->setErrorMessage(_JSHOP_YOO_ERROR_MESSAGE_CREATE_PAYMENT);
}
$app->redirect($redirect);
@@ -378,21 +379,21 @@ function checkTransaction($pmConfigs, $order, $act)
return array(
-1,
- sprintf(_JSHOP_YM_PAYMENT_CAPTURED_TEXT, $transactionId),
+ sprintf(_JSHOP_YOO_PAYMENT_CAPTURED_TEXT, $transactionId),
$transactionId,
- _JSHOP_YM_PAYMENT_CAPTURED,
+ _JSHOP_YOO_PAYMENT_CAPTURED,
);
}
}
}
/**
- * @return \YandexMoney\Model\OrderModel
+ * @return \YooMoney\Model\OrderModel
*/
public function getOrderModel()
{
if ($this->orderModel === null) {
- $this->orderModel = new \YandexMoney\Model\OrderModel();
+ $this->orderModel = new \YooMoney\Model\OrderModel();
}
return $this->orderModel;
@@ -427,7 +428,7 @@ public function log($level, $message, $context = array())
private function getLogFileName()
{
- return realpath(JSH_DIR).'/log/pm_yandex_money.log';
+ return realpath(JSH_DIR).'/log/pm_yoomoney.log';
}
public function getKassaPaymentMethod($pmConfigs)
@@ -449,7 +450,7 @@ private function generateReturnUrl($order)
{
$uri = JURI::getInstance();
$redirectUrl = $uri->toString(array('scheme', 'host', 'port'))
- .SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_yandex_money_sbbol&no_lang=1&order_id=".$order->order_id);
+ .SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=return&js_paymentclass=pm_yoomoney_sbbol&no_lang=1&order_id=".$order->order_id);
$redirectUrl = htmlspecialchars_decode($redirectUrl);
return $redirectUrl;
diff --git a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/sbboladminparamsform.php b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/sbboladminparamsform.php
similarity index 81%
rename from src/components/com_jshopping/payments/pm_yandex_money_sbbol/sbboladminparamsform.php
rename to src/components/com_jshopping/payments/pm_yoomoney_sbbol/sbboladminparamsform.php
index 2af75e0..9c3723a 100644
--- a/src/components/com_jshopping/payments/pm_yandex_money_sbbol/sbboladminparamsform.php
+++ b/src/components/com_jshopping/payments/pm_yoomoney_sbbol/sbboladminparamsform.php
@@ -3,8 +3,8 @@
/**
* @package JoomShopping for Joomla!
* @subpackage payment
- * @author YandexMoney
- * @copyright Copyright (C) 2012-2017 YandexMoney. All rights reserved.
+ * @author YooMoney
+ * @copyright Copyright (C) 2020 YooMoney. All rights reserved.
*/
defined('_JEXEC') or die('Restricted access');
@@ -13,7 +13,7 @@
$liveurlhost = $uri->toString(array("scheme", 'host', 'port'));
$sslurlhost = $uri->toString(array('host', 'port'));
-$notify_url = 'https://'.$sslurlhost.SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_yandex_money_sbbol&no_lang=1");
+$notify_url = 'https://'.$sslurlhost.SEFLink("index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_yoomoney_sbbol&no_lang=1");
$notify_url = htmlspecialchars_decode($notify_url);
@@ -25,23 +25,23 @@ function escapeValue($value)
?>
@@ -64,7 +64,7 @@ function escapeValue($value)
-
+
@@ -90,21 +90,21 @@ function escapeValue($value)
-
Ставка НДС по
+
Ставка НДС по
умолчанию
-
-
-
+
Ставка в вашем магазине.
-
Слева — ставка НДС в вашем магазине, справа — в Яндекс.Кассе. Пожалуйста,
+
Слева — ставка НДС в вашем магазине, справа — в ЮKassa. Пожалуйста,
сопоставьте их.
@@ -128,22 +128,22 @@ function escapeValue($value)