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
(defroutes routes | |
["/contact" {:get [:contact home/contact-page] ;; Handler for GET /contact | |
:post [^:interceptors [home/verify-contact-form] ;; Interceptors for POST /contact | |
:contact-submit home/contact-submit-form]} ;; Handler for POST /contact | |
^:interceptors [middlewares/keyword-params]]) ;; Interceptors for any HTTP verb in the /contact route |
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
;; Implementación de Código de control con módulo 11 | |
;; http://es.wikipedia.org/wiki/C%C3%B3digo_de_control | |
(defn verificador-suma-parcial [grupo] (reduce + 0 (map * grupo (range 2 8)))) | |
(defn digito-verificador [clave-acceso] | |
(let [c (partition 6 6 nil (map #(Integer/parseInt (str %)) (reverse clave-acceso))) | |
digito (reduce + 0 (map verificador-suma-parcial c)) | |
m (mod digito 11)] | |
(if (> m 1) (- 11 m) m))) |
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
{ | |
"apikey": "497eacaa70f34afb86e343d568540cc5", | |
"codigoestablecimiento": "001", | |
"codigopuntoventa":"001", | |
"secuencia": "000000003", | |
"fechainiciotransporte":"12-12-2014", | |
"fechafintransporte": "12-12-2014", | |
"direccionpartida": "Victor Emilio Estrada", | |
"transportista": { | |
"tipoidentificacion":"RUC", |
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
{ | |
"count":2, | |
"next":null, | |
"previous":null, | |
"results":[ | |
{ | |
"numero":"001-001-000000110", | |
"comprador_correo":"[email protected]", | |
"detalle":[ | |
{ |
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
{ | |
"emisor": null, | |
"total_sin_impuestos": "225.57", | |
"secuencia": "263", | |
"tipo": "factura", | |
"total_impuestos": [ | |
{ | |
"codigo": "2", | |
"codigo_porcentaje": "2", | |
"base_imponible": "200.58", |
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
{ | |
name: "Guayaquil", | |
photos: [{ | |
file: "peñas.jpg", | |
description: "Barrio las Peñas", | |
created: "2015-10-24" | |
}, { | |
file: "malecón.jpg", | |
description: "Vista Aérea del Malecón", | |
created: "2014-12-30" |
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
{ | |
"id":"07f471bcfd434d13897a6edcf190441d", | |
"secuencial":"42578", | |
"clave_acceso":"0911201501099258144100120010010000425781993590512", | |
"autorizacion":{ | |
"numero":"0911201516311709925814410010997052341", | |
"fecha":"2015-11-09T16:31:17.000968", | |
"estado":"AUTORIZADO", | |
"mensajes":[ |
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
(ns co.datil.sqsd | |
"Polls SQS periodically for messages." | |
(:require [amazonica.aws.simpleworkflow :as swf] | |
[amazonica.aws.sqs :as sqs] | |
[clojure.tools.logging :as log] | |
[environ.core :refer [env]])) | |
(defn process-msg | |
"Task: body of the message placed in the queue" | |
[queue-url msg] |
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
{ | |
"secuencial":766, | |
"firma":{ | |
"result":"bad", | |
"error":"Ocurrió un error al tratar de firmar el comprobante, por favor inténtalo nuevamente.", | |
"status":400 | |
}, | |
"fecha_emision":"2015-12-16T15:38:01-05:00", | |
"emisor":{ | |
"ruc":"1792478103001", |
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
(defn strftime [secs] | |
(format "%02d:%02d:%02d" | |
(mod (int (/ secs 3600)) 24) | |
(mod (int (/ secs 60)) 60) | |
(mod secs 60))) | |
(defn secs-elapsed-since-midnight [] | |
(let [now (java.time.ZonedDateTime/now) | |
midnight (.truncatedTo now java.time.temporal.ChronoUnit/DAYS) | |
duration (java.time.Duration/between midnight now)] |
OlderNewer