Skip to content

Commit

Permalink
Adding version information in the Tpay configuration view
Browse files Browse the repository at this point in the history
  • Loading branch information
krzGablo committed Jul 24, 2024
1 parent bc1b90e commit 1bbb0f7
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.9
2.1.0
4 changes: 4 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0]
### Added
- Adding version information in the Tpay configuration view

## [2.0.9]
### Fixed
- Fixed refund scope
Expand Down
25 changes: 25 additions & 0 deletions Model/Config/Source/VersionInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

namespace Tpay\Magento2\Model\Config\Source;

use Magento\Backend\Block\Template\Context;
use Magento\Config\Block\System\Config\Form\Field;
use Magento\Framework\Data\Form\Element\AbstractElement;
use Tpay\Magento2\Api\TpayConfigInterface;

class VersionInfo extends Field
{
/** @var TpayConfigInterface */
private $tpayConfig;

public function __construct(Context $context, TpayConfigInterface $tpayConfig, array $data = [])
{
$this->tpayConfig = $tpayConfig;
parent::__construct($context, $data);
}

protected function _getElementHtml(AbstractElement $element): string
{
return $this->tpayConfig->buildMagentoInfo();
}
}
4 changes: 4 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
</field>
</group>
<field id="version_comment" translate="label" type="label" sortOrder="19" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Version information</label>
<frontend_model>Tpay\Magento2\Model\Config\Source\VersionInfo</frontend_model>
</field>
</group>
</section>
</system>
Expand Down
1 change: 1 addition & 0 deletions i18n/pl_PL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"Maximal amount for method","Maksymalna kwota"
"Leave empty for no limit","Puste pole bez ograniczeń"
"View bank payments","Widok płatności bankowych"
"Version information","Informacje o wersji"
"If you use other currencies visible on the website and pay in PLN, turn it on/off","W przypadku korzystania z innych walut widocznych na stronie i płatności w PLN należy włączyć/wyłączyć"
"Type in 6 digit code and press pay to commit blik payment.", "Wpisz 6 cyfrowy kod aby powiązać transakcję blik."
"Choose a payment method","Wybierz jeden ze sposobów płatności"
Expand Down

0 comments on commit 1bbb0f7

Please sign in to comment.