Skip to content

Commit

Permalink
Merge pull request #96 from TransbankDevelopers/chore/prepare-release…
Browse files Browse the repository at this point in the history
…-2.2.0

chore: prepare release 2.2.0
  • Loading branch information
Matiasnickolas authored Apr 12, 2024
2 parents 0c9ffef + 1000d74 commit 5555c83
Show file tree
Hide file tree
Showing 49 changed files with 1,895 additions and 2,886 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: PHP CI

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.1"
- name: Run script
run: echo "We don't have tests yet :("
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

53 changes: 27 additions & 26 deletions Block/System/Config/TbkButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Transbank\Webpay\Block\System\Config;

use Transbank\Webpay\Model\HealthCheck;
use Transbank\Webpay\Model\LogHandler;
use Transbank\Webpay\Helper\PluginLogger;

class TbkButton extends \Magento\Config\Block\System\Config\Form\Field
{
public $tbk_data;
/**
* @var string
*/
Expand All @@ -21,35 +22,35 @@ public function __construct(
$config = $configProvider->getPluginConfig();

$healthcheck = new HealthCheck($config);
$datos_hc = json_decode($healthcheck->printFullResume());
$datos_hc = $healthcheck->getFullResume();

$log = new LogHandler();
$resume = $log->getResume();
$logger = new PluginLogger();
$logInfo = $logger->getInfo();
$logDetail = [];

if (isset($logInfo['last'])) {
$logDetail = $logger->getLogDetail($logInfo['last']);
}

$this->tbk_data = [
'url_request' => $context->getUrlBuilder()->getUrl('admin_webpay/Request/index'),
'url_create_pdf_report' => $context->getUrlBuilder()->getUrl('admin_webpay/CreatePdf/index').'?document=report',
'url_create_pdf_php_info' => $context->getUrlBuilder()->getUrl('admin_webpay/CreatePdf/index').'?document=php_info',
'php_status' => $datos_hc->server_resume->php_version->status,
'php_version' => $datos_hc->server_resume->php_version->version,
'server_version' => $datos_hc->server_resume->server_version->server_software,
'ecommerce' => $datos_hc->server_resume->plugin_info->ecommerce,
'ecommerce_version' => $datos_hc->server_resume->plugin_info->ecommerce_version,
'current_plugin_version' => $datos_hc->server_resume->plugin_info->current_plugin_version,
'last_plugin_version' => $datos_hc->server_resume->plugin_info->last_plugin_version,
'dom_status' => $datos_hc->php_extensions_status->dom->status,
'dom_version' => $datos_hc->php_extensions_status->dom->version,
'php_info' => $datos_hc->php_info->string->content,
'lockfile' => isset($resume['lock_file']['status']) ? $resume['lock_file']['status'] : null,
'logs' => isset($resume['last_log']['log_content']) ? $resume['last_log']['log_content'] : null,
'log_file' => isset($resume['last_log']['log_file']) ? $resume['last_log']['log_file'] : null,
'log_weight' => isset($resume['last_log']['log_weight']) ? $resume['last_log']['log_weight'] : null,
'log_regs_lines' => isset($resume['last_log']['log_regs_lines']) ? $resume['last_log']['log_regs_lines'] : null,
'log_days' => $resume['validate_lock_file']['max_logs_days'],
'log_size' => $resume['validate_lock_file']['max_log_weight'],
'log_dir' => $resume['log_dir'],
'logs_count' => $resume['logs_count']['log_count'],
'logs_list' => isset($resume['logs_list']) ? $resume['logs_list'] : ['no hay archivos de registro'],
'php_status' => $datos_hc['server_resume']['php_version']['status'],
'php_version' => $datos_hc['server_resume']['php_version']['version'],
'server_version' => $datos_hc['server_resume']['server_version']['server_software'],
'ecommerce' => $datos_hc['server_resume']['plugin_info']['ecommerce'],
'ecommerce_version' => $datos_hc['server_resume']['plugin_info']['ecommerce_version'],
'last_ecommerce_version' => $datos_hc['server_resume']['plugin_info']['last_ecommerce_version'],
'current_plugin_version' => $datos_hc['server_resume']['plugin_info']['current_plugin_version'],
'last_plugin_version' => $datos_hc['server_resume']['plugin_info']['last_plugin_version'],
'dom_status' => $datos_hc['php_extensions_status']['dom']['status'],
'dom_version' => $datos_hc['php_extensions_status']['dom']['version'],
'logs' => isset($logDetail['content']) ? $logDetail['content'] : '',
'log_file' => isset($logInfo['last']) ? $logInfo['last'] : '-',
'log_weight' => isset($logDetail['size']) ? $logDetail['size'] : '-',
'log_regs_lines' => isset($logDetail['lines']) ? $logDetail['lines'] : '-',
'log_dir' => $logInfo['dir'],
'logs_count' => $logInfo['length'],
'logs_list' => isset($logInfo['logs']) ? $logInfo['logs'] : ['no hay archivos de registro'],
];
}

Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ Todos los cambios notables a este proyecto serán documentados en este archivo.
El formato está basado en [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

# [2.2.0] - 2024-04-12
## Fixed
- Se corrige el retorno de una inscripción Oneclick cuando es rechazada por el usuario.
- Se corrige el retorno de transacción Webpay Plus cuando es rechazada por el usuario.
- Se modifica la vista de configuración del plugin.
- Se corrige bug de vista duplicada al listar tarjetas desde el administrador de cuenta de usuario.
- Se corrige un bug relacionado a cancelaciones simultáneas en el formulario de Transbank.
## Added
- Se muestra ahora la última versión del plugin disponible desde la vista de diagnóstico.
- Se agrega la opción de reembolso parcial para Oneclick.
- Se agrega reembolso parcial y total para Webpay Plus.

## Changed
- Se quita el servicio para recolectar métricas.
- Se modifica el campo de API Key a tipo password.
- Se mejora la gestión de la clase de logs.
- Se remueven referencias deprecadas a la integración con SOAP.

# [2.1.5] - 2023-03-24
## Added
Expand Down
2 changes: 2 additions & 0 deletions Controller/Adminhtml/CreatePdf/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

class Index extends \Magento\Backend\App\Action
{
protected $configProvider;

public function __construct(
\Magento\Backend\App\Action\Context $context,
\Transbank\Webpay\Model\Config\ConfigProvider $configProvider
Expand Down
10 changes: 6 additions & 4 deletions Controller/Adminhtml/Request/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

namespace Transbank\Webpay\Controller\Adminhtml\Request;

use Exception;
use Transbank\Webpay\Model\HealthCheck;
use Transbank\Webpay\Exceptions\TransbankCreateException;

class Index extends \Magento\Backend\App\Action
{
protected $configProvider;

public function __construct(
\Magento\Backend\App\Action\Context $context,
\Transbank\Webpay\Model\Config\ConfigProvider $configProvider
Expand All @@ -24,10 +26,10 @@ public function execute()
try {
$config = $this->configProvider->getPluginConfig();
$healthcheck = new HealthCheck($config);
$response = $healthcheck->getCreateTransaction();
$response = $healthcheck->createTestTransaction();

echo json_encode(['success' => true, 'msg' => json_decode($response)]);
} catch (Exception $e) {
echo json_encode(['success' => true, 'msg' => $response]);
} catch (TransbankCreateException $e) {
echo json_encode(['success' => false, 'msg' => $e->getMessage()]);
}
}
Expand Down
20 changes: 10 additions & 10 deletions Controller/Oneclick/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@

class Delete extends Action
{
protected $configProvider;
protected $oneclickInscriptionDataFactory;
protected $resultPageFactory;

public function __construct(
Context $context,
PageFactory $resultPageFactory,
\Transbank\Webpay\Model\OneclickInscriptionDataFactory $OneclickInscriptionDataFactory,
\Transbank\Webpay\Model\OneclickInscriptionDataFactory $oneclickInscriptionDataFactory,
\Transbank\Webpay\Model\Config\ConfigProvider $configProvider
)
{
parent::__construct($context);
$this->configProvider = $configProvider;
$this->resultPageFactory = $resultPageFactory;
$this->OneclickInscriptionDataFactory = $OneclickInscriptionDataFactory;
$this->oneclickInscriptionDataFactory = $oneclickInscriptionDataFactory;
}

public function execute()
Expand All @@ -43,8 +45,6 @@ public function execute()

$response = $transbankSdkWebpay->deleteInscription($username, $tbkUser);

var_dump($response);

if ($response->success) {
$this->messageManager->addSuccessMessage(__("Tarjeta inscrita eliminada exitosamente."));
} else {
Expand All @@ -70,11 +70,11 @@ public function execute()
*/
protected function getOneclickInscriptionData($inscriptionId)
{
$OneclickInscriptionDataModel = $this->OneclickInscriptionDataFactory->create();
$OneclickInscriptionData = $OneclickInscriptionDataModel->load($inscriptionId, 'id');
$tbkUser = $OneclickInscriptionData->getTbkUser();
$username = $OneclickInscriptionData->getUsername();
$oneclickInscriptionDataModel = $this->oneclickInscriptionDataFactory->create();
$oneclickInscriptionData = $oneclickInscriptionDataModel->load($inscriptionId, 'id');
$tbkUser = $oneclickInscriptionData->getTbkUser();
$username = $oneclickInscriptionData->getUsername();

return [$username, $tbkUser, $OneclickInscriptionDataModel];
return [$username, $tbkUser, $oneclickInscriptionDataModel];
}
}
}
14 changes: 8 additions & 6 deletions Controller/Oneclick/Index.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?php

namespace Transbank\Webpay\Controller\Oneclick;

use Magento\Framework\App\Action\Action;
use Magento\Framework\App\Action\Context;
use Magento\Framework\View\Result\PageFactory;
class Index extends \Magento\Framework\App\Action\Action

class Index extends Action
{
protected $resultPageFactory;

Expand All @@ -14,10 +16,10 @@ public function __construct(Context $context, PageFactory $resultPageFactory)
$this->resultPageFactory = $resultPageFactory;
}

public function execute()
public function execute()
{
$this->_view->loadLayout();
$this->_view->renderLayout();
return $this->resultPageFactory->create();
$this->resultPageFactory->create();
}
}
}
Loading

0 comments on commit 5555c83

Please sign in to comment.