Skip to content

Commit

Permalink
Merge pull request #109 from yoomoney/release/v2.1.3
Browse files Browse the repository at this point in the history
Release/2.1.3
  • Loading branch information
tonchik-tm authored Jul 26, 2021
2 parents 5c558bc + 9f60594 commit cec6c2e
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v2.1.3 от 26.07.2021
* Курсы валют с учетом номинала
* Обновлен SDK до версии 2.1.3

### v2.1.2 от 20.07.2021
* Заменён файл верификации для ApplePay
* Обновлен SDK до версии 2.1.2
Expand Down
2 changes: 1 addition & 1 deletion src/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modification>
<name>YooMoney for Opencart 3.x</name>
<code>YooMoney</code>
<version>2.1.2</version>
<version>2.1.3</version>
<author>YooMoney</author>
<link>https://github.com/yoomoney/cms-opencart3</link>
<!-- Вставка кнопки в историю заказов-->
Expand Down
2 changes: 1 addition & 1 deletion src/upload/admin/controller/extension/payment/yoomoney.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class ControllerExtensionPaymentYoomoney extends Controller
{
const MODULE_NAME = 'yoomoney';
const MODULE_VERSION = '2.1.2';
const MODULE_VERSION = '2.1.3';

const WIDGET_INSTALL_STATUS_SUCCESS = true;
const WIDGET_INSTALL_STATUS_FAIL = false;
Expand Down
2 changes: 1 addition & 1 deletion src/upload/admin/model/extension/payment/yoomoney.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ModelExtensionPaymentYoomoney extends Model
/**
* string
*/
const MODULE_VERSION = '2.1.2';
const MODULE_VERSION = '2.1.3';
const YOOMONEY_EVENT_SECOND_RECEIPT_CODE = 'yoomoney_second_receipt_trigger';

private $kassaModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class ControllerExtensionPaymentYoomoney extends Controller
{
const MODULE_NAME = 'yoomoney';
const MODULE_VERSION = '2.1.2';
const MODULE_VERSION = '2.1.3';

/**
* @var ModelExtensionPaymentYoomoney
Expand Down
2 changes: 1 addition & 1 deletion src/upload/catalog/model/extension/payment/yoomoney.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class ModelExtensionPaymentYoomoney extends Model
{
const MODULE_VERSION = '2.1.2';
const MODULE_VERSION = '2.1.3';

private $kassaModel;
private $walletModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public function load($date=null)
{
$code = $item->getElementsByTagName('CharCode')->item(0)->nodeValue;
$curs = $item->getElementsByTagName('Value')->item(0)->nodeValue;
$this->list[$code] = floatval(str_replace(',', '.', $curs));
$nominal = $item->getElementsByTagName('Nominal')->item(0)->nodeValue;
$this->list[$code] = floatval(str_replace(',', '.', $curs) / $nominal);
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@
},
{
"name": "yoomoney/yookassa-sdk-php",
"version": "2.1.2",
"version_normalized": "2.1.2.0",
"version": "2.1.3",
"version_normalized": "2.1.3.0",
"source": {
"type": "git",
"url": "https://github.com/yoomoney/yookassa-sdk-php.git",
"reference": "8d62f9d56b2ed926ac299775faa02effa100fbb2"
"reference": "3d1420c74ce405df0eeb09e5ea8bc70e7970df22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/yoomoney/yookassa-sdk-php/zipball/8d62f9d56b2ed926ac299775faa02effa100fbb2",
"reference": "8d62f9d56b2ed926ac299775faa02effa100fbb2",
"url": "https://api.github.com/repos/yoomoney/yookassa-sdk-php/zipball/3d1420c74ce405df0eeb09e5ea8bc70e7970df22",
"reference": "3d1420c74ce405df0eeb09e5ea8bc70e7970df22",
"shasum": ""
},
"require": {
Expand All @@ -75,7 +75,7 @@
"mockery/mockery": "^0.9.9",
"phpunit/phpunit": "^4.8.35 || ^5.7"
},
"time": "2021-06-02T13:58:05+00:00",
"time": "2021-07-26T08:21:36+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v2.1.3 от 26.07.2021
* Изменен формат строки для Amount

### v2.1.2 от 02.06.2021
* Модификация Amount

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"email": "cms@yoomoney.ru"
}
],
"version": "2.1.2",
"version": "2.1.3",
"require": {
"php": ">=5.3.0",
"ext-curl": "*",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Client extends BaseClient
/**
* Текущая версия библиотеки
*/
const SDK_VERSION = '2.1.2';
const SDK_VERSION = '2.1.3';

/**
* Получить список платежей магазина
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,14 @@ public function jsonSerialize()

private function serializeValueToJson($value)
{
if ($value === null || is_scalar($value) || is_array($value)) {
if ($value === null || is_scalar($value)) {
return $value;
} elseif (is_array($value)) {
$array = array();
foreach ($value as $key => $item) {
$array[$key] = $this->serializeValueToJson($item);
}
return $array;
} elseif (is_object($value) && $value instanceof \JsonSerializable) {
return $value->jsonSerialize();
} elseif (is_object($value) && $value instanceof \DateTime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
/**
* MonetaryAmount - Сумма определенная в валюте
*
* @property string $value Сумма
* @package YooKassa
*
* @property int $value Сумма
* @property string $currency Код валюты
*/
class MonetaryAmount extends AbstractObject implements AmountInterface
Expand All @@ -58,7 +60,7 @@ class MonetaryAmount extends AbstractObject implements AmountInterface
public function __construct($value = null, $currency = null)
{
if (is_array($value)) {
$this->fromArray($value);
parent::__construct($value);
} else {
if ($value !== null && $value > 0.0) {
$this->setValue($value);
Expand Down Expand Up @@ -221,7 +223,7 @@ public function increase($value)
public function jsonSerialize()
{
return array(
'value' => sprintf('%.2f',$this->_value / 100.0),
'value' => number_format($this->_value / 100.0, 2, '.', ''),
'currency' => $this->_currency,
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@

/**
* Class ReceiptItemAmount
*
* @package YooKassa
*
* @method fromArray($sourceArray)
* @property int $value Сумма
* @property string $currency Код валюты
*/
class ReceiptItemAmount extends AbstractObject implements AmountInterface
{
Expand All @@ -60,7 +62,7 @@ class ReceiptItemAmount extends AbstractObject implements AmountInterface
public function __construct($value = null, $currency = null)
{
if (is_array($value)) {
$this->fromArray($value);
parent::__construct($value);
} else {
if ($value !== null && $value > 0.0) {
$this->setValue($value);
Expand Down Expand Up @@ -217,8 +219,8 @@ public function increase($value)
public function jsonSerialize()
{
return array(
'value' => sprintf('%.2f',$this->_value / 100.0),
'value' => number_format($this->_value / 100.0, 2, '.', ''),
'currency' => $this->_currency,
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<paths>
<output>.phpdoc</output>
</paths>
<version number="2.1.2">
<version number="2.1.3">
<folder>latest</folder>
<api>
<source dsn=".">
Expand Down
Binary file modified yoomoney.oc3x.ocmod.zip
Binary file not shown.

0 comments on commit cec6c2e

Please sign in to comment.