Skip to content

Commit

Permalink
Fixed report operation name (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgog78 authored and luckyraul committed May 28, 2019
1 parent 75f8d16 commit e66dc95
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 76 deletions.
4 changes: 4 additions & 0 deletions Api/Data/TransactionAttemptInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ interface TransactionAttemptInterface extends TransactionInterface
{
const ID = 'id';
const OPERATION = 'operation';
const OPERATION_LABEL = [
1 => 'Payment',
2 => 'Refund',
];
const SALES_ENTITY_INCREMENT_ID = 'sales_entity_increment_id';
const STATUS = 'status';
const MESSAGE = 'message';
Expand Down
70 changes: 0 additions & 70 deletions Model/Source/Attributes.php

This file was deleted.

4 changes: 3 additions & 1 deletion Model/TransactionAttempt.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ public function getParentTxnId()
*/
public function getTxnType()
{
return $this->getOperation();
$operation = $this->getOperation();

return self::OPERATION_LABEL[$operation] ?? $operation;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
2. Регистрируется попытка отправки данных. Создается сущность `Api\Data\TransactionInterface\TransactionAttemptInterface` со статусом `NEW` (1)

3. Осуществляется передача данных в виде JSON в АТОЛ.
3.1. В случае **УСПЕШНОЙ** передачи (один из HTTP статусов `[200, 400, 401]`)
3.1. В случае **УСПЕШНОЙ** передачи (один из HTTP статусов `[200, 400, 401]`)
* создается транзакция - сущность `Magento\Sales\Api\Data\TransactionInterface` в который записываются UUID и все данные о передаче. В админке это грида Sales -> Transactions.
* Сущность попытки отправки `TransactionAttemptInterface` получает статус `Sent` (2)
* Создается комментарий к заказу
Expand Down Expand Up @@ -76,7 +76,7 @@

## Список событий и плагинов, Описание действий и причины

### События
### События
* **sales_order_invoice_save_commit_after**:
* отправляет данные по инвойсу после его сохранения.
* **sales_order_creditmemo_save_commit_after**:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mygento/module-kkm",
"type": "magento2-module",
"version": "2.3.0",
"version": "2.3.2",
"license": "OSL-3.0",
"description": "Модуль интеграции фискальных кассовых аппаратов для Magento в соответствии с 54-ФЗ",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
</field>
<field id="product_tax_attr" translate="label" type="select" sortOrder="110" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Attribute for product tax</label>
<source_model>Mygento\Kkm\Model\Source\Attributes</source_model>
<source_model>Mygento\Base\Model\Source\Attributes</source_model>
<can_be_empty>0</can_be_empty>
<depends>
<field id="*/*/tax_all">0</field>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Mygento_Kkm" setup_version="2.3.1"/>
<module name="Mygento_Kkm" setup_version="2.3.2"/>
</config>

0 comments on commit e66dc95

Please sign in to comment.