Skip to content

Commit

Permalink
Merge pull request #175 from TransbankDevelopers/refactor/remove-metr…
Browse files Browse the repository at this point in the history
…icts-utility

refactor: remove metricts utility
  • Loading branch information
mvarlic authored Oct 27, 2023
2 parents 7417a73 + 74cd74f commit 42cedcb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 147 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use Transbank\WooCommerce\WebpayRest\Controllers\OneclickInscriptionResponseController;
use Transbank\WooCommerce\WebpayRest\Helpers\ErrorHelper;
use Transbank\WooCommerce\WebpayRest\Helpers\LogHandler;
use Transbank\WooCommerce\WebpayRest\Telemetry\PluginVersion;
use Transbank\WooCommerce\WebpayRest\Helpers\WordpressPluginVersion;
use Transbank\WooCommerce\WebpayRest\OneclickTransbankSdk;
use Transbank\WooCommerce\WebpayRest\Exceptions\Oneclick\RejectedAuthorizeOneclickException;
use Transbank\WooCommerce\WebpayRest\Exceptions\Oneclick\CreateTransactionOneclickException;
Expand Down Expand Up @@ -94,35 +92,9 @@ public function __construct()

add_filter('woocommerce_payment_methods_list_item', [$this, 'methods_list_item_oneclick'], null, 2);
add_action('woocommerce_update_options_payment_gateways_'.$this->id, [$this, 'process_admin_options']);
add_action('woocommerce_update_options_payment_gateways_'.$this->id, [$this, 'registerPluginVersion']);

}

public function registerPluginVersion()
{

$commerceCode = $this->get_option('commerce_code');

$pluginVersion = $this->getPluginVersion();

(new PluginVersion())->registerVersion(
$commerceCode,
$pluginVersion,
wc()->version,
PluginVersion::ECOMMERCE_WOOCOMMERCE,
$this->get_option('environment'),
'oneclick'
);
}

/**
* @return mixed
*/
public function getPluginVersion()
{
return (new WordpressPluginVersion())->get();
}

public function payment_fields()
{
$description = $this->get_description();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
use Transbank\WooCommerce\WebpayRest\Controllers\ResponseController;
use Transbank\WooCommerce\WebpayRest\Controllers\ThankYouPageController;
use Transbank\WooCommerce\WebpayRest\Helpers\ErrorHelper;
use Transbank\WooCommerce\WebpayRest\Telemetry\PluginVersion;
use Transbank\WooCommerce\WebpayRest\Helpers\LogHandler;
use Transbank\WooCommerce\WebpayRest\Helpers\WordpressPluginVersion;
use Transbank\WooCommerce\WebpayRest\PaymentGateways\TransbankRESTPaymentGateway;
use Transbank\WooCommerce\WebpayRest\WebpayplusTransbankSdk;
use Transbank\WooCommerce\WebpayRest\Exceptions\Webpay\CreateWebpayException;
Expand Down Expand Up @@ -78,7 +76,6 @@ public function __construct()

add_action('woocommerce_thankyou', [new ThankYouPageController($this->config), 'show'], 1);
add_action('woocommerce_update_options_payment_gateways_'.$this->id, [$this, 'process_admin_options']);
add_action('woocommerce_update_options_payment_gateways_'.$this->id, [$this, 'registerPluginVersion']);
add_action('woocommerce_api_wc_gateway_'.$this->id, [$this, 'check_ipn_response']);

if (!$this->is_valid_for_use()) {
Expand Down Expand Up @@ -134,23 +131,6 @@ private function processRefundError($order, $exception, $action, $tx, $response)
throw new Exception($messageError);
}

public function registerPluginVersion()
{

$commerceCode = $this->get_option('webpay_rest_commerce_code');

$pluginVersion = $this->getPluginVersion();

(new PluginVersion())->registerVersion(
$commerceCode,
$pluginVersion,
wc()->version,
PluginVersion::ECOMMERCE_WOOCOMMERCE,
$this->get_option('webpay_rest_environment'),
'webpay'
);
}

/**
* Comprueba configuración de moneda (Peso Chileno).
**/
Expand Down Expand Up @@ -271,11 +251,4 @@ public function admin_options()
include_once __DIR__.'/../../views/admin/options-tabs.php';
}

/**
* @return mixed
*/
public function getPluginVersion()
{
return (new WordpressPluginVersion())->get();
}
}
88 changes: 0 additions & 88 deletions plugin/src/Telemetry/PluginVersion.php

This file was deleted.

4 changes: 0 additions & 4 deletions plugin/webpay-rest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,7 @@ function transbank_webpay_rest_on_webpay_rest_plugin_activation()
woocommerce_transbank_rest_init();
if (!class_exists(WC_Gateway_Transbank_Webpay_Plus_REST::class)) {
exit('Se necesita tener WooCommerce instalado y activo para poder activar este plugin');

return;
}
$pluginObject = new WC_Gateway_Transbank_Webpay_Plus_REST();
$pluginObject->registerPluginVersion();
}

function on_transbank_rest_webpay_plugins_loaded()
Expand Down

0 comments on commit 42cedcb

Please sign in to comment.