Skip to content

Instantly share code, notes, and snippets.

@marti1125
Last active January 19, 2017 15:30
Show Gist options
  • Save marti1125/a2f5c30cd665c66d9fa301260d54d810 to your computer and use it in GitHub Desktop.
Save marti1125/a2f5c30cd665c66d9fa301260d54d810 to your computer and use it in GitHub Desktop.
culqi-node example
const Culqi = require('culqi-node');
const culqi = new Culqi('test_462ikymMGqUf', 'C/9qeO95+Ii6qjupoJkeaDKlepFSx5Q6LbXpovObijc=', 'integ');
var token = ''
culqi.crearToken({
"correo_electronico": "[email protected]",
"nombre": "William",
"apellido": "Muro",
"numero": 4444333322221111,
"cvv": 123,
"m_exp": 9,
"a_exp": 2019,
"guardar": true
}).then(function (response) {
token = response.body.id;
charge(token)
})
function charge(token){
culqi.crearCargo({
"token": token,
"moneda": "PEN",
"monto": 19900,
"descripcion": "Venta de prueba",
"pedido": '89567dasdasd',
"codigo_pais": "PE",
"ciudad": "Lima",
"usuario": "71701956",
"direccion": "Avenida Lima 1232",
"telefono": 12313123,
"nombres": "Will",
"apellidos": "Muro",
"correo_electronico": "[email protected]"
}).then(function (response) {
console.log(response.body)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment