Skip to content

Instantly share code, notes, and snippets.

View variux's full-sized avatar

Andrés Zúñiga variux

View GitHub Profile
@variux
variux / genXML.php
Created September 4, 2018 06:21
Archivo correcto de CRLibre
<?php
/* * ************************************************** */
/* Funcion para generar XML */
/* * ************************************************** */
function genXMLFe() {
//datos contribuyente
$clave = params_get("clave");
$consecutivo = params_get("consecutivo");
@variux
variux / jsonavon.json
Last active September 2, 2018 18:29
jsonavon.json
{
"CompanyAPI": "57bf1a09-72f1-46a1-98a8-da74dae1bd42",
"Environment": "stag",
"Key": {
"Branch": "01",
"Terminal": "1",
"Type": "01",
"Voucher": "803777143",
"Country": "506",
"Situation": "1"
@variux
variux / aceptarfactura.json
Created August 8, 2018 13:43
aceptarfactura.json
{
"xml": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48RmFjdHVyYUVsZWN0cm9uaWNhIHhtbG5zPSJodHRwczovL3RyaWJ1bmV0LmhhY2llbmRhLmdvLmNyL2RvY3MvZXNxdWVtYXMvMjAxNy92NC4yL2ZhY3R1cmFFbGVjdHJvbmljYSIgeG1sbnM6eHNkPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYSIgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwczovL3RyaWJ1bmV0LmhhY2llbmRhLmdvLmNyL2RvY3MvZXNxdWVtYXMvMjAxNy92NC4yL2ZhY3R1cmFFbGVjdHJvbmljYSBodHRwczovL3RyaWJ1bmV0LmhhY2llbmRhLmdvLmNyL2RvY3MvZXNxdWVtYXMvMjAxNy92NC4yL2ZhY3R1cmFFbGVjdHJvbmljYS54c2QiPjxDbGF2ZT41MDYyNjA3MTgwMDAxMTcxNzA3MTkwMDEwMDAwMTAxMDAwMDAwMDAwMjE2ODIzOTM3NjwvQ2xhdmU+PE51bWVyb0NvbnNlY3V0aXZvPjAwMTAwMDAxMDEwMDAwMDAwMDAyPC9OdW1lcm9Db25zZWN1dGl2bz48RmVjaGFFbWlzaW9uPjIwMTgtMDctMjZUMDY6NTk6MjQuMjkzPC9GZWNoYUVtaXNpb24+PEVtaXNvcj48Tm9tYnJlPkFMVkFSTyBBTkRSRVMgWlXDkUlHQSBIRVJOQU5ERVo8L05vbWJyZT48SWRlbnRpZmljYWNpb24+PFRpcG8+MDE8L1RpcG8+PE51bWVybz4xMTcxNzA3MTk8L051bWVybz48L0lkZW50aWZpY2FjaW9uPjxVYmljYWNpb24+PFByb3ZpbmNpYT4xPC9Qcm92aW5jaWE+PENhb
@variux
variux / cx_oracle_instructions.md
Created July 19, 2018 16:24 — forked from thom-nic/cx_oracle_instructions.md
Installing CX Oracle for Python & Mac OS X. Instructions exist around the web, but they seem to be piecemeal and incomplete.
#Esto va en el load
if (VerifyLicense() == false)
{
MessageBox.Show("Licencia vencida contacte a ITCO para continuar");
Environment.Exit(1);
}
//la funcion
private bool VerifyLicense() {
<?xml version="1.0" encoding="UTF-8"?>
<MensajeHacienda xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2016/v4.1/mensajeHacienda">
<Clave>50609011800011717071900000000000000000034987656238</Clave>
<NombreEmisor/>
<TipoIdentificacionEmisor>01</TipoIdentificacionEmisor>
<NumeroCedulaEmisor>117170719</NumeroCedulaEmisor>
<NombreReceptor/>
<TipoIdentificacionReceptor>02</TipoIdentificacionReceptor>
<NumeroCedulaReceptor>3101660919</NumeroCedulaReceptor>
<Mensaje>3</Mensaje>
<?xml version="1.0" encoding="UTF-8"?>
<FacturaElectronica xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica">
<Clave>50609011800011717071900000000000000000034987656238</Clave>
<NumeroConsecutivo>00000000000000000032</NumeroConsecutivo>
<FechaEmision>2018-01-08T20:25:49.049Z</FechaEmision>
<Emisor>
<Nombre>Alvaro Andres Zuniga Hernandez</Nombre>
<Identificacion>
<Tipo>01</Tipo>
<Numero>117170719</Numero>
<?xml version="1.0" encoding="UTF-8"?>
<FacturaElectronica xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://tribunet.hacienda.go.cr/docs/esquemas/2017/v4.2/facturaElectronica">
<Clave>50609011800011717071900000000000000000034987656238</Clave>
<NumeroConsecutivo>00000000000000000032</NumeroConsecutivo>
<FechaEmision>2018-01-08T20:25:49.049Z</FechaEmision>
<Emisor>
<Nombre>Alvaro Andres Zuniga Hernandez</Nombre>
<Identificacion>
<Tipo>01</Tipo>
<Numero>117170719</Numero>
{
"clave": "50609011800011717071900000000000000000034987656238",
"fecha": "2018-01-24T03:43:46.930Z",
"emisor": {
"tipoIdentificacion": "01",
"numeroIdentificacion": "117170719"
},
"receptor": {
"tipoIdentificacion": "02",
"numeroIdentificacion": "3101660919"
const WebCrypto = require("node-webcrypto-ossl");
const crypto = new WebCrypto();
const fs = require('fs');
const asn1js = require('asn1js');
const pkijs = require('pkijs');
const pvutils = require('pvutils');
function parsePKCS12Internal(buffer, password)
{
//region Initial variables