Skip to content

Commit c041b10

Browse files
author
Leonix
committed
wa-plugins/payment/yandexkassa 1.2.11
* Улучшили поддержку расширенных возможностей премиум-лицензии Shop-Script.
1 parent 2d9da3a commit c041b10

File tree

3 files changed

+20
-15
lines changed

3 files changed

+20
-15
lines changed
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<?php
22
return array(
3-
'name' => 'ЮKassa (бывшая Яндекс.Касса)',
4-
'description' => 'Приём платежей через сервис «ЮKassa» (<a href="https://yookassa.ru/">yookassa.ru</a>).',
5-
'icon' => 'img/yandexkassa16.png',
6-
'logo' => 'img/yandexkassa.png',
7-
'version' => '1.2.10',
8-
'vendor' => 'webasyst',
9-
'type' => waPayment::TYPE_ONLINE,
10-
'partial_refund' => true,
11-
'partial_capture' => true,
3+
'name' => 'ЮKassa (бывшая Яндекс.Касса)',
4+
'description' => 'Приём платежей через сервис «ЮKassa» (<a href="https://yookassa.ru/">yookassa.ru</a>).',
5+
'icon' => 'img/yandexkassa16.png',
6+
'logo' => 'img/yandexkassa.png',
7+
'version' => '1.2.11',
8+
'vendor' => 'webasyst',
9+
'type' => waPayment::TYPE_ONLINE,
10+
'partial_refund' => true,
11+
'partial_capture' => true,
12+
'fractional_quantity' => true,
13+
'stock_units' => false,
1214
);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"support_premium": "yes",
2+
"support_premium": "partial",
33
"support_premium_description": "<p><strong>Дробное количество</strong> товаров передаётся в «ЮKassa» <em>точно так, как указано в заказе</em>.</p><p><strong>Единицы измерения</strong> количества товаров <em>не передаются</em> — такая возможность не предусмотрена платёжной системой.</p>"
44
}

wa-plugins/payment/yandexkassa/lib/yandexkassaPayment.class.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -921,14 +921,13 @@ protected function getReceiptItems(waOrder $order)
921921
$receipt_items = [];
922922

923923
foreach ($order->items as $item) {
924-
$quantity = (int)ifset($item, 'quantity', 0);
924+
$quantity = ifset($item, 'quantity', 0);
925925
if ($quantity <= 0) {
926926
continue;
927927
}
928928
$item['amount'] = round($item['price'], 2) - round(ifset($item['discount'], 0.0), 2);
929929

930-
// possible splitting items into array of items
931-
$items = [$item];
930+
$items = [];
932931

933932
// "Честный знак" marking code for product item leads to splitting by 'quantity'
934933
if ($item['type'] === 'product') {
@@ -942,8 +941,12 @@ protected function getReceiptItems(waOrder $order)
942941
}
943942
}
944943

945-
foreach ($items as $it) {
946-
$receipt_items[] = $this->formatReceiptItem($it, $order->currency);
944+
if ($items) {
945+
foreach ($items as $it) {
946+
$receipt_items[] = $this->formatReceiptItem($it, $order->currency);
947+
}
948+
} else {
949+
$receipt_items[] = $this->formatReceiptItem($item, $order->currency);
947950
}
948951

949952
unset($item);

0 commit comments

Comments
 (0)