From ad0b3af4f8f417481f95fa8b2acab38ae3797e6e Mon Sep 17 00:00:00 2001 From: RicardoSaldarriagaPayco Date: Tue, 24 Sep 2024 15:49:03 -0500 Subject: [PATCH 1/6] fix:Se ajusta renombre del modulo para cargar las traducciones --- README.md | 1 - assets/images/paymentLogo.svg | 591 ++++++++++++++-------------- classes/class-wc-gateway-epayco.php | 502 +++++++++++------------ readme.txt | 15 +- woocommerce-gateway-payco.php | 146 +++---- 5 files changed, 603 insertions(+), 652 deletions(-) mode change 100755 => 100644 readme.txt diff --git a/README.md b/README.md index 34ada8a..c4d9348 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ ** Se recomienda emplear la última versión disponible. ** ## Versiones -* [epayco plugin WooCommerce v8.1.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.0). * [epayco plugin WooCommerce v8.0.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.3). * [epayco plugin WooCommerce v8.0.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.2). * [epayco plugin WooCommerce v8.0.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.1). diff --git a/assets/images/paymentLogo.svg b/assets/images/paymentLogo.svg index 1e60a8a..98e84d9 100644 --- a/assets/images/paymentLogo.svg +++ b/assets/images/paymentLogo.svg @@ -1,297 +1,294 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/classes/class-wc-gateway-epayco.php b/classes/class-wc-gateway-epayco.php index a6a337d..d9288bd 100644 --- a/classes/class-wc-gateway-epayco.php +++ b/classes/class-wc-gateway-epayco.php @@ -15,10 +15,10 @@ class WC_Gateway_Epayco extends WC_Payment_Gateway { public function __construct() { $this->id = 'epayco'; - $this->version = '8.1.0'; + $this->version = '8.1.1'; $this->icon = apply_filters( 'woocommerce_' . $this->id . '_icon', EPAYCO_PLUGIN_URL . 'assets/images/paymentLogo.svg' ); - $this->method_title = __( 'ePayco Checkout Gateway', 'epayco-woocommerce' ); - $this->method_description = __( 'Acepta tarjetas de credito, depositos y transferencias.', 'epayco-woocommerce' ); + $this->method_title = __( 'ePayco Checkout Gateway', 'woo-epayco-gateway' ); + $this->method_description = __( 'Acepta tarjetas de credito, depositos y transferencias.', 'woo-epayco-gateway' ); //$this->order_button_text = __('Pay', 'epayco_woocommerce'); $this->has_fields = false; $this->supports = array( @@ -103,22 +103,22 @@ public function admin_options() {
-

+

ePayco
- - . -
+ + . +
is_valid_for_use() ) : ?> @@ -129,7 +129,7 @@ public function admin_options() { ?> - + @@ -138,7 +138,7 @@ public function admin_options() {

- +


@@ -150,8 +150,8 @@ public function admin_options() {
-

-

del comercio son inválidas.
Consúltelas en el apartado de integraciones
Llaves API en su Dashboard ePayco.', 'epayco-woocommerce' );?>

+

+

del comercio son inválidas.
Consúltelas en el apartado de integraciones
Llaves API en su Dashboard ePayco.', 'woo-epayco-gateway' );?>

@@ -177,11 +177,11 @@ public function admin_options() {
-

:

@@ -199,129 +199,129 @@ public function admin_options() { function init_form_fields() { $this->form_fields = array( 'enabled' => array( - 'title' => __( 'Habilitar/Deshabilitar', 'epayco-woocommerce' ), + 'title' => __( 'Habilitar/Deshabilitar', 'woo-epayco-gateway' ), 'type' => 'checkbox', - 'label' => __( 'Habilitar ePayco', 'epayco-woocommerce' ), + 'label' => __( 'Habilitar ePayco', 'woo-epayco-gateway' ), 'default' => 'yes', ), 'title' => array( - 'title' => __( 'Título', 'epayco-woocommerce' ), + 'title' => __( 'Título', 'woo-epayco-gateway' ), 'type' => 'text', - 'description' => __( 'Corresponde al título que el usuario ve durante el Checkout.', 'epayco-woocommerce' ), - 'default' => __( 'Checkout ePayco (Tarjetas de crédito,debito,efectivo)', 'epayco-woocommerce' ), + 'description' => __( 'Corresponde al título que el usuario ve durante el Checkout.', 'woo-epayco-gateway' ), + 'default' => __( 'Checkout ePayco (Tarjetas de crédito,debito,efectivo)', 'woo-epayco-gateway' ), 'desc_tip' => true, ), 'description' => array( - 'title' => __( 'Descripción', 'epayco-woocommerce' ), + 'title' => __( 'Descripción', 'woo-epayco-gateway' ), 'type' => 'textarea', - 'description' => __( 'Corresponde a la descripción que verá el usuario durante el Checkout', 'epayco-woocommerce' ), - 'default' => __( 'ePayco: Paga con Tarjeta de crédito/débito nacional e internacional, PSE, Daviplata, Nequi, Paypal, Efectivo, Safetypay y muchos más.', 'epayco-woocommerce' ), + 'description' => __( 'Corresponde a la descripción que verá el usuario durante el Checkout', 'woo-epayco-gateway' ), + 'default' => __( 'Checkout ePayco (Tarjetas de crédito,débito,efectivo)', 'woo-epayco-gateway' ), ), 'epayco_customerid' => array( - 'title' => __( 'P_CUST_ID_CLIENTE', 'epayco-woocommerce' ), + 'title' => __( 'P_CUST_ID_CLIENTE', 'woo-epayco-gateway' ), 'type' => 'text', - 'description' => __( 'ID de cliente que lo identifica en ePayco. Lo puede encontrar en su panel de clientes en la opción configuración', 'epayco-woocommerce' ), + 'description' => __( 'ID de cliente que lo identifica en ePayco. Lo puede encontrar en su panel de clientes en la opción configuración', 'woo-epayco-gateway' ), 'default' => '', //'desc_tip' => true, 'placeholder' => '', ), 'epayco_secretkey' => array( - 'title' => __( 'P_KEY', 'epayco-woocommerce' ), + 'title' => __( 'P_KEY', 'woo-epayco-gateway' ), 'type' => 'text', - 'description' => __( 'LLave para firmar la información enviada y recibida de ePayco. Lo puede encontrar en su panel de clientes en la opción configuración', 'epayco-woocommerce' ), + 'description' => __( 'LLave para firmar la información enviada y recibida de ePayco. Lo puede encontrar en su panel de clientes en la opción configuración', 'woo-epayco-gateway' ), 'default' => '', //'desc_tip' => true, 'placeholder' => '', ), 'epayco_publickey' => array( - 'title' => __( 'PUBLIC_KEY', 'epayco-woocommerce' ), + 'title' => __( 'PUBLIC_KEY', 'woo-epayco-gateway' ), 'type' => 'text', - 'description' => __( 'LLave para autenticar y consumir los servicios de ePayco, Proporcionado en su panel de clientes en la opción configuración', 'epayco-woocommerce' ), + 'description' => __( 'LLave para autenticar y consumir los servicios de ePayco, Proporcionado en su panel de clientes en la opción configuración', 'woo-epayco-gateway' ), 'default' => '', //'desc_tip' => true, 'placeholder' => '', ), 'epayco_privatekey' => array( - 'title' => __( 'PRIVATE_KEY', 'epayco-woocommerce' ), + 'title' => __( 'PRIVATE_KEY', 'woo-epayco-gateway' ), 'type' => 'text', - 'description' => __( 'LLave para autenticar y consumir los servicios de ePayco, Proporcionado en su panel de clientes en la opción configuración', 'epayco-woocommerce' ), + 'description' => __( 'LLave para autenticar y consumir los servicios de ePayco, Proporcionado en su panel de clientes en la opción configuración', 'woo-epayco-gateway' ), 'default' => '', //'desc_tip' => true, 'placeholder' => '', ), 'epayco_testmode' => array( - 'title' => __( 'Sitio en pruebas', 'epayco-woocommerce' ), + 'title' => __( 'Sitio en pruebas', 'woo-epayco-gateway' ), 'type' => 'checkbox', - 'label' => __('Habilitar el modo de pruebas', 'epayco-woocommerce'), - 'description' => __( 'Habilite para realizar pruebas', 'epayco-woocommerce' ), + 'label' => __('Habilitar el modo de pruebas', 'woo-epayco-gateway'), + 'description' => __( 'Habilite para realizar pruebas', 'woo-epayco-gateway' ), 'default' => 'no', ), 'epayco_type_checkout' => array( - 'title' => __( 'Tipo Checkout', 'epayco-woocommerce' ), + 'title' => __( 'Tipo Checkout', 'woo-epayco-gateway' ), 'type' => 'select', 'css' =>'line-height: inherit', - 'label' => __('Seleccione un tipo de Checkout:', 'epayco-woocommerce'), - 'description' => __( '(Onpage Checkout, el usuario al pagar permanece en el sitio) ó (Standard Checkout, el usario al pagar es redireccionado a la pasarela de ePayco)', 'epayco-woocommerce' ), + 'label' => __('Seleccione un tipo de Checkout:', 'woo-epayco-gateway'), + 'description' => __( '(Onpage Checkout, el usuario al pagar permanece en el sitio) ó (Standard Checkout, el usario al pagar es redireccionado a la pasarela de ePayco)', 'woo-epayco-gateway' ), 'options' => array('false'=>"Onpage Checkout","true"=>"Standard Checkout"), ), 'epayco_endorder_state' => array( - 'title' => __( 'Estado Final del Pedido', 'epayco-woocommerce' ), + 'title' => __( 'Estado Final del Pedido', 'woo-epayco-gateway' ), 'type' => 'select', 'css' =>'line-height: inherit', - 'description' => __( 'Seleccione el estado del pedido que se aplicará a la hora de aceptar y confirmar el pago de la orden', 'epayco-woocommerce' ), + 'description' => __( 'Seleccione el estado del pedido que se aplicará a la hora de aceptar y confirmar el pago de la orden', 'woo-epayco-gateway' ), 'options' => array( - 'epayco-processing'=> __( 'ePayco Procesando Pago', 'epayco-woocommerce' ), - "epayco-completed"=> __( 'ePayco Pago Completado', 'epayco-woocommerce' ), - 'processing'=> __( 'Procesando', 'epayco-woocommerce' ), - "completed"=> __( 'Completado', 'epayco-woocommerce' ) + 'epayco-processing'=> __( 'ePayco Procesando Pago', 'woo-epayco-gateway' ), + "epayco-completed"=> __( 'ePayco Pago Completado', 'woo-epayco-gateway' ), + 'processing'=> __( 'Procesando', 'woo-epayco-gateway' ), + "completed"=> __( 'Completado', 'woo-epayco-gateway' ) ), ), 'epayco_cancelled_endorder_state' => array( - 'title' => __( 'Estado Cancelado del Pedido', 'epayco-woocommerce' ), + 'title' => __( 'Estado Cancelado del Pedido', 'woo-epayco-gateway' ), 'type' => 'select', 'css' =>'line-height: inherit', - 'description' => __( 'Seleccione el estado del pedido que se aplicará cuando la transacciónes Cancelada o Rechazada', 'epayco-woocommerce' ), + 'description' => __( 'Seleccione el estado del pedido que se aplicará cuando la transacciónes Cancelada o Rechazada', 'woo-epayco-gateway' ), 'options' => array( - 'epayco-cancelled'=> __( 'ePayco Pago Cancelado', 'epayco-woocommerce' ), - "epayco-failed"=> __( 'ePayco Pago Fallido', 'epayco-woocommerce' ), - 'cancelled'=> __( 'Cancelado', 'epayco-woocommerce' ), - "failed"=> __( 'Fallido', 'epayco-woocommerce' ) + 'epayco-cancelled'=> __( 'ePayco Pago Cancelado', 'woo-epayco-gateway' ), + "epayco-failed"=> __( 'ePayco Pago Fallido', 'woo-epayco-gateway' ), + 'cancelled'=> __( 'Cancelado', 'woo-epayco-gateway' ), + "failed"=> __( 'Fallido', 'woo-epayco-gateway' ) ), ), 'epayco_url_response' => array( - 'title' => __( 'Página de Respuesta', 'epayco-woocommerce' ), + 'title' => __( 'Página de Respuesta', 'woo-epayco-gateway' ), 'type' => 'select', 'css' =>'line-height: inherit', - 'description' => __( 'Url de la tienda donde se redirecciona al usuario luego de pagar el pedido', 'epayco-woocommerce' ), - 'options' => $this->get_pages(__('Seleccionar pagina', 'epayco-woocommerce')), + 'description' => __( 'Url de la tienda donde se redirecciona al usuario luego de pagar el pedido', 'woo-epayco-gateway' ), + 'options' => $this->get_pages(__('Seleccionar pagina', 'woo-epayco-gateway')), ), 'epayco_url_confirmation' => array( - 'title' => __( 'Página de Confirmación', 'epayco-woocommerce' ), + 'title' => __( 'Página de Confirmación', 'woo-epayco-gateway' ), 'type' => 'select', 'css' =>'line-height: inherit', - 'description' => __( 'Url de la tienda donde ePayco confirma el pago', 'epayco-woocommerce' ), - 'options' => $this->get_pages(__('Seleccionar pagina', 'epayco-woocommerce')), + 'description' => __( 'Url de la tienda donde ePayco confirma el pago', 'woo-epayco-gateway' ), + 'options' => $this->get_pages(__('Seleccionar pagina', 'woo-epayco-gateway')), ), 'epayco_reduce_stock_pending' => array( - 'title' => __( 'Reducir el stock en transacciones pendientes', 'epayco-woocommerce' ), + 'title' => __( 'Reducir el stock en transacciones pendientes', 'woo-epayco-gateway' ), 'type' => 'checkbox', 'css' =>'line-height: inherit', 'default' => 'yes', - 'description' => sprintf( __( 'Habilite para reducir el stock en transacciones pendientes', 'epayco-woocommerce' ) ), + 'description' => sprintf( __( 'Habilite para reducir el stock en transacciones pendientes', 'woo-epayco-gateway' ) ), ), 'epayco_lang' => array( - 'title' => __( 'Idioma del Checkout', 'epayco-woocommerce' ), + 'title' => __( 'Idioma del Checkout', 'woo-epayco-gateway' ), 'type' => 'select', 'css' =>'line-height: inherit', - 'description' => __( 'Seleccione el idioma del checkout', 'epayco-woocommerce' ), + 'description' => __( 'Seleccione el idioma del checkout', 'woo-epayco-gateway' ), 'default' => 'es', 'options' => array(), ), 'response_data' => array( - 'title' => __( 'Habilitar envió de atributos a través de la URL de respuesta', 'epayco-woocommerce' ), + 'title' => __( 'Habilitar envió de atributos a través de la URL de respuesta', 'woo-epayco-gateway' ), 'type' => 'checkbox', - 'label' => __('Habilitar el modo redirección con data', 'epayco-woocommerce'), - 'description' => __( 'Al habilitar esta opción puede exponer información sensible de sus clientes, el uso de esta opción es bajo su responsabilidad, conozca esta información en el siguiente link.', 'epayco-woocommerce' ), + 'label' => __('Habilitar el modo redirección con data', 'woo-epayco-gateway'), + 'description' => __( 'Al habilitar esta opción puede exponer información sensible de sus clientes, el uso de esta opción es bajo su responsabilidad, conozca esta información en el siguiente link.', 'woo-epayco-gateway' ), 'default' => 'no', ), /*'monto_maximo' => array( @@ -371,209 +371,183 @@ function get_pages($title = false, $indent = true) { */ function generate_epayco_form( $order_id ) { global $woocommerce; - $order = new WC_Order($order_id); - $descripcionParts = array(); - $receiversData = []; - foreach ($order->get_items() as $product) { - $clearData = str_replace('_', ' ', $this->string_sanitize($product['name'])); - $descripcionParts[] = $clearData; - } - - $descripcion = implode(' - ', $descripcionParts); - $currency = strtolower(get_woocommerce_currency()); - $testMode = $this->epayco_testmode == "yes" ? "true" : "false"; - $basedCountry = WC()->countries->get_base_country(); - $external=$this->epayco_type_checkout; - $redirect_url =get_site_url() . "/"; - $confirm_url=get_site_url() . "/"; - $redirect_url = add_query_arg( 'wc-api', get_class( $this ), $redirect_url ); - $redirect_url = add_query_arg( 'order_id', $order_id, $redirect_url ); - - if ($this->get_option('epayco_url_confirmation' ) == 0) { - $confirm_url = add_query_arg( 'wc-api', get_class( $this ), $confirm_url ); - $confirm_url = add_query_arg( 'order_id', $order_id, $confirm_url ); - $confirm_url = $redirect_url.'&confirmation=1'; - } else { - $confirm_url = get_permalink($this->get_option('epayco_url_confirmation')); - } + $order = new WC_Order($order_id); + $descripcionParts = array(); + $iva=0; + $ico=0; + $base_tax=$order->get_subtotal()-$order->get_total_discount(); + foreach($order->get_items('tax') as $item_id => $item ) { + if( strtolower( $item->get_label() ) == 'iva' ){ + $iva += round($item->get_tax_total(),2); + } + if( strtolower( $item->get_label() ) == 'ico'){ + $ico += round($item->get_tax_total(),2); + } + } - $name_billing=$order->get_billing_first_name().' '.$order->get_billing_last_name(); - $address_billing=$order->get_billing_address_1(); - $phone_billing=@$order->billing_phone; - $email_billing=@$order->billing_email; + foreach ($order->get_items() as $product) { + $clearData = str_replace('_', ' ', $this->string_sanitize($product['name'])); + $descripcionParts[] = $clearData; + } - $tax=$order->get_total_tax(); - $tax=round($tax,2); - if((int)$tax>0){ - $base_tax=$order->get_total()-$tax; - }else{ - $base_tax=$order->get_total(); - $tax=0; - } - $myIp=$this->getCustomerIp(); - //Busca si ya se restauro el stock - if (!EpaycoOrder::ifExist($order_id)) { - //si no se restauro el stock restaurarlo inmediatamente - EpaycoOrder::create($order_id,1); - //$this->restore_order_stock($order->get_id(),"decrease"); - } - $force_redirect = $this->force_redirect == "yes" ? "true" : "false"; + $descripcion = implode(' - ', $descripcionParts); + $currency = strtolower(get_woocommerce_currency()); + $testMode = $this->epayco_testmode == "yes" ? "true" : "false"; + $basedCountry = WC()->countries->get_base_country(); + $external=$this->epayco_type_checkout; + $redirect_url =get_site_url() . "/"; + $redirect_url = add_query_arg( 'wc-api', get_class( $this ), $redirect_url ); + $redirect_url = add_query_arg( 'order_id', $order_id, $redirect_url ); + $myIp=$this->getCustomerIp(); + $lang = $this->epayco_lang == 1 ? "es" : "en"; + if ($this->get_option('epayco_url_confirmation' ) == 0) { + $confirm_url = $redirect_url.'&confirmation=1'; + } else { + $confirm_url = get_permalink($this->get_option('epayco_url_confirmation')); + } - if ($this->epayco_lang !== "es") { - $msgEpaycoCheckout = 'Loading payment methods -
If they do not load automatically, click on the "Pay with ePayco" button'; - $epaycoButtonImage = plugin_dir_url(__FILE__).'lib/Boton-color-Ingles.png'; - }else{ - $msgEpaycoCheckout = 'Cargando métodos de pago -
Si no se cargan automáticamente, de clic en el botón "Pagar con ePayco'; - $epaycoButtonImage = plugin_dir_url(__FILE__).'lib/Boton-color-espanol.png'; - } + $name_billing=$order->get_billing_first_name().' '.$order->get_billing_last_name(); + $address_billing=$order->get_billing_address_1(); + $phone_billing=@$order->billing_phone; + $email_billing=@$order->billing_email; - echo sprintf(' -
-
-
-

- '.$msgEpaycoCheckout.' -

- - -
- - - -
- - + -
-
- ', trim($this->epayco_publickey), - $testMode, - $descripcion, - $descripcion, - $order->get_id(), - $currency, - $order->get_total(), - $base_tax, - $tax, - $basedCountry, - $this->epayco_lang, - $external, - $confirm_url, - $redirect_url, - $name_billing, - $address_billing, - $email_billing, - $phone_billing, - $myIp, - $testMode, - trim($this->epayco_publickey), - trim($this->epayco_privatekey) - ); + }) + .catch(error => { + error.message; + }); + } + var openChekout = function () { + //handler.open(data); + bntPagar.style.pointerEvents = "none"; + openNewChekout() + } + bntPagar.addEventListener("click", openChekout); + openChekout() + + + + ', trim($this->epayco_publickey), + $testMode, + $descripcion, + $descripcion, + $order->get_id(), + $currency, + $order->get_total(), + $base_tax, + $iva, + $ico, + $basedCountry, + $lang, + $external, + $confirm_url, + $redirect_url, + $name_billing, + $address_billing, + $email_billing, + $phone_billing, + $myIp, + $testMode, + trim($this->epayco_publickey), + trim($this->epayco_privatekey) + ); + wp_enqueue_script('epayco', 'https://epayco-checkout-testing.s3.amazonaws.com/checkout.preprod.js', array(), $this->version, null); + wc_enqueue_js(' + jQuery("#btn_epayco_new").click(function(){ + console.log("epayco") + }); + ' + ); + return '
+
'; } /** * Process the payment and return the result @@ -599,8 +573,8 @@ function receipt_page( $order_id ) {

- ' . esc_html__( 'Cargando métodos de pago', 'epayco-woocommerce' ) . ' -
+ ' . esc_html__( 'Cargando métodos de pago', 'woo-epayco-gateway' ) . ' +
' . esc_html__( '', 'woo-epayco-gateway' ) . '

'; if ($this->epayco_lang === "2") { @@ -706,7 +680,7 @@ function successful_request($validationData) } - $url = 'https://secure.epayco.co/validation/v1/reference/'.$ref_payco; + $url = 'https://secure.epayco.io/validation/v1/reference/'.$ref_payco; $response = wp_remote_get( $url ); $body = wp_remote_retrieve_body( $response ); $jsonData = @json_decode($body, true); @@ -917,12 +891,12 @@ function successful_request($validationData) } echo "2"; if(!$isConfirmation){ - //$woocommerce->cart->empty_cart(); + $woocommerce->cart->empty_cart(); foreach ($order->get_items() as $item) { // Get an instance of corresponding the WC_Product object $product_id = $item->get_product()->id; $qty = $item->get_quantity(); // Get the item quantity - //WC()->cart->add_to_cart( $product_id ,(int)$qty); + WC()->cart->add_to_cart( $product_id ,(int)$qty); } wp_safe_redirect( wc_get_checkout_url() ); exit(); @@ -1126,7 +1100,7 @@ function ePayco_successful_validation($validationData) { $username = sanitize_text_field($validationData['epayco_publickey']); $password = sanitize_text_field($validationData['epayco_privatey']); - $response = wp_remote_post( 'https://apify.epayco.co/login', array( + $response = wp_remote_post( 'https://apify.epayco.io/login', array( 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( $username . ':' . $password ), ), diff --git a/readme.txt b/readme.txt old mode 100755 new mode 100644 index ba53cc1..234a6d6 --- a/readme.txt +++ b/readme.txt @@ -1,11 +1,11 @@ === ePayco plugin for WooCommerce === Contributors: ePayco Team Donate link: https://epayco.com/ -Tags: e-commerce, commerce, wordpress ecommerce, store, epayco -Requires at least: 8.8.5 -Tested up to: 6.7 -Stable tag: 6.7 -Requires PHP: 7.4 +Tags: e-commerce, commerce, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, epayco +Requires at least: 5.5 +Tested up to: 6.4 +Stable tag: 7.0.0 +Requires PHP: 5.6.0 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -45,11 +45,8 @@ Yes. But it is advisable that you consider using it since it is revealing for br == Changelog == -= 6.7.0 = += 6.0.0 = * Initial stable release -= 8.1.0 = -* upload release - == Additional Info == **Contribute** [repository on github](https://github.com/epayco/Plugin_ePayco_WooCommerce) \ No newline at end of file diff --git a/woocommerce-gateway-payco.php b/woocommerce-gateway-payco.php index 9822585..2991282 100644 --- a/woocommerce-gateway-payco.php +++ b/woocommerce-gateway-payco.php @@ -6,13 +6,13 @@ * * Plugin Name: WooCommerce Epayco Gateway * Description: Plugin ePayco Gateway for WooCommerce. - * Version: 8.1 + * Version: 8.0.3 * Author: ePayco * Author URI: http://epayco.co * Tested up to: 6.4 * WC requires at least: 7.4 * WC tested up to: 8.3 - * Text Domain: epayco-woocommerce + * Text Domain: woo-epayco-gateway * Domain Path: /i18n/languages/ * License: GNU General Public License v3.0 * License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -67,7 +67,7 @@ function woocommerce_gateway_epayco_init() { /** * Localisation */ - load_plugin_textdomain( 'epayco-woocommerce', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); + load_plugin_textdomain( 'woo-epayco-gateway', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' ); /** @@ -126,7 +126,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Fallido (%s)' + 'label_count' => _n_noop( 'ePayco Pago Fallido (%s)', 'ePayco Pago Fallido (%s)' ) )); register_post_status( 'wc-epayco_failed', array( @@ -135,7 +135,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Fallido Prueba (%s)' + 'label_count' => _n_noop( 'ePayco Pago Fallido Prueba (%s)', 'ePayco Pago Fallido Prueba (%s)' ) )); register_post_status( 'wc-epayco-cancelled', array( @@ -144,7 +144,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Cancelado (%s)' + 'label_count' => _n_noop( 'ePayco Pago Cancelado (%s)', 'ePayco Pago Cancelado (%s)' ) )); register_post_status( 'wc-epayco_cancelled', array( @@ -153,7 +153,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Cancelado Prueba (%s)' + 'label_count' => _n_noop( 'ePayco Pago Cancelado Prueba (%s)', 'ePayco Pago Cancelado Prueba (%s)' ) )); register_post_status( 'wc-epayco-on-hold', array( @@ -162,7 +162,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Pendiente (%s)' + 'label_count' => _n_noop( 'ePayco Pago Pendiente (%s)', 'ePayco Pago Pendiente (%s)' ) )); register_post_status( 'wc-epayco_on_hold', array( @@ -171,7 +171,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Pendiente Prueba (%s)' + 'label_count' => _n_noop( 'ePayco Pago Pendiente Prueba (%s)', 'ePayco Pago Pendiente Prueba (%s)' ) )); register_post_status( 'wc-epayco-processing', array( @@ -180,7 +180,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Procesando Pago (%s)' + 'label_count' => _n_noop( 'ePayco Procesando Pago (%s)', 'ePayco Procesando Pago (%s)' ) )); register_post_status( 'wc-epayco_processing', array( @@ -189,7 +189,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Procesando Pago Prueba(%s)' + 'label_count' => _n_noop( 'ePayco Procesando Pago Prueba(%s)', 'ePayco Procesando Pago Prueba(%s)' ) )); register_post_status( 'wc-processing', array( @@ -198,7 +198,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'Procesando(%s)' + 'label_count' => _n_noop( 'Procesando(%s)', 'Procesando(%s)' ) )); register_post_status( 'wc-processing_test', array( @@ -207,7 +207,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'Procesando Prueba(%s)' + 'label_count' => _n_noop( 'Procesando Prueba(%s)', 'Procesando Prueba(%s)' ) )); register_post_status( 'wc-epayco-completed', array( @@ -216,7 +216,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Completado (%s)' + 'label_count' => _n_noop( 'ePayco Pago Completado (%s)', 'ePayco Pago Completado (%s)' ) )); register_post_status( 'wc-epayco_completed', array( @@ -225,7 +225,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'ePayco Pago Completado Prueba (%s)' + 'label_count' => _n_noop( 'ePayco Pago Completado Prueba (%s)', 'ePayco Pago Completado Prueba (%s)' ) )); register_post_status( 'wc-completed', array( @@ -234,7 +234,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'Completado(%s)' + 'label_count' => _n_noop( 'Completado(%s)', 'Completado(%s)' ) )); register_post_status( 'wc-completed_test', array( @@ -243,7 +243,7 @@ function register_epayco_order_status() { 'show_in_admin_status_list' => true, 'show_in_admin_all_list' => true, 'exclude_from_search' => false, - 'label_count' => 'Completado Prueba(%s)' + 'label_count' => _n_noop( 'Completado Prueba(%s)', 'Completado Prueba(%s)' ) )); } add_action( 'plugins_loaded', 'register_epayco_order_status' ); @@ -318,73 +318,57 @@ function styling_admin_order_list() { $epayco_order = get_option('epayco_order_status'); $testMode = $epayco_order == "yes" ? "true" : "false"; if($testMode=="true"){ - ?> - - - - + + + Date: Tue, 24 Sep 2024 15:52:21 -0500 Subject: [PATCH 2/6] upload logo --- assets/images/paymentLogo.svg | 591 +++++++++++++++++----------------- 1 file changed, 297 insertions(+), 294 deletions(-) diff --git a/assets/images/paymentLogo.svg b/assets/images/paymentLogo.svg index 98e84d9..1e60a8a 100644 --- a/assets/images/paymentLogo.svg +++ b/assets/images/paymentLogo.svg @@ -1,294 +1,297 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From bf11157ffcacf426438562cffb0afe935fd9085c Mon Sep 17 00:00:00 2001 From: RicardoSaldarriagaPayco Date: Tue, 24 Sep 2024 15:55:44 -0500 Subject: [PATCH 3/6] feat:upload readme --- README.md | 1 + readme.txt | 13 ++++++++----- woocommerce-gateway-payco.php | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c4d9348..8fd21c8 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ** Se recomienda emplear la última versión disponible. ** ## Versiones +* [epayco plugin WooCommerce v8.1.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.1). * [epayco plugin WooCommerce v8.0.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.3). * [epayco plugin WooCommerce v8.0.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.2). * [epayco plugin WooCommerce v8.0.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.1). diff --git a/readme.txt b/readme.txt index 234a6d6..c550e9a 100644 --- a/readme.txt +++ b/readme.txt @@ -2,10 +2,10 @@ Contributors: ePayco Team Donate link: https://epayco.com/ Tags: e-commerce, commerce, wordpress ecommerce, store, sales, sell, shop, shopping, cart, checkout, configurable, epayco -Requires at least: 5.5 -Tested up to: 6.4 -Stable tag: 7.0.0 -Requires PHP: 5.6.0 +Requires at least: 8.8.5 +Tested up to: 6.7 +Stable tag: 6.7 +Requires PHP: 7.4 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -45,8 +45,11 @@ Yes. But it is advisable that you consider using it since it is revealing for br == Changelog == -= 6.0.0 = += 6.7.0 = * Initial stable release += 8.1.0 = +* upload release + == Additional Info == **Contribute** [repository on github](https://github.com/epayco/Plugin_ePayco_WooCommerce) \ No newline at end of file diff --git a/woocommerce-gateway-payco.php b/woocommerce-gateway-payco.php index 2991282..8a0cf38 100644 --- a/woocommerce-gateway-payco.php +++ b/woocommerce-gateway-payco.php @@ -6,7 +6,7 @@ * * Plugin Name: WooCommerce Epayco Gateway * Description: Plugin ePayco Gateway for WooCommerce. - * Version: 8.0.3 + * Version: 8.1.3 * Author: ePayco * Author URI: http://epayco.co * Tested up to: 6.4 From 98876b4113124dcfe517faa6b286628bffc1a7de Mon Sep 17 00:00:00 2001 From: RicardoSaldarriagaPayco Date: Tue, 1 Oct 2024 12:41:40 -0500 Subject: [PATCH 4/6] feat:se actualiza readme --- README.md | 1 + classes/class-wc-gateway-epayco.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8fd21c8..8b0dab8 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ ** Se recomienda emplear la última versión disponible. ** ## Versiones +* [epayco plugin WooCommerce v8.1.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.2). * [epayco plugin WooCommerce v8.1.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.1). * [epayco plugin WooCommerce v8.0.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.3). * [epayco plugin WooCommerce v8.0.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.2). diff --git a/classes/class-wc-gateway-epayco.php b/classes/class-wc-gateway-epayco.php index d9288bd..d5fab4a 100644 --- a/classes/class-wc-gateway-epayco.php +++ b/classes/class-wc-gateway-epayco.php @@ -680,7 +680,7 @@ function successful_request($validationData) } - $url = 'https://secure.epayco.io/validation/v1/reference/'.$ref_payco; + $url = 'https://secure.epayco.co/validation/v1/reference/'.$ref_payco; $response = wp_remote_get( $url ); $body = wp_remote_retrieve_body( $response ); $jsonData = @json_decode($body, true); @@ -1100,7 +1100,7 @@ function ePayco_successful_validation($validationData) { $username = sanitize_text_field($validationData['epayco_publickey']); $password = sanitize_text_field($validationData['epayco_privatey']); - $response = wp_remote_post( 'https://apify.epayco.io/login', array( + $response = wp_remote_post( 'https://apify.epayco.co/login', array( 'headers' => array( 'Authorization' => 'Basic ' . base64_encode( $username . ':' . $password ), ), From a0138c8a73b170e7e9c45ab6f4abca78d7ce7090 Mon Sep 17 00:00:00 2001 From: RicardoSaldarriagaPayco Date: Tue, 1 Oct 2024 12:43:04 -0500 Subject: [PATCH 5/6] feat:se actualiza readme --- README.md | 1 - classes/class-wc-gateway-epayco.php | 6 +++--- readme.txt | 3 +++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8b0dab8..8fd21c8 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ ** Se recomienda emplear la última versión disponible. ** ## Versiones -* [epayco plugin WooCommerce v8.1.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.2). * [epayco plugin WooCommerce v8.1.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.1). * [epayco plugin WooCommerce v8.0.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.3). * [epayco plugin WooCommerce v8.0.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.2). diff --git a/classes/class-wc-gateway-epayco.php b/classes/class-wc-gateway-epayco.php index d5fab4a..984849d 100644 --- a/classes/class-wc-gateway-epayco.php +++ b/classes/class-wc-gateway-epayco.php @@ -425,7 +425,7 @@ function generate_epayco_form( $order_id ) { } echo sprintf('