├── index.php ├── assets ├── index.php ├── images │ ├── arrow.png │ ├── epayco1.png │ ├── epayco2.png │ ├── epayco3.png │ ├── epayco4.png │ ├── epayco5.png │ ├── epayco6.png │ ├── iconoepayco.png │ ├── logo2epayco.png │ ├── logo_warning.png │ ├── logoepayco.png │ ├── epayco1.svg │ ├── logo.svg │ └── logoepayco.svg ├── js │ └── frontend │ │ ├── blocks.js │ │ └── admin.js └── css │ └── epayco-css.css ├── includes ├── index.php └── blocks │ ├── wc-gateway-epayco-support.php │ └── EpaycoOrder.php ├── ImgTutorialWooCommerce ├── tuto-1.png ├── tuto-2.png ├── tuto-3.png ├── tuto-4.png ├── tuto-5.png ├── tuto-6.png ├── tuto-7.png └── tuto-8.png ├── languages ├── woo-epayco-gateway-en_US.mo ├── woo-epayco-gateway-en_US-15d543622ebcb29b916ea71d8e102a56.json ├── woo-epayco-gateway.pot ├── woo-epayco-gateway-en_US-backup-202401300412410.po~ └── woo-epayco-gateway-en_US.po ├── CHANGELOG.md ├── readme.txt ├── classes ├── epayco-settings.php ├── class-wc-transaction-epayco.php └── class-wc-gateway-epayco.php ├── README.md └── woocommerce-gateway-payco.php /index.php: -------------------------------------------------------------------------------- 1 | { 2 | "use strict"; 3 | const e=window.wp.element, 4 | t=window.wp.i18n, 5 | n=window.wc.wcBlocksRegistry, 6 | s=window.wp.htmlEntities, 7 | a=window.wc.wcSettings, 8 | l=(0,a.getSetting)("epayco_data",{}), 9 | o=(0,t.__)("Epayco","woo-epayco-gateway"), 10 | c=(0,s.decodeEntities)(l.title)||o, 11 | w=()=>(0,s.decodeEntities)(l.description||""), 12 | y={ 13 | name:"epayco", 14 | label:(0,e.createElement)( 15 | (t=> {const{PaymentMethodLabel:n}=t.components; 16 | return(0,e.createElement)(n,{text:c}) 17 | }),null), 18 | content:(0,e.createElement)(w,null), 19 | edit:(0,e.createElement)(w,null), 20 | canMakePayment:()=>!0, 21 | ariaLabel:c, 22 | supports:{features:l.supports} 23 | }; 24 | (0,n.registerPaymentMethod)(y) 25 | })(); -------------------------------------------------------------------------------- /assets/js/frontend/admin.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | $(document).ready(function() { 3 | console.log("epayco admin.") 4 | var modal = document.getElementById("myModal"); 5 | var span = document.getElementsByClassName("close")[0]; 6 | span.onclick = function() { 7 | modal.style.display = "none"; 8 | } 9 | $(".validar").on("click", function() { 10 | var modal = document.getElementById("myModal"); 11 | var url_validate = $("#path_validate")[0].innerHTML.trim(); 12 | const epayco_publickey = $("input:text[name=woocommerce_epayco_epayco_publickey]").val().replace(/\s/g,""); 13 | const epayco_privatey = $("input:text[name=woocommerce_epayco_epayco_privatekey]").val().replace(/\s/g,""); 14 | if (epayco_publickey !== "" && 15 | epayco_privatey !== "") { 16 | var formData = new FormData(); 17 | formData.append("epayco_publickey",epayco_publickey.replace(/\s/g,"")); 18 | formData.append("epayco_privatey",epayco_privatey.replace(/\s/g,"")); 19 | $.ajax({ 20 | url: url_validate, 21 | type: "post", 22 | data: formData, 23 | contentType: false, 24 | processData: false, 25 | success: function(response) { 26 | debugger 27 | if (response == "success") { 28 | alert("validacion exitosa!"); 29 | } else { 30 | modal.style.display = "block"; 31 | } 32 | } 33 | }); 34 | }else{ 35 | modal.style.display = "block"; 36 | } 37 | }); 38 | }); 39 | }(jQuery)); -------------------------------------------------------------------------------- /includes/blocks/wc-gateway-epayco-support.php: -------------------------------------------------------------------------------- 1 | settings = get_option( 'woocommerce_epayco_settings', array() ); 30 | 31 | } 32 | 33 | /** 34 | * Returns if this payment method should be active. If false, the scripts will not be enqueued. 35 | * 36 | * @return boolean 37 | */ 38 | public function is_active() { 39 | return $this->get_epayco_option( 'enabled', 'epayco' ); 40 | } 41 | 42 | /** 43 | * Returns an array of scripts/handles to be registered for this payment method. 44 | * 45 | * @return array 46 | */ 47 | public function get_payment_method_script_handles() { 48 | $script_path = '/assets/js/frontend/blocks.js'; 49 | $script_url = plugin_url_epayco() . $script_path; 50 | 51 | wp_register_script( 52 | 'wc-epayco-payments-blocks', 53 | $script_url, 54 | array(), 55 | '1.2.0', 56 | true 57 | ); 58 | 59 | if ( function_exists( 'wp_set_script_translations' ) ) { 60 | wp_set_script_translations( 'wc-epayco-payments-blocks', 'woo-epayco-gateway', plugin_abspath_epayco() . 'languages/' ); 61 | } 62 | 63 | return array( 'wc-epayco-payments-blocks' ); 64 | } 65 | 66 | /** 67 | * Returns an array of key=>value pairs of data made available to the payment methods script. 68 | * 69 | * @return array 70 | */ 71 | public function get_payment_method_data() { 72 | return array( 73 | 'title' => $this->get_epayco_option( 'title', 'epayco'), 74 | 'description' => $this->get_epayco_option( 'description', 'epayco'), 75 | 'supports' => array( 76 | 'products', 77 | 'refunds', 78 | ), 79 | ); 80 | } 81 | 82 | public function get_epayco_option( $option, $gateway ) { 83 | 84 | $options = get_option( 'woocommerce_' . $gateway . '_settings' ); 85 | 86 | if ( ! empty( $options ) ) { 87 | $epayco_options = maybe_unserialize( $options ); 88 | if ( array_key_exists( $option, $epayco_options ) ) { 89 | $option_value = $epayco_options[ $option ]; 90 | return $option_value; 91 | } else { 92 | return false; 93 | } 94 | } else { 95 | return false; 96 | } 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /assets/css/epayco-css.css: -------------------------------------------------------------------------------- 1 | tbody{ 2 | } 3 | .epayco-table tr:not(:first-child) { 4 | border-top: 1px solid #ededed; 5 | } 6 | .epayco-table tr th{ 7 | padding-left: 15px; 8 | text-align: -webkit-right; 9 | } 10 | .epayco-table input[type="text"]{ 11 | padding: 8px 13px!important; 12 | border-radius: 3px; 13 | width: 100%!important; 14 | } 15 | .epayco-table .description{ 16 | color: #afaeae; 17 | } 18 | .epayco-table select{ 19 | padding: 8px 13px!important; 20 | border-radius: 3px; 21 | width: 100%!important; 22 | height: 37px!important; 23 | } 24 | .epayco-required::before{ 25 | content: '* '; 26 | font-size: 16px; 27 | color: #F00; 28 | font-weight: bold; 29 | } 30 | 31 | .modal { 32 | display: none; 33 | position: fixed; 34 | z-index: 1; 35 | padding-top: 100px; 36 | left: 0; 37 | top: 0; 38 | width: 100%; 39 | height: 100%; 40 | overflow: auto; 41 | background-color: rgb(0,0,0); 42 | background-color: rgba(0,0,0,0.4); 43 | justify-content: center; 44 | align-items: center; 45 | } 46 | 47 | /* Modal Content */ 48 | .modal-content { 49 | background-color: #ffff; 50 | padding: 20px; 51 | border: 1px solid #888; 52 | position: absolute; 53 | border-radius: 8px; 54 | left: 50%; 55 | top: 35%; 56 | transform: translate(-50%, -50%); 57 | } 58 | 59 | .modal-content p { 60 | position: static; 61 | font-family: 'Open Sans'; 62 | font-style: normal; 63 | font-weight: 400; 64 | font-size: 16px; 65 | line-height: 22px; 66 | text-align: center; 67 | color: #5C5B5C; 68 | margin: 8px 0px; 69 | } 70 | /* The Close Button */ 71 | .close { 72 | color: #aaaaaa; 73 | float: right; 74 | font-size: 28px; 75 | font-weight: bold; 76 | } 77 | 78 | .close:hover, 79 | .close:focus { 80 | color: #000; 81 | text-decoration: none; 82 | cursor: pointer; 83 | } 84 | @media screen and (max-width: 425px) { 85 | .modal-content { 86 | width: 50% ; 87 | } 88 | } 89 | @media screen and (max-width: 425px) { 90 | .dropdown dt a{ 91 | width: 250px !important; 92 | } 93 | } 94 | 95 | .desc { color:#6b6b6b;} 96 | .desc a {color:#0092dd;} 97 | .dropdown dd, .dropdown dt, .dropdown ul { margin:0px; padding:0px; } 98 | .dropdown dd { position:relative; } 99 | .dropdown a, .dropdown a:visited { color:#2c3338; text-decoration:none; outline:none;} 100 | .dropdown a:hover { color:#007cba;} 101 | .dropdown dt a:hover { color:#007cba; border: 1px solid #07cba;} 102 | .dropdown dt a {background:#ffffff url("data:../images/arrow.png") no-repeat scroll right center; display:block; padding-right:20px; 103 | border:1px solid #2c3338;width: 400px;} 104 | .dropdown dt a span {cursor:pointer; display:block; padding:5px;} 105 | .dropdown dd ul { background:#ffffff none repeat scroll 0 0; border:1px solid #d4ca9a; color:#C5C0B0; display:none; 106 | left:0px; padding:5px 0px; position:absolute; top:2px; width:auto; min-width:170px; list-style:none;} 107 | .dropdown span.value { display:none;} 108 | .dropdown dd ul li a { padding:5px; display:block;} 109 | .dropdown dd ul li a:hover { background-color:#d0c9af;} 110 | 111 | .dropdown img.flag { border:none; vertical-align:middle; margin-left:10px; } 112 | .flagvisibility { display:none;} -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Todos los cambios notables de este proyecto serán documentados en este archivo. 4 | 5 | El formato está basado en [Keep a Changelog](https://keepachangelog.com/es-es/1.0.0/), 6 | y este proyecto adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 7 | 8 | ## [Unreleased] 9 | 10 | ### Changed 11 | 12 | - **23 de octubre de 2025** - Actualización para versión 2 del checkout de ePayco 13 | - Actualizado el payload de configuración del checkout para incluir `checkout_version: "2"` 14 | - Implementada integración con el nuevo endpoint `payment/session/create` para crear sesiones de pago 15 | - Mejorada la configuración del checkout con soporte para `sessionId` dinámico 16 | - Actualizada la configuración JavaScript del checkout para usar el nuevo sistema de sesiones 17 | - Corregida la configuración de `autoClick` a `false` para mejor control del flujo de pago 18 | 19 | ### Added 20 | 21 | - **Nuevos campos en el payload del checkout:** 22 | - `checkout_version`: "2" - Especifica la versión del checkout a utilizar 23 | - `sessionId`: Campo dinámico obtenido de la respuesta de `payment/session/create` 24 | - `autoClick`: false - Control mejorado del flujo de apertura del checkout 25 | 26 | ### Technical Details 27 | 28 | - Modificado `classes/class-wc-gateway-epayco.php`: 29 | - Actualizada la función `generate_epayco_form()` para incluir llamada a `getEpaycoSessionId()` 30 | - Implementada lógica para obtener `sessionId` desde la respuesta de la API 31 | - Mejorada la configuración del objeto checkout JavaScript con parámetros de sesión 32 | - Actualizada la estructura del payload para compatibilidad con checkout v2 33 | 34 | ### Security 35 | 36 | - Implementado manejo seguro de tokens Bearer para autenticación con API ePayco 37 | - Mejorada la validación de respuestas de la API antes de procesar datos de sesión 38 | 39 | ## [Previous Versions] 40 | 41 | ### [1.1.0] - Versiones anteriores 42 | 43 | #### Funcionalidades Base 44 | 45 | - Funcionalidades base del plugin ePayco para WooCommerce 46 | - Integración con API de ePayco para procesamiento de pagos 47 | - Gestión automática de órdenes y estados de pago 48 | - Sistema de validación de firmas para seguridad de transacciones 49 | 50 | #### Características Principales 51 | 52 | - Soporte para múltiples métodos de pago (tarjetas de crédito, débito, PSE, etc.) 53 | - Manejo automático de stock y restauración en caso de fallos 54 | - Sistema de cron jobs para sincronización de estados 55 | - Configuración de URLs de confirmación y respuesta personalizables 56 | - Soporte para modo de pruebas y producción 57 | - Validación de llaves públicas y privadas 58 | - Manejo de múltiples monedas (COP, USD) 59 | 60 | #### Implementación Técnica 61 | 62 | - Clase principal `WC_Gateway_Epayco` extendiendo `WC_Payment_Gateway` 63 | - Sistema de logs integrado para debugging 64 | - Manejo de excepciones y errores robusto 65 | - Validación de firmas SHA256 para seguridad 66 | - API REST endpoints para confirmación y validación de pagos 67 | - Sistema de metadata para tracking de transacciones 68 | 69 | #### Características de Seguridad 70 | 71 | - Validación de firmas digitales 72 | - Manejo seguro de credenciales 73 | - Sanitización de datos de entrada 74 | - Protección contra acceso directo a archivos 75 | - Validación de IPs y datos de transacción 76 | -------------------------------------------------------------------------------- /includes/blocks/EpaycoOrder.php: -------------------------------------------------------------------------------- 1 | prefix . "epayco_order"; 21 | $result = $wpdb->insert( $table_name, 22 | array( 23 | 'order_id' => $orderId, 24 | 'order_stock_restore' => $stock 25 | ) 26 | ); 27 | return $result; 28 | } 29 | 30 | /** 31 | * Consultar si existe el registro de una oden 32 | * @param int $orderId 33 | */ 34 | public static function ifExist($orderId) 35 | { 36 | global $wpdb; 37 | $table_name = $wpdb->prefix . "epayco_order"; 38 | $results = $wpdb->get_row( "SELECT * FROM $table_name WHERE order_id = $orderId" ); 39 | if ($results) 40 | return true; 41 | return false; 42 | } 43 | 44 | /** 45 | * Consultar si a una orden ya se le descconto el stock 46 | * @param int $orderId 47 | */ 48 | public static function ifStockDiscount($orderId) 49 | { 50 | global $wpdb; 51 | $table_name = $wpdb->prefix . "epayco_order"; 52 | $result = $wpdb->get_row( "SELECT * FROM $table_name WHERE order_id = $orderId" ); 53 | if (is_null($result)) 54 | return false; 55 | return intval($result->order_stock_discount) != 0 ? true : false; 56 | } 57 | 58 | /** 59 | * Actualizar que ya se le descont贸 el stock a una orden 60 | * @param int $orderId 61 | */ 62 | public static function updateStockDiscount($orderId) 63 | { 64 | global $wpdb; 65 | $table_name = $wpdb->prefix . "epayco_order"; 66 | $result = $wpdb->update( $table_name, array('order_stock_discount'=>1), array('order_id'=>(int)$orderId) ); 67 | return (int)$result == 1; 68 | } 69 | 70 | /** 71 | * Crear la tabla en la base de datos. 72 | * @return true or false 73 | */ 74 | public static function setup() 75 | { 76 | global $wpdb; 77 | $table_name = $wpdb->prefix . "epayco_order"; 78 | $charset_collate = $wpdb->get_charset_collate(); 79 | $sql = "CREATE TABLE ". $table_name." ( 80 | id INT NOT NULL AUTO_INCREMENT, 81 | id_payco INT NULL, 82 | order_id INT NULL, 83 | order_stock_restore INT NULL, 84 | order_stock_discount INT NULL, 85 | order_status TEXT NULL, 86 | PRIMARY KEY (id) 87 | ) $charset_collate;"; 88 | require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); 89 | dbDelta($sql); 90 | } 91 | 92 | /** 93 | * Borra la tabla en la base de datos. 94 | * @return true or false 95 | */ 96 | public static function remove(){ 97 | $sql = array( 98 | 'DROP TABLE IF EXISTS '._DB_PREFIX_.'epayco_order' 99 | ); 100 | foreach ($sql as $query) { 101 | if (Db::getInstance()->execute($query) == false) { 102 | return false; 103 | } 104 | } 105 | } 106 | 107 | } -------------------------------------------------------------------------------- /assets/images/epayco1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /assets/images/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === ePayco plugin for WooCommerce === 2 | Contributors: ePayco Team 3 | Donate link: https://epayco.com/ 4 | Tags: payments, checkout, woocommerce, epayco, gateway 5 | Requires at least: 5.5 6 | Tested up to: 6.8.3 7 | Stable tag: 8.3.0 8 | Requires PHP: 7.4 9 | License: GNU General Public License v3.0 10 | License URI: http://www.gnu.org/licenses/gpl-3.0.html 11 | 12 | **The official ePayco plugin for WooCommerce allows seamless payment processing for your online store.** 13 | 14 | == Description == 15 | 16 | The official ePayco plugin enables seamless payment processing for your online store, allowing customers to complete their purchases using their preferred payment methods. 17 | 18 | Installation is **straightforward and requires no technical expertise**, so you can start selling immediately. 19 | 20 | == Method Payments == 21 | 22 | ePayco accepts Visa, MasterCard, American Express, Diners Club, SEPA, PSE (Bank Transfer), Cash (Efecty, Gana, Punto Red, Red Servi, Su Red, Paga todo, Acertemos, Gana Gana, Su Chance, Jer, La Perla), Daviplata, PayPal, SafetyPay, Davipuntos, Puntos Colombia (Coming soon) and more directly on your store with the ePayco plugin for WooCommerce, allowing payments for mobile and desktop. Also, ePayco supports 3D-Secure v 2.2. 23 | 24 | == Why Choose ePayco? == 25 | 26 | * ePayco has no setup fees, no hidden costs: you only get charged when you earn money! Earnings are transferred to you quickly. 27 | * Easily convert your product prices between Colombian pesos and U.S. dollars. 28 | * Offer installment payments and highlight current promotions. 29 | * Test your store in our Sandbox environment before going live. 30 | * Receive your sales revenue on the same day. 31 | * **ePayco customers can use their stored cards** for quick and easy checkout without re-entering card details. 32 | * Focus on selling while ** we handle security with our advanced fraud prevention and analysis tools.** 33 | 34 | ==Sell more with the paid market == 35 | 36 | **[Leave your details](https://epayco.com/contacto/)** to talk to our team of experts (currently available only for Colombia). 37 | 38 | == Screenshots == 39 | 40 | 41 | == Frequently Asked Questions == 42 | 43 | = I had a question during setup, where can I check the documentation? = 44 | In our developer website you will find the step by step guide on [how to integrate the ePayco Plugin](https://github.com/epayco/Plugin_ePayco_WooCommerce?tab=readme-ov-file#requisitos) in your online store. 45 | 46 | = I reviewed the documentation and these FAQs but still have problems in my store, what can I do? = 47 | If you have already reviewed the documentation and have not found a solution, you can contact our support team through their [contact form](https://epayco.com/contacto/). Please note that we guarantee a response as soon as possible. 48 | 49 | = Are you required to use an SSL certificate? = 50 | Yes. It is advisable to use an SSL certificate as it is crucial for browser security. 51 | 52 | 53 | == Installation == 54 | 55 | = Automatic Installation = 56 | 57 | Automatic installation is super easy because WordPress takes care of the file transfers for you, so you don’t even need to leave your web browser. To automatically install the ePayco plugin for Woocommerce Stripe plugin, just log in to your WordPress dashboard, go to the Plugins menu, and click Add New. 58 | 59 | In the search field, type “ePayco plugin for Woocommerce” and hit Search Plugins. Once you find our plugin, you can check out details like the version, rating, and description. The best part? You can install it with a simple click on “Install Now” and then “Activate”. 60 | 61 | = Manual Installation = 62 | 63 | 1. Download the [zip](https://github.com/epayco/Plugin_ePayco_WooCommerce?tab=readme-ov-file#requisitos) or from the [WordPress Module Directory](https://wordpress.org/plugins/epayco-gateway/). 64 | 2. Go to the “Plugins” module and click on “Upload Plugin”. 65 | 3. Upload the file, install, and activate the plugin. 66 | 67 | Done! 68 | 69 | = Installing this plugin won’t slow down your store at all! = 70 | 71 | If everything went smoothly, you’ll find it in your list of “Installed Plugins” in the WordPress dashboard. Just enable it and then move on to integrating and setting up your ePayco account. 72 | 73 | = ePayco Integration = 74 | 75 | Log in to the ePayco dashboard with your credentials. 76 | 77 | Next, go to the settings module, click on configuration-customizations, and finally, select the “Secret Keys” category. 78 | 79 | Approve your account to go to production and receive real payments. 80 | 81 | = Configuration= 82 | 83 | 1. Log in to the ePayco dashboard with your credentials. 84 | 2. Go to **Settings > Customizations > Secret Keys**. 85 | 3. Enter the **P_CUST_ID_CLIENTE, P_KEY, PUBLIC_KEY, PRIVATE_KEY**. 86 | 4. Test the store with sandbox credentials. 87 | 5. Approve your account to receive real payments. 88 | 89 | == Changelog == 90 | = 8.1.0 = 91 | * upload release 92 | 93 | = 8.1.1 = 94 | * upload release 95 | 96 | = 8.2.1 = 97 | * upload release 98 | 99 | = 8.2.2 = 100 | * upload release 101 | 102 | = 8.2.3 = 103 | * upload release 104 | 105 | == Additional Info == 106 | Contribute to the repository on GitHub: [Visit the GitHub repository](https://github.com/epayco/Plugin_ePayco_WooCommerce) 107 | -------------------------------------------------------------------------------- /classes/epayco-settings.php: -------------------------------------------------------------------------------- 1 | array( 8 | 'title' => __('Habilitar/Deshabilitar', 'woo-epayco-gateway'), 9 | 'type' => 'checkbox', 10 | 'label' => __('Habilitar ePayco', 'woo-epayco-gateway'), 11 | 'default' => 'yes', 12 | ), 13 | 'title' => array( 14 | 'title' => __('Título', 'woo-epayco-gateway'), 15 | 'type' => 'text', 16 | 'description' => __('Corresponde al título que el usuario ve durante el Checkout.', 'woo-epayco-gateway'), 17 | 'default' => __('Checkout ePayco (Tarjetas de crédito,debito,efectivo)', 'woo-epayco-gateway'), 18 | 'desc_tip' => true, 19 | ), 20 | 'description' => array( 21 | 'title' => __('Descripción', 'woo-epayco-gateway'), 22 | 'type' => 'textarea', 23 | 'description' => __('Corresponde a la descripción que verá el usuario durante el Checkout', 'woo-epayco-gateway'), 24 | 'default' => __('Checkout ePayco (Tarjetas de crédito,débito,efectivo)', 'woo-epayco-gateway'), 25 | ), 26 | 'epayco_customerid' => array( 27 | 'title' => __('P_CUST_ID_CLIENTE', 'woo-epayco-gateway'), 28 | 'type' => 'text', 29 | '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'), 30 | 'default' => '', 31 | //'desc_tip' => true, 32 | 'placeholder' => '', 33 | ), 34 | 'epayco_secretkey' => array( 35 | 'title' => __('P_KEY', 'woo-epayco-gateway'), 36 | 'type' => 'text', 37 | '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'), 38 | 'default' => '', 39 | //'desc_tip' => true, 40 | 'placeholder' => '', 41 | ), 42 | 'epayco_publickey' => array( 43 | 'title' => __('PUBLIC_KEY', 'woo-epayco-gateway'), 44 | 'type' => 'text', 45 | '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'), 46 | 'default' => '', 47 | //'desc_tip' => true, 48 | 'placeholder' => '', 49 | ), 50 | 'epayco_privatekey' => array( 51 | 'title' => __('PRIVATE_KEY', 'woo-epayco-gateway'), 52 | 'type' => 'text', 53 | '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'), 54 | 'default' => '', 55 | //'desc_tip' => true, 56 | 'placeholder' => '', 57 | ), 58 | 'epayco_testmode' => array( 59 | 'title' => __('Sitio en pruebas', 'woo-epayco-gateway'), 60 | 'type' => 'checkbox', 61 | 'label' => __('Habilitar el modo de pruebas', 'woo-epayco-gateway'), 62 | 'description' => __('Habilite para realizar pruebas', 'woo-epayco-gateway'), 63 | 'default' => 'no', 64 | ), 65 | 'epayco_type_checkout' => array( 66 | 'title' => __('Tipo Checkout', 'woo-epayco-gateway'), 67 | 'type' => 'select', 68 | 'css' => 'line-height: inherit', 69 | 'label' => __('Seleccione un tipo de Checkout:', 'woo-epayco-gateway'), 70 | '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'), 71 | 'options' => array('false' => "Onpage Checkout", "true" => "Standard Checkout"), 72 | ), 73 | 'epayco_endorder_state' => array( 74 | 'title' => __('Estado Final del Pedido', 'woo-epayco-gateway'), 75 | 'type' => 'select', 76 | 'css' => 'line-height: inherit', 77 | 'description' => __('Seleccione el estado del pedido que se aplicará a la hora de aceptar y confirmar el pago de la orden', 'woo-epayco-gateway'), 78 | 'options' => array( 79 | 'epayco-processing' => __('ePayco Procesando Pago', 'woo-epayco-gateway'), 80 | "epayco-completed" => __('ePayco Pago Completado', 'woo-epayco-gateway'), 81 | 'processing' => __('Procesando', 'woo-epayco-gateway'), 82 | "completed" => __('Completado', 'woo-epayco-gateway') 83 | ), 84 | ), 85 | 'epayco_cancelled_endorder_state' => array( 86 | 'title' => __('Estado Cancelado del Pedido', 'woo-epayco-gateway'), 87 | 'type' => 'select', 88 | 'css' => 'line-height: inherit', 89 | 'description' => __('Seleccione el estado del pedido que se aplicará cuando la transacciónes Cancelada o Rechazada', 'woo-epayco-gateway'), 90 | 'options' => array( 91 | 'epayco-cancelled' => __('ePayco Pago Cancelado', 'woo-epayco-gateway'), 92 | "epayco-failed" => __('ePayco Pago Fallido', 'woo-epayco-gateway'), 93 | 'cancelled' => __('Cancelado', 'woo-epayco-gateway'), 94 | "failed" => __('Fallido', 'woo-epayco-gateway') 95 | ), 96 | ), 97 | 'epayco_url_response' => array( 98 | 'title' => __('Página de Respuesta', 'woo-epayco-gateway'), 99 | 'type' => 'select', 100 | 'css' => 'line-height: inherit', 101 | 'description' => __('Url de la tienda donde se redirecciona al usuario luego de pagar el pedido', 'woo-epayco-gateway'), 102 | 'options' => $this->get_pages(__('Seleccionar pagina', 'woo-epayco-gateway')), 103 | ), 104 | 'epayco_url_confirmation' => array( 105 | 'title' => __('Página de Confirmación', 'woo-epayco-gateway'), 106 | 'type' => 'select', 107 | 'css' => 'line-height: inherit', 108 | 'description' => __('Url de la tienda donde ePayco confirma el pago', 'woo-epayco-gateway'), 109 | 'options' => $this->get_pages(__('Seleccionar pagina', 'woo-epayco-gateway')), 110 | ), 111 | 'epayco_reduce_stock_pending' => array( 112 | 'title' => __('Reducir el stock en transacciones pendientes', 'woo-epayco-gateway'), 113 | 'type' => 'checkbox', 114 | 'css' => 'line-height: inherit', 115 | 'default' => 'yes', 116 | 'description' => sprintf(__('Habilite para reducir el stock en transacciones pendientes', 'woo-epayco-gateway')), 117 | ), 118 | 'epayco_lang' => array( 119 | 'title' => __('Idioma del Checkout', 'woo-epayco-gateway'), 120 | 'type' => 'select', 121 | 'css' => 'line-height: inherit', 122 | 'description' => __('Seleccione el idioma del checkout', 'woo-epayco-gateway'), 123 | 'default' => 'es', 124 | 'options' => array(), 125 | ), 126 | 'response_data' => array( 127 | 'title' => __('Habilitar envió de atributos a través de la URL de respuesta', 'woo-epayco-gateway'), 128 | 'type' => 'checkbox', 129 | 'label' => __('Habilitar el modo redirección con data', 'woo-epayco-gateway'), 130 | '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'), 131 | 'default' => 'no', 132 | ), 133 | 'cron_data' => array( 134 | 'title' => __('Rastreo de orden ', 'woo-epayco-gateway'), 135 | 'type' => 'checkbox', 136 | 'label' => __('Habilitar el rastreo de orden ', 'woo-epayco-gateway'), 137 | 'description' => __('Mantendremos tus pedidos actualizados cada hora. Recomendamos activar esta opción sólo en caso de fallos en la actualización automática de pedidos. ', 'woo-epayco-gateway'), 138 | 'default' => 'no', 139 | ), 140 | ) 141 | ); 142 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## ePayco plugin para WooCommerce 2 | 3 | **Si usted tiene alguna pregunta o problema, no dude en ponerse en contacto con nuestro soporte técnico: desarrollo@epayco.com.** 4 | 5 | ** Se recomienda emplear la última versión disponible. ** 6 | 7 | ## Versiones 8 | * [epayco plugin WooCommerce v8.3.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.3.0). 9 | * [epayco plugin WooCommerce v8.2.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.2.3). 10 | * [epayco plugin WooCommerce v8.2.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.2.2). 11 | * [epayco plugin WooCommerce v8.2.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.2.1). 12 | * [epayco plugin WooCommerce v8.2.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.2.0). 13 | * [epayco plugin WooCommerce v8.1.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.1). 14 | * [epayco plugin WooCommerce v8.1.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.1.0). 15 | * [epayco plugin WooCommerce v8.0.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.3). 16 | * [epayco plugin WooCommerce v8.0.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.2). 17 | * [epayco plugin WooCommerce v8.0.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.1). 18 | * [epayco plugin WooCommerce v8.0.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v8.0.0). 19 | * [epayco plugin WooCommerce v7.1.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v7.1.0). 20 | * [epayco plugin WooCommerce v7.0.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v7.0.0). 21 | * [epayco plugin WooCommerce v6.7.6](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.6). 22 | * [epayco plugin WooCommerce v6.7.5](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.5). 23 | * [epayco plugin WooCommerce v6.7.4](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.4). 24 | * [epayco plugin WooCommerce v6.7.3](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.3). 25 | * [epayco plugin WooCommerce v6.7.2](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.2). 26 | * [epayco plugin WooCommerce v6.7.1](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.1). 27 | * [epayco plugin WooCommerce v6.7.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v6.7.0). 28 | * [epayco plugin WooCommerce v6.6.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.6.0). 29 | * [epayco plugin WooCommerce v6.5.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.5.0). 30 | * [epayco plugin WooCommerce v6.4.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.4.0). 31 | * [epayco plugin WooCommerce v6.3.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.3.0). 32 | * [epayco plugin WooCommerce v6.2.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.2.0). 33 | * [epayco plugin WooCommerce v6.1.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.1.0). 34 | * [epayco plugin WooCommerce v6.0.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V6.0.0). 35 | * [epayco plugin WooCommerce v5.5.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V5.5.0). 36 | * [epayco plugin WooCommerce v5.4.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V5.4.0). 37 | * [epayco plugin WooCommerce v5.3.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V5.3.0). 38 | * [epayco plugin WooCommerce v5.2.0](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v5.2.0). 39 | * [ePayco plugin WooCommerce v5.2.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V5.2.x). 40 | * [ePayco plugin WooCommerce v5.1.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V5.1.X). 41 | * [ePayco plugin WooCommerce v5.0.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V5.0.X). 42 | * [ePayco plugin WooCommerce v4.9.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.9.x). 43 | * [ePayco plugin WooCommerce v4.8.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.8.X). 44 | * [ePayco plugin WooCommerce v4.7.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V.4.7). 45 | * [ePayco plugin WooCommerce v4.6.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.6.x). 46 | * [ePayco plugin WooCommerce v4.5.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.5.x). 47 | * [ePayco plugin WooCommerce v4.4.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.4.x). 48 | * [ePayco plugin WooCommerce v4.3.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.3.x). 49 | * [ePayco plugin WooCommerce v4.2.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.2.x). 50 | * [ePayco plugin WooCommerce v4.0.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/V4.0.x). 51 | * [ePayco plugin WooCommerce v3.9.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v3.9.x). 52 | * [ePayco plugin WooCommerce v3.8.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.8.x). 53 | * [ePayco plugin WooCommerce v3.7.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.7.0). 54 | * [ePayco plugin WooCommerce v3.6.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.6.5). 55 | * [ePayco plugin WooCommerce v3.5.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.5.3). 56 | * [ePayco plugin WooCommerce v3.4.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.4.2). 57 | * [ePayco plugin WooCommerce v3.2.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.2.1). 58 | * [ePayco plugin WooCommerce v3.0.4.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/3.0.4.x). 59 | * [ePayco plugin WooCommerce v2.6.4.x](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/2.6.4.x). 60 | * [ePayco plugin WooCommerce v2.6](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/2.6). 61 | * [ePayco plugin WooCommerce v2.5](https://github.com/epayco/Plugin_ePayco_WooCommerce/releases/tag/v2.5.x). 62 | 63 | 64 | ## Tabla de contenido 65 | 66 | * [Requisitos](#requisitos) 67 | * [Instalación](#instalación) 68 | * [Pasos](#pasos) 69 | * [Versiones](#versiones) 70 | 71 | ## Requisitos 72 | 73 | * Tener una cuenta activa en [ePayco](https://pagaycobra.com). 74 | * Tener instalado WordPress y WooCommerce. 75 | * Acceso a las carpetas donde se encuetra instalado WordPress y WooCommerce. 76 | * Acceso al admin de WordPress. 77 | 78 | ## Instalación 79 | 80 | 1. [Descarga el plugin.](https://github.com/epayco/Plugin_ePayco_WooCommerce#versiones) 81 | 2. Ingresa al administrador de tu wordPress. 82 | 3. Ingresa a Plugins / Añadir-Nuevo / Subir-Plugin. 83 | 4. Busca el plugin descargado en tu equipo y súbelo como cualquier otro archivo. 84 | 5. Después de instalar el .zip lo puedes ver en la lista de plugins instalados , puedes activarlo o desactivarlo. 85 | 6. Para configurar el plugin debes ir a: WooCommerce / Ajustes / Finalizar Compra y Ubica la pestaña ePayco. 86 | 7. Configura el plugin ingresando el **P_CUST_ID_CLIENTE**, **PUBLIC_KEY** y **P_KEY**, los puedes ver en tu [panel de clientes](https://dashboard.epayco.co/login). 87 | 8. Selecciona o crea una página de respuesta donde el usuario será devuelto después de finalizar la compra. 88 | 9. Realiza una o varias compras para comprobar que todo esté bien. 89 | 10. Si todo está bien recuerda cambiar la variable Modo Prueba a NO y empieza a recibir pagos de forma instantánea y segura con ePayco. 90 | 91 | ### Nota sobre la actualización manual de órdenes 92 | 93 | Si deseas actualizar manualmente todas las órdenes para sincronizar su estado con **ePayco**, sigue estos pasos: 94 | 95 | 1. Ve a **WooCommerce → Estado → Acciones programadas**. 96 | 2. Filtra por **ePayco**. 97 | 3. Selecciona la opción de estado. 98 | 4. Haz clic en **Ejecutar**. 99 | 100 | Esto sincronizará los estados de las órdenes con el estado actual en tu dashboard de ePayco. 101 | 102 | **Importante:** Estas actualizaciones también se ejecutan automáticamente por defecto, pero puedes realizarlas manualmente si lo prefieres o según la configuración 103 | personalizada de tu tienda. 104 | 105 | 106 | ## Pasos 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /languages/woo-epayco-gateway.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 ePayco 2 | # This file is distributed under the GNU General Public License v3.0. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WooCommerce Epayco Gateway 7.0.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/Plugin_ePayco_WooCommerce\n" 7 | "Last-Translator: FULL NAME \n" 8 | "Language-Team: LANGUAGE \n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "POT-Creation-Date: 2024-01-29T22:36:59-05:00\n" 13 | "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 | "X-Generator: WP-CLI 2.9.0\n" 15 | "X-Domain: woo-epayco-gateway\n" 16 | 17 | #. Plugin Name of the plugin 18 | msgid "WooCommerce Epayco Gateway" 19 | msgstr "" 20 | 21 | #. Description of the plugin 22 | msgid "Plugin ePayco Gateway for WooCommerce." 23 | msgstr "" 24 | 25 | #. Author of the plugin 26 | msgid "ePayco" 27 | msgstr "" 28 | 29 | #. Author URI of the plugin 30 | msgid "http://epayco.co" 31 | msgstr "" 32 | 33 | #: classes/class-wc-gateway-epayco.php:26 34 | msgid "ePayco Checkout Gateway" 35 | msgstr "" 36 | 37 | #: classes/class-wc-gateway-epayco.php:27 38 | msgid "Acepta tarjetas de credito, depositos y transferencias." 39 | msgstr "" 40 | 41 | #: classes/class-wc-gateway-epayco.php:120 42 | msgid "Configuración Epayco" 43 | msgstr "" 44 | 45 | #: classes/class-wc-gateway-epayco.php:124 46 | msgid "Este módulo le permite aceptar pagos seguros por la plataforma de pagos ePayco.Si el cliente decide pagar por ePayco, el estado del pedido cambiará a " 47 | msgstr "" 48 | 49 | #: classes/class-wc-gateway-epayco.php:125 50 | msgid " Esperando Pago" 51 | msgstr "" 52 | 53 | #: classes/class-wc-gateway-epayco.php:126 54 | msgid "Cuando el pago sea Aceptado o Rechazado ePayco envía una confirmación a la tienda para cambiar el estado del pedido." 55 | msgstr "" 56 | 57 | #: classes/class-wc-gateway-epayco.php:137 58 | msgid "Validar llaves" 59 | msgstr "" 60 | 61 | #: classes/class-wc-gateway-epayco.php:146 62 | msgid "Validación de llaves PUBLIC_KEY y PRIVATE_KEY" 63 | msgstr "" 64 | 65 | #: classes/class-wc-gateway-epayco.php:158 66 | msgid "Llaves de comercio inválidas" 67 | msgstr "" 68 | 69 | #: classes/class-wc-gateway-epayco.php:159 70 | msgid "Las llaves Public Key, Private Key insertadas
del comercio son inválidas.
Consúltelas en el apartado de integraciones
Llaves API en su Dashboard ePayco." 71 | msgstr "" 72 | 73 | #: classes/class-wc-gateway-epayco.php:185 74 | msgid "Gateway Disabled" 75 | msgstr "" 76 | 77 | #: classes/class-wc-gateway-epayco.php:189 78 | msgid "Servired/Epayco only support " 79 | msgstr "" 80 | 81 | #: classes/class-wc-gateway-epayco.php:207 82 | msgid "Habilitar/Deshabilitar" 83 | msgstr "" 84 | 85 | #: classes/class-wc-gateway-epayco.php:209 86 | msgid "Habilitar ePayco" 87 | msgstr "" 88 | 89 | #: classes/class-wc-gateway-epayco.php:213 90 | msgid "Título" 91 | msgstr "" 92 | 93 | #: classes/class-wc-gateway-epayco.php:215 94 | msgid "Corresponde al título que el usuario ve durante el Checkout." 95 | msgstr "" 96 | 97 | #: classes/class-wc-gateway-epayco.php:216 98 | msgid "Checkout ePayco (Tarjetas de crédito,debito,efectivo)" 99 | msgstr "" 100 | 101 | #: classes/class-wc-gateway-epayco.php:220 102 | msgid "Descripción" 103 | msgstr "" 104 | 105 | #: classes/class-wc-gateway-epayco.php:222 106 | msgid "Corresponde a la descripción que verá el usuario durante el Checkout" 107 | msgstr "" 108 | 109 | #: classes/class-wc-gateway-epayco.php:223 110 | msgid "Checkout ePayco (Tarjetas de crédito,débito,efectivo)" 111 | msgstr "" 112 | 113 | #: classes/class-wc-gateway-epayco.php:226 114 | msgid "P_CUST_ID_CLIENTE" 115 | msgstr "" 116 | 117 | #: classes/class-wc-gateway-epayco.php:228 118 | msgid "ID de cliente que lo identifica en ePayco. Lo puede encontrar en su panel de clientes en la opción configuración" 119 | msgstr "" 120 | 121 | #: classes/class-wc-gateway-epayco.php:234 122 | msgid "P_KEY" 123 | msgstr "" 124 | 125 | #: classes/class-wc-gateway-epayco.php:236 126 | msgid "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" 127 | msgstr "" 128 | 129 | #: classes/class-wc-gateway-epayco.php:242 130 | msgid "PUBLIC_KEY" 131 | msgstr "" 132 | 133 | #: classes/class-wc-gateway-epayco.php:244 134 | #: classes/class-wc-gateway-epayco.php:252 135 | msgid "LLave para autenticar y consumir los servicios de ePayco, Proporcionado en su panel de clientes en la opción configuración" 136 | msgstr "" 137 | 138 | #: classes/class-wc-gateway-epayco.php:250 139 | msgid "PRIVATE_KEY" 140 | msgstr "" 141 | 142 | #: classes/class-wc-gateway-epayco.php:258 143 | msgid "Sitio en pruebas" 144 | msgstr "" 145 | 146 | #: classes/class-wc-gateway-epayco.php:260 147 | msgid "Habilitar el modo de pruebas" 148 | msgstr "" 149 | 150 | #: classes/class-wc-gateway-epayco.php:261 151 | msgid "Habilite para realizar pruebas" 152 | msgstr "" 153 | 154 | #: classes/class-wc-gateway-epayco.php:265 155 | msgid "Tipo Checkout" 156 | msgstr "" 157 | 158 | #: classes/class-wc-gateway-epayco.php:268 159 | msgid "Seleccione un tipo de Checkout:" 160 | msgstr "" 161 | 162 | #: classes/class-wc-gateway-epayco.php:269 163 | msgid "(Onpage Checkout, el usuario al pagar permanece en el sitio) ó (Standard Checkout, el usario al pagar es redireccionado a la pasarela de ePayco)" 164 | msgstr "" 165 | 166 | #: classes/class-wc-gateway-epayco.php:273 167 | msgid "Estado Final del Pedido" 168 | msgstr "" 169 | 170 | #: classes/class-wc-gateway-epayco.php:276 171 | msgid "Seleccione el estado del pedido que se aplicará a la hora de aceptar y confirmar el pago de la orden" 172 | msgstr "" 173 | 174 | #: classes/class-wc-gateway-epayco.php:278 175 | msgid "ePayco Procesando Pago" 176 | msgstr "" 177 | 178 | #: classes/class-wc-gateway-epayco.php:279 179 | msgid "ePayco Pago Completado" 180 | msgstr "" 181 | 182 | #: classes/class-wc-gateway-epayco.php:280 183 | msgid "Procesando" 184 | msgstr "" 185 | 186 | #: classes/class-wc-gateway-epayco.php:281 187 | msgid "Completado" 188 | msgstr "" 189 | 190 | #: classes/class-wc-gateway-epayco.php:285 191 | msgid "Estado Cancelado del Pedido" 192 | msgstr "" 193 | 194 | #: classes/class-wc-gateway-epayco.php:288 195 | msgid "Seleccione el estado del pedido que se aplicará cuando la transacciónes Cancelada o Rechazada" 196 | msgstr "" 197 | 198 | #: classes/class-wc-gateway-epayco.php:290 199 | msgid "ePayco Pago Cancelado" 200 | msgstr "" 201 | 202 | #: classes/class-wc-gateway-epayco.php:291 203 | msgid "ePayco Pago Fallido" 204 | msgstr "" 205 | 206 | #: classes/class-wc-gateway-epayco.php:292 207 | msgid "Cancelado" 208 | msgstr "" 209 | 210 | #: classes/class-wc-gateway-epayco.php:293 211 | msgid "Fallido" 212 | msgstr "" 213 | 214 | #: classes/class-wc-gateway-epayco.php:297 215 | msgid "Página de Respuesta" 216 | msgstr "" 217 | 218 | #: classes/class-wc-gateway-epayco.php:300 219 | msgid "Url de la tienda donde se redirecciona al usuario luego de pagar el pedido" 220 | msgstr "" 221 | 222 | #: classes/class-wc-gateway-epayco.php:301 223 | #: classes/class-wc-gateway-epayco.php:308 224 | msgid "Seleccionar pagina" 225 | msgstr "" 226 | 227 | #: classes/class-wc-gateway-epayco.php:304 228 | msgid "Página de Confirmación" 229 | msgstr "" 230 | 231 | #: classes/class-wc-gateway-epayco.php:307 232 | msgid "Url de la tienda donde ePayco confirma el pago" 233 | msgstr "" 234 | 235 | #: classes/class-wc-gateway-epayco.php:311 236 | msgid "Reducir el stock en transacciones pendientes" 237 | msgstr "" 238 | 239 | #: classes/class-wc-gateway-epayco.php:315 240 | msgid "Habilite para reducir el stock en transacciones pendientes" 241 | msgstr "" 242 | 243 | #: classes/class-wc-gateway-epayco.php:318 244 | msgid "Idioma del Checkout" 245 | msgstr "" 246 | 247 | #: classes/class-wc-gateway-epayco.php:321 248 | msgid "Seleccione el idioma del checkout" 249 | msgstr "" 250 | 251 | #: classes/class-wc-gateway-epayco.php:326 252 | msgid "Habilitar envió de atributos a través de la URL de respuesta" 253 | msgstr "" 254 | 255 | #: classes/class-wc-gateway-epayco.php:328 256 | msgid "Habilitar el modo redirección con data" 257 | msgstr "" 258 | 259 | #: classes/class-wc-gateway-epayco.php:329 260 | msgid "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." 261 | msgstr "" 262 | 263 | #: classes/class-wc-gateway-epayco.php:570 264 | msgid "Cargando métodos de pago" 265 | msgstr "" 266 | 267 | #: classes/class-wc-gateway-epayco.php:571 268 | msgid "Si no se cargan automáticamente, haga clic en el botón \\\"Pagar con ePayco\\\"" 269 | msgstr "" 270 | 271 | #: assets/js/frontend/blocks.js:9 272 | msgid "Epayco" 273 | msgstr "" 274 | -------------------------------------------------------------------------------- /languages/woo-epayco-gateway-en_US-backup-202401300412410.po~: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 ePayco 2 | # This file is distributed under the GNU General Public License v3.0. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WooCommerce Epayco Gateway 7.0.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress." 7 | "org/support/plugin/Plugin_ePayco_WooCommerce\n" 8 | "Last-Translator: \n" 9 | "Language-Team: English (United States)\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "POT-Creation-Date: 2024-01-29T22:36:59-05:00\n" 14 | "PO-Revision-Date: 2024-01-30 03:51+0000\n" 15 | "X-Generator: Loco https://localise.biz/\n" 16 | "X-Domain: woo-epayco-gateway\n" 17 | "\n" 18 | "Language: en_US\n" 19 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 20 | "X-Loco-Version: 2.6.6; wp-6.4.2" 21 | 22 | #. Plugin Name of the plugin 23 | msgid "WooCommerce Epayco Gateway" 24 | msgstr "" 25 | 26 | #. Description of the plugin 27 | msgid "Plugin ePayco Gateway for WooCommerce." 28 | msgstr "" 29 | 30 | #. Author of the plugin 31 | msgid "ePayco" 32 | msgstr "" 33 | 34 | #. Author URI of the plugin 35 | msgid "http://epayco.co" 36 | msgstr "" 37 | 38 | #: classes/class-wc-gateway-epayco.php:26 39 | msgid "ePayco Checkout Gateway" 40 | msgstr "" 41 | 42 | #: classes/class-wc-gateway-epayco.php:27 43 | msgid "Acepta tarjetas de credito, depositos y transferencias." 44 | msgstr "" 45 | 46 | #: classes/class-wc-gateway-epayco.php:120 47 | msgid "Configuración Epayco" 48 | msgstr "" 49 | 50 | #: classes/class-wc-gateway-epayco.php:124 51 | msgid "" 52 | "Este módulo le permite aceptar pagos seguros por la plataforma de pagos " 53 | "ePayco.Si el cliente decide pagar por ePayco, el estado del pedido cambiará " 54 | "a " 55 | msgstr "" 56 | 57 | #: classes/class-wc-gateway-epayco.php:125 58 | msgid " Esperando Pago" 59 | msgstr "" 60 | 61 | #: classes/class-wc-gateway-epayco.php:126 62 | msgid "" 63 | "Cuando el pago sea Aceptado o Rechazado ePayco envía una confirmación a la " 64 | "tienda para cambiar el estado del pedido." 65 | msgstr "" 66 | 67 | #: classes/class-wc-gateway-epayco.php:137 68 | msgid "Validar llaves" 69 | msgstr "" 70 | 71 | #: classes/class-wc-gateway-epayco.php:146 72 | msgid "Validación de llaves PUBLIC_KEY y PRIVATE_KEY" 73 | msgstr "" 74 | 75 | #: classes/class-wc-gateway-epayco.php:158 76 | msgid "Llaves de comercio inválidas" 77 | msgstr "" 78 | 79 | #: classes/class-wc-gateway-epayco.php:159 80 | msgid "" 81 | "Las llaves Public Key, Private Key insertadas
del comercio son inválidas." 82 | "
Consúltelas en el apartado de integraciones
Llaves API en su " 83 | "Dashboard ePayco." 84 | msgstr "" 85 | 86 | #: classes/class-wc-gateway-epayco.php:185 87 | msgid "Gateway Disabled" 88 | msgstr "" 89 | 90 | #: classes/class-wc-gateway-epayco.php:189 91 | msgid "Servired/Epayco only support " 92 | msgstr "" 93 | 94 | #: classes/class-wc-gateway-epayco.php:207 95 | msgid "Habilitar/Deshabilitar" 96 | msgstr "" 97 | 98 | #: classes/class-wc-gateway-epayco.php:209 99 | msgid "Habilitar ePayco" 100 | msgstr "" 101 | 102 | #: classes/class-wc-gateway-epayco.php:213 103 | msgid "Título" 104 | msgstr "" 105 | 106 | #: classes/class-wc-gateway-epayco.php:215 107 | msgid "Corresponde al título que el usuario ve durante el Checkout." 108 | msgstr "" 109 | 110 | #: classes/class-wc-gateway-epayco.php:216 111 | msgid "Checkout ePayco (Tarjetas de crédito,debito,efectivo)" 112 | msgstr "" 113 | 114 | #: classes/class-wc-gateway-epayco.php:220 115 | msgid "Descripción" 116 | msgstr "" 117 | 118 | #: classes/class-wc-gateway-epayco.php:222 119 | msgid "Corresponde a la descripción que verá el usuario durante el Checkout" 120 | msgstr "" 121 | 122 | #: classes/class-wc-gateway-epayco.php:223 123 | msgid "Checkout ePayco (Tarjetas de crédito,débito,efectivo)" 124 | msgstr "" 125 | 126 | #: classes/class-wc-gateway-epayco.php:226 127 | msgid "P_CUST_ID_CLIENTE" 128 | msgstr "" 129 | 130 | #: classes/class-wc-gateway-epayco.php:228 131 | msgid "" 132 | "ID de cliente que lo identifica en ePayco. Lo puede encontrar en su panel de " 133 | "clientes en la opción configuración" 134 | msgstr "" 135 | 136 | #: classes/class-wc-gateway-epayco.php:234 137 | msgid "P_KEY" 138 | msgstr "" 139 | 140 | #: classes/class-wc-gateway-epayco.php:236 141 | msgid "" 142 | "LLave para firmar la información enviada y recibida de ePayco. Lo puede " 143 | "encontrar en su panel de clientes en la opción configuración" 144 | msgstr "" 145 | 146 | #: classes/class-wc-gateway-epayco.php:242 147 | msgid "PUBLIC_KEY" 148 | msgstr "" 149 | 150 | #: classes/class-wc-gateway-epayco.php:244 151 | #: classes/class-wc-gateway-epayco.php:252 152 | msgid "" 153 | "LLave para autenticar y consumir los servicios de ePayco, Proporcionado en " 154 | "su panel de clientes en la opción configuración" 155 | msgstr "" 156 | 157 | #: classes/class-wc-gateway-epayco.php:250 158 | msgid "PRIVATE_KEY" 159 | msgstr "" 160 | 161 | #: classes/class-wc-gateway-epayco.php:258 162 | msgid "Sitio en pruebas" 163 | msgstr "" 164 | 165 | #: classes/class-wc-gateway-epayco.php:260 166 | msgid "Habilitar el modo de pruebas" 167 | msgstr "" 168 | 169 | #: classes/class-wc-gateway-epayco.php:261 170 | msgid "Habilite para realizar pruebas" 171 | msgstr "" 172 | 173 | #: classes/class-wc-gateway-epayco.php:265 174 | msgid "Tipo Checkout" 175 | msgstr "" 176 | 177 | #: classes/class-wc-gateway-epayco.php:268 178 | msgid "Seleccione un tipo de Checkout:" 179 | msgstr "" 180 | 181 | #: classes/class-wc-gateway-epayco.php:269 182 | msgid "" 183 | "(Onpage Checkout, el usuario al pagar permanece en el sitio) ó (Standard " 184 | "Checkout, el usario al pagar es redireccionado a la pasarela de ePayco)" 185 | msgstr "" 186 | 187 | #: classes/class-wc-gateway-epayco.php:273 188 | msgid "Estado Final del Pedido" 189 | msgstr "" 190 | 191 | #: classes/class-wc-gateway-epayco.php:276 192 | msgid "" 193 | "Seleccione el estado del pedido que se aplicará a la hora de aceptar y " 194 | "confirmar el pago de la orden" 195 | msgstr "" 196 | 197 | #: classes/class-wc-gateway-epayco.php:278 198 | msgid "ePayco Procesando Pago" 199 | msgstr "" 200 | 201 | #: classes/class-wc-gateway-epayco.php:279 202 | msgid "ePayco Pago Completado" 203 | msgstr "" 204 | 205 | #: classes/class-wc-gateway-epayco.php:280 206 | msgid "Procesando" 207 | msgstr "" 208 | 209 | #: classes/class-wc-gateway-epayco.php:281 210 | msgid "Completado" 211 | msgstr "" 212 | 213 | #: classes/class-wc-gateway-epayco.php:285 214 | msgid "Estado Cancelado del Pedido" 215 | msgstr "" 216 | 217 | #: classes/class-wc-gateway-epayco.php:288 218 | msgid "" 219 | "Seleccione el estado del pedido que se aplicará cuando la transacciónes " 220 | "Cancelada o Rechazada" 221 | msgstr "" 222 | 223 | #: classes/class-wc-gateway-epayco.php:290 224 | msgid "ePayco Pago Cancelado" 225 | msgstr "" 226 | 227 | #: classes/class-wc-gateway-epayco.php:291 228 | msgid "ePayco Pago Fallido" 229 | msgstr "" 230 | 231 | #: classes/class-wc-gateway-epayco.php:292 232 | msgid "Cancelado" 233 | msgstr "" 234 | 235 | #: classes/class-wc-gateway-epayco.php:293 236 | msgid "Fallido" 237 | msgstr "" 238 | 239 | #: classes/class-wc-gateway-epayco.php:297 240 | msgid "Página de Respuesta" 241 | msgstr "" 242 | 243 | #: classes/class-wc-gateway-epayco.php:300 244 | msgid "" 245 | "Url de la tienda donde se redirecciona al usuario luego de pagar el pedido" 246 | msgstr "" 247 | 248 | #: classes/class-wc-gateway-epayco.php:301 249 | #: classes/class-wc-gateway-epayco.php:308 250 | msgid "Seleccionar pagina" 251 | msgstr "" 252 | 253 | #: classes/class-wc-gateway-epayco.php:304 254 | msgid "Página de Confirmación" 255 | msgstr "" 256 | 257 | #: classes/class-wc-gateway-epayco.php:307 258 | msgid "Url de la tienda donde ePayco confirma el pago" 259 | msgstr "" 260 | 261 | #: classes/class-wc-gateway-epayco.php:311 262 | msgid "Reducir el stock en transacciones pendientes" 263 | msgstr "" 264 | 265 | #: classes/class-wc-gateway-epayco.php:315 266 | msgid "Habilite para reducir el stock en transacciones pendientes" 267 | msgstr "" 268 | 269 | #: classes/class-wc-gateway-epayco.php:318 270 | msgid "Idioma del Checkout" 271 | msgstr "" 272 | 273 | #: classes/class-wc-gateway-epayco.php:321 274 | msgid "Seleccione el idioma del checkout" 275 | msgstr "" 276 | 277 | #: classes/class-wc-gateway-epayco.php:326 278 | msgid "Habilitar envió de atributos a través de la URL de respuesta" 279 | msgstr "" 280 | 281 | #: classes/class-wc-gateway-epayco.php:328 282 | msgid "Habilitar el modo redirección con data" 283 | msgstr "" 284 | 285 | #: classes/class-wc-gateway-epayco.php:329 286 | msgid "" 287 | "Al habilitar esta opción puede exponer información sensible de sus clientes, " 288 | "el uso de esta opción es bajo su responsabilidad, conozca esta información " 289 | "en el siguiente link." 291 | msgstr "" 292 | 293 | #: classes/class-wc-gateway-epayco.php:570 294 | msgid "Cargando métodos de pago" 295 | msgstr "" 296 | 297 | #: classes/class-wc-gateway-epayco.php:571 298 | msgid "" 299 | "Si no se cargan automáticamente, haga clic en el botón \\\"Pagar con " 300 | "ePayco\\\"" 301 | msgstr "" 302 | 303 | #: assets/js/frontend/blocks.js:9 304 | msgid "Epayco" 305 | msgstr "" 306 | -------------------------------------------------------------------------------- /classes/class-wc-transaction-epayco.php: -------------------------------------------------------------------------------- 1 | get_id(); 9 | $current_state = $order->get_status(); 10 | $modo = $settings['test_mode'] === "true" ? "pruebas" : "Producción"; 11 | 12 | self::save_epayco_metadata($order, $modo, $data); 13 | 14 | $estado_final_exitoso = self::get_success_status($settings); 15 | $estado_cancelado = self::get_cancel_status($settings); 16 | 17 | switch ($data['x_cod_transaction_state']) { 18 | case 1: // Aprobada 19 | self::handle_approved($order, $order_id, $current_state, $settings, $estado_final_exitoso,$data['x_franchise']); 20 | echo "1"; 21 | break; 22 | 23 | case 2: case 4: case 10: case 11: // Cancelada, fallida o rechazada 24 | self::handle_failed($order, $current_state, $estado_cancelado, $data['is_confirmation'],$settings,$data['x_franchise']); 25 | echo "2"; 26 | break; 27 | 28 | case 3: case 7: // Pendiente 29 | self::handle_pending($order, $order_id, $current_state, $settings,$data['x_franchise']); 30 | echo "3"; 31 | break; 32 | 33 | case 6: // Reversado 34 | self::handle_reversed($order); 35 | echo "6"; 36 | break; 37 | 38 | default: 39 | self::handle_default($order, $current_state); 40 | echo "default"; 41 | break; 42 | } 43 | } 44 | 45 | private static function save_epayco_metadata($order, $modo, $data) { 46 | $order->update_meta_data('refPayco', esc_attr($data['x_ref_payco'])); 47 | $order->update_meta_data('modo', esc_attr($modo)); 48 | $order->update_meta_data('fecha', esc_attr($data['x_fecha_transaccion'])); 49 | $order->update_meta_data('franquicia', esc_attr($data['x_franchise'])); 50 | $order->update_meta_data('autorizacion', esc_attr($data['x_approval_code'])); 51 | $order->save(); 52 | } 53 | 54 | private static function get_success_status($settings) { 55 | if ($settings['test_mode'] === "true") { 56 | return ($settings['end_order_state'] == "processing") ? "processing_test" : 57 | ( ($settings['end_order_state'] == "completed") ? "completed_test" : 58 | ( ($settings['end_order_state'] == "epayco-processing") ? "epayco_processing" : 59 | ( ($settings['end_order_state'] == "epayco-completed") ? "epayco_completed" : 60 | $settings['end_order_state'] ))); 61 | } 62 | return $settings['end_order_state']; 63 | } 64 | 65 | private static function get_cancel_status($settings) { 66 | if ($settings['test_mode'] === "true") { 67 | return ($settings['cancel_order_state'] == "cancelled") ? "cancelled" : 68 | ( ($settings['cancel_order_state'] == "epayco-cancelled") ? "epayco_cancelled" : 69 | ( ($settings['cancel_order_state'] == "epayco-failed") ? "epayco_failed" : "failed")); 70 | } 71 | return $settings['cancel_order_state']; 72 | } 73 | 74 | private static function handle_approved($order, $order_id, $current_state, $settings, $estado_final_exitoso,$franchise) { 75 | try{ 76 | $logger = new WC_Logger(); 77 | if ($settings['reduce_stock_pending'] === "yes" && in_array($current_state, ['epayco_failed', 'epayco_cancelled', 'failed', 'canceled','epayco-failed', 'epayco-cancelled'])) { 78 | if (!EpaycoOrder::ifStockDiscount($order_id)) { 79 | EpaycoOrder::updateStockDiscount($order_id, 1); 80 | if ( in_array($estado_final_exitoso, ['epayco-processing', 'epayco-completed'])) { 81 | self::restore_stock($order_id, 'decrease'); 82 | } 83 | } 84 | } else { 85 | if (!EpaycoOrder::ifStockDiscount($order_id)) { 86 | EpaycoOrder::updateStockDiscount($order_id, 1); 87 | } 88 | } 89 | 90 | if (in_array($current_state, ['pending'])) { 91 | 92 | $order->update_status('on-hold'); 93 | if ($settings['reduce_stock_pending'] !== "yes"){ 94 | self::restore_stock($order_id); 95 | } 96 | } 97 | 98 | if (!in_array($current_state, ['processing', 'completed', 'processing_test', 'completed_test','epayco-processing', 'epayco-completed','epayco_processing', 'epayco_completed',])) { 99 | 100 | $order->payment_complete($order->get_meta('refPayco')); 101 | $order->update_status($estado_final_exitoso); 102 | if ($settings['reduce_stock_pending'] !== "yes"){ 103 | self::restore_stock($order_id, 'decrease'); 104 | } 105 | } 106 | }catch (\Exception $ex) { 107 | $error_message = "handle_approved got error: {$ex->getMessage()}"; 108 | $logger->add('handle_approved', $error_message); 109 | throw new Exception($error_message); 110 | } 111 | } 112 | 113 | private static function handle_failed($order, $current_state, $estado_cancelado, $isConfirmation,$settings,$franchise) { 114 | try{ 115 | $logger = new WC_Logger(); 116 | if (!in_array($current_state, [ 117 | 'processing', 118 | 'completed', 119 | 'processing_test', 120 | 'completed_test', 121 | 'epayco-processing', 122 | 'epayco-completed', 123 | 'epayco_processing', 124 | 'epayco_completed' 125 | ])) { 126 | $order->update_status($estado_cancelado); 127 | if ($settings['reduce_stock_pending'] === "yes" && in_array($current_state, ['pending', 'on-hold'])) { 128 | if($current_state == 'pending'){ 129 | if (!$isConfirmation) { 130 | wp_safe_redirect(wc_get_checkout_url()); 131 | exit; 132 | } 133 | }else{ 134 | self::restore_stock($order->get_id()); 135 | } 136 | } 137 | 138 | } 139 | }catch (\Exception $ex) { 140 | $error_message = "handle_failed got error: {$ex->getMessage()}"; 141 | $logger->add('handle_failed', $error_message); 142 | throw new Exception($error_message); 143 | } 144 | } 145 | 146 | private static function handle_pending($order, $order_id, $current_state, $settings,$franchise) { 147 | try{ 148 | $logger = new WC_Logger(); 149 | if (!EpaycoOrder::ifStockDiscount($order_id) && $settings['reduce_stock_pending'] != 'yes') { 150 | EpaycoOrder::updateStockDiscount($order_id, 1); 151 | } 152 | if ($settings['reduce_stock_pending'] === "yes" && in_array($current_state, ['epayco_failed', 'epayco_cancelled', 'failed', 'canceled','epayco-failed', 'epayco-cancelled'])) { 153 | // self::restore_stock($order_id, 'decrease'); 154 | $order->update_status('on-hold'); 155 | }else{ 156 | if ($current_state != 'on-hold') { 157 | $order->update_status('on-hold'); 158 | if ($settings['reduce_stock_pending'] !== "yes"){ 159 | self::restore_stock($order_id); 160 | } 161 | } 162 | } 163 | 164 | 165 | }catch (\Exception $ex) { 166 | $error_message = "handle_pending got error: {$ex->getMessage()}"; 167 | $logger->add('handle_pending', $error_message); 168 | throw new Exception($error_message); 169 | } 170 | } 171 | 172 | private static function handle_reversed($order) { 173 | $order->update_status('refunded'); 174 | $order->add_order_note('Pago Reversado'); 175 | self::restore_stock($order->get_id()); 176 | } 177 | 178 | private static function handle_default($order, $current_state) { 179 | if (!in_array($current_state, ['processing', 'completed'])) { 180 | $order->update_status('epayco-failed'); 181 | $order->add_order_note('Pago fallido o abandonado'); 182 | self::restore_stock($order->get_id()); 183 | } 184 | } 185 | 186 | public static function restore_stock($order_id, $direction = 'increase') { 187 | $order = wc_get_order($order_id); 188 | if (!get_option('woocommerce_manage_stock') == 'yes' && !sizeof($order->get_items()) > 0) { 189 | return; 190 | } 191 | foreach ($order->get_items() as $item) { 192 | // Get an instance of corresponding the WC_Product object 193 | $product = $item->get_product(); 194 | $qty = $item->get_quantity(); // Get the item quantity 195 | wc_update_product_stock($product, $qty, $direction); 196 | } 197 | if (function_exists('restore_order_stock')) { 198 | // restore_order_stock($order_id, $direction); 199 | } 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /languages/woo-epayco-gateway-en_US.po: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2024 ePayco 2 | # This file is distributed under the GNU General Public License v3.0. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: WooCommerce Epayco Gateway 7.0.0\n" 6 | "Report-Msgid-Bugs-To: https://wordpress." 7 | "org/support/plugin/Plugin_ePayco_WooCommerce\n" 8 | "Last-Translator: \n" 9 | "Language-Team: English (United States)\n" 10 | "MIME-Version: 1.0\n" 11 | "Content-Type: text/plain; charset=UTF-8\n" 12 | "Content-Transfer-Encoding: 8bit\n" 13 | "POT-Creation-Date: 2024-01-29T22:36:59-05:00\n" 14 | "PO-Revision-Date: 2024-01-30 04:12+0000\n" 15 | "X-Generator: Loco https://localise.biz/\n" 16 | "X-Domain: woo-epayco-gateway\n" 17 | "Language: en_US\n" 18 | "Plural-Forms: nplurals=2; plural=n != 1;\n" 19 | "X-Loco-Version: 2.6.6; wp-6.4.2" 20 | 21 | #. Plugin Name of the plugin 22 | msgid "WooCommerce Epayco Gateway" 23 | msgstr "WooCommerce Epayco Gateway" 24 | 25 | #. Description of the plugin 26 | msgid "Plugin ePayco Gateway for WooCommerce." 27 | msgstr "Plugin ePayco Gateway for WooCommerce." 28 | 29 | #. Author of the plugin 30 | msgid "ePayco" 31 | msgstr "ePayco" 32 | 33 | #. Author URI of the plugin 34 | msgid "http://epayco.co" 35 | msgstr "http://epayco.co" 36 | 37 | #: classes/class-wc-gateway-epayco.php:26 38 | msgid "ePayco Checkout Gateway" 39 | msgstr "ePayco Checkout Gateway" 40 | 41 | #: classes/class-wc-gateway-epayco.php:27 42 | msgid "Acepta tarjetas de credito, depositos y transferencias." 43 | msgstr "Accepts credit cards, deposits and transfers." 44 | 45 | #: classes/class-wc-gateway-epayco.php:120 46 | msgid "Configuración Epayco" 47 | msgstr "Epayco Configuration" 48 | 49 | #: classes/class-wc-gateway-epayco.php:124 50 | msgid "" 51 | "Este módulo le permite aceptar pagos seguros por la plataforma de pagos " 52 | "ePayco.Si el cliente decide pagar por ePayco, el estado del pedido cambiará " 53 | "a " 54 | msgstr "" 55 | "This module allows you to accept secure payments through the ePayco payment " 56 | "platform. If the customer decides to pay by ePayco, the order status will " 57 | "change to" 58 | 59 | #: classes/class-wc-gateway-epayco.php:125 60 | msgid " Esperando Pago" 61 | msgstr "Waiting for payment" 62 | 63 | #: classes/class-wc-gateway-epayco.php:126 64 | msgid "" 65 | "Cuando el pago sea Aceptado o Rechazado ePayco envía una confirmación a la " 66 | "tienda para cambiar el estado del pedido." 67 | msgstr "" 68 | "When the payment is Accepted or Rejected, ePayco sends a confirmation to the " 69 | "store to change the status of the order." 70 | 71 | #: classes/class-wc-gateway-epayco.php:137 72 | msgid "Validar llaves" 73 | msgstr "Validate keys" 74 | 75 | #: classes/class-wc-gateway-epayco.php:146 76 | msgid "Validación de llaves PUBLIC_KEY y PRIVATE_KEY" 77 | msgstr "PUBLIC_KEY and PRIVATE_KEY key validation" 78 | 79 | #: classes/class-wc-gateway-epayco.php:158 80 | msgid "Llaves de comercio inválidas" 81 | msgstr "Invalid keys" 82 | 83 | #: classes/class-wc-gateway-epayco.php:159 84 | msgid "" 85 | "Las llaves Public Key, Private Key insertadas
del comercio son inválidas." 86 | "
Consúltelas en el apartado de integraciones
Llaves API en su " 87 | "Dashboard ePayco." 88 | msgstr "" 89 | "The Public Key, Private Key keys inserted from the merchant are invalid. " 90 | "Consult them in the integrations
API Keys section in your ePayco " 91 | "Dashboard." 92 | 93 | #: classes/class-wc-gateway-epayco.php:185 94 | msgid "Gateway Disabled" 95 | msgstr "Gateway Disabled" 96 | 97 | #: classes/class-wc-gateway-epayco.php:189 98 | msgid "Servired/Epayco only support " 99 | msgstr "Servired/Epayco only support " 100 | 101 | #: classes/class-wc-gateway-epayco.php:207 102 | msgid "Habilitar/Deshabilitar" 103 | msgstr "Enable/disable" 104 | 105 | #: classes/class-wc-gateway-epayco.php:209 106 | msgid "Habilitar ePayco" 107 | msgstr "Enable ePayco" 108 | 109 | #: classes/class-wc-gateway-epayco.php:213 110 | msgid "Título" 111 | msgstr "Title" 112 | 113 | #: classes/class-wc-gateway-epayco.php:215 114 | msgid "Corresponde al título que el usuario ve durante el Checkout." 115 | msgstr "It corresponds to the title that the user sees during Checkout." 116 | 117 | #: classes/class-wc-gateway-epayco.php:216 118 | msgid "Checkout ePayco (Tarjetas de crédito,debito,efectivo)" 119 | msgstr "Checkout ePayco (Credit cards, debit cards, cash)" 120 | 121 | #: classes/class-wc-gateway-epayco.php:220 122 | msgid "Descripción" 123 | msgstr "Description" 124 | 125 | #: classes/class-wc-gateway-epayco.php:222 126 | msgid "Corresponde a la descripción que verá el usuario durante el Checkout" 127 | msgstr "Corresponds to the description that the user will see during Checkout" 128 | 129 | #: classes/class-wc-gateway-epayco.php:223 130 | msgid "Checkout ePayco (Tarjetas de crédito,débito,efectivo)" 131 | msgstr "Checkout ePayco (Credit cards, debit cards, cash)" 132 | 133 | #: classes/class-wc-gateway-epayco.php:226 134 | msgid "P_CUST_ID_CLIENTE" 135 | msgstr "P_CUST_ID_CLIENTE" 136 | 137 | #: classes/class-wc-gateway-epayco.php:228 138 | msgid "" 139 | "ID de cliente que lo identifica en ePayco. Lo puede encontrar en su panel de " 140 | "clientes en la opción configuración" 141 | msgstr "" 142 | "Customer ID that identifies you in ePayco. You can find it in your customer " 143 | "panel in the configuration option" 144 | 145 | #: classes/class-wc-gateway-epayco.php:234 146 | msgid "P_KEY" 147 | msgstr "P_KEY" 148 | 149 | #: classes/class-wc-gateway-epayco.php:236 150 | msgid "" 151 | "LLave para firmar la información enviada y recibida de ePayco. Lo puede " 152 | "encontrar en su panel de clientes en la opción configuración" 153 | msgstr "" 154 | "Key to sign the information sent and received from ePayco. You can find it " 155 | "in your customer panel in the configuration option" 156 | 157 | #: classes/class-wc-gateway-epayco.php:242 158 | msgid "PUBLIC_KEY" 159 | msgstr "PUBLIC_KEY" 160 | 161 | #: classes/class-wc-gateway-epayco.php:244 162 | #: classes/class-wc-gateway-epayco.php:252 163 | msgid "" 164 | "LLave para autenticar y consumir los servicios de ePayco, Proporcionado en " 165 | "su panel de clientes en la opción configuración" 166 | msgstr "" 167 | "Key to authenticate and consume ePayco services, Provided in your customer " 168 | "panel in the configuration option" 169 | 170 | #: classes/class-wc-gateway-epayco.php:250 171 | msgid "PRIVATE_KEY" 172 | msgstr "PRIVATE_KEY" 173 | 174 | #: classes/class-wc-gateway-epayco.php:258 175 | msgid "Sitio en pruebas" 176 | msgstr "Test site" 177 | 178 | #: classes/class-wc-gateway-epayco.php:260 179 | msgid "Habilitar el modo de pruebas" 180 | msgstr "Enable testing mode" 181 | 182 | #: classes/class-wc-gateway-epayco.php:261 183 | msgid "Habilite para realizar pruebas" 184 | msgstr "Enable for testing" 185 | 186 | #: classes/class-wc-gateway-epayco.php:265 187 | msgid "Tipo Checkout" 188 | msgstr "Checkout Type" 189 | 190 | #: classes/class-wc-gateway-epayco.php:268 191 | msgid "Seleccione un tipo de Checkout:" 192 | msgstr "Select a Checkout type:" 193 | 194 | #: classes/class-wc-gateway-epayco.php:269 195 | msgid "" 196 | "(Onpage Checkout, el usuario al pagar permanece en el sitio) ó (Standard " 197 | "Checkout, el usario al pagar es redireccionado a la pasarela de ePayco)" 198 | msgstr "" 199 | "(Onpage Checkout, the user remains on the site when paying) or (Standard " 200 | "Checkout, the user when paying is redirected to the ePayco gateway)" 201 | 202 | #: classes/class-wc-gateway-epayco.php:273 203 | msgid "Estado Final del Pedido" 204 | msgstr "Final Order Status" 205 | 206 | #: classes/class-wc-gateway-epayco.php:276 207 | msgid "" 208 | "Seleccione el estado del pedido que se aplicará a la hora de aceptar y " 209 | "confirmar el pago de la orden" 210 | msgstr "" 211 | "Select the order status that will be applied when accepting and confirming " 212 | "payment for the order" 213 | 214 | #: classes/class-wc-gateway-epayco.php:278 215 | msgid "ePayco Procesando Pago" 216 | msgstr "ePayco Processing Payment" 217 | 218 | #: classes/class-wc-gateway-epayco.php:279 219 | msgid "ePayco Pago Completado" 220 | msgstr "ePayco Payment Completed" 221 | 222 | #: classes/class-wc-gateway-epayco.php:280 223 | msgid "Procesando" 224 | msgstr "Processing" 225 | 226 | #: classes/class-wc-gateway-epayco.php:281 227 | msgid "Completado" 228 | msgstr "Complete" 229 | 230 | #: classes/class-wc-gateway-epayco.php:285 231 | msgid "Estado Cancelado del Pedido" 232 | msgstr "Canceled Order Status" 233 | 234 | #: classes/class-wc-gateway-epayco.php:288 235 | msgid "" 236 | "Seleccione el estado del pedido que se aplicará cuando la transacciónes " 237 | "Cancelada o Rechazada" 238 | msgstr "" 239 | "Select the order status that will be applied when the transaction is " 240 | "Canceled or Rejected" 241 | 242 | #: classes/class-wc-gateway-epayco.php:290 243 | msgid "ePayco Pago Cancelado" 244 | msgstr "ePayco Payment Canceled" 245 | 246 | #: classes/class-wc-gateway-epayco.php:291 247 | msgid "ePayco Pago Fallido" 248 | msgstr "ePayco Payment Failed" 249 | 250 | #: classes/class-wc-gateway-epayco.php:292 251 | msgid "Cancelado" 252 | msgstr "Cancelled" 253 | 254 | #: classes/class-wc-gateway-epayco.php:293 255 | msgid "Fallido" 256 | msgstr "Failed" 257 | 258 | #: classes/class-wc-gateway-epayco.php:297 259 | msgid "Página de Respuesta" 260 | msgstr "Response Page" 261 | 262 | #: classes/class-wc-gateway-epayco.php:300 263 | msgid "" 264 | "Url de la tienda donde se redirecciona al usuario luego de pagar el pedido" 265 | msgstr "URL of the store where the user is redirected after paying the order" 266 | 267 | #: classes/class-wc-gateway-epayco.php:301 268 | #: classes/class-wc-gateway-epayco.php:308 269 | msgid "Seleccionar pagina" 270 | msgstr "Select page" 271 | 272 | #: classes/class-wc-gateway-epayco.php:304 273 | msgid "Página de Confirmación" 274 | msgstr "Confirmation Page" 275 | 276 | #: classes/class-wc-gateway-epayco.php:307 277 | msgid "Url de la tienda donde ePayco confirma el pago" 278 | msgstr "URL of the store where ePayco confirms the payment" 279 | 280 | #: classes/class-wc-gateway-epayco.php:311 281 | msgid "Reducir el stock en transacciones pendientes" 282 | msgstr "Reduce stock in pending transactions" 283 | 284 | #: classes/class-wc-gateway-epayco.php:315 285 | msgid "Habilite para reducir el stock en transacciones pendientes" 286 | msgstr "Enable to reduce stock in pending transactions" 287 | 288 | #: classes/class-wc-gateway-epayco.php:318 289 | msgid "Idioma del Checkout" 290 | msgstr "Checkout Language" 291 | 292 | #: classes/class-wc-gateway-epayco.php:321 293 | msgid "Seleccione el idioma del checkout" 294 | msgstr "Select the checkout language" 295 | 296 | #: classes/class-wc-gateway-epayco.php:326 297 | msgid "Habilitar envió de atributos a través de la URL de respuesta" 298 | msgstr "Enable sending attributes via response URL" 299 | 300 | #: classes/class-wc-gateway-epayco.php:328 301 | msgid "Habilitar el modo redirección con data" 302 | msgstr "Enable redirection mode with data" 303 | 304 | #: classes/class-wc-gateway-epayco.php:329 305 | msgid "" 306 | "Al habilitar esta opción puede exponer información sensible de sus clientes, " 307 | "el uso de esta opción es bajo su responsabilidad, conozca esta información " 308 | "en el siguiente link." 310 | msgstr "" 311 | "By enabling this option you may expose sensitive information of your clients," 312 | " the use of this option is under your responsibility, know this information " 313 | "in the following link." 315 | 316 | #: classes/class-wc-gateway-epayco.php:570 317 | msgid "Cargando métodos de pago" 318 | msgstr "Loading payment methods" 319 | 320 | #: classes/class-wc-gateway-epayco.php:571 321 | msgid "" 322 | "Si no se cargan automáticamente, haga clic en el botón \\\"Pagar con " 323 | "ePayco\\\"" 324 | msgstr "" 325 | "If they are not loaded automatically, click the \\\"Pay with ePayco\\\" " 326 | "button" 327 | 328 | #: assets/js/frontend/blocks.js:9 329 | msgid "Epayco" 330 | msgstr "Epayco" 331 | -------------------------------------------------------------------------------- /assets/images/logoepayco.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /woocommerce-gateway-payco.php: -------------------------------------------------------------------------------- 1 | register( new WC_Gateway_Epayco_Support ); 104 | } 105 | ); 106 | } 107 | } 108 | add_action( 'woocommerce_blocks_loaded', 'woocommerce_gateway_epayco_block_support' ); 109 | 110 | function epayco_woocommerce_addon_settings_link( $links ) { 111 | array_push( $links, '' . __( 'Configuración' ) . '' ); 112 | return $links; 113 | } 114 | 115 | add_filter( "plugin_action_links_".plugin_basename( __FILE__ ),'epayco_woocommerce_addon_settings_link' ); 116 | function epayco_update_db_check() 117 | { 118 | require_once(dirname(__FILE__) . '/includes/blocks/EpaycoOrder.php'); 119 | EpaycoOrder::setup(); 120 | } 121 | add_action('plugins_loaded', 'epayco_update_db_check'); 122 | function register_epayco_order_status() { 123 | register_post_status( 'wc-epayco-failed', array( 124 | 'label' => 'ePayco Pago Fallido', 125 | 'public' => true, 126 | 'show_in_admin_status_list' => true, 127 | 'show_in_admin_all_list' => true, 128 | 'exclude_from_search' => false, 129 | 'label_count' => _n_noop( 'ePayco Pago Fallido (%s)', 'ePayco Pago Fallido (%s)' ) 130 | )); 131 | 132 | register_post_status( 'wc-epayco_failed', array( 133 | 'label' => 'ePayco Pago Fallido Prueba', 134 | 'public' => true, 135 | 'show_in_admin_status_list' => true, 136 | 'show_in_admin_all_list' => true, 137 | 'exclude_from_search' => false, 138 | 'label_count' => _n_noop( 'ePayco Pago Fallido Prueba (%s)', 'ePayco Pago Fallido Prueba (%s)' ) 139 | )); 140 | 141 | register_post_status( 'wc-epayco-cancelled', array( 142 | 'label' => 'ePayco Pago Cancelado', 143 | 'public' => true, 144 | 'show_in_admin_status_list' => true, 145 | 'show_in_admin_all_list' => true, 146 | 'exclude_from_search' => false, 147 | 'label_count' => _n_noop( 'ePayco Pago Cancelado (%s)', 'ePayco Pago Cancelado (%s)' ) 148 | )); 149 | 150 | register_post_status( 'wc-epayco_cancelled', array( 151 | 'label' => 'ePayco Pago Cancelado Prueba', 152 | 'public' => true, 153 | 'show_in_admin_status_list' => true, 154 | 'show_in_admin_all_list' => true, 155 | 'exclude_from_search' => false, 156 | 'label_count' => _n_noop( 'ePayco Pago Cancelado Prueba (%s)', 'ePayco Pago Cancelado Prueba (%s)' ) 157 | )); 158 | 159 | register_post_status( 'wc-epayco-on-hold', array( 160 | 'label' => 'ePayco Pago Pendiente', 161 | 'public' => true, 162 | 'show_in_admin_status_list' => true, 163 | 'show_in_admin_all_list' => true, 164 | 'exclude_from_search' => false, 165 | 'label_count' => _n_noop( 'ePayco Pago Pendiente (%s)', 'ePayco Pago Pendiente (%s)' ) 166 | )); 167 | 168 | register_post_status( 'wc-epayco_on_hold', array( 169 | 'label' => 'ePayco Pago Pendiente Prueba', 170 | 'public' => true, 171 | 'show_in_admin_status_list' => true, 172 | 'show_in_admin_all_list' => true, 173 | 'exclude_from_search' => false, 174 | 'label_count' => _n_noop( 'ePayco Pago Pendiente Prueba (%s)', 'ePayco Pago Pendiente Prueba (%s)' ) 175 | )); 176 | 177 | register_post_status( 'wc-epayco-processing', array( 178 | 'label' => 'ePayco Procesando Pago', 179 | 'public' => true, 180 | 'show_in_admin_status_list' => true, 181 | 'show_in_admin_all_list' => true, 182 | 'exclude_from_search' => false, 183 | 'label_count' => _n_noop( 'ePayco Procesando Pago (%s)', 'ePayco Procesando Pago (%s)' ) 184 | )); 185 | 186 | register_post_status( 'wc-epayco_processing', array( 187 | 'label' => 'ePayco Procesando Pago Prueba', 188 | 'public' => true, 189 | 'show_in_admin_status_list' => true, 190 | 'show_in_admin_all_list' => true, 191 | 'exclude_from_search' => false, 192 | 'label_count' => _n_noop( 'ePayco Procesando Pago Prueba(%s)', 'ePayco Procesando Pago Prueba(%s)' ) 193 | )); 194 | 195 | register_post_status( 'wc-processing', array( 196 | 'label' => 'Procesando', 197 | 'public' => true, 198 | 'show_in_admin_status_list' => true, 199 | 'show_in_admin_all_list' => true, 200 | 'exclude_from_search' => false, 201 | 'label_count' => _n_noop( 'Procesando(%s)', 'Procesando(%s)' ) 202 | )); 203 | 204 | register_post_status( 'wc-processing_test', array( 205 | 'label' => 'Procesando Prueba', 206 | 'public' => true, 207 | 'show_in_admin_status_list' => true, 208 | 'show_in_admin_all_list' => true, 209 | 'exclude_from_search' => false, 210 | 'label_count' => _n_noop( 'Procesando Prueba(%s)', 'Procesando Prueba(%s)' ) 211 | )); 212 | 213 | register_post_status( 'wc-epayco-completed', array( 214 | 'label' => 'ePayco Pago Completado', 215 | 'public' => true, 216 | 'show_in_admin_status_list' => true, 217 | 'show_in_admin_all_list' => true, 218 | 'exclude_from_search' => false, 219 | 'label_count' => _n_noop( 'ePayco Pago Completado (%s)', 'ePayco Pago Completado (%s)' ) 220 | )); 221 | 222 | register_post_status( 'wc-epayco_completed', array( 223 | 'label' => 'ePayco Pago Completado Prueba', 224 | 'public' => true, 225 | 'show_in_admin_status_list' => true, 226 | 'show_in_admin_all_list' => true, 227 | 'exclude_from_search' => false, 228 | 'label_count' => _n_noop( 'ePayco Pago Completado Prueba (%s)', 'ePayco Pago Completado Prueba (%s)' ) 229 | )); 230 | 231 | register_post_status( 'wc-completed', array( 232 | 'label' => 'Completado', 233 | 'public' => true, 234 | 'show_in_admin_status_list' => true, 235 | 'show_in_admin_all_list' => true, 236 | 'exclude_from_search' => false, 237 | 'label_count' => _n_noop( 'Completado(%s)', 'Completado(%s)' ) 238 | )); 239 | 240 | register_post_status( 'wc-completed_test', array( 241 | 'label' => 'Completado Prueba', 242 | 'public' => true, 243 | 'show_in_admin_status_list' => true, 244 | 'show_in_admin_all_list' => true, 245 | 'exclude_from_search' => false, 246 | 'label_count' => _n_noop( 'Completado Prueba(%s)', 'Completado Prueba(%s)' ) 247 | )); 248 | } 249 | add_action( 'plugins_loaded', 'register_epayco_order_status' ); 250 | 251 | function add_epayco_to_order_statuses( $order_statuses ) { 252 | $new_order_statuses = array(); 253 | $epayco_order = get_option('epayco_order_status'); 254 | $testMode = $epayco_order == "yes" ? "true" : "false"; 255 | foreach ( $order_statuses as $key => $status ) { 256 | $new_order_statuses[ $key ] = $status; 257 | if ( 'wc-cancelled' === $key ) { 258 | if($testMode=="true"){ 259 | $new_order_statuses['wc-epayco_cancelled'] = 'ePayco Pago Cancelado Prueba'; 260 | }else{ 261 | $new_order_statuses['wc-epayco-cancelled'] = 'ePayco Pago Cancelado'; 262 | } 263 | } 264 | 265 | if ( 'wc-failed' === $key ) { 266 | if($testMode=="true"){ 267 | $new_order_statuses['wc-epayco_failed'] = 'ePayco Pago Fallido Prueba'; 268 | }else{ 269 | $new_order_statuses['wc-epayco-failed'] = 'ePayco Pago Fallido'; 270 | } 271 | } 272 | 273 | if ( 'wc-on-hold' === $key ) { 274 | if($testMode=="true"){ 275 | $new_order_statuses['wc-epayco_on_hold'] = 'ePayco Pago Pendiente Prueba'; 276 | }else{ 277 | $new_order_statuses['wc-epayco-on-hold'] = 'ePayco Pago Pendiente'; 278 | } 279 | } 280 | 281 | if ( 'wc-processing' === $key ) { 282 | if($testMode=="true"){ 283 | $new_order_statuses['wc-epayco_processing'] = 'ePayco Pago Procesando Prueba'; 284 | }else{ 285 | $new_order_statuses['wc-epayco-processing'] = 'ePayco Pago Procesando'; 286 | } 287 | }else { 288 | if($testMode=="true"){ 289 | $new_order_statuses['wc-processing_test'] = 'Procesando Prueba'; 290 | }else{ 291 | $new_order_statuses['wc-processing'] = 'Procesando'; 292 | } 293 | } 294 | 295 | if ( 'wc-completed' === $key ) { 296 | if($testMode=="true"){ 297 | $new_order_statuses['wc-epayco_completed'] = 'ePayco Pago Completado Prueba'; 298 | }else{ 299 | $new_order_statuses['wc-epayco-completed'] = 'ePayco Pago Completado'; 300 | } 301 | }else{ 302 | if($testMode=="true"){ 303 | $new_order_statuses['wc-completed_test'] = 'Completado Prueba'; 304 | }else{ 305 | $new_order_statuses['wc-completed'] = 'Completado'; 306 | } 307 | } 308 | } 309 | return $new_order_statuses; 310 | } 311 | add_filter( 'wc_order_statuses', 'add_epayco_to_order_statuses' ); 312 | 313 | function styling_admin_order_list() { 314 | global $pagenow, $post; 315 | //if( $pagenow != 'edit.php') return; // Exit 316 | //if( get_post_type($post->ID) != 'shop_order' ) return; // Exit 317 | // HERE we set your custom status 318 | $epayco_order = get_option('epayco_order_status'); 319 | $testMode = $epayco_order == "yes" ? "true" : "false"; 320 | if($testMode=="true"){ 321 | $order_status_failed = 'epayco_failed'; 322 | $order_status_on_hold = 'epayco_on_hold'; 323 | $order_status_processing = 'epayco_processing'; 324 | $order_status_processing_ = 'processing_test'; 325 | $order_status_completed = 'epayco_completed'; 326 | $order_status_cancelled = 'epayco_cancelled'; 327 | $order_status_completed_ = 'completed_test'; 328 | 329 | }else{ 330 | $order_status_failed = 'epayco-failed'; 331 | $order_status_on_hold = 'epayco-on-hold'; 332 | $order_status_processing = 'epayco-processing'; 333 | $order_status_processing_ = 'processing'; 334 | $order_status_completed = 'epayco-completed'; 335 | $order_status_cancelled = 'epayco-cancelled'; 336 | $order_status_completed_ = 'completed'; 337 | } 338 | ?> 339 | 340 | 370 | 371 | get_id() : $order->id; 405 | $ref_payco = $order->get_meta('refPayco')??get_post_meta( $order_id, 'refPayco', true ); 406 | $modo = $order->get_meta('modo')??get_post_meta( $order_id, 'modo', true ); 407 | $fecha = $order->get_meta('fecha')??get_post_meta( $order_id, 'fecha', true ); 408 | $franquicia = $order->get_meta('franquicia')??get_post_meta( $order_id, 'franquicia', true ); 409 | $autorizacion = $order->get_meta('autorizacion')??get_post_meta( $order_id, 'autorizacion', true ); 410 | if( null !== $ref_payco && null !== $fecha && null !== $franquicia && null !== $autorizacion 411 | ){ 412 | echo '
413 |

Detalle de la transacción

414 |
415 |
416 |
417 |
418 |

'.__('Pago con ePayco').': ' . $ref_payco . '

419 |

'.__('Modo').': ' . $modo . '

420 |
421 |
422 |
423 |
424 |

'.__('Fecha y hora transacción').': ' . $fecha . '

425 |

'.__('Franquicia/Medio de pago').': ' . $franquicia . '

426 |
427 |
428 |
429 |
430 |

'.__('Código de autorización').': ' . $autorizacion . '

431 |
432 |
433 |
434 |
435 | '; 436 | } 437 | 438 | } 439 | 440 | 441 | /////////////////////////////////////////////////////////////////////// 442 | add_action('woocommerce_checkout_create_order_line_item', 'add_custom_hiden_order_item_meta_data', 20, 4 ); 443 | function add_custom_hiden_order_item_meta_data( $item, $cart_item_key, $values, $order ) { 444 | 445 | // Set user meta custom field as order item meta 446 | if( $meta_value = get_user_meta( $order->get_user_id(), 'billing_enumber', true ) ) 447 | $item->update_meta_data( 'pa_billing-e-number', $meta_value ); 448 | } 449 | 450 | 451 | function epayco_cron_job_deactivation() { 452 | wp_clear_scheduled_hook('woocommerc_epayco_cron_hook'); 453 | as_unschedule_action( 'woocommerce_epayco_cleanup_draft_orders' ); 454 | $timestamp = wp_next_scheduled('woocommerce_epayco_cleanup_draft_orders'); 455 | if ($timestamp) { 456 | wp_unschedule_event($timestamp, 'woocommerce_epayco_cleanup_draft_orders'); 457 | } 458 | } 459 | register_deactivation_hook(__FILE__, 'epayco_cron_job_deactivation'); 460 | 461 | function payco_shop_order($postOrOrderObject) { 462 | $order = ($postOrOrderObject instanceof WP_Post) ? wc_get_order($postOrOrderObject->ID) : $postOrOrderObject; 463 | try { 464 | $logger = new WC_Logger(); 465 | $paymentsIds = explode(',', $order->get_meta(WC_Gateway_Epayco::PAYMENTS_IDS, true)); 466 | $lastPaymentId = trim(end($paymentsIds)); 467 | $orderStatus = $order->get_status(); 468 | $logger->add('ePayco_shop_order', $lastPaymentId); 469 | if (!$lastPaymentId) { 470 | return false; 471 | } 472 | if($orderStatus == 'pending' || $orderStatus == 'on-hold'){ 473 | $epayco = new WC_Gateway_Epayco(); 474 | $token = $epayco->epyacoBerarToken(); 475 | if($token && !isset($token['error'])){ 476 | $path = "payment/transaction"; 477 | $data = [ "referencePayco" => $paymentsIds[0]]; 478 | $epayco_status = $epayco->getEpaycoStatusOrder($path,$data, $token); 479 | if ($epayco_status['success']) { 480 | if (isset($epayco_status['data']) && is_array($epayco_status['data'])) { 481 | $epayco->epaycoUploadOrderStatus($epayco_status); 482 | } 483 | } 484 | } 485 | } 486 | } catch (Exception $e) { 487 | throw new Exception('Couldn\'t find order'.$e->getMessage()); 488 | } 489 | } 490 | 491 | 492 | 493 | add_action('add_meta_boxes_shop_order', 'payco_shop_order'); 494 | add_action('add_meta_boxes_woocommerce_page_wc-orders', 'payco_shop_order'); 495 | 496 | 497 | add_action('woocommerc_epayco_order_hook', 'woocommerce_epayco_cleanup_draft_orders'); 498 | 499 | register_deactivation_hook(__FILE__, 'epayco_cron_inactive'); 500 | function epayco_cron_inactive() { 501 | wp_clear_scheduled_hook('bf_epayco_event'); 502 | } 503 | // function that registers new custom schedule 504 | function bf_add_epayco_schedule( $schedules ) 505 | { 506 | $schedules[ 'every_five_minutes' ] = array( 507 | 'interval' => 300, 508 | 'display' => 'Every 5 minutes', 509 | ); 510 | 511 | return $schedules; 512 | } 513 | 514 | // function that schedules epayco event 515 | 516 | function bf_schedule_epayco_event() 517 | { 518 | // the actual hook to register new epayco schedule 519 | 520 | add_filter( 'cron_schedules', 'bf_add_epayco_schedule' ); 521 | 522 | // schedule epayco event 523 | 524 | if( !wp_next_scheduled( 'bf_epayco_event' ) ) 525 | { 526 | wp_schedule_event( time(), 'every_five_minutes', 'bf_epayco_event' ); 527 | } 528 | } 529 | add_action( 'init', 'bf_schedule_epayco_event' ); 530 | 531 | // fire custom event 532 | 533 | function bf_do_epayco_on_schedule() 534 | { 535 | if (class_exists('WC_Gateway_Epayco')) { 536 | $ePayco = new WC_Gateway_Epayco(); 537 | $ePayco->woocommerc_epayco_cron_job_funcion(); 538 | } 539 | 540 | } 541 | add_action( 'bf_epayco_event', 'bf_do_epayco_on_schedule' ); 542 | -------------------------------------------------------------------------------- /classes/class-wc-gateway-epayco.php: -------------------------------------------------------------------------------- 1 | id = 'epayco'; 28 | //$this->version = '8.2.2'; 29 | $this->icon = apply_filters('woocommerce_' . $this->id . '_icon', EPAYCO_PLUGIN_URL . 'assets/images/paymentLogo.svg' ); 30 | $this->method_title = __('ePayco Checkout Gateway', 'woo-epayco-gateway'); 31 | $this->method_description = __('Acepta tarjetas de credito, depositos y transferencias.', 'woo-epayco-gateway'); 32 | //$this->order_button_text = __('Pay', 'epayco_woocommerce'); 33 | $this->has_fields = false; 34 | $this->supports = array( 35 | 'products', 36 | 'refunds', 37 | ); 38 | // Load the settings 39 | $this->init_form_fields(); 40 | $this->init_settings(); 41 | // Define user set variables 42 | self::$_settings = get_option('woocommerce_epayco_settings'); 43 | $this->title = $this->get_option('title'); 44 | //$this->max_monto = $this->get_option('monto_maximo'); 45 | $this->description = $this->get_option('description'); 46 | // Actions 47 | add_action('valid-' . $this->id . '-standard-ipn-request', array($this, 'successful_request')); 48 | add_action('ePayco_init_validation', array($this, 'ePayco_successful_validation')); 49 | add_action('woocommerce_receipt_' . $this->id, array($this, 'receipt_page')); 50 | add_action('woocommerce_update_options_payment_gateways_' . $this->id, array($this, 'process_admin_options')); 51 | 52 | // Payment listener/API hook 53 | add_action('woocommerce_api_wc_gateway_' . $this->id, array($this, 'check_ipn_response')); 54 | add_action('woocommerce_api_' . strtolower(get_class($this) . "Validation"), array($this, 'validate_ePayco_request')); 55 | 56 | add_action('woocommerce_checkout_create_order' . $this->id, array($this, 'add_expiration')); 57 | 58 | //Cron 59 | add_action('woocommerce_epayco_cleanup_draft_orders', [$this, 'delete_epayco_expired_draft_orders']); 60 | add_action('woocommerc_epayco_cron_hook', [$this, 'woocommerc_epayco_cron_job_funcion']); 61 | 62 | add_action('admin_init', [$this, 'install']); 63 | 64 | if (! $this->is_valid_for_use()) { 65 | $this->enabled = false; 66 | } 67 | 68 | if (empty(self::$logger)) { 69 | if (version_compare(WC_VERSION, '3.0', '<')) { 70 | self::$logger = new WC_Logger(); 71 | } else { 72 | self::$logger = wc_get_logger(); 73 | } 74 | } 75 | } 76 | 77 | 78 | 79 | 80 | 81 | /** 82 | * Installation related logic for Draft order functionality. 83 | * 84 | * @internal 85 | */ 86 | public function install() 87 | { 88 | $this->maybe_create_cronjobs(); 89 | } 90 | 91 | /** 92 | * Maybe create cron events. 93 | */ 94 | protected function maybe_create_cronjobs() 95 | { 96 | $cron_data = $this->settings['cron_data'] == "yes" ? true : false; 97 | if ($cron_data) { 98 | if (function_exists('as_next_scheduled_action') && false === as_next_scheduled_action('woocommerce_epayco_cleanup_draft_orders')) { 99 | as_schedule_recurring_action(time() + 3600, 3600, 'woocommerce_epayco_cleanup_draft_orders'); 100 | } 101 | } 102 | } 103 | 104 | 105 | public function woocommerc_epayco_cron_job_funcion() 106 | { 107 | if(isset($this->settings['cron_data'])){ 108 | $cron_data = $this->settings['cron_data'] == "yes" ? true : false; 109 | if ($cron_data) { 110 | $this->getEpaycoORders(); 111 | $this->getWoocommercePendigsORders(); 112 | } 113 | } 114 | } 115 | 116 | /** 117 | * Delete draft orders older than a day in batches of 20. 118 | * 119 | * Ran on a daily cron schedule. 120 | * 121 | * @internal 122 | */ 123 | public function delete_epayco_expired_draft_orders() 124 | { 125 | $this->getEpaycoORders(); 126 | $this->getWoocommercePendigsORders(); 127 | } 128 | 129 | 130 | 131 | function is_valid_for_use() 132 | { 133 | if (! in_array(get_woocommerce_currency(), array('COP', 'USD'), true)) { 134 | return false; 135 | } else { 136 | return true; 137 | } 138 | } 139 | 140 | /** 141 | * Admin Panel Options 142 | * 143 | * @since 6.0.0 144 | */ 145 | public function admin_options() 146 | { 147 | $validation_url = get_site_url() . "/"; 148 | $validation_url = add_query_arg('wc-api', get_class($this) . "Validation", $validation_url); 149 | $logo_url = get_site_url() . "/"; 150 | $logo_url = add_query_arg('wc-api', get_class($this) . "ChangeLogo", $logo_url); 151 | ?> 152 | 153 | 154 |
155 |
156 | 157 | 160 | 163 | 166 |
167 |

168 |
ePayco 169 |
170 |
171 | 172 | . 173 |
174 |
175 | 176 | is_valid_for_use()) : ?> 177 | 178 | generate_settings_html(); 181 | ?> 182 | 183 | 211 | 212 | 213 |
184 | 185 | 186 | 187 | 188 |
189 | 191 | 192 |

193 | 194 |

195 |
196 |
197 | 198 | 209 | 210 |
214 | 223 | 224 |
225 | 226 | 227 | 228 | 229 | 230 | 231 |
232 |

234 | : 235 | 239 |

240 |
241 | form_fields = include dirname(__FILE__) . '/epayco-settings.php'; 254 | $epayco_langs = array( 255 | '1' => 'Español', 256 | '2' => 'English - Inglés' 257 | ); 258 | 259 | foreach ($epayco_langs as $epayco_lang => $valor) { 260 | $this->form_fields['epayco_lang']['options'][$epayco_lang] = $valor; 261 | } 262 | } 263 | 264 | function get_pages($title = false, $indent = true) 265 | { 266 | $wp_pages = get_pages('sort_column=menu_order'); 267 | $page_list = array(); 268 | if ($title) $page_list[] = $title; 269 | foreach ($wp_pages as $page) { 270 | $prefix = ''; 271 | // show indented child pages? 272 | if ($indent) { 273 | $has_parent = $page->post_parent; 274 | while ($has_parent) { 275 | $prefix .= ' - '; 276 | $next_page = get_page($has_parent); 277 | $has_parent = $next_page->post_parent; 278 | } 279 | } 280 | // add to page list array array 281 | $page_list[$page->ID] = $prefix . $page->post_title; 282 | } 283 | return $page_list; 284 | } 285 | 286 | /** 287 | * Generate the epayco form 288 | * 289 | * @param mixed $order_id 290 | * @return string 291 | */ 292 | function generate_epayco_form($order_id) 293 | { 294 | global $woocommerce; 295 | $order = new WC_Order($order_id); 296 | $descripcionParts = array(); 297 | 298 | $iva = 0; 299 | $ico = 0; 300 | 301 | foreach ($order->get_items('tax') as $item_id => $item) { 302 | $tax_label = trim(strtolower($item->get_label())); 303 | $tax_name = trim(strtolower($order->get_items_tax_classes()[0])); 304 | if ($tax_label == 'iva' || $tax_name == 'iva' ) { 305 | $iva = round($order->get_total_tax(), 2); 306 | } 307 | 308 | if ($tax_label == 'ico'|| $tax_name == 'ico') { 309 | $ico = round($order->get_total_tax(), 2); 310 | } 311 | } 312 | 313 | //$iva = $iva !== 0 ? $iva :$order->get_total_tax(); 314 | 315 | //$base_tax = ($iva !== 0) ? ($order->get_total() - $order->get_total_tax()): (($ico !== 0) ? ($order->get_total() - $order->get_total_tax()): $order->get_subtotal() ); 316 | $base_tax = $order->get_total() - $iva - $ico; 317 | 318 | foreach ($order->get_items() as $product) { 319 | $clearData = str_replace('_', ' ', $this->string_sanitize($product['name'])); 320 | $descripcionParts[] = $clearData; 321 | } 322 | 323 | $descripcion = implode(' - ', $descripcionParts); 324 | $currency = strtolower(get_woocommerce_currency()); 325 | $testMode = $this->settings['epayco_testmode'] == "yes" ? true : false; 326 | $basedCountry = WC()->countries->get_base_country(); 327 | $external = $this->settings['epayco_type_checkout'] == "true" ? 'standard' : 'onepage'; 328 | $redirect_url = get_site_url() . "/"; 329 | $redirect_url = add_query_arg('wc-api', get_class($this), $redirect_url); 330 | $redirect_url = add_query_arg('order_id', $order_id, $redirect_url); 331 | $myIp = $this->getCustomerIp(); 332 | $lang = $this->settings['epayco_lang'] == 1 ? "es" : "en"; 333 | if ($this->get_option('epayco_url_confirmation') == 0) { 334 | $confirm_url = $redirect_url . '&confirmation=1'; 335 | } else { 336 | $confirm_url = get_permalink($this->get_option('epayco_url_confirmation')); 337 | } 338 | 339 | $name_billing = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); 340 | $address_billing = $order->get_billing_address_1(); 341 | $phone_billing = @$order->billing_phone; 342 | $email_billing = @$order->billing_email; 343 | 344 | //Busca si ya se restauro el stock 345 | if (!EpaycoOrder::ifExist($order_id)) { 346 | //si no se restauro el stock restaurarlo inmediatamente 347 | EpaycoOrder::create($order_id, 1); 348 | //$this->restore_order_stock($order->get_id(),"decrease"); 349 | } 350 | $orderStatus = "pending"; 351 | $current_state = $order->get_status(); 352 | if ($current_state != $orderStatus) { 353 | $order->update_status($orderStatus); 354 | //$this->restore_order_stock($order->get_id(),"decrease"); 355 | } 356 | 357 | 358 | $tokenResponse = $this->epyacoBerarToken(); 359 | $bearerToken = ($tokenResponse && isset($tokenResponse['token'])) ? $tokenResponse['token'] : ''; 360 | $payload = array( 361 | "name"=>$descripcion, 362 | "description"=>$descripcion, 363 | "invoice"=>(string)$order->get_id(), 364 | "currency"=>$currency, 365 | "amount"=>floatval($order->get_total()), 366 | "taxBase"=>floatval($base_tax), 367 | "tax"=>floatval($iva), 368 | "taxIco"=>floatval($ico), 369 | "country"=>$basedCountry, 370 | "lang"=>$lang, 371 | "confirmation"=>$confirm_url, 372 | "response"=>$redirect_url, 373 | "billing" => [ 374 | "name" => $name_billing, 375 | "address" => $address_billing, 376 | "email" => $email_billing, 377 | "mobilePhone" => $phone_billing 378 | ], 379 | "autoclick"=> true, 380 | "ip"=>$myIp, 381 | "test"=>$testMode, 382 | "extras" => [ 383 | "extra1" => (string)$order->get_id(), 384 | ], 385 | "extrasEpayco" => [ 386 | "extra5" => "P19" 387 | ], 388 | "epaycoMethodsDisable" => [], 389 | "method"=> "POST", 390 | "checkout_version"=>"2", 391 | "autoClick" => false, 392 | ); 393 | $path = "payment/session/create"; 394 | $newToken['token'] = $bearerToken; 395 | $epayco_status_session = $this->getEpaycoSessionId($path,$payload, $newToken); 396 | if ($epayco_status_session['success']) { 397 | if (isset($epayco_status_session['data']) && is_array($epayco_status_session['data'])) { 398 | $sessionId = $epayco_status_session['data']['sessionId']; 399 | $payload['sessionId'] = $sessionId; 400 | } 401 | } 402 | $checkout = base64_encode(json_encode([ 403 | "sessionId"=>$payload['sessionId'], 404 | "external"=>$external, 405 | "test"=>$testMode 406 | ])); 407 | echo sprintf( 408 | ' 434 | 435 | 436 | ', 437 | $checkout 438 | ); 439 | wp_enqueue_script('epayco', 'https://checkout.epayco.co/checkout-v2.js', array(), '8.3.0', null); 440 | return '
441 |
'; 442 | } 443 | 444 | /** 445 | * @param WC_Order $order 446 | * @param bool $single 447 | * 448 | * @return mixed 449 | */ 450 | public function getPaymentsIdMeta(WC_Order $order, bool $single = true) 451 | { 452 | return $order->get_meta(self::PAYMENTS_IDS, $single); 453 | } 454 | 455 | /** 456 | * @param WC_Order $order 457 | * @param mixed $value 458 | * 459 | * @return void 460 | */ 461 | public function setPaymentsIdData(WC_Order $order, $value): void 462 | { 463 | try { 464 | $logger = new WC_Logger(); 465 | if ( $order instanceof WC_Order ) { 466 | $order->add_meta_data( self::PAYMENTS_IDS, $value ); 467 | $order->save(); 468 | } 469 | } catch (\Exception $ex) { 470 | $error_message = "Unable to update batch of orders on action got error: {$ex->getMessage()}"; 471 | $logger->add($this->id,$error_message); 472 | } 473 | } 474 | 475 | /** 476 | * Process the payment and return the result 477 | * 478 | * @param int $order_id 479 | * @return array 480 | */ 481 | function process_payment($order_id) 482 | { 483 | $order = new WC_Order($order_id); 484 | return array( 485 | 'result' => 'success', 486 | 'redirect' => $order->get_checkout_payment_url(true), 487 | ); 488 | } 489 | 490 | /** 491 | * Output for the order received page. 492 | * @param $order_id 493 | * @return void 494 | */ 495 | function receipt_page($order_id) 496 | { 497 | echo '
498 |
499 |
500 |

501 | ' . esc_html__('Cargando métodos de pago', 'woo-epayco-gateway') . ' 502 |
' . esc_html__('', 'woo-epayco-gateway') . ' 503 |

'; 504 | 505 | if ($this->settings['epayco_lang'] === "2") { 506 | $epaycoButtonImage = 'https://multimedia.epayco.co/epayco-landing/btns/Boton-epayco-color-Ingles.png'; 507 | } else { 508 | $epaycoButtonImage = 'https://multimedia.epayco.co/epayco-landing/btns/Boton-epayco-color1.png'; 509 | } 510 | echo '

511 |

512 | 513 | 514 | 515 |
516 |

'; 517 | echo $this->generate_epayco_form($order_id); 518 | } 519 | 520 | /** 521 | * Check for Epayco HTTP Notification 522 | * 523 | * @return void 524 | */ 525 | function check_ipn_response() 526 | { 527 | @ob_clean(); 528 | $post = stripslashes_deep($_POST); 529 | if (true) { 530 | header('HTTP/1.1 200 OK'); 531 | do_action('valid-' . $this->id . '-standard-ipn-request', $post); 532 | } else { 533 | wp_die('Do not access this page directly (ePayco)'); 534 | } 535 | } 536 | 537 | function validate_ePayco_request() 538 | { 539 | @ob_clean(); 540 | if (! empty($_REQUEST)) { 541 | header('HTTP/1.1 200 OK'); 542 | do_action("ePayco_init_validation", $_REQUEST); 543 | } else { 544 | wp_die('Do not access this page directly (ePayco)'); 545 | } 546 | } 547 | 548 | /** 549 | * Successful Payment! 550 | * 551 | * @access public 552 | * @param array $posted 553 | * @return void 554 | */ 555 | function successful_request($validationData) 556 | { 557 | try { 558 | global $woocommerce; 559 | $order_id_info = sanitize_text_field($_GET['order_id']); 560 | $order_id_explode = explode('=', $order_id_info); 561 | $order_id_rpl = str_replace('?ref_payco', '', $order_id_explode); 562 | $order_id = $order_id_rpl[0]; 563 | $order = new WC_Order($order_id); 564 | $isConfirmation = sanitize_text_field($_GET['confirmation']) == 1; 565 | if ($isConfirmation) { 566 | $x_signature = sanitize_text_field($_REQUEST['x_signature']); 567 | $x_cod_transaction_state = sanitize_text_field($_REQUEST['x_cod_transaction_state']); 568 | $x_ref_payco = sanitize_text_field($_REQUEST['x_ref_payco']); 569 | $x_transaction_id = sanitize_text_field($_REQUEST['x_transaction_id']); 570 | $x_amount = sanitize_text_field($_REQUEST['x_amount']); 571 | $x_currency_code = sanitize_text_field($_REQUEST['x_currency_code']); 572 | $x_test_request = trim(sanitize_text_field($_REQUEST['x_test_request'])); 573 | $x_approval_code = trim(sanitize_text_field($_REQUEST['x_approval_code'])); 574 | $x_franchise = trim(sanitize_text_field($_REQUEST['x_franchise'])); 575 | $x_fecha_transaccion = trim(sanitize_text_field($_REQUEST['x_fecha_transaccion'])); 576 | } else { 577 | $ref_payco = sanitize_text_field($_REQUEST['ref_payco']); 578 | if (empty($ref_payco)) { 579 | $ref_payco = $order_id_rpl[1]; 580 | } 581 | if (!$ref_payco) { 582 | $explode = explode('=', $order_id); 583 | $ref_payco = $explode[1]; 584 | } 585 | if (!$ref_payco || $ref_payco=='undefined') { 586 | wp_safe_redirect(wc_get_checkout_url()); 587 | exit(); 588 | } 589 | $jsonData = $this->getRefPayco($ref_payco); 590 | if(is_null($jsonData)){ 591 | sleep(3); 592 | $jsonData = $this->getRefPayco($ref_payco); 593 | } 594 | 595 | if(!$jsonData){ 596 | wp_safe_redirect(wc_get_checkout_url()); 597 | exit(); 598 | } 599 | $validationData = $jsonData; 600 | $x_signature = trim($validationData['x_signature']); 601 | $x_cod_transaction_state = (int)trim($validationData['x_cod_transaction_state']) ? 602 | (int)trim($validationData['x_cod_transaction_state']) : (int)trim($validationData['x_cod_response']); 603 | $x_ref_payco = trim($validationData['x_ref_payco']); 604 | $x_transaction_id = trim($validationData['x_transaction_id']); 605 | $x_amount = trim($validationData['x_amount']); 606 | $x_currency_code = trim($validationData['x_currency_code']); 607 | $x_test_request = trim($validationData['x_test_request']); 608 | $x_approval_code = trim($validationData['x_approval_code']); 609 | $x_franchise = trim($validationData['x_franchise']); 610 | $x_fecha_transaccion = trim($validationData['x_fecha_transaccion']); 611 | } 612 | $epaycoOrder = [ 613 | 'refPayco' => $x_ref_payco 614 | ]; 615 | $paymentsIdMetadata = $this->getPaymentsIdMeta($order); 616 | if (empty($paymentsIdMetadata)) { 617 | $this->setPaymentsIdData($order, implode(', ', $epaycoOrder)); 618 | } 619 | foreach ($epaycoOrder as $paymentId) { 620 | $paymentDetailMetadata = $order->get_meta($paymentId); 621 | if (empty($paymentDetailMetadata)) { 622 | $order->update_meta_data(self::PAYMENTS_IDS, $paymentId); 623 | $order->save(); 624 | } 625 | } 626 | // Validamos la firma 627 | if ($order_id != "" && $x_ref_payco != "") { 628 | $authSignature = $this->authSignature($x_ref_payco, $x_transaction_id, $x_amount, $x_currency_code); 629 | } 630 | $message = ''; 631 | $messageClass = ''; 632 | $current_state = $order->get_status(); 633 | $isTestTransaction = $x_test_request == 'TRUE' ? "yes" : "no"; 634 | update_option('epayco_order_status', $isTestTransaction); 635 | $isTestMode = get_option('epayco_order_status') == "yes" ? "true" : "false"; 636 | $isTestPluginMode =$this->settings['epayco_testmode']; 637 | if (floatval($order->get_total()) == floatval($x_amount)) { 638 | if ("yes" == $isTestPluginMode) { 639 | $validation = true; 640 | } 641 | if ("no" == $isTestPluginMode) { 642 | if ($x_cod_transaction_state == 1) { 643 | $validation = true; 644 | } else { 645 | if ($x_cod_transaction_state != 1) { 646 | $validation = true; 647 | } else { 648 | $validation = false; 649 | } 650 | } 651 | } 652 | } else { 653 | $validation = false; 654 | } 655 | if ($authSignature == $x_signature && $validation) { 656 | Epayco_Transaction_Handler::handle_transaction($order, [ 657 | 'x_cod_transaction_state' => $x_cod_transaction_state, 658 | 'x_ref_payco' => $x_ref_payco, 659 | 'x_fecha_transaccion' => $x_fecha_transaccion, 660 | 'x_franchise' => $x_franchise, 661 | 'x_approval_code' => $x_approval_code, 662 | 'is_confirmation' => $isConfirmation, 663 | ], [ 664 | 'test_mode' => $isTestMode, 665 | 'end_order_state' => $this->settings['epayco_endorder_state'], 666 | 'cancel_order_state' => $this->settings['epayco_cancelled_endorder_state'], 667 | 'reduce_stock_pending' => $this->get_option('epayco_reduce_stock_pending'), 668 | ]); 669 | 670 | 671 | //validar si la transaccion esta pendiente y pasa a rechazada y ya habia descontado el stock 672 | if (($current_state == 'on-hold' || $current_state == 'pending') && ((int)$x_cod_transaction_state == 2 || (int)$x_cod_transaction_state == 4) && EpaycoOrder::ifStockDiscount($order_id)) { 673 | //si no se restauro el stock restaurarlo inmediatamente 674 | // Epayco_Transaction_Handler::restore_stock($order_id); 675 | }; 676 | } else { 677 | 678 | if ( 679 | $current_state == "epayco-processing" || 680 | $current_state == "epayco-completed" || 681 | $current_state == "processing" || 682 | $current_state == "completed" 683 | ) { 684 | } else { 685 | $message = 'Firma no valida'; 686 | $orderStatus = 'epayco-failed'; 687 | if ($x_cod_transaction_state != 1 && !empty($x_cod_transaction_state)) { 688 | if ( 689 | $current_state == "epayco_failed" || 690 | $current_state == "epayco_cancelled" || 691 | $current_state == "failed" || 692 | $current_state == "epayco-cancelled" || 693 | $current_state == "epayco-failed"|| 694 | $current_state == "pending" 695 | ) { 696 | } else { 697 | Epayco_Transaction_Handler::restore_stock($order_id); 698 | $order->update_status($orderStatus); 699 | $messageClass = 'error'; 700 | } 701 | } 702 | echo $x_cod_transaction_state . " firma no valida: " . $validation; 703 | } 704 | } 705 | 706 | if (isset($_REQUEST['confirmation'])) { 707 | echo $x_cod_transaction_state; 708 | exit(); 709 | } else { 710 | if ($this->get_option('epayco_url_response') == 0) { 711 | $redirect_url = $order->get_checkout_order_received_url(); 712 | } else { 713 | $woocommerce->cart->empty_cart(); 714 | $redirect_url = get_permalink($this->get_option('epayco_url_response')); 715 | $redirect_url = add_query_arg(['ref_payco' => $ref_payco], $redirect_url); 716 | } 717 | } 718 | 719 | $arguments = array(); 720 | foreach ($validationData as $key => $value) { 721 | $arguments[$key] = $value; 722 | } 723 | 724 | unset($arguments["wc-api"]); 725 | $arguments['msg'] = urlencode($message); 726 | $arguments['type'] = $messageClass; 727 | $response_data = $this->settings['response_data'] == "yes" ? true : false; 728 | 729 | if ($response_data) { 730 | $redirect_url = add_query_arg($arguments, $redirect_url); 731 | } 732 | 733 | wp_redirect($redirect_url); 734 | }catch (\Exception $ex) { 735 | $error_message = "successful_request got error: {$ex->getMessage()}"; 736 | self::$logger->add($this->id, $error_message); 737 | throw new Exception($error_message); 738 | } 739 | } 740 | 741 | public function getRefPayco($refPayco) 742 | { 743 | $url = 'https://secure.epayco.co/validation/v1/reference/' . $refPayco; 744 | $response = wp_remote_get($url); 745 | if (is_wp_error($response)) { 746 | self::$logger->add($this->id, $response->get_error_message()); 747 | return false; 748 | } 749 | $body = wp_remote_retrieve_body($response); 750 | $jsonData = @json_decode($body, true); 751 | if (isset($jsonData['status']) && !$jsonData['status']) { 752 | $responseNewData = wp_remote_get('https://eks-ms-checkout-response-transaction-service.epayco.io/checkout/history?historyId='.$_GET['ref_payco']); 753 | if($responseNewData === false or is_wp_error($responseNewData)){ 754 | self::$logger->add($this->id, $responseNewData->get_error_message()); 755 | return false; 756 | } 757 | $bodySecondrequest = wp_remote_retrieve_body($responseNewData); 758 | $jsonNewData = @json_decode($bodySecondrequest, true); 759 | $validationData = []; 760 | if(isset($jsonNewData)){ 761 | $responseDataDetail = wp_remote_get('https://cms.epayco.co/transaction/'. $jsonNewData['ePaycoID']); 762 | if (is_wp_error($response)) { 763 | self::$logger->add($this->id, $responseDataDetail->get_error_message()); 764 | return false; 765 | } 766 | $responseDataDetail = wp_remote_retrieve_body($responseDataDetail); 767 | $jsonDataDetail = @json_decode($responseDataDetail, true); 768 | if($jsonDataDetail['success']){ 769 | $validationData = $jsonDataDetail['data']['transaction']; 770 | $url_shop = $validationData['extra2']; 771 | $id_order = $validationData['extra1']; 772 | $confirmation = false; 773 | $x_cod_transaction_state = (int)trim($validationData['codTransactionState']); 774 | $payment_id = $validationData['extra1']; 775 | $ref_payco = $_GET['ref_payco']; 776 | $x_ref_payco = $validationData['refPayco']; 777 | $x_transaction_id = $validationData['transactionId']; 778 | $x_signature = trim($validationData['signature']); 779 | $x_amount = $validationData['amount']; 780 | $x_currency_code = $validationData['currency']; 781 | $x_franchise = $validationData['franchise']; 782 | $x_test_request = $validationData['testMode']; 783 | $x_fecha_transaccion = $validationData['date']; 784 | $x_approval_code = $validationData['autorizacion']; 785 | }else{ 786 | switch ($jsonNewData['status']) { 787 | case "Aprobada": 788 | $x_cod_transaction_state = 1; 789 | break; 790 | case "Pendiente": 791 | case "iniciada": 792 | $x_cod_transaction_state = 3; 793 | break; 794 | default: 795 | $x_cod_transaction_state = 2; 796 | break; 797 | } 798 | $url_shop = parse_url( $jsonNewData['data']['urlRedirect'], PHP_URL_HOST); 799 | $id_order = $jsonNewData['storeReference']; 800 | $ref_payco = $jsonNewData['ePaycoID']; 801 | $confirmation = false; 802 | $payment_id = ''; 803 | $x_amount = $jsonNewData['total']; 804 | $x_signature = 'Authorized'; 805 | $x_currency_code = 'COP'; 806 | $x_franchise = $jsonNewData['franchise']; 807 | 808 | } 809 | }else{ 810 | //error_log("shopify: ".json_encode($jsonNewData)); 811 | //header("location: error.php?ref_payco=".$_GET['ref_payco']); 812 | return false; 813 | } 814 | }else{ 815 | $validationData = $jsonData['data']; 816 | $x_signature = trim($validationData['x_signature']); 817 | $x_cod_transaction_state = (int)trim($validationData['x_cod_transaction_state']) ? 818 | (int)trim($validationData['x_cod_transaction_state']) : (int)trim($validationData['x_cod_response']); 819 | $x_ref_payco = trim($validationData['x_ref_payco']); 820 | $x_transaction_id = trim($validationData['x_transaction_id']); 821 | $x_amount = trim($validationData['x_amount']); 822 | $x_currency_code = trim($validationData['x_currency_code']); 823 | $x_test_request = trim($validationData['x_test_request']); 824 | $x_approval_code = trim($validationData['x_approval_code']); 825 | $x_franchise = trim($validationData['x_franchise']); 826 | $x_fecha_transaccion = trim($validationData['x_fecha_transaccion']); 827 | } 828 | return $paylod = [ 829 | 'x_signature' => $x_signature, 830 | 'x_cod_transaction_state' => $x_cod_transaction_state, 831 | 'x_ref_payco' => $x_ref_payco, 832 | 'x_transaction_id' => $x_transaction_id, 833 | 'x_amount' => $x_amount, 834 | 'x_currency_code' => $x_currency_code, 835 | 'x_test_request' => $x_test_request, 836 | 'x_approval_code' => $x_approval_code, 837 | 'x_franchise' => $x_franchise, 838 | 'x_fecha_transaccion' => $x_fecha_transaccion 839 | ]; 840 | } 841 | 842 | public function authSignature($x_ref_payco, $x_transaction_id, $x_amount, $x_currency_code) 843 | { 844 | $signature = hash( 845 | 'sha256', 846 | trim($this->settings['epayco_customerid']) . '^' 847 | . trim($this->settings['epayco_secretkey']) . '^' 848 | . $x_ref_payco . '^' 849 | . $x_transaction_id . '^' 850 | . $x_amount . '^' 851 | . $x_currency_code 852 | ); 853 | return $signature; 854 | } 855 | 856 | function add_expiration($order, $data) 857 | { 858 | $items_count = WC()->cart->get_cart_contents_count(); 859 | 860 | $order->update_meta_data('expiration_date', date('Y-m-d H:i:s', strtotime('+' . ($items_count * 60) . ' minutes'))); 861 | } 862 | 863 | /** 864 | * @param $validationData 865 | */ 866 | function ePayco_successful_validation($validationData) 867 | { 868 | $username = sanitize_text_field($validationData['epayco_publickey']); 869 | $password = sanitize_text_field($validationData['epayco_privatey']); 870 | $response = wp_remote_post('https://apify.epayco.co/login', array( 871 | 'headers' => array( 872 | 'Authorization' => 'Basic ' . base64_encode($username . ':' . $password), 873 | ), 874 | )); 875 | $data = json_decode(wp_remote_retrieve_body($response)); 876 | if ($data->token) { 877 | echo "success"; 878 | exit(); 879 | } 880 | } 881 | 882 | function string_sanitize($string, $force_lowercase = true, $anal = false) 883 | { 884 | 885 | $strip = array("~", "`", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "=", "+", "[", "{", "]", "}", "\\", "|", ";", ":", "\"", "'", "‘", "’", "“", "”", "–", "—", "—", "–", ",", "<", ".", ">", "/", "?"); 886 | $clean = trim(str_replace($strip, "", strip_tags($string))); 887 | $clean = preg_replace('/\s+/', "_", $clean); 888 | $clean = ($anal) ? preg_replace("/[^a-zA-Z0-9]/", "", $clean) : $clean; 889 | return $clean; 890 | } 891 | 892 | 893 | public function getCustomerIp() 894 | { 895 | $ipaddress = ''; 896 | if (isset($_SERVER['HTTP_CLIENT_IP'])) 897 | $ipaddress = $_SERVER['HTTP_CLIENT_IP']; 898 | else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) 899 | $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR']; 900 | else if (isset($_SERVER['HTTP_X_FORWARDED'])) 901 | $ipaddress = $_SERVER['HTTP_X_FORWARDED']; 902 | else if (isset($_SERVER['HTTP_X_CLUSTER_CLIENT_IP'])) 903 | $ipaddress = $_SERVER['HTTP_X_CLUSTER_CLIENT_IP']; 904 | else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) 905 | $ipaddress = $_SERVER['HTTP_FORWARDED_FOR']; 906 | else if (isset($_SERVER['HTTP_FORWARDED'])) 907 | $ipaddress = $_SERVER['HTTP_FORWARDED']; 908 | else if (isset($_SERVER['REMOTE_ADDR'])) 909 | $ipaddress = $_SERVER['REMOTE_ADDR']; 910 | else 911 | $ipaddress = 'UNKNOWN'; 912 | return $ipaddress; 913 | } 914 | 915 | public function getEpaycoORders() 916 | { 917 | try { 918 | $orders = wc_get_orders(array( 919 | 'limit' => -1, 920 | 'status' => 'on-hold', 921 | 'meta_query' => array( 922 | 'key' => self::PAYMENTS_IDS 923 | ) 924 | )); 925 | $ref_payco_list = []; 926 | foreach ($orders as $order) { 927 | $ref_payco = $this->syncOrderStatus($order); 928 | if ($ref_payco) { 929 | $ref_payco_list[] = $ref_payco; 930 | } 931 | } 932 | if (is_array($ref_payco_list) && !empty($ref_payco_list)) { 933 | $token = $this->epyacoBerarToken(); 934 | if ($token) { 935 | foreach ($ref_payco_list as $ref_payco) { 936 | $path = "payment/transaction"; 937 | $data = [ "referencePayco" => $ref_payco]; 938 | $epayco_status = $this->getEpaycoStatusOrder($path,$data, $token); 939 | if ($epayco_status['success']) { 940 | if (isset($epayco_status['data']) && is_array($epayco_status['data'])) { 941 | $this->epaycoUploadOrderStatus($epayco_status); 942 | } 943 | } 944 | } 945 | } 946 | } 947 | } catch (\Exception $ex) { 948 | $error_message = "Unable to update batch of orders on action got error: {$ex->getMessage()}"; 949 | self::$logger->add($this->id, $error_message); 950 | throw new Exception($error_message); 951 | } 952 | } 953 | 954 | public function getWoocommercePendigsORders(){ 955 | try { 956 | $orders = wc_get_orders([ 957 | 'limit' => -1, 958 | 'status' => 'pending', 959 | 'payment_method' => 'epayco', 960 | 'orderby' => 'date', 961 | 'order' => 'DESC', 962 | ]); 963 | $token = $this->epyacoBerarToken(); 964 | foreach ($orders as $order) { 965 | $orderId = $order->get_id(); 966 | if ($token) { 967 | $path = "transaction/detail"; 968 | $data = [ "filter" => ["referenceClient" => $orderId]]; 969 | $epayco_status = $this->getEpaycoStatusOrder($path,$data, $token); 970 | if ($epayco_status['success']) { 971 | if (isset($epayco_status['data']) && is_array($epayco_status['data'])) { 972 | foreach ($epayco_status['data'] as $epaycoData) { 973 | $refPayco = $epaycoData['referencePayco']; 974 | } 975 | $epaycoOrder = [ 976 | 'refPayco' => $refPayco 977 | ]; 978 | $paymentsIdMetadata = $this->getPaymentsIdMeta($order); 979 | if (empty($paymentsIdMetadata)) { 980 | $this->setPaymentsIdData($order, implode(', ', $epaycoOrder)); 981 | } 982 | foreach ($epaycoOrder as $paymentId) { 983 | $paymentDetailMetadata = $order->get_meta($paymentId); 984 | if (empty($paymentDetailMetadata)) { 985 | $order->update_meta_data(self::PAYMENTS_IDS, $paymentId); 986 | $order->save(); 987 | } 988 | } 989 | $path = "payment/transaction"; 990 | $data = [ "referencePayco" => $refPayco]; 991 | $epayco_status = $this->getEpaycoStatusOrder($path,$data, $token); 992 | if ($epayco_status['success']) { 993 | if (isset($epayco_status['data']) && is_array($epayco_status['data'])) { 994 | $this->epaycoUploadOrderStatus($epayco_status); 995 | } 996 | } 997 | } 998 | } 999 | } 1000 | } 1001 | } catch (\Exception $ex) { 1002 | $error_message = "Unable to update batch of orders on action got error: {$ex->getMessage()}"; 1003 | self::$logger->add($this->id, $error_message); 1004 | throw new Exception($error_message); 1005 | } 1006 | } 1007 | 1008 | public function getEpaycoSessionId($path,$data, $token) 1009 | { 1010 | if ($token) { 1011 | $headers = [ 1012 | 'Content-Type' => 'application/json', 1013 | 'Authorization' => 'Bearer '.$token['token'], 1014 | ]; 1015 | return $this->epayco_realizar_llamada_api($path, $data, $headers); 1016 | } 1017 | } 1018 | 1019 | public function getEpaycoStatusOrder($path,$data, $token) 1020 | { 1021 | if ($token) { 1022 | $headers = [ 1023 | 'Content-Type' => 'application/json', 1024 | 'Authorization' => 'Bearer '.$token['token'], 1025 | ]; 1026 | return $this->epayco_realizar_llamada_api($path, $data, $headers); 1027 | } 1028 | } 1029 | 1030 | public function epaycoUploadOrderStatus($epayco_status) 1031 | { 1032 | $order_id = isset($epayco_status['data']['transaction']['extra1']) ?$epayco_status['data']['transaction']['extra1'] : null; 1033 | //$x_cod_transaction_state = isset($epayco_status['data']['x_cod_transaction_state']) ? $epayco_status['data']['x_cod_transaction_state'] : null; 1034 | $status = isset($epayco_status['data']['transaction']['status']) ? $epayco_status['data']['transaction']['status'] : null; 1035 | $ePaycoStatus = strtolower($status); 1036 | $x_ref_payco = isset($epayco_status['data']['transaction']['refPayco']) ? $epayco_status['data']['transaction']['refPayco'] : null; 1037 | $x_fecha_transaccion = isset($epayco_status['data']['transaction']['date']) ? $epayco_status['data']['transaction']['date'] : null; 1038 | $x_franchise = isset($epayco_status['data']['transaction']['bank']) ? $epayco_status['data']['transaction']['bank'] : null; 1039 | $x_approval_code = isset($epayco_status['data']['transaction']['autorizacion']) ? $epayco_status['data']['transaction']['autorizacion'] : null; 1040 | $x_cod_transaction_state = isset($epayco_status['data']['transaction']['codeResponse']) ? $epayco_status['data']['transaction']['codeResponse'] :$this->get_epayco_estado_codigo_detallado($ePaycoStatus); 1041 | $isTestMode = get_option('epayco_order_status') == "yes" ? "true" : "false"; 1042 | if ($order_id) { 1043 | $order = wc_get_order($order_id); 1044 | if ($order) { 1045 | Epayco_Transaction_Handler::handle_transaction($order, [ 1046 | 'x_cod_transaction_state' => $x_cod_transaction_state, 1047 | 'x_ref_payco' => $x_ref_payco, 1048 | 'x_fecha_transaccion' => $x_fecha_transaccion, 1049 | 'x_franchise' => $x_franchise, 1050 | 'x_approval_code' => $x_approval_code, 1051 | 'is_confirmation' => true, 1052 | ], [ 1053 | 'test_mode' => $isTestMode, 1054 | 'end_order_state' => $this->settings['epayco_endorder_state'], 1055 | 'cancel_order_state' => $this->settings['epayco_cancelled_endorder_state'], 1056 | 'reduce_stock_pending' => $this->get_option('epayco_reduce_stock_pending'), 1057 | ]); 1058 | } 1059 | } 1060 | } 1061 | 1062 | public function get_epayco_estado_codigo_detallado($estado_texto) { 1063 | $estado_texto = strtolower(trim($estado_texto)); 1064 | 1065 | switch ($estado_texto) { 1066 | case 'aprobada': 1067 | case 'aceptada': 1068 | return 1; 1069 | 1070 | case 'abandonada': 1071 | return 10; 1072 | 1073 | case 'fallida': 1074 | return 4; 1075 | 1076 | case 'cancelada': 1077 | case 'rechazada': 1078 | return 2; 1079 | 1080 | case 'pendiente': 1081 | return 3; 1082 | 1083 | case 'retenido': 1084 | return 7; 1085 | 1086 | case 'reversada': 1087 | case 'reversado': 1088 | return 6; 1089 | 1090 | default: 1091 | return 0; 1092 | } 1093 | } 1094 | 1095 | public function syncOrderStatus(\WC_Order $order): string 1096 | { 1097 | $paymentsIds = explode(',', $order->get_meta(self::PAYMENTS_IDS)); 1098 | $lastPaymentId = trim(end($paymentsIds)); 1099 | if ($lastPaymentId) { 1100 | return $lastPaymentId; 1101 | } else { 1102 | return false; 1103 | } 1104 | } 1105 | 1106 | public function epyacoBerarToken() 1107 | { 1108 | $publicKey = $this->settings['epayco_publickey']; 1109 | $privateKey = $this->settings['epayco_privatekey']; 1110 | 1111 | if (!isset($_COOKIE[$publicKey])) { 1112 | $token = base64_encode($publicKey . ":" . $privateKey); 1113 | $bearer_token = $token; 1114 | $cookie_value = $bearer_token; 1115 | setcookie($publicKey, $cookie_value, time() + (60 * 14), "/"); 1116 | } else { 1117 | $bearer_token = $_COOKIE[$publicKey]; 1118 | } 1119 | 1120 | $headers = array( 1121 | 'Content-Type' => 'application/json', 1122 | 'Authorization' => "Basic " . $bearer_token 1123 | ); 1124 | return $this->epayco_realizar_llamada_api("login", [], $headers); 1125 | } 1126 | 1127 | public function epayco_realizar_llamada_api($path, $data, $headers, $method = 'POST') 1128 | { 1129 | $url = 'https://apify.epayco.co/' . $path; 1130 | 1131 | $response = wp_remote_post($url, [ 1132 | 'headers' => $headers, 1133 | 'body' => json_encode($data), 1134 | 'timeout' => 15, 1135 | ]); 1136 | 1137 | if (is_wp_error($response)) { 1138 | $error_message = $response->get_error_message(); 1139 | self::$logger->add($this->id, "Error al hacer la llamada a la API de ePayco: " . $error_message); 1140 | error_log("Error al hacer la llamada a la API de ePayco: " . $error_message); 1141 | return false; 1142 | } else { 1143 | $response_body = wp_remote_retrieve_body($response); 1144 | $status_code = wp_remote_retrieve_response_code($response); 1145 | if ($status_code == 200) { 1146 | $responseTransaction = json_decode($response_body, true); 1147 | return $responseTransaction; 1148 | } else { 1149 | self::$logger->add($this->id,"Error en la respuesta de la API de ePayco, código de estado: " . $status_code); 1150 | error_log("Error en la respuesta de la API de ePayco, código de estado: " . $status_code); 1151 | return false; 1152 | } 1153 | } 1154 | } 1155 | } 1156 | --------------------------------------------------------------------------------