This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ejemplo de uso | |
libredte_preauth('hash-del-usuario', 76192083, '/dte/dte_emitidos'); | |
/** | |
* Funci贸n para preautenticar y redireccionar a un usuario en LibreDTE | |
* @param hash Hash del usuario, est谩 en su perfil | |
* @param rut RUT del contribuyente sin DV | |
* @param uri Donde se desea enviar al usuario luego de autenticar y seleccionar contribuyente |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
show('$_GET', $_GET); | |
show('$_POST', $_POST); | |
show('$_FILES', $_FILES); | |
show('apache_request_headers()', apache_request_headers()); | |
show('php://input', file_get_contents('php://input')); | |
function show($name, $var) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Servicio web para recibir una notificaci贸n de pago de LibreDTE | |
*/ | |
// configuraci贸n auth en LibreDTE | |
$emisor = 76192083; // RUT sin puntos ni DV | |
$hash = ''; // en perfil del usuario | |
$user = ''; // definido en la config del servicio web en LibreDTE | |
$pass = ''; // definido en la config del servicio web en LibreDTE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Ubicar, por ejemplo, justo despu茅s de tag form --> | |
<!-- | |
Este ejemplo permite elegir boleta o factura | |
Si se desea s贸lo: | |
- Boleta nominativa: quitar selecci贸n de boleta/factura y giro | |
- Boleta no nominativa: no colocar este c贸digo (no modificar template) | |
- Factura: quitar selecci贸n boleta/factura y cambiar por campo hidden con value 33 | |
--> | |
{% comment %}Inicio LibreDTE{% endcomment %} | |
<div class="row"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('woocommerce_checkout_fields', 'custom_override_checkout_fields'); | |
function custom_override_checkout_fields($fields) | |
{ | |
$fields['billing']['billing_documento'] = array( | |
'type' => 'select', | |
'label' => __('Documento', 'woocommerce'), | |
'options' => array(33=>'Factura', 39=>'Boleta'), | |
'required' => true, | |
'class' => array('form-row-wide'), | |
'clear' => true, |