diff --git a/.devcontainer/devcontainer.example.json b/.devcontainer/devcontainer.example.json index cc12bc9..a6309f6 100755 --- a/.devcontainer/devcontainer.example.json +++ b/.devcontainer/devcontainer.example.json @@ -2,14 +2,7 @@ { "name": "PHP", // https: //github.com/devcontainers/images/tree/main/src/php - "image": "mcr.microsoft.com/vscode/devcontainers/php:8.1", - "mounts": [ - { - "source": "/path/to/your/wordpress-stubs", - "target": "/home/vscode/_wordpress", - "type": "bind" - } - ], + "image": "mcr.microsoft.com/vscode/devcontainers/php:7.4", "features": { // https://github.com/devcontainers/features/tree/main/src/node "ghcr.io/devcontainers/features/node:1": { @@ -17,6 +10,13 @@ "nvmVersion": "0.39.3" } }, + "mounts": [ + { + "source": "/home/{yourusername}/wordpress", + "target": "/home/vscode/_wordpress", + "type": "bind" + } + ], "postCreateCommand": "npm install", "customizations": { "vscode": { @@ -24,7 +24,11 @@ "junstyle.php-cs-fixer", "bmewburn.vscode-intelephense-client", "neilbrayfield.php-docblocker", - "dbaeumer.vscode-eslint" + "dbaeumer.vscode-eslint", + "jkiviluoto.tws", + "lacroixdavid1.vscode-format-context-menu", + "Gruntfuggly.todo-tree", + "Natizyskunk.sftp" ], "settings": { "[html]": { @@ -34,7 +38,6 @@ "editor.tabSize": 4 }, "[javascript]": { - "editor.defaultFormatter": "junstyle.php-cs-fixer", "editor.rulers": [ 80, 120 @@ -64,12 +67,8 @@ "html.format.wrapAttributes": "force-expand-multiline", "html.format.wrapAttributesIndentSize": 4, "html.format.wrapLineLength": 120, - "intelephense.completion.maxItems": 10, "intelephense.environment.documentRoot": "src", "intelephense.environment.phpVersion": "8.1", - "intelephense.environment.includePaths": [ - "/home/vscode/wordpress" - ], "intelephense.files.associations": [ "*.php" ], @@ -92,4 +91,4 @@ } } } -} +} \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b706d2b..bd32414 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: uses: mathieudutour/github-tag-action@v6.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: "1.14.0" + custom_tag: "1.14.1" # Generate new release - name: Generate new Release diff --git a/.vscode/.php-cs-fixer.php b/.vscode/.php-cs-fixer.php index e851874..b11a558 100755 --- a/.vscode/.php-cs-fixer.php +++ b/.vscode/.php-cs-fixer.php @@ -98,4 +98,5 @@ )) ->setIndent(' ') ->setLineEnding("\n") - ->setRiskyAllowed(true); + ->setRiskyAllowed(true) +; \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2037a23..5330e1f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.14.1 - 06/12/2024 +* Correção de bug para a função de mostrar logs no pedido. + # 1.14.0 - 05/12/2024 * Adição de compatibilidade com botão para capturar pedido; * Adição de configurações para adicionar logs no pedido; diff --git a/README.txt b/README.txt index 40cd28d..07d1645 100755 --- a/README.txt +++ b/README.txt @@ -4,7 +4,7 @@ Donate link: https://www.linknacional.com.br/wordpress/woocommerce/cielo/ Tags: woocommerce, payment, paymethod, card, credit Requires at least: 5.7 Tested up to: 6.7 -Stable tag: 1.14.0 +Stable tag: 1.14.1 Requires PHP: 7.2 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html @@ -93,6 +93,10 @@ Payment Gateway for Cielo API on WooCommerce plugin is dependent on WooCommerce 7. Debit card front page with payment fields. == Changelog == += 1.14.1 = +**06/12/2024** +* Fix bug on show detailed logs on order. + = 1.14.0 = **05/12/2024** * Add compatibility with button to capture order; diff --git a/includes/LknWCGatewayCieloCredit.php b/includes/LknWCGatewayCieloCredit.php index dc2e02f..de5fcf8 100755 --- a/includes/LknWCGatewayCieloCredit.php +++ b/includes/LknWCGatewayCieloCredit.php @@ -18,7 +18,7 @@ */ // Exit if accessed directly. -if (! defined('ABSPATH')) { +if ( ! defined('ABSPATH')) { exit; } @@ -29,8 +29,7 @@ * * @version 1.0.0 */ -final class LknWCGatewayCieloCredit extends WC_Payment_Gateway -{ +final class LknWCGatewayCieloCredit extends WC_Payment_Gateway { /** * Define instructions to configure and use this plugin. * @@ -61,8 +60,7 @@ final class LknWCGatewayCieloCredit extends WC_Payment_Gateway /** * Constructor for the gateway. */ - public function __construct() - { + public function __construct() { $this->id = 'lkn_cielo_credit'; $this->icon = apply_filters('lkn_wc_cielo_gateway_icon', ''); $this->has_fields = true; @@ -112,16 +110,14 @@ public function __construct() * @param WC_Order $order * @return void */ - public function process_subscription_payment($amount, $order): void - { + public function process_subscription_payment($amount, $order): void { do_action('lkn_wc_cielo_scheduled_subscription_payment', $amount, $order); } /** * Load admin JavaScript for the admin page. */ - public function admin_load_script(): void - { + public function admin_load_script(): void { wp_enqueue_script('lkn-wc-gateway-admin', plugin_dir_url(__FILE__) . '../resources/js/admin/lkn-wc-gateway-admin.js', array('wp-i18n'), $this->version, 'all'); $page = isset($_GET['page']) ? sanitize_text_field(wp_unslash($_GET['page'])) : ''; @@ -142,8 +138,7 @@ public function admin_load_script(): void /** * Load gateway scripts/styles. */ - public function payment_gateway_scripts(): void - { + public function payment_gateway_scripts(): void { // Don't load scripts outside payment page if ( ! is_checkout() @@ -177,8 +172,7 @@ public function payment_gateway_scripts(): void /** * Initialise Gateway Settings Form Fields. */ - public function init_form_fields(): void - { + public function init_form_fields(): void { $this->form_fields = array( 'general' => array( 'title' => esc_attr__('General', 'lkn-wc-gateway-cielo'), @@ -293,13 +287,13 @@ public function init_form_fields(): void ); if ($this->get_option('debug') == 'yes') { - $this->form_fields['show_order_logs'] = array( + $this->form_fields['show_order_logs'] = array( 'title' => __('Visualizar Log no Pedido', 'lkn-wc-gateway-cielo'), 'type' => 'checkbox', 'label' => sprintf('Habilita visualização do log da transação dentro do pedido.', 'lkn-wc-gateway-cielo'), 'default' => 'no', ); - $this->form_fields['clear_order_records'] = array( + $this->form_fields['clear_order_records'] = array( 'title' => __('Limpar logs nos Pedidos', 'lkn-wc-gateway-cielo'), 'type' => 'button', 'id' => 'validateLicense', @@ -309,7 +303,7 @@ public function init_form_fields(): void $customConfigs = apply_filters('lkn_wc_cielo_get_custom_configs', array(), $this->id); - if (! empty($customConfigs)) { + if ( ! empty($customConfigs)) { $this->form_fields = array_merge($this->form_fields, $customConfigs); } } @@ -317,8 +311,7 @@ public function init_form_fields(): void /** * Render the payment fields. */ - public function payment_fields(): void - { + public function payment_fields(): void { $activeInstallment = $this->get_option('installment_payment'); $total_cart = number_format($this->get_order_total(), 2, '.', ''); $noLoginCheckout = isset($_GET['pay_for_order']) ? sanitize_text_field($_GET['pay_for_order']) : 'false'; @@ -484,10 +477,9 @@ class="lkn-cvv" * * @return bool */ - public function validate_fields() - { + public function validate_fields() { $validateCompatMode = $this->get_option('input_validation_compatibility', 'no'); - if (! wp_verify_nonce($_POST['nonce_lkn_cielo_credit'], 'nonce_lkn_cielo_credit')) { + if ( ! wp_verify_nonce($_POST['nonce_lkn_cielo_credit'], 'nonce_lkn_cielo_credit')) { $this->log->log('error', 'Nonce verification failed. Nonce: ' . var_export($_POST['nonce_lkn_cielo_credit'], true), array('source' => 'woocommerce-cielo-credit')); $this->add_notice_once(__('Nonce verification failed, try reloading the page', 'lkn-wc-gateway-cielo'), 'error'); return false; @@ -518,11 +510,10 @@ public function validate_fields() * * @return array */ - public function process_payment($order_id) - { + public function process_payment($order_id) { $nonceInactive = $this->get_option('nonce_compatibility', 'no'); - if (! wp_verify_nonce($_POST['nonce_lkn_cielo_credit'], 'nonce_lkn_cielo_credit') && 'no' === $nonceInactive) { + if ( ! wp_verify_nonce($_POST['nonce_lkn_cielo_credit'], 'nonce_lkn_cielo_credit') && 'no' === $nonceInactive) { $this->log->log('error', 'Nonce verification failed. Nonce: ' . var_export($_POST['nonce_lkn_cielo_credit'], true), array('source' => 'woocommerce-cielo-credit')); $this->add_notice_once(__('Nonce verification failed, try reloading the page', 'lkn-wc-gateway-cielo'), 'error'); throw new Exception(esc_attr(__('Nonce verification failed, try reloading the page', 'lkn-wc-gateway-cielo'))); @@ -703,7 +694,7 @@ public function process_payment($order_id) // Salvar o token e a bandeira do cartão no meta do pedido $user_id = $order->get_user_id(); - if (! isset($responseDecoded->Payment->CreditCard->CardToken)) { + if ( ! isset($responseDecoded->Payment->CreditCard->CardToken)) { $order->add_order_note('O token para cobranças automáticas não foi gerado, então as cobranças automáticas não poderão ser efetuadas.'); } @@ -783,8 +774,7 @@ public function process_payment($order_id) /** * Calculate the total value of items in the WooCommerce cart. */ - public static function lknGetCartTotal() - { + public static function lknGetCartTotal() { $cart = WC()->cart; if (empty($cart)) { @@ -811,8 +801,7 @@ public static function lknGetCartTotal() * * @return bool */ - public function process_refund($order_id, $amount = null, $reason = '') - { + public function process_refund($order_id, $amount = null, $reason = '') { // Do your refund here. Refund $amount for the order with ID $order_id $url = ($this->get_option('env') == 'production') ? 'https://api.cieloecommerce.cielo.com.br/' : 'https://apisandbox.cieloecommerce.cielo.com.br/'; $merchantId = sanitize_text_field($this->get_option('merchant_id')); @@ -856,8 +845,7 @@ public function process_refund($order_id, $amount = null, $reason = '') * * @return bool */ - private function validate_card_number($ccnum, $renderNotice) - { + private function validate_card_number($ccnum, $renderNotice) { if (empty($ccnum)) { if ($renderNotice) { $this->add_notice_once(__('Credit Card number is required!', 'lkn-wc-gateway-cielo'), 'error'); @@ -878,8 +866,7 @@ private function validate_card_number($ccnum, $renderNotice) return true; } - private function validate_card_holder_name($cardName, $renderNotice) - { + private function validate_card_holder_name($cardName, $renderNotice) { if (empty($cardName) || strlen($cardName) < 3) { if ($renderNotice) { $this->add_notice_once(__('Card Holder Name is required!', 'lkn-wc-gateway-cielo'), 'error'); @@ -899,8 +886,7 @@ private function validate_card_holder_name($cardName, $renderNotice) * * @return bool */ - private function validate_exp_date($expDate, $renderNotice) - { + private function validate_exp_date($expDate, $renderNotice) { if (empty($expDate)) { if ($renderNotice) { $this->add_notice_once(__('Expiration date is required!', 'lkn-wc-gateway-cielo'), 'error'); @@ -940,8 +926,7 @@ private function validate_exp_date($expDate, $renderNotice) * * @return bool */ - private function validate_cvv($cvv, $renderNotice) - { + private function validate_cvv($cvv, $renderNotice) { if (empty($cvv)) { if ($renderNotice) { $this->add_notice_once(__('CVV is required!', 'lkn-wc-gateway-cielo'), 'error'); @@ -968,9 +953,8 @@ private function validate_cvv($cvv, $renderNotice) * @param string $message * @param string $type */ - private function add_notice_once($message, $type): void - { - if (! wc_has_notice($message, $type)) { + private function add_notice_once($message, $type): void { + if ( ! wc_has_notice($message, $type)) { wc_add_notice($message, $type); } } @@ -982,8 +966,7 @@ private function add_notice_once($message, $type): void * * @return string|bool */ - private function get_card_provider($cardNumber) - { + private function get_card_provider($cardNumber) { $brand = ''; $brand = apply_filters('lkn_wc_cielo_get_card_brand', $brand, $cardNumber); diff --git a/includes/LknWCGatewayCieloDebit.php b/includes/LknWCGatewayCieloDebit.php index b57b207..1f3de61 100755 --- a/includes/LknWCGatewayCieloDebit.php +++ b/includes/LknWCGatewayCieloDebit.php @@ -2,7 +2,6 @@ namespace Lkn\WCCieloPaymentGateway\Includes; use DateTime; - use Exception; use Lkn\WCCieloPaymentGateway\Includes\LknWcCieloHelper; use WC_Logger; @@ -341,13 +340,13 @@ public function init_form_fields(): void { ); if ( $this->get_option('debug') == 'yes' ) { - $this->form_fields['show_order_logs'] = array( + $this->form_fields['show_order_logs'] = array( 'title' => __('Visualizar Log no Pedido', 'lkn-wc-gateway-cielo'), 'type' => 'checkbox', 'label' => sprintf('Habilita visualização do log da transação dentro do pedido.', 'lkn-wc-gateway-cielo'), 'default' => 'no', ); - $this->form_fields['clear_order_records'] = array( + $this->form_fields['clear_order_records'] = array( 'title' => __('Limpar logs nos Pedidos', 'lkn-wc-gateway-cielo'), 'type' => 'button', 'id' => 'validateLicense', @@ -1246,13 +1245,13 @@ public function process_payment($order_id) { 'body' => json_decode($args['body'], true), // Decodificar como array associativo 'response' => json_decode(json_encode($responseDecoded), true) // Certificar que responseDecoded é um array associativo ); - + // Censurar o número do cartão de crédito $orderLogsArray['body']['Payment']['CreditCard']['CardNumber'] = substr($orderLogsArray['body']['Payment']['CreditCard']['CardNumber'], 0, 6) . '******' . substr($orderLogsArray['body']['Payment']['CreditCard']['CardNumber'], -4); - + // Remover a parte de "Links" unset($orderLogsArray['response']['Payment']['Links']); - + $orderLogs = json_encode($orderLogsArray); $order->update_meta_data('lknWcCieloOrderLogs', $orderLogs); } diff --git a/includes/LknWCGatewayCieloEndpoint.php b/includes/LknWCGatewayCieloEndpoint.php index 4c3c8c7..0a691c7 100755 --- a/includes/LknWCGatewayCieloEndpoint.php +++ b/includes/LknWCGatewayCieloEndpoint.php @@ -72,20 +72,19 @@ public function orderCapture($request) { } public function clearOrderLogs($request) { - $args = array( 'limit' => -1, // Sem limite, pega todas as ordens 'meta_key' => 'lknWcCieloOrderLogs', // Meta key específica 'meta_compare' => 'EXISTS', // Verifica se a meta key existe ); - + $orders = wc_get_orders($args); foreach ($orders as $order) { $order->delete_meta_data('lknWcCieloOrderLogs'); $order->save(); } - + return new WP_REST_Response($orders, 200); } } \ No newline at end of file diff --git a/includes/LknWcCieloCreditBlocks.php b/includes/LknWcCieloCreditBlocks.php index f06b8b1..9c8556f 100755 --- a/includes/LknWcCieloCreditBlocks.php +++ b/includes/LknWcCieloCreditBlocks.php @@ -5,24 +5,20 @@ use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType; use Lkn\WCCieloPaymentGateway\Includes\LknWCGatewayCieloCredit; -final class LknWcCieloCreditBlocks extends AbstractPaymentMethodType -{ +final class LknWcCieloCreditBlocks extends AbstractPaymentMethodType { private $gateway; protected $name = 'lkn_cielo_credit'; - public function initialize(): void - { + public function initialize(): void { $this->settings = get_option('woocommerce_lkn_cielo_credit_settings', array()); $this->gateway = new LknWCGatewayCieloCredit(); } - public function is_active() - { + public function is_active() { return $this->gateway->is_available(); } - public function get_payment_method_script_handles() - { + public function get_payment_method_script_handles() { wp_register_script( 'lkn_cielo_credit-blocks-integration', plugin_dir_url(__FILE__) . '../resources/js/creditCard/lknCieloCredit.js', @@ -44,18 +40,17 @@ public function get_payment_method_script_handles() return array('lkn_cielo_credit-blocks-integration'); } - public function get_payment_method_data() - { + public function get_payment_method_data() { $installmentLimit = $this->gateway->get_option('installment_limit', 12); $installments = array(); $installmentLimit = apply_filters('lkn_wc_cielo_set_installment_limit', $installmentLimit, $this->gateway); for ($i = 1; $i <= 12; $i++) { - $installments[] = [ - 'index' => (string)$i, + $installments[] = array( + 'index' => (string) $i, 'label' => "teste $i" - ]; + ); } /** * @param $installments array diff --git a/includes/LknWcCieloDebitBlocks.php b/includes/LknWcCieloDebitBlocks.php index ddd355d..cddb7a3 100755 --- a/includes/LknWcCieloDebitBlocks.php +++ b/includes/LknWcCieloDebitBlocks.php @@ -42,7 +42,7 @@ public function get_payment_method_script_handles() { private function get_client_ip() { $ip_address = ''; - + if ( ! empty($_SERVER['HTTP_CLIENT_IP'])) { $ip_address = $_SERVER['HTTP_CLIENT_IP']; } elseif ( ! empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { @@ -54,7 +54,7 @@ private function get_client_ip() { } else { $ip_address = $_SERVER['REMOTE_ADDR']; } - + return $ip_address; } @@ -67,7 +67,7 @@ public function get_payment_method_data() { $installmentLimit = $this->gateway->get_option('installment_limit', 12); $installments = array(); - + $installmentLimit = apply_filters('lkn_wc_cielo_set_installment_limit', $installmentLimit, $this->gateway); $installments = apply_filters('lkn_wc_cielo_set_installments', $installments, $this->gateway); diff --git a/includes/LknWcCieloHelper.php b/includes/LknWcCieloHelper.php index dade6d2..c09629c 100755 --- a/includes/LknWcCieloHelper.php +++ b/includes/LknWcCieloHelper.php @@ -1,89 +1,87 @@ get_meta('lknWcCieloOrderLogs'); - $payment_method_id = $order->get_payment_method(); - $options = get_option('woocommerce_'.$payment_method_id.'_settings'); - if($orderLogs && $options['show_order_logs'] === 'yes') { - //carregar css - wp_enqueue_style( 'lkn-wc-cielo-order-logs', plugin_dir_url( __FILE__ ) . '../resources/css/frontend/lkn-admin-order-logs.css', array(), LKN_WC_CIELO_VERSION, 'all' ); - - $screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled() - ? wc_get_page_screen_id( 'shop-order' ) - : 'shop_order'; - - add_meta_box( - 'showOrderLogs', - 'Logs das transações', - [$this, 'showLogsContent'], - $screen, - 'advanced', - ); + + if ($order && $order instanceof WC_Order) { + $orderLogs = $order->get_meta('lknWcCieloOrderLogs'); + $payment_method_id = $order->get_payment_method(); + $options = get_option('woocommerce_' . $payment_method_id . '_settings'); + if ($orderLogs && 'yes' === $options['show_order_logs']) { + //carregar css + wp_enqueue_style( 'lkn-wc-cielo-order-logs', plugin_dir_url( __FILE__ ) . '../resources/css/frontend/lkn-admin-order-logs.css', array(), LKN_WC_CIELO_VERSION, 'all' ); + + $screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' ) && wc_get_container()->get( 'Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' )->custom_orders_table_usage_is_enabled() + ? wc_get_page_screen_id( 'shop-order' ) + : 'shop_order'; + + add_meta_box( + 'showOrderLogs', + 'Logs das transações', + array($this, 'showLogsContent'), + $screen, + 'advanced', + ); + } } } - + // Metabox content - public function showLogsContent( $object ) { + public function showLogsContent( $object ): void { // Obter o objeto WC_Order $order = is_a( $object, 'WP_Post' ) ? wc_get_order( $object->ID ) : $object; $orderLogs = $order->get_meta('lknWcCieloOrderLogs'); - + // Decodificar o JSON armazenado $decodedLogs = json_decode($orderLogs, true); - + if ($decodedLogs && is_array($decodedLogs)) { // Preparar cada seção para exibição com formatação $url = $decodedLogs['url'] ?? 'N/A'; $headers = isset($decodedLogs['headers']) ? json_encode($decodedLogs['headers'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 'N/A'; $body = isset($decodedLogs['body']) ? json_encode($decodedLogs['body'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 'N/A'; $response = isset($decodedLogs['response']) ? json_encode($decodedLogs['response'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 'N/A'; - + // Exibir as seções formatadas ?> -
-
-

URL:

-
-
- -

Headers:

-
- -

Body:

-
- -

Response:

-
-
- +
+

URL:

+
+
+ +

Headers:

+
+ +

Body:

+
+ +

Response:

+
+ += $length) { // Se o número de caracteres a censurar for maior ou igual ao comprimento total, censura tudo return str_repeat('*', $length); } - + $startLength = floor(($length - $censorLength) / 2); // Dividir o restante igualmente entre início e fim $endLength = $length - $startLength - $censorLength; // O que sobra para o final - + $start = substr($string, 0, $startLength); $end = substr($string, -$endLength); - + $censored = str_repeat('*', $censorLength); return $start . $censored . $end; } - } \ No newline at end of file diff --git a/lkn-wc-gateway-cielo.php b/lkn-wc-gateway-cielo.php index 42ccca1..802e11e 100755 --- a/lkn-wc-gateway-cielo.php +++ b/lkn-wc-gateway-cielo.php @@ -3,7 +3,7 @@ * Plugin Name: Payment Gateway for Cielo API on WooCommerce * Plugin URI: https://www.linknacional.com.br/wordpress/woocommerce/cielo/ * Description: Adds the Cielo API 3.0 Payments gateway to your WooCommerce website. - * Version: 1.14.0 + * Version: 1.14.1 * Author: Link Nacional * Author URI: https://linknacional.com.br * Text Domain: lkn-wc-gateway-cielo @@ -103,7 +103,7 @@ public static function init(): void { add_action('woocommerce_order_details_after_order_table', array(__CLASS__, 'order_details_after_order_table'), 10, 1); add_action('rest_api_init', array(new LknWCGatewayCieloEndpoint(), 'registerOrderCaptureEndPoint')); - + add_action('add_meta_boxes', array(new LknWcCieloHelper(), 'showOrderLogs')); } @@ -311,7 +311,7 @@ public static function email_order_meta_fields($fields, $sent_to_admin, $order) private static function setup_constants(): void { // Defines addon version number for easy reference. if ( ! defined('LKN_WC_CIELO_VERSION')) { - define('LKN_WC_CIELO_VERSION', '1.14.0'); + define('LKN_WC_CIELO_VERSION', '1.14.1'); } if ( ! defined('LKN_WC_CIELO_TRANSLATION_PATH')) { define('LKN_WC_CIELO_TRANSLATION_PATH', plugin_dir_path(__FILE__) . 'languages/');