diff --git a/plugin/css/tbk.css b/plugin/css/tbk.css index e15ed8ce..002ae3f4 100644 --- a/plugin/css/tbk.css +++ b/plugin/css/tbk.css @@ -221,6 +221,8 @@ } .tbk-box { + --tbk-red: #D5006C; + --tbk-red-2: #C00063; background: #fff; border-radius: 10px; padding: 15px; @@ -316,20 +318,35 @@ } .button.tbk-button-primary { - background: #D5006C; - border-color: #D5006C; + background: var(--tbk-red); + border-color: var(--tbk-red); color: white; transition: background-color 0.3s ease; } .button.tbk-button-primary:hover, .button.tbk-button-primary:focus { - background: #C00063; - border-color: #C00063; + background: var(--tbk-red-2); + border-color: var(--tbk-red-2); color: white; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } +.button.tbk-button-secondary { + background: white; + border-color: var(--tbk-red); + color: var(--tbk-red); + transition: background-color 0.3s ease; +} + +.button.tbk-button-secondary:hover, +.button.tbk-button-secondary:focus { + background: white; + border-color: var(--tbk-red-2); + color: var(--tbk-red-2); + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +} + .log-container { width: calc(100vw - 480px); max-height: 600px; diff --git a/plugin/js/admin.js b/plugin/js/admin.js index 14cad5e8..287557d8 100644 --- a/plugin/js/admin.js +++ b/plugin/js/admin.js @@ -113,4 +113,63 @@ jQuery(function($) { notice_id: noticeId }); }); + + function checkPermission(fileToDownload) { + return $.ajax({ + url: ajaxurl, + type: 'POST', + data: { + action: 'check_can_download_file', + file: fileToDownload + } + }).then(function (response) { + return response; + }).catch(function (error) { + return { success: false, data: { + error: error.message || "Error en la solicitud de descarga" + } }; + }); + } + + function showNotice(title, message, type = 'success') { + const notice = $('
') + .addClass(`is-dismissible notice notice-${type}`) + .prepend(`

${title}
${message}

`); + + const dismissButton = $('
diff --git a/plugin/webpay-rest.php b/plugin/webpay-rest.php index dc4aa9e9..0154259d 100644 --- a/plugin/webpay-rest.php +++ b/plugin/webpay-rest.php @@ -11,6 +11,7 @@ use Transbank\WooCommerce\WebpayRest\Blocks\WCGatewayTransbankOneclickBlocks; use Transbank\WooCommerce\WebpayRest\Utils\ConnectionCheck; use Transbank\WooCommerce\WebpayRest\Utils\TableCheck; +use Transbank\Plugin\Helpers\PluginLogger; if (!defined('ABSPATH')) { return; @@ -41,8 +42,9 @@ add_action('wp_loaded', 'woocommerceTransbankInit'); add_action('admin_init', 'on_transbank_rest_webpay_plugins_loaded'); -add_action('wp_ajax_check_connection', ConnectionCheck::class.'::check'); -add_action('wp_ajax_check_exist_tables', TableCheck::class.'::check'); +add_action('wp_ajax_check_connection', ConnectionCheck::class . '::check'); +add_action('wp_ajax_check_exist_tables', TableCheck::class . '::check'); +add_action('wp_ajax_check_can_download_file', PluginLogger::class . '::checkCanDownloadLogFile'); add_action('wp_ajax_get_transaction_status', [new TransactionStatusController(), 'getStatus']); add_action('woocommerce_before_cart', 'transbank_rest_before_cart');